Click or drag to resize
DigitalRuneSimulationTimeScaling Property
Gets or sets the time scaling.

Namespace: DigitalRune.Physics
Assembly: DigitalRune.Physics (in DigitalRune.Physics.dll) Version: 1.10.0.0 (1.10.0.14427)
Syntax
public float TimeScaling { get; set; }

Property Value

Type: Single
The time scaling. The default value is 1.0.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionvalue is negative.
Remarks

This is a factor which speeds up or slows down the simulation. Use a value less than 1 to create slow motion effects.

The fixed time step size (FixedTimeStep) is not automatically scaled to keep the simulation results consistent. That means, if the time scaling is set to 2, the simulation makes twice as much steps as usual when Update(TimeSpan) is called. If the time scaling is set to 0.1 to create a slow motion effect, the simulation performs only 1 / 10 of the usual simulation steps. - This standard behavior keeps the simulation accuracy constant.

If constant accuracy is not required, you might want to scale FixedTimeStep manually with this scaling factor. Then the simulation accuracy will change with the time scaling factor. Especially, when a time scaling less than 1 ("slow motion") is used, it might be necessary to make the fixed time step smaller to keep the simulation results fluid.

See Also