[ODE] High level collision detection strategy

David McClurg dmcclurg at pandemicstudios.com.au
Tue Mar 11 16:14:01 2003


Benny Kramek wrote:
> My second question is about ray geoms. I need to simulate a light-speed projectile. I experimented with using a ray and it works well. The problem is that if I create a ray and test it against the level geoms than it is possible to detect collision with multiple geoms. The bullet "goes through walls". I could just find the shortest collision and use
that but I was wondering if there is a better way?

In your near/proximity callback, you just need to compare the depth of all contacts generated and pick the nearest one.  

If your bullet has dimension, it might be most efficient and accurate to use a cylinder or sweep a sphere through the space.  That is, iteratively call dGeomSetPosition() and dSpaceCollide() for your bullet sphere.  You only want to test the bullet against the space.  Perhaps dSpaceCollide2() will let you do that, but I'm not sure how to iterate the things in a space.

hmmm.  I'm interested in the approach you end up taking.