Click or drag to resize
DigitalRuneConstraintSettingsStackingTolerance Property
Gets or sets the stacking optimization tolerance. (Experimental)

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

Property Value

Type: Single
The stacking optimization tolerance in the range [0, 1]. The default value is 0.1.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionvalue is less than 0 or greater than 1.
Remarks

Stacking objects is difficult for the simulation - especially if the FixedTimeStep is large or the NumberOfConstraintIterations is low. The stacking optimization is a trick to improve the stability of stacking by stabilizing contacts. A non-zero value improves the stability of high stacks or walls and it improves the simulation performance when there are many contacts.

Use a value of 0 to disable this optimization. This will make stacks less stable and the simulation will actually be a bit slower. But any unnatural behaviors that could be caused by this stacking optimization are removed.

Use a value of 1 to fully enable this optimization. This will make stakes more stable and the simulation performance is improved. In very rare cases, the stacking optimization can cause unnatural behavior.

Any value between 0 and 1 can be used. Already very small values (0.05 - 0.1) are enough to greatly improve the stability of stacks.

This stacking optimization is independent from the StackingFactor optimization.

See Also