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(): {}
  • set angularVelocity(value: Partial<Vector3>): void

constraints

velocity

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

Methods

addForce

  • addForce(force: Partial<Vector3Like>): void
  • Apply a force to the rigid body for physics to simulate.

    Parameters

    • force: Partial<Vector3Like>

      The force to apply to the rigid body.

    Returns void

addForceAtPosition

  • addForceAtPosition(force: Partial<Vector3Like>, position: Partial<Vector3Like>): void
  • 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

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

    Parameters

    • torque: Partial<Vector3Like>

      The torque to apply to the rigid body.

    Returns void

movePosition

  • movePosition(position: Partial<Vector3Like>): void
  • Move the rigid body to the new position with interpolation where supported.

    Parameters

    • position: Partial<Vector3Like>

      The position to move to.

    Returns void

moveRotation

  • moveRotation(rotation: QuaternionLike): void
  • Rotate the rigid body to the new rotation with interpolation where supported.

    Parameters

    • rotation: QuaternionLike

      The new rotation to rotate to.

    Returns void