[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Adonthell-devel] eSpacePosition/Velocity
From: |
Kai Sterker |
Subject: |
Re: [Adonthell-devel] eSpacePosition/Velocity |
Date: |
Fri, 2 Apr 2010 11:03:04 +0200 |
On Fri, Apr 2, 2010 at 4:15 AM, Tyler Nielsen <address@hidden> wrote:
> Can you give me a quick rundown on what these are? I see one comment in the
> code that stays:
[...]
> I looks like it's really changing coordinate space also (so that one unit in
> eSpace = one Radius of the object).
That's exactly what it does :-).
> I'm just not sure how this is useful,
> and how you would compare it to another object with different dimensions.
The trick is to make that object undergo the same transformation,
which happens in collision::check_triangle:
// translate triangle into espace
triangle3<float> eTriangle = triangle.translate (Radius, offset);
The offset parameter is actually the object's coordinate on the world
map, which is determined in moving::collide_with_objects:
// ... and check if collision occurs
shape->collide (collisionData, (*i)->Min-(*i)->get_object()->entire_min());
(That's one of the places you already changed, it seems).
The whole collision stuff doesn't come out of nowhere, however. It's taken from
http://www.peroxide.dk/papers/collision/collision.pdf
with some more changes and bugfixes from the accompanying forum
http://mrgamemaker.yuku.com/topic/368/t/Telemachos-tutorial-Improved-collision-detection-amp-resp.html
Hope that helps,
Kai