[ODE] fixed time steps
Morgan McGuire
morgan3d at yahoo.com
Tue Dec 13 11:49:37 MST 2005
If you use code like this:
> #define FIXEDSTEP 0.006
> float curTime;
> void StepODE (float dtime)
> {
> static float lastTime = 0;
> curTime += dtime;
> loops=0;
> while(lastTime<curTime){
> lastTime += FIXEDSTEP;
> dSpaceCollide(space, 0, &nearCallback);
> dWorldQuickStep(world, FIXEDSTEP);
> dJointGroupEmpty(contactgroup);
> }
>}
I believe you will end up zeroing your force accumulators after the 1st iteration and produce incorrect results. You have to run all of your own simulation code after dWorldQuickStep inside the loop. (Please correct me if I'm wrong!)
-m
More information about the ODE
mailing list