Skip to content

PhysicsAPI reference

Class PhysicsSync

Namespace: MicroEngine.Physics
Assembly: MicroEngine.Physics.dll
Guide: Physics worlds

Copies body poses to the transforms of the entities that own them.

C#
public static class PhysicsSync

Inheritance

object ← PhysicsSync

Methods

Teleport(IPhysicsWorld2D, IWorld, BodyId, Vector2)

Teleports body to position and its owner with it: the body is placed without collision, the owner’s transform is written and it is drawn there at once (Teleport).

C#
public static void Teleport(IPhysicsWorld2D physics, IWorld world, BodyId body, Vector2 position)

Parameters

physics IPhysicsWorld2D

world IWorld

body BodyId

position Vector2

WriteTransforms(IPhysicsWorld2D, IWorld)

Writes the origin (and, on backends with Rotation, the angle) of every kinematic and dynamic body of physics to its owner’s transform in world (Position2D, Rotation2D). Bodies whose owner is not alive are skipped; static bodies are never written.

C#
public static void WriteTransforms(IPhysicsWorld2D physics, IWorld world)

Parameters

physics IPhysicsWorld2D

world IWorld

Exceptions

InvalidOperationException

An owner has a parent: body poses are world positions, so owners must be root entities.