PhysicsAPI reference
Class PhysicsSystem
Namespace: MicroEngine.Physics
Assembly: MicroEngine.Physics.dll
Guide: Physics worlds
Steps physics worlds, each optionally bound to the scene world whose entities own its bodies. A bound physics world steps only in the engine steps its scene world stepped in, by that world’s scaled step (Delta), so a paused, frozen or covered scene’s physics stands still too; after the step, the pose of every kinematic and dynamic body is written to its owner’s transform (WriteTransforms), which the scene world interpolates for drawing. An unbound world steps by the engine’s fixed step.
public sealed class PhysicsSystemInheritance
Constructors
PhysicsSystem()
public PhysicsSystem()Properties
Count
How many physics worlds are registered.
public int Count { get; }Property Value
Methods
Add(IPhysicsWorld2D, SceneWorld?)
Registers physics, bound to world when given.
public void Add(IPhysicsWorld2D physics, SceneWorld? world = null)Parameters
physics IPhysicsWorld2D
world SceneWorld?
Exceptions
It is already registered.
Remove(IPhysicsWorld2D)
Stops stepping physics; false when it was not registered.
public bool Remove(IPhysicsWorld2D physics)Parameters
physics IPhysicsWorld2D
Returns
Run(FrameContext)
Steps every registered world for one fixed step of frame (what PhysicsModule schedules).
public void Run(FrameContext frame)Parameters
frame FrameContext