Collider class

This class encapsulates the physics entities attached to a component (rigid body, collider).

it offers some convenience methods to physics properties of the component.

For more info on the underlying physics engine, cf Rapier docs (opens in a new tab)

Signature:

export declare class Collider 

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Collider class.

Properties

PropertyModifiersTypeDescription
_colliderRapierColliderRapier collider instance, cf Rapier docs (opens in a new tab) for more info
colliderDescColliderDescCollider description, cf Rapier docs (opens in a new tab) for more info
colliderTypeColliderTypeCollider type, cf Rapier docs (opens in a new tab) for more info on the meaning of different types
componentreadonlyComponent3DReturns the component this collider is attached to
enabledbooleanReturns the enabled state of the rigidbody
enabledRotation[boolean, boolean, boolean]Returns the current rotation lock state
enabledTranslation[boolean, boolean, boolean]Returns the current translation lock state
isSensorreadonlyboolean
namestringComponent's name this collider is attached to
rigidBodyRigidBodyRapier rigid body instance, cf Rapier docs (opens in a new tab) for more info
rigidbodyTypeRigidBodyTypeRigid body type, cf Rapier docs (opens in a new tab) for more info on the meaning of different types