Enable to visualize raycasts in the scene with gizmos
Enables or disables the physics engine
Gets the current gravity vector
Sets the gravity vector for the physics simulation
Indicates whether the physics engine has been initialized
Indicates whether the physics engine is currently updating
Returns the underlying physics world object
Adds a capsule collider to the physics world
The collider component to add
The radius of the capsule
The height of the capsule
Adds a continuous force to a rigidbody
The rigidbody to add force to
The force vector to add
Whether to wake up the rigidbody
Adds a sphere collider to the physics world
The collider component to add
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
Gets the rapier physics body for a Needle component
The collider or rigidbody component
The underlying physics body or null if not found
Gets the physics body for a component
The collider or rigidbody component
The underlying physics body or null if not found
Gets the Needle Engine component for a rapier physics object
The rapier physics object
The associated component or null if not found
Gets the linear velocity of a rigidbody or the rigidbody attached to a collider
The rigidbody or collider to get velocity from
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?: numberRaycast filter groups. Groups are used to apply the collision group rules for the scene query. The scene query will only consider hits with colliders with collision groups compatible with this collision group (using the bitwise test described in the collision groups section). For example membership 0x0001 and filter 0x0002 should be 0x00010002
Optional
filterPredicate?: (collider: ICollider) => booleanPredicate to filter colliders in raycast results
Optional
maxDistance?: numberOptional
queryFilterFlags?: QueryFilterFlagsOptional
solid?: booleanTrue if you want to also hit objects when the raycast starts from inside a collider
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?: numberRaycast filter groups. Groups are used to apply the collision group rules for the scene query. The scene query will only consider hits with colliders with collision groups compatible with this collision group (using the bitwise test described in the collision groups section). For example membership 0x0001 and filter 0x0002 should be 0x00010002
Optional
filterPredicate?: (collider: ICollider) => booleanPredicate to filter colliders in raycast results
Optional
maxDistance?: numberOptional
queryFilterFlags?: QueryFilterFlagsOptional
solid?: booleanTrue if you want to also hit objects when the raycast starts from inside a collider
Raycast result containing hit point, normal, and collider, or null if no hit
Removes a physics body from the simulation
The component whose physics body should be removed
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
Finds all colliders within a sphere
The center point of the sphere
The radius of the sphere
Array of objects that overlap with the sphere
Advances physics simulation by the given time step
Updates 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 physics material properties of a collider
The collider to update
Updates the physical properties of a rigidbody or collider
The rigidbody or collider to update
Enable to render collider shapes