Private
colliderReadonly
handlePrivate
rawOptional
userAn arbitrary user-defined object associated with this rigid-body.
Adds a force at the given world-space point of this rigid-body.
the world-space force to add to the rigid-body.
the world-space point where the impulse is to be applied on the rigid-body.
should the rigid-body be automatically woken-up?
Applies an impulse at the given world-space point of this rigid-body.
the world-space impulse to apply on the rigid-body.
the world-space point where the impulse is to be applied on the rigid-body.
should the rigid-body be automatically woken-up?
Applies an impulsive torque at the center-of-mass of this rigid-body.
the world-space torque impulse to apply on the rigid-body.
should the rigid-body be automatically woken-up?
Retrieves the i-th
collider attached to this rigid-body.
The index of the collider to retrieve. Must be a number in [0, this.numColliders()[
.
This index is not the same as the unique identifier of the collider.
Locks or unlocks the ability of this rigid-body to rotate.
If true
, this rigid-body will no longer rotate due to torques and impulses.
If true
, this rigid-body will be automatically awaken if it is currently asleep.
Locks or unlocks the ability of this rigid-body to translate.
If true
, this rigid-body will no longer translate due to forces and impulses.
If true
, this rigid-body will be automatically awaken if it is currently asleep.
The world-space next orientation of this rigid-body.
If this rigid-body is kinematic this value is set by the setNextKinematicRotation
method and is used for estimating the kinematic body velocity at the next timestep.
For non-kinematic bodies, this value is currently unspecified.
The world-space next translation of this rigid-body.
If this rigid-body is kinematic this value is set by the setNextKinematicTranslation
method and is used for estimating the kinematic body velocity at the next timestep.
For non-kinematic bodies, this value is currently unspecified.
Locks or unlocks the ability of this rigid-body to rotate along individual coordinate axes.
use this.setEnabledRotations
with the same arguments instead.
If false
, this rigid-body will no longer rotate due to torques and impulses, along the X coordinate axis.
If false
, this rigid-body will no longer rotate due to torques and impulses, along the Y coordinate axis.
If false
, this rigid-body will no longer rotate due to torques and impulses, along the Z coordinate axis.
If true
, this rigid-body will be automatically awaken if it is currently asleep.
Locks or unlocks the ability of this rigid-body to translate along individual coordinate axes.
use this.setEnabledTranslations
with the same arguments instead.
If false
, this rigid-body will no longer translate due to torques and impulses, along the X coordinate axis.
If false
, this rigid-body will no longer translate due to torques and impulses, along the Y coordinate axis.
If false
, this rigid-body will no longer translate due to torques and impulses, along the Z coordinate axis.
If true
, this rigid-body will be automatically awaken if it is currently asleep.
Sets the rigid-body's additional mass.
The total angular inertia of the rigid-body will be scaled automatically based on this additional mass. If this scaling effect isn’t desired, use Self::additional_mass_properties instead of this method.
This is only the "additional" mass because the total mass of the rigid-body is equal to the sum of this additional mass and the mass computed from the colliders (with non-zero densities) attached to this rigid-body.
That total mass (which includes the attached colliders’ contributions) will be updated at the name physics step,
or can be updated manually with this.recomputeMassPropertiesFromColliders
.
This will override any previous additional mass-properties set by this.setAdditionalMass
,
this.setAdditionalMassProperties
, RigidBodyDesc::setAdditionalMass
, or
RigidBodyDesc.setAdditionalMassfProperties
for this rigid-body.
The additional mass to set.
If true
then the rigid-body will be woken up if it was put to sleep because it did not move for a while.
Sets the rigid-body's additional mass-properties.
This is only the "additional" mass-properties because the total mass-properties of the rigid-body is equal to the sum of this additional mass-properties and the mass computed from the colliders (with non-zero densities) attached to this rigid-body.
That total mass-properties (which include the attached colliders’ contributions) will be updated at the name
physics step, or can be updated manually with this.recomputeMassPropertiesFromColliders
.
This will override any previous mass-properties set by this.setAdditionalMass
,
this.setAdditionalMassProperties
, RigidBodyDesc.setAdditionalMass
, or RigidBodyDesc.setAdditionalMassProperties
for this rigid-body.
If wake_up
is true then the rigid-body will be woken up if it was put to sleep because it did not move for a while.
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.
The new number of additional solver iterations (default: 0).
Locks or unlocks the ability of this rigid-body to rotate along individual coordinate axes.
If false
, this rigid-body will no longer rotate due to torques and impulses, along the X coordinate axis.
If false
, this rigid-body will no longer rotate due to torques and impulses, along the Y coordinate axis.
If false
, this rigid-body will no longer rotate due to torques and impulses, along the Z coordinate axis.
If true
, this rigid-body will be automatically awaken if it is currently asleep.
Locks or unlocks the ability of this rigid-body to translate along individual coordinate axes.
If false
, this rigid-body will no longer translate due to torques and impulses, along the X coordinate axis.
If false
, this rigid-body will no longer translate due to torques and impulses, along the Y coordinate axis.
If false
, this rigid-body will no longer translate due to torques and impulses, along the Z coordinate axis.
If true
, this rigid-body will be automatically awaken if it is currently asleep.
Sets the scale factor applied to the gravity affecting this rigid-body.
The scale factor to set. A value of 0.0 means that this rigid-body will on longer be affected by gravity.
Forces the rigid-body to wake-up if it was asleep.
If this rigid body is kinematic, sets its future rotation after the next timestep integration.
This should be used instead of rigidBody.setRotation
to make the dynamic object
interacting with this kinematic body behave as expected. Internally, Rapier will compute
an artificial velocity for this rigid-body from its current position and its next kinematic
position. This velocity will be used to compute forces on dynamic bodies interacting with
this body.
The kinematic rotation to set.
If this rigid body is kinematic, sets its future translation after the next timestep integration.
This should be used instead of rigidBody.setTranslation
to make the dynamic object
interacting with this kinematic body behave as expected. Internally, Rapier will compute
an artificial velocity for this rigid-body from its current position and its next kinematic
position. This velocity will be used to compute forces on dynamic bodies interacting with
this body.
The kinematic translation to set.
Sets the rotation quaternion of this rigid-body.
This does nothing if a zero quaternion is provided.
Forces the rigid-body to wake-up so it is properly affected by forces if it wasn't moving before modifying its position.
Sets the translation of this rigid-body.
The world-space position of the rigid-body.
Forces the rigid-body to wake-up so it is properly affected by forces if it wasn't moving before modifying its position.
Wakes this rigid-body up.
A dynamic rigid-body that does not move during several consecutive frames will be put to sleep by the physics engine, i.e., it will stop being simulated in order to avoid useless computations. This methods forces a sleeping rigid-body to wake-up. This is useful, e.g., before modifying the position of a dynamic body so that it is properly simulated afterwards.
Generated using TypeDoc
A rigid-body.