2009-01-31 05:49:14 UTC
Hi, is Tokamak unsuitable for non-fixed timesteps? I'm using a delta time system (passing in the number of seconds that have elapsed since the last frame, in a single precision float, to neSimulator::Advance), and I'm noticing that on faster framerate machines I have problems:
At 60 fps (vsync locked), the game seems to control properly.
At 1000+ fps (unlocked), the same rigid body will come to rest on the animated body (small rebound impulse), but an assertion is thrown in neQ::Normalize that the quaternion has become entirely NaN. If I run in Release mode, the NaN quaternion causes my camera projection to break, which seems to indicate to me that it's the rigid body's rotation.
I notice that all of the sample code uses 1/60 for its timestep, and if I change my simulator timestep to 1/60, the behaviour acts the same as on 60fps (obviously).
I've never done a fixed timestep system before; I could do it but it seems to me that Tokamak should be able to handle very small timesteps accurately. The object isn't moving terribly fast, and the sensors seem to pick up the collisions properly.
Is there something I'm missing here that could be causing this behaviour? I hope that I'm just seeing this as a red herring, and the simulator instability is from some misconfiguration in neSimulator or my animated/rigid bodies.
Thanks in advance