[ODE] new ODE collision

David McClurg dmcclurg at pandemicstudios.com.au
Mon Nov 11 16:55:02 2002


>>> - When adding the ray class we should think about what the 'penetration depth' should be. Do you have any thoughts on this?

The way a ray works is that you get one contact point where the ray first hits something.  Penetration depth doesn't mean anything but it is very convenient to know the distance from the origin of the ray to the contact position.  Storing that in the 'depth' field would make alot of sense for rays.

>> i'm not sure that dRay will ever be attached to a body, in which case penetration depth does not have much use for the dynamics. perhaps you can think of a non-dynamics use/definition for the penetration depth?

I'm finding two uses for rays in my game.
1) Ground Height Detection
2) LOS - line of sight

The rays are almost always associated with a moving body!

Perhaps some examples will clarify...

- cameras: i don't want the chase camera going under the ground or perhaps i want to look at the ground point under the puppet so i don't have to head bob when he jumps.  two rays are useful here-- one for the target and one for the eye.  also the camera will need to cast a LOS ray to determine if there is an obstruction.

- floating prizes: i detect the ground height so that prizes can automatically find a convenient home position where the player can grab them.  in this situation, the ray is used for one HIT and then the ray is destroyed.

Hope that helps!