tags:

views:

66

answers:

0

This is a question regarding physx implementation when using fixed time steps for its Simulation timing.

Given a deltaT (Time passed since the last frame) is there a way to determine how much time it will be advance in the physics simulation when it uses fixed time steps?

The following parameters we use are.

maxTimeStep = 1/60  
MaxIteration = 8  
TimeStepMethod = NX_TIMESTEP_FIXED

I have used the following funciton to retrive how much time it previous used to advance the simulation.

virtual void getTiming  
(  
  NxReal &  maxTimestep,  
  NxU32 &  maxIter,  
  NxTimeStepMethod &  method,  
  NxU32 *  numSubSteps = NULL<br>
)

The problem is our normal simulation routine is like this.

1) Calculate deltaT
2) Simulate all objects with deltaT
3) Simulate physx with deltaT (Because of fixed time step, physx may determine not to advance the simulation)

Because of this, when simulating all the objects in the game world its important to know how much the physics simulation will advance the simulation when using Fixed Time steps.