[ODE] CVS repository available

Adam Moravanszky amoravanszky at dplanet.ch
Mon Nov 19 10:09:02 MST 2001


Great.  I was looking at your TODO list there, and was wondering when/how
you/we want to implement some way of approximating collision times
(undoing a step that penetrated too far and/or asking collision system how
far it is OK to go).  This is a precondition for more robust collision
detection which IS on your list.

You also didn't answer this related bit of mine from last week:

BTW:  Would it not make sense to split the collision detection library off
ODE?  I'm not using it in my current project (yet), and I'm sure many others
will find that they need to use their own collision detection as well.  Why
not make it a separate library with separate documentation?

I realized that there is actually a dependency between ODE and the collision
library because the contacts reference the collision shapes.  However, in
the ODE code, these references are not used.  This is getting quite
important for me, because I have to use both GarageGames' GJK implementation
for convex meshes (indoor BSP geometry, terrain heightfield) NOW, and I
would like to do also replace your box-box code with my Crater code, which
we discussed before.  But neither is possible if ODE depends on your own
library (again, this doesn't seem to be the case, but the interface gives
that impression), and time steps cannot be undone.  If the simulation takes
a high speed object too deep into another, no contact point I come up with
will make any sense.

To permit the most flexibility on the part of the collision detection
module, I recommend what I have in my own dynamics code:

/ /user code example:

void main()
    {
crater.setContactCallback(::craterCallback);        / /  the collision
detection callback, just like in ODE
pscene->setContactCallback(::sceneCallback);    / /the physics also operates
via callback, unlike ODE!  See implementation below.

while(do_simulation)
    {
    pscene->run(dt);
    }
}

eAEResult sceneCallback(Body * bodyList)


    if (do_my_collision_detection() == SOME_PENETRATION_WAS_TOO_DEEP)
            return AEupdateRejected;            // in this case simulation
will try calling this with a different state.
    else
            return AEupdateMadeOk;

// In practical code, from this callback several different collision
detection systems may be queried for contacts.  In my demo, I used one
crater (for which the 1. callback gets set above) world instance for the
inter bodyList collisions, one for bodyList vs. static objects, and a custom
piece of code inlined right here to check bodyList against the z=0 floor
plane.
    }


--
-- Adam Moravanszky
http://n.ethz.ch/student/adammo/





More information about the ODE mailing list