[ODE] Trimesh problems

Anders Olofsson anders.olofsson at biologigrand.ac
Mon Jan 9 11:07:54 MST 2006


Its fixed, like this:

float curtime;
int loops;
void StepODE (float dtime)
{
   //Fixed timestep
   static float lasttime = 0;
   curtime += dtime;
   loops=0;
   while(lasttime<curtime){
     lasttime += FIXEDSTEP;
     dSpaceCollide(space, 0, &nearCallback);
     dWorldQuickStep(world, FIXEDSTEP);
//    dWorldStep(world, FIXEDSTEP);
     dJointGroupEmpty(contactgroup);
     loops++;
     if (loops>10){
       lasttime=curtime;
     }
   }
}

I don't add any custom forces, I just have the gravity set. The loop 
variable is just a safety thing so it wont hang on slow systems, it usually 
loops 3-4 times on my system. FIXEDSTEP = 0.005 (200 hz).

I'm going to write a little test.. Dropping a sphere on a triangle with the 
normal (0,1,0) should result in the same motion as in dropping a sphere on 
a plane with the same normal (0,1,0), right?! (With the same contact 
parameters ofcourse)

I dont understand how a sphere can start jumping higher and higher without 
me adding some force, could it be somehow that the sphere sinks deeper 
below a triangle sometimes and then the collision response act 
accordingly?. Anyhow, I'll be back with the test result and I'll publish 
out the source too.

Thanks!

--Anders Olofsson



At 18:20 2006-01-09, you wrote:

>Are you using a fixed time step when calling dWorldStep() or its 
>relatives? If not, that's the first thing to try to get simulations more 
>consistent.
>
>Cheers,
>
>                         / h+



More information about the ODE mailing list