Enable to visualize raycasts in the scene with gizmos
Enables or disables the physics engine
Sets the gravity vector for the physics simulation
Sets the gravity vector for the physics simulation
Indicates whether the physics engine has been initialized
Indicates whether the physics engine is currently updating
Get access to the rapier world
Adds a continuous force to a rigidbody
Whether to wake up the rigidbody
The joint prevents any relative movement between two rigid-bodies, except for relative rotations along one axis. This is typically used to simulate wheels, fans, etc. They are characterized by one local anchor as well as one local axis on each rigid-body.
Applies an instantaneous impulse to a rigidbody
The rigidbody to apply impulse to
The impulse vector to apply
Whether to wake up the rigidbody
Clears all cached data (e.g., mesh data when creating scaled mesh colliders)
Gets the angular velocity of a rigidbody
The rigidbody to get angular velocity from
The angular velocity vector or null if not available
Get the Needle Engine component for a rapier object
Gets the linear velocity of a rigidbody or the rigidbody attached to a collider
The linear velocity vector or null if not available
Initializes the physics engine
Checks if a rigidbody is currently sleeping
The rigidbody to check
Whether the rigidbody is sleeping or undefined if cannot be determined
Performs a fast raycast against physics colliders
Optional
origin: Vec3 | Vec2Ray origin in screen or worldspace
Optional
direction: Vec3Ray direction in worldspace
Optional
options: {Additional raycast configuration options
Optional
filterGroups?: numberOptional
filterPredicate?: (c: ICollider) => booleanReturn false to ignore this collider
Optional
maxDistance?: numberOptional
queryFilterFlags?: QueryFilterFlagsOptional
solid?: booleanTrue if you want to also hit objects when the raycast starts from inside a collider
Optional
useIgnoreRaycastLayer?: booleanWhen enabled the hit object's layer will be tested. If layer 2 is enabled the object will be ignored (Layer 2 == IgnoreRaycast) If not set the raycast will ignore objects in the IgnoreRaycast layer (default: true)
Raycast result containing hit point and collider, or null if no hit
Performs a raycast that also returns the normal vector at the hit point
Optional
origin: Vec3 | Vec2Ray origin in screen or worldspace
Optional
direction: Vec3Ray direction in worldspace
Optional
options: {Additional raycast configuration options
Optional
filterGroups?: numberOptional
filterPredicate?: (c: ICollider) => booleanReturn false to ignore this collider
Optional
maxDistance?: numberOptional
queryFilterFlags?: QueryFilterFlagsOptional
solid?: booleanTrue if you want to also hit objects when the raycast starts from inside a collider
Optional
useIgnoreRaycastLayer?: booleanWhen enabled the hit object's layer will be tested. If layer 2 is enabled the object will be ignored (Layer 2 == IgnoreRaycast) If not set the raycast will ignore objects in the IgnoreRaycast layer (default: true)
Raycast result containing hit point, normal, and collider, or null if no hit
Resets all forces acting on a rigidbody
The rigidbody to reset forces on
Whether to wake up the rigidbody
Resets all torques acting on a rigidbody
The rigidbody to reset torques on
Whether to wake up the rigidbody
Sets the angular velocity of a rigidbody
The rigidbody to set angular velocity for
The angular velocity vector to set
Whether to wake up the rigidbody
Sets the linear velocity of a rigidbody
The rigidbody to set linear velocity for
The linear velocity vector to set
Whether to wake up the rigidbody
Precice sphere overlap detection using rapier against colliders
center of the sphere in worldspace
radius of the sphere
array of colliders that overlap with the sphere. Note: they currently only contain the collider and the gameobject
Advances physics simulation by the given time step
Optional
dt: numberUpdates the position and/or rotation of a physics body
The collider or rigidbody component to update
Whether to update the position
Whether to update the rotation
Updates the physical properties of a rigidbody or collider
Enable to render collider shapes