Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RigidBodyDesc

Hierarchy

  • RigidBodyDesc

Index

Constructors

constructor

Properties

angularDamping

angularDamping: number

angularInertiaLocalFrame

angularInertiaLocalFrame: Rotation

angvel

angvel: Vector

canSleep

canSleep: boolean

ccdEnabled

ccdEnabled: boolean

centerOfMass

centerOfMass: Vector

dominanceGroup

dominanceGroup: number

gravityScale

gravityScale: number

linearDamping

linearDamping: number

linvel

linvel: Vector

mass

mass: number

principalAngularInertia

principalAngularInertia: Vector

rotation

rotation: Rotation

rotationsEnabledX

rotationsEnabledX: boolean

rotationsEnabledY

rotationsEnabledY: boolean

rotationsEnabledZ

rotationsEnabledZ: boolean

status

translation

translation: Vector

translationsEnabled

translationsEnabled: boolean

Methods

lockRotations

  • Locks all rotations that would have resulted from forces on the created rigid-body.

    Returns RigidBodyDesc

  • Locks all rotations that would have resulted from forces on the created rigid-body.

    Returns RigidBodyDesc

lockTranslations

  • Locks all translations that would have resulted from forces on the created rigid-body.

    Returns RigidBodyDesc

  • Locks all translations that would have resulted from forces on the created rigid-body.

    Returns RigidBodyDesc

restrictRotations

  • restrictRotations(rotationsEnabledX: boolean, rotationsEnabledY: boolean, rotationsEnabledZ: boolean): RigidBodyDesc
  • restrictRotations(rotationsEnabledX: boolean, rotationsEnabledY: boolean, rotationsEnabledZ: boolean): RigidBodyDesc
  • Allow rotation of this rigid-body only along specific axes.

    Parameters

    • rotationsEnabledX: boolean

      Are rotations along the X axis enabled?

    • rotationsEnabledY: boolean

      Are rotations along the y axis enabled?

    • rotationsEnabledZ: boolean

      Are rotations along the Z axis enabled?

    Returns RigidBodyDesc

  • Allow rotation of this rigid-body only along specific axes.

    Parameters

    • rotationsEnabledX: boolean

      Are rotations along the X axis enabled?

    • rotationsEnabledY: boolean

      Are rotations along the y axis enabled?

    • rotationsEnabledZ: boolean

      Are rotations along the Z axis enabled?

    Returns RigidBodyDesc

setAdditionalMass

  • Sets the initial mass of the rigid-body being built, before adding colliders' contributions.

    Parameters

    • mass: number

      − The initial mass of the rigid-body to create.

    Returns RigidBodyDesc

  • Sets the initial mass of the rigid-body being built, before adding colliders' contributions.

    Parameters

    • mass: number

      − The initial mass of the rigid-body to create.

    Returns RigidBodyDesc

setAdditionalMassProperties

  • Sets the mass properties of the rigid-body being built.

    Note that the final mass properties of the rigid-bodies depends on the initial mass-properties of the rigid-body (set by this method) to which is added the contributions of all the colliders with non-zero density attached to this rigid-body.

    Therefore, if you want your provided mass properties to be the final mass properties of your rigid-body, don't attach colliders to it, or only attach colliders with densities equal to zero.

    Parameters

    • mass: number

      − The initial mass of the rigid-body to create.

    • centerOfMass: Vector

      − The initial center-of-mass of the rigid-body to create.

    • principalAngularInertia: Vector

      − The initial principal angular inertia of the rigid-body to create. These are the eigenvalues of the angular inertia matrix.

    • angularInertiaLocalFrame: Rotation

      − The initial local angular inertia frame of the rigid-body to create. These are the eigenvectors of the angular inertia matrix.

    Returns RigidBodyDesc

  • Sets the mass properties of the rigid-body being built.

    Note that the final mass properties of the rigid-bodies depends on the initial mass-properties of the rigid-body (set by this method) to which is added the contributions of all the colliders with non-zero density attached to this rigid-body.

    Therefore, if you want your provided mass properties to be the final mass properties of your rigid-body, don't attach colliders to it, or only attach colliders with densities equal to zero.

    Parameters

    • mass: number

      − The initial mass of the rigid-body to create.

    • centerOfMass: Vector

      − The initial center-of-mass of the rigid-body to create.

    • principalAngularInertia: Vector

      − The initial principal angular inertia of the rigid-body to create. These are the eigenvalues of the angular inertia matrix.

    • angularInertiaLocalFrame: Rotation

      − The initial local angular inertia frame of the rigid-body to create. These are the eigenvectors of the angular inertia matrix.

    Returns RigidBodyDesc

setAdditionalPrincipalAngularInertia

  • Sets the mass properties of the rigid-body being built.

    Parameters

    • principalAngularInertia: Vector

      − The initial principal angular inertia of the rigid-body to create.

    Returns RigidBodyDesc

  • Sets the mass properties of the rigid-body being built.

    Parameters

    • principalAngularInertia: Vector

      − The initial principal angular inertia of the rigid-body to create.

    Returns RigidBodyDesc

setAngularDamping

  • Sets the angular damping of the rigid-body to create.

    This will progressively slowdown the rotational movement of the rigid-body.

    Parameters

    • damping: number

      The angular damping coefficient. Should be >= 0. The higher this value is, the stronger the rotational slowdown will be.

    Returns RigidBodyDesc

  • Sets the angular damping of the rigid-body to create.

    This will progressively slowdown the rotational movement of the rigid-body.

    Parameters

    • damping: number

      The angular damping coefficient. Should be >= 0. The higher this value is, the stronger the rotational slowdown will be.

    Returns RigidBodyDesc

setAngvel

  • Sets the initial angular velocity of the rigid-body to create.

    Parameters

    • vel: Vector

      The angular velocity to set.

    Returns RigidBodyDesc

  • Sets the initial angular velocity of the rigid-body to create.

    Parameters

    • vel: Vector

      The angular velocity to set.

    Returns RigidBodyDesc

setCanSleep

  • Sets whether or not the rigid-body to create can sleep.

    Parameters

    • can: boolean

      true if the rigid-body can sleep, false if it can't.

    Returns RigidBodyDesc

  • Sets whether or not the rigid-body to create can sleep.

    Parameters

    • can: boolean

      true if the rigid-body can sleep, false if it can't.

    Returns RigidBodyDesc

setCcdEnabled

  • Sets whether Continuous Collision Detection (CCD) is enabled for this rigid-body.

    Parameters

    • enabled: boolean

      true if the rigid-body has CCD enabled.

    Returns RigidBodyDesc

  • Sets whether Continuous Collision Detection (CCD) is enabled for this rigid-body.

    Parameters

    • enabled: boolean

      true if the rigid-body has CCD enabled.

    Returns RigidBodyDesc

setDominanceGroup

  • Parameters

    • group: number

    Returns RigidBodyDesc

  • Parameters

    • group: number

    Returns RigidBodyDesc

setGravityScale

  • Sets the scale factor applied to the gravity affecting the rigid-body being built.

    Parameters

    • scale: number

      The scale factor. Set this to 0.0 if the rigid-body needs to ignore gravity.

    Returns RigidBodyDesc

  • Sets the scale factor applied to the gravity affecting the rigid-body being built.

    Parameters

    • scale: number

      The scale factor. Set this to 0.0 if the rigid-body needs to ignore gravity.

    Returns RigidBodyDesc

setLinearDamping

  • Sets the linear damping of the rigid-body to create.

    This will progressively slowdown the translational movement of the rigid-body.

    Parameters

    • damping: number

      The angular damping coefficient. Should be >= 0. The higher this value is, the stronger the translational slowdown will be.

    Returns RigidBodyDesc

  • Sets the linear damping of the rigid-body to create.

    This will progressively slowdown the translational movement of the rigid-body.

    Parameters

    • damping: number

      The angular damping coefficient. Should be >= 0. The higher this value is, the stronger the translational slowdown will be.

    Returns RigidBodyDesc

setLinvel

  • Sets the initial linear velocity of the rigid-body to create.

    Parameters

    • x: number

      The linear velocity to set along the x axis.

    • y: number

      The linear velocity to set along the y axis.

    • z: number

      The linear velocity to set along the z axis.

    Returns RigidBodyDesc

  • Sets the initial linear velocity of the rigid-body to create.

    Parameters

    • x: number

      The linear velocity to set along the x axis.

    • y: number

      The linear velocity to set along the y axis.

    • z: number

      The linear velocity to set along the z axis.

    Returns RigidBodyDesc

setRotation

  • Sets the initial rotation of the rigid-body to create.

    Parameters

    Returns RigidBodyDesc

  • Sets the initial rotation of the rigid-body to create.

    Parameters

    Returns RigidBodyDesc

setTranslation

  • Sets the initial translation of the rigid-body to create.

    Parameters

    • x: number
    • y: number
    • z: number

    Returns RigidBodyDesc

  • Sets the initial translation of the rigid-body to create.

    Parameters

    • x: number
    • y: number
    • z: number

    Returns RigidBodyDesc

Static newDynamic

  • A rigid-body descriptor used to build a dynamic rigid-body.

    Returns RigidBodyDesc

  • A rigid-body descriptor used to build a dynamic rigid-body.

    Returns RigidBodyDesc

Static newKinematicPositionBased

  • A rigid-body descriptor used to build a position-based kinematic rigid-body.

    Returns RigidBodyDesc

  • A rigid-body descriptor used to build a position-based kinematic rigid-body.

    Returns RigidBodyDesc

Static newKinematicVelocityBased

  • A rigid-body descriptor used to build a velocity-based kinematic rigid-body.

    Returns RigidBodyDesc

  • A rigid-body descriptor used to build a velocity-based kinematic rigid-body.

    Returns RigidBodyDesc

Static newStatic

  • A rigid-body descriptor used to build a static rigid-body.

    Returns RigidBodyDesc

  • A rigid-body descriptor used to build a static rigid-body.

    Returns RigidBodyDesc

Generated using TypeDoc