Method SetTransform
- Namespace
- Box3D
- Assembly
- Box3D.NET.dll
SetTransform(Vector3, Quaternion?)
Teleports the body.
public void SetTransform(Vector3 position, Quaternion? rotation = null)Parameters
positionVector3-
The new world position of the body origin.
rotationQuaternion?-
The new world rotation, or null to keep the current one.
Remarks
This is a teleport, not a move: it does not sweep, so the body can pass through geometry, and it is expensive. Prefer creating the body where it belongs, or driving a kinematic body with Box3D.Body.MoveTowards(System.Numerics.Vector3,System.Numerics.Quaternion,System.Single,System.Boolean) or a velocity.