[ODE] Values required to produce at least semi-realistic frictionusing the default constant-force-limit model?

Megan Fox shalinor at circustent.us
Sun Mar 14 22:30:22 MST 2004


I'm sure that would work, but if I'm going to be applying the friction force
manually, I'm unclear what the purpose of ODE's friction value is, then?

... especially given how simple and generic that bit of code would be to
apply to all bodies in the system, it seems surpising this isn't something
ODE just handles?  I'd imagined that mu became something like the dragCoef
in your equation below.

-Megan Fox

> A simplest way to add friction, as Russ mentions in his doc, is to apply
> some sort of drag on the body.  This should be done at every
> frame, and code
> sniplet looks something like what's shown below.  Forces will eventually
> settle to 0.
>
> VOID SOMECLASSBODYOBJ::ApplyLinearVelocityDrag(FLOAT dragCoef)
> {
>     const dReal *temp;
>     dReal fX;
>     dReal fY;
>     dReal fZ;
>
>     temp = dBodyGetLinearVel(m_BodyId);
>     fX = temp[0]*(dReal)dragCoef*-1;
>     fY = temp[1]*(dReal)dragCoef*-1;
>     fZ = temp[2]*(dReal)dragCoef*-1;
>
>     dBodyAddForce(m_BodyId, fX, fY, fZ);
> }



More information about the ODE mailing list