[ODE] Jitters
Tyler Streeter
tylerstreeter at gmail.com
Tue Nov 9 10:28:49 MST 2004
>dReal *lvel = dBodyGetLinearVel( body );
>dReal *avel = dBodyGetAngularVel( body );
>dMass mass;
>dBodyGetMass( body, &mass );
>dReal ldamping = -0.01 * mass.mass;
>dBodyAddForce( body, ldamping*lvel[0], ldamping*lvel[1], ldamping*lvel[2] );
>dVector3 amom;
>dMULTIPLYOP0_331( amom, =, avel, mass.I );
>dReal adamping = -0.01;
>dBodyAddTorque( body, adamping*amom[0], adamping*amom[1], adamping*amom[2] );
>(Appologies in advance for any typos; I use a highly customized version of
>ODE, so I couldn't just cut-and-paste my actual code. Something along
>these lines is probably what you want, though.)
Just to clarify what the actual code from standard ODE would be... I
think the mass.I inertia matrix is relative to the body, so you'd
either have to convert this to a global frame or convert the angular
velocity and resulting torque to the body's frame of reference. Does
that sound right to everyone else?
Btw, what's the easiest way to get a body's angular velocity locally,
not globally?
Tyler
More information about the ODE
mailing list