[ODE] Collision Detection ... again
Jon Watte
hplus-ode at mindcontrol.org
Mon Jun 21 10:08:45 MST 2004
As the FAQ says, or shoudl say, two things will help with this:
1) Add damping. For each object, for each step, add counter-
force scaled by linear velocity, and counter-torque scaled
by angular velocity. From memory, it looks something like:
/* Apply damping to the body to get it to settle properly */
/* over time. This also simulates "air drag" or "rolling */
/* friction" to some extent. */
/* Change "-0.01f" to some other negative number for tuning. */
dVector3 v;
dBodyGetLinearVelocity( body, v );
v[0] *= -0.01f; v[1] *= -0.01f; v[2] *= -0.01f;
dBodyAddForcce( body, v );
dBodyGetAngularVelocity( body, v );
v[0] *= -0.01f; v[1] *= -0.01f; v[2] *= -0.01f;
dBodyAddTorque( body, v );
2) Use auto-disable, or implement auto-disable yourself. When
a body has been more or less at rest for some number of steps,
freeze it in its current location. This increases stability,
in addition to reducing computational load.
Actually, I can't find that code snippet (or anything like it)
in the FAQ or documentation sections dealing with this settling
problem; could anyone add it perhaps?
Cheers,
/ h+
-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of
Andrew Cross
Sent: Monday, June 21, 2004 3:10 AM
To: ode at q12.org
Subject: [ODE] Collision Detection ... again
All,
I know that the whole subject of collision detection has probably been
discussed to death at this point, however I am seeing a relatively annoying
problem when {planes or boxes} are collided with {cylinders or boxes}. If
you just drop (say) a cylinder onto a plane it will bounce correctly,
however once it has bounced around a bit and settled down, it starts to
"swim" meaning that the two surfaces can penetrate and seem to move around
certain axis's. This is somewhat hard to describe, but I have uploaded a
short movie that shows this problem on :
http://www.3dgraphics.com/~deadline/CollisionProblem.wmv
This shows the collision of a capped cylinder with a plane.
Thanks in advance for your help.
Andrew
_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode
More information about the ODE
mailing list