|
pX_setsteprate (var rate, var maxIter, var TimeStepMethod ); |
Simulation is done one time step at a time, typically using a fixed step size ranging between 1/100th of a second and 1/50th of a second. maxIter provides a cap on the number of sub steps executed, per time step. If the number of possible sub steps exceeds maxIter, then maxIter sub steps are executed and the remaining time is added on to the accumulator to be executed on the next time step.
|
Parameters: |
|
rate |
step rate, good range is between 50 – 100. ( default: 60 ) |
|
maxIter |
default is 8 |
|
TimeStepMethod |
NX_TIMESTEP_FIXED |
|
Returns: |
1 if successful, 0 otherwise.
|
Remarks: |
Note that longer timesteps lead to poor stability in the simulation, and that values beyond the abovementioned range are not recommended.
Using fixed time sub steps is very important to ensure a stable and reproducible simulation and is recommended for this application, specified using NX_TIMESTEP_FIXED.
When NX_TIMESTEP_VARIABLE is specified, the PhysX SDK does not divide the time steps, giving the user direct control over the stepping.
Must be set between the physX_load() and physX_run() functions.
|
Speed: |
Medium