Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RigidBody

Class that represents a rigid body found on an actor.

Hierarchy

  • RigidBody

Implements

Index

Properties

collisionDetectionMode

collisionDetectionMode: CollisionDetectionMode = CollisionDetectionMode.Discrete

The collision detection mode to use with this rigid body. @see CollisionDetectionMode for options.

detectCollisions

detectCollisions: boolean = true

Whether to detect collisions with this rigid body.

enabled

enabled: boolean = true

Whether the rigid body is enabled or not.

isKinematic

isKinematic: boolean = false

Whether the rigid body is kinematic. Note kinematic rigid bodies participate in collisions, but are not simulated by the rigid body. This is useful for objects that should collide with other objects, but you want to control the position/rotation manually or animate them.

mass

mass: number = 1

The mass of the rigid body.

useGravity

useGravity: boolean = true

Whether the rigid body is affected by gravity.

Accessors

angularVelocity

  • get angularVelocity(): object
  • set angularVelocity(value: Partial<Vector3>): void

constraints

velocity

  • get velocity(): object
  • set velocity(value: Partial<Vector3>): void

Methods

addForce

addForceAtPosition

  • Apply a force to the rigid body at a specific position for physics to simulate.

    Parameters

    • force: Partial<Vector3Like>

      The force to apply to the rigid body.

    • position: Partial<Vector3Like>

      The position at which to apply the force. This should be in app coordinates.

    Returns void

addRelativeTorque

  • addRelativeTorque(relativeTorque: Partial<Vector3Like>): void
  • Add a relative torque to the rigid body for physics to simulate.

    Parameters

    • relativeTorque: Partial<Vector3Like>

      The relative torque to apply to the rigid body.

    Returns void

addTorque

movePosition

moveRotation