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

Property

Modifiers

Type

Description

_collider

RapierCollider

Rapier collider instance, cf Rapier docs (opens in a new tab) for more info

colliderDesc

ColliderDesc

Collider description, cf Rapier docs (opens in a new tab) for more info

colliderType

ColliderType

Collider type, cf Rapier docs (opens in a new tab) for more info on the meaning of different types

component

readonly

Component3D

Returns the component this collider is attached to

enabled

boolean

Returns 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

isSensor

readonly

boolean

name

string

Component's name this collider is attached to

rigidBody

RigidBody

Rapier rigid body instance, cf Rapier docs (opens in a new tab) for more info

rigidbodyType

RigidBodyType

Rigid body type, cf Rapier docs (opens in a new tab) for more info on the meaning of different types