Class PhysicsWorld
Thin Box3D world. The only engine type that may mention b3*.
Construct per scene; dispose with the scene. Single-threaded.
public sealed class PhysicsWorld : IDisposable
- Inheritance
-
PhysicsWorld
- Implements
- Inherited Members
Constructors
PhysicsWorld(Vector3?)
public PhysicsWorld(Vector3? gravity = null)
Parameters
gravityVector3?
Methods
CreateDynamicBox(Vector3, Vector3, float, float)
public PhysicsBodyId CreateDynamicBox(Vector3 center, Vector3 halfExtents, float density = 1, float friction = 0.3)
Parameters
Returns
CreateStaticBox(Vector3, Vector3)
public PhysicsBodyId CreateStaticBox(Vector3 center, Vector3 halfExtents)
Parameters
Returns
CreateStaticHull(ReadOnlySpan<Vector3>)
Static convex hull from world-space points. Used for Quake brushes (#403). Returns a null id if Box3D rejects the point cloud.
public PhysicsBodyId CreateStaticHull(ReadOnlySpan<Vector3> points)
Parameters
pointsReadOnlySpan<Vector3>
Returns
DestroyBody(PhysicsBodyId)
public void DestroyBody(PhysicsBodyId id)
Parameters
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetPosition(PhysicsBodyId)
public Vector3 GetPosition(PhysicsBodyId id)
Parameters
Returns
GetRotation(PhysicsBodyId)
public Quaternion GetRotation(PhysicsBodyId id)
Parameters
Returns
Move(CharacterMover, Vector3)
Swept capsule move + plane solve + velocity clip. Mutates
mover position and velocity.
public void Move(CharacterMover mover, Vector3 translation)
Parameters
moverCharacterMovertranslationVector3
OverlapSphere(Vector3, float)
public bool OverlapSphere(Vector3 center, float radius)
Parameters
Returns
RayCast(Vector3, Vector3)
Closest ray. translation is the full sweep (end − start).
public PhysicsHit RayCast(Vector3 origin, Vector3 translation)
Parameters
Returns
ShapeCastSphere(Vector3, float, Vector3)
Swept sphere. translation is the full sweep.
public PhysicsHit ShapeCastSphere(Vector3 origin, float radius, Vector3 translation)
Parameters
Returns
Step(float)
public void Step(float dt)
Parameters
dtfloat