[ODE] Calculating G force

Anders Olofsson anders.olofsson at biologigrand.ac
Fri May 5 05:02:44 MST 2006


Well, it didn't work that good.. Am I thinking this all wrong?.

dVector3 vel,oldvel,force;
void CalculateGForces (dBodyID body)
{
         const dReal *tmp;
         dVector3 tmpv;

         tmp=dBodyGetLinearVel (body);
         dBodyVectorFromWorld (body, tmp[0], tmp[1], tmp[2], tmpv);
         vel[0]=tmpv[0];
         vel[1]=tmpv[1];
         vel[2]=tmpv[2];
         if (dtime>0){
                 force[0]=(vel[0]-oldvel[0])/dtime;
                 force[1]=(vel[1]-oldvel[1])/dtime;
                 force[2]=(vel[2]-oldvel[2])/dtime;
         }
         oldvel[0]=vel[0];
         oldvel[1]=vel[1];
         oldvel[2]=vel[2];
}



More information about the ODE mailing list