Table of Contents

Method Step

Namespace
Box3D
Assembly
Box3D.NET.dll

Step(float, int)

Advances the simulation by one time step.

public void Step(float timeStep, int subStepCount = 4)

Parameters

timeStep float

How far to advance, in seconds. Keep this fixed; a varying step makes the simulation non-reproducible and hurts stability. One sixtieth is typical.

subStepCount int

How many solver sub-steps to take. More is more accurate and more expensive. Four is the usual choice.

Remarks

This is where collision detection, integration and constraint solving happen. Events raised during the step are available afterwards through Box3D.PhysicsWorld.Events until the next call.

Exceptions

ObjectDisposedException

The world has been disposed.

ArgumentOutOfRangeException

timeStep is negative, or subStepCount is not positive.