RigidBodyWrapper class
Signature:
export declare class RigidBodyWrapper
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(engine, _component, _opts) | Constructs a new instance of the RigidBodyWrapper class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
colliders | readonly | Collider[] | |
component | readonly | Component3D | Returns the component that owns this rigidbody |
enabled | boolean | Is this rigidbody enabled? | |
isDynamic | readonly | boolean | Is this rigidbody a dynamic rigidbody? |
isFixed | readonly | boolean | Is this rigidbody a fixed rigidbody? |
isKinematic | readonly | boolean | Is this rigidbody a kinematic rigidbody? |
options | readonly | RigidBodyOpts | Returns the options used to create this rigidbody |
position | Vector3 | ||
quaternion | Quaternion | ||
raw | readonly | RapierRigidBody | Returns the raw Rapier rigidbody |
rotationLock | [boolean, boolean, boolean] | Returns the current rotation lock state | |
translationLock | [boolean, boolean, boolean] | Returns the current translation lock state |
Methods
Method | Modifiers | Description |
---|---|---|
__updateActiveEvents() | ||
addCollider(collider) | ||
addForce(force, relativePoint) | Add a force to the rigidbody. The force is applied at the center of mass by default unless a relative point is provided | |
addTorque(torque) | Add a torque to the rigidbody | |
applyImpulse(impulse, relativePoint) | Apply an impulse to the rigidbody. The impulse is applied at the center of mass by default unless a relative point is provided | |
dispose() | ||
removeCollider(collider) | ||
resetForces() | Reset all forces applied to the rigidbody to zero | |
resetTorques() | Reset all torques applied to the rigidbody to zero | |
teleport(position, quaternion) |