ConstraintSettingsStackingTolerance Property |
Namespace: DigitalRune.Physics.Settings
Exception | Condition |
---|---|
ArgumentOutOfRangeException | value is less than 0 or greater than 1. |
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.