[ODE] Trimesh collision doesn't seem to be functioning in my case
Jon Watte (ODE)
hplus-ode at mindcontrol.org
Sat Nov 19 09:57:51 MST 2005
I don't know whether this is a problem with UNSTABLE as such, or whether
it's some side effect of your code.
If you are using a variable frame rate, then you will get tunneling at
variable movement speeds. ODE is an intersection tester, not a swept
movement tester, so if you're on one side of the trimesh one frame, and
on the other side the other frame, then you will "tunnel" through the
trimesh. The two solutions for this are:
1) step physics at a constant frame rate, determined such that the
sphere will never move further than its radius (not diameter) in a
single timestep -- i e, with a 100 steps/second rate, and 1 m radius
sphere, the sphere will never move faster than 100 meters/second.
2) use an explicit raycast, or swept sphere, to detect tunneling
conditions. Update the ray/swept sphere each frame to cover the from->to
movement path, and if a penetration is discovered, resolve it.
Cheers,
/ h+
Ryan O'Connor wrote:
> I tried compiling ode UNSTABLE and using it on an existing project. I hoped
> it would improve stability of collisions. At the moment if the frame rate of
> our game drops below about 40fps, or you go too fast into a wall
> (sphere-trimesh collision), the sphere will penetrate straight through. What
> I found was that no collisions are detected between the sphere and anything.
> All objects are in the same space and I have custom collision code on the
> callback to quickly discard irrelevant objects from collision response. It
> all worked ok on 0.5 stable, but not on the latest unstable branch. Any
> ideas? What has changed that's relevant since then? I'm kinda stumped.. It
> leads me to believe I set my basic scene up wrong before and it's only
> evident now because the ode code is better.
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>
>
More information about the ODE
mailing list