Hello,
I have some code to test collisions between a primitive (Y aligned cylinder)
and a concave static trimesh. This code based on the collision interface demo.
This works OK, but I only have *contact points* when browsing the manifold
list. I'd need instead to have a vector describing the penetration depth and
its direction. (I plan to use it to apply a steering algorithm to my
cylinder/player to avoid obstacles).
Is there a way to do this without using impulse and the whole dynamic
world sheebang? My cylinder primitive is a kinematic object with no
physical properties (just like in the collision interface demo).
Any help is welcome!
-pogn
Collisions : how to compute penetration depth?
-
- Posts: 6
- Joined: Sat Dec 16, 2006 2:53 pm
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
-
- Posts: 6
- Joined: Sat Dec 16, 2006 2:53 pm
Wow, that's cool Going to try this right now.Erwin Coumans wrote:The contact points contain information about penetration depth and normal direction:
cp.getDistance(); //when negative this is penetration depth, otherwise distance
cp.m_normalWorldOnB // direction
Hope this helps,
Erwin
Thank you very much for your help!
pogn