[ODE] Resistance on bodys.
Jon Watte (ODE)
hplus-ode at mindcontrol.org
Thu Jun 15 07:33:57 MST 2006
The documentation (and FAQ) clearly states that rolling friction is not
modeled, so no, there's no simple flag you can turn on.
What I do is apply a slight counter-force and slight counter-torque to
each body each step to dampen the system. This also models rolling
friction. In C++ terms:
Vector3 lVel = body->LinearVelocity();
Vector3 aVel = body->AngularVelocity();
float mass = body->MassScalar();
body->AddForce(-mass * LINEAR_DAMPENING * lVel);
body->AddTorque(-mass * ANGULAR_DAMPENING * aVel);
Values for LINEAR_DAMPENING in the 0.002 to 0.02 range seem to work
well, as do values for ANUGLAR_DAMPENING in the range 0.005 to 0.05, but
it all comes down to your simulation constants and step size.
Russell Bartley wrote:
> I have a body with 1 spherical geom that rolls down a hill, then
> continues rolling along forever. I'd like to add some resistance to
> the simulation so the ball has some sort of resistance applised to it
> so it slows down and comes to an eventual stop. I have read a bit
> about AMotors, and think I could probably achieve what I'm after with
> these, but they seem a bit of overkill. Am I missing some parameter in
> the contact joints I'm creating that can suffice? Do I have to put in
> an AMotor to slow it down? What would I do for air resistance, where
> there are no contacts?
> This message and its attachments may contain legally privileged or
> confidential information. This message is intended for the use of the
> individual or entity to which it is addressed. If you are not the
> addressee indicated in this message, or the employee or agent
> responsible for delivering the message to the intended recipient, you
> may not copy or deliver this message or its attachments to anyone.
> Rather, you should permanently delete this message and its attachments
> and kindly notify the sender by reply e-mail. Any content of this
> message and its attachments, which does not relate to the official
> business of the sending company must be taken not to have been sent or
> endorsed by the sending company or any of its related entities. No
> warranty is made that the e-mail or attachment(s) are free from
> computer virus or other defect.
> ODE mailing list
> ODE at q12.org
More information about the ODE