[ODE] Joints send bodies to NaN

Jens Thiele jens.thiele at student.uni-tuebingen.de
Thu Feb 21 05:48:02 2002


> I ran into the same thing.  I got around it by constraining the time step
> with user-settable maximum and minumum values.  Maybe something like this
> should be in the docs, or in the sample code?  It seems to be a common
> pitfall.
> 
> // compute time delay (GetTickCount is a Win32 thing)
> UINT32 uThisTimerTick = GetTickCount (); 
> UINT32 uMilliseconds = uThisTimerTick - m_uLastTimerTick;
> m_uLastTimerTick = uThisTimerTick;
> 
> // constrain delay period
> if (uMilliseconds > m_uMaxDelta)
> 	uMilliseconds = m_uMaxDelta;
you should consider something like:
dt+=timeElapsed();
while (dt > maxdt)
{
  dWorldStep (m_WorldID, maxdt);
  dt-=maxdt;
}