Class RigidBodyDesc

Hierarchy

  • RigidBodyDesc

Constructors

Properties

additionalSolverIterations: number
angularDamping: number
angvel: number
canSleep: boolean
ccdEnabled: boolean
centerOfMass: Vector
dominanceGroup: number
enabled: boolean
gravityScale: number
linearDamping: number
linvel: Vector
mass: number
massOnly: boolean
principalAngularInertia: number
rotation: number
rotationsEnabled: boolean
sleeping: boolean
softCcdPrediction: number
translation: Vector
translationsEnabledX: boolean
translationsEnabledY: boolean
userData?: unknown

Methods

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

    Parameters

    • translationsEnabledX: boolean

      Are translations along the X axis enabled?

    • translationsEnabledY: boolean

      Are translations along the y axis enabled?

    Returns RigidBodyDesc

  • Locks all rotations 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

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

    Deprecated

    use this.enabledTranslations with the same arguments instead.

    Parameters

    • translationsEnabledX: boolean

      Are translations along the X axis enabled?

    • translationsEnabledY: boolean

      Are translations along the y axis enabled?

    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

  • 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: number

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

    Returns RigidBodyDesc

  • Sets the number of additional solver iterations that will be run for this rigid-body and everything that interacts with it directly or indirectly through contacts or joints.

    Compared to increasing the global World.numSolverIteration, setting this value lets you increase accuracy on only a subset of the scene, resulting in reduced performance loss.

    Parameters

    • iters: number

      The new number of additional solver iterations (default: 0).

    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

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

    Parameters

    • vel: number

      The angular velocity to set.

    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

  • 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

  • Parameters

    • group: number

    Returns RigidBodyDesc

  • Sets whether the created rigid-body will be enabled or disabled.

    Parameters

    • enabled: boolean

      − If set to false the rigid-body will be disabled at creation.

    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

  • 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 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.

    Returns RigidBodyDesc

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

    Parameters

    • rot: number

      The rotation to set.

    Returns RigidBodyDesc

  • Sets whether or not the rigid-body is to be created asleep.

    Parameters

    • sleeping: boolean

    Returns RigidBodyDesc

  • Sets the maximum prediction distance Soft Continuous Collision-Detection.

    When set to 0, soft-CCD is disabled. Soft-CCD helps prevent tunneling especially of slow-but-thin to moderately fast objects. The soft CCD prediction distance indicates how far in the object’s path the CCD algorithm is allowed to inspect. Large values can impact performance badly by increasing the work needed from the broad-phase.

    It is a generally cheaper variant of regular CCD (that can be enabled with RigidBodyDesc::setCcdEnabled since it relies on predictive constraints instead of shape-cast and substeps.

    Parameters

    • distance: number

    Returns RigidBodyDesc

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

    Parameters

    • x: number
    • y: number

    Returns RigidBodyDesc

  • Sets the user-defined object of this rigid-body.

    Parameters

    • Optional data: unknown

    Returns RigidBodyDesc

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

    Returns RigidBodyDesc

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

    Returns RigidBodyDesc

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

    Returns RigidBodyDesc

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

    Returns RigidBodyDesc

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

    Deprecated

    The method has been renamed to .dynamic().

    Returns RigidBodyDesc

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

    Deprecated

    The method has been renamed to .kinematicPositionBased().

    Returns RigidBodyDesc

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

    Deprecated

    The method has been renamed to .kinematicVelocityBased().

    Returns RigidBodyDesc

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

    Deprecated

    The method has been renamed to .fixed().

    Returns RigidBodyDesc

Generated using TypeDoc