|
Rapier C — 2D / f64 0.36.0+c.0
|
Descriptions and live, world-bound handles. More...
Data Structures | |
| struct | R2RigidBodyHandle |
| Copyable non-owning handle: world pointer plus entity index and generation. More... | |
| struct | R2RigidBodyDesc |
| Stack-allocated rigid-body construction data. More... | |
| struct | R2RigidBodyState |
| A copied state snapshot, with no pointers or ownership obligations. More... | |
Macros | |
| #define | R2_DYNAMIC 0 |
| Dynamic body affected by forces and contacts. | |
| #define | R2_FIXED 1 |
| Immovable body. | |
| #define | R2_KINEMATIC_POSITION_BASED 2 |
| Kinematic body controlled by its next pose. | |
| #define | R2_KINEMATIC_VELOCITY_BASED 3 |
| Kinematic body controlled by its velocity. | |
| #define | R2_LOCK_TRANSLATION_X 1 |
| Rigid-body lock bit: translation x. | |
| #define | R2_LOCK_TRANSLATION_Y 2 |
| Rigid-body lock bit: translation y. | |
| #define | R2_LOCK_TRANSLATION_Z 4 |
| Rigid-body lock bit: translation z. | |
| #define | R2_LOCK_ROTATION_X 8 |
| Rigid-body lock bit: rotation x. | |
| #define | R2_LOCK_ROTATION_Y 16 |
| Rigid-body lock bit: rotation y. | |
| #define | R2_LOCK_ROTATION_Z 32 |
| Rigid-body lock bit: rotation z. | |
Typedefs | |
| typedef struct R2RigidBodyHandle | R2RigidBodyHandle |
| Copyable non-owning handle: world pointer plus entity index and generation. | |
| typedef struct R2RigidBodyDesc | R2RigidBodyDesc |
| Stack-allocated rigid-body construction data. | |
| typedef struct R2RigidBodyState | R2RigidBodyState |
| A copied state snapshot, with no pointers or ownership obligations. | |
Functions | |
| struct R2RigidBodyDesc | r2DynamicRigidBodyDesc (void) |
| Return a dynamic rigid-body description with native defaults; no allocation. | |
| struct R2RigidBodyDesc | r2FixedRigidBodyDesc (void) |
| Return a fixed rigid-body description with native defaults; no allocation. | |
| struct R2RigidBodyDesc | r2KinematicPositionBasedRigidBodyDesc (void) |
| Return a kinematic position based rigid-body description with native defaults; no allocation. | |
| struct R2RigidBodyDesc | r2KinematicVelocityBasedRigidBodyDesc (void) |
| Return a kinematic velocity based rigid-body description with native defaults; no allocation. | |
| struct R2RigidBodyHandle | r2InsertRigidBody (struct R2World *world, const struct R2RigidBodyDesc *desc) |
| Create a body from the description and return its world-bound handle. | |
| R2Status | r2RigidBodyPropagateModifiedBodyPositionsToColliders (struct R2World *world) |
| Propagate all modified body poses to attached colliders. | |
| R2Status | r2RigidBody_WakeUp (struct R2RigidBodyHandle handle, R2Bool strong) |
| Wake a body by handle, including a soft-body cluster proxy. | |
| size_t | r2RigidBodyCount (const struct R2World *world) |
| Return the number of rigid body objects in the world. | |
| size_t | r2RigidBodyHandles (const struct R2World *world, struct R2RigidBodyHandle *buffer, size_t capacity) |
| Copy entity handles. | |
| R2Bool | r2RigidBody_Contains (struct R2RigidBodyHandle handle) |
| Test whether the live world contains this rigid body handle. | |
| R2Status | r2RemoveRigidBody (struct R2RigidBodyHandle handle, R2Bool remove_attached_colliders) |
| Remove a body and its joints, optionally keeping colliders as standalone objects. | |
| struct R2Pose | r2RigidBody_Position (struct R2RigidBodyHandle handle) |
| Return the rigid body world-space pose. | |
| struct R2Vector | r2RigidBody_Translation (struct R2RigidBodyHandle handle) |
| Return the rigid body world-space translation. | |
| struct R2Vector | r2RigidBody_Linvel (struct R2RigidBodyHandle handle) |
| Return the rigid body world-space linear velocity. | |
| R2AngVector | r2RigidBody_Angvel (struct R2RigidBodyHandle handle) |
| Return the rigid body world-space angular velocity (radians per second). | |
| R2Bool | r2RigidBody_IsSleeping (struct R2RigidBodyHandle handle) |
| Return whether the rigid body is sleeping. | |
| R2Bool | r2RigidBody_IsEnabled (struct R2RigidBodyHandle handle) |
| Return whether the rigid body is enabled. | |
| struct R2UserData | r2RigidBody_UserData (struct R2RigidBodyHandle handle) |
| Return the rigid body application-owned 128-bit user value. | |
| R2Status | r2RigidBody_SetPosition (struct R2RigidBodyHandle handle, struct R2Pose value, R2Bool wake_up) |
| Set the rigid body world-space pose. | |
| R2Status | r2RigidBody_SetTranslation (struct R2RigidBodyHandle handle, struct R2Vector value, R2Bool wake_up) |
| Set the rigid body world-space translation. | |
| R2Status | r2RigidBody_SetLinvel (struct R2RigidBodyHandle handle, struct R2Vector value, R2Bool wake_up) |
| Set the rigid body world-space linear velocity. | |
| R2Status | r2RigidBody_SetAngvel (struct R2RigidBodyHandle handle, R2AngVector value, R2Bool wake_up) |
| Set the rigid body world-space angular velocity (radians per second). | |
| R2Status | r2RigidBody_SetNextKinematicPosition (struct R2RigidBodyHandle handle, struct R2Pose value) |
| Set the rigid body next kinematic world-space pose. | |
| R2Status | r2RigidBody_SetNextKinematicTranslation (struct R2RigidBodyHandle handle, struct R2Vector value) |
| Set the rigid body next kinematic world-space translation. | |
| R2Status | r2RigidBody_SetGravityScale (struct R2RigidBodyHandle handle, R2Real value, R2Bool wake_up) |
| Set the rigid body gravity multiplier. | |
| R2Status | r2RigidBody_SetLinearDamping (struct R2RigidBodyHandle handle, R2Real value) |
| Set the rigid body linear damping coefficient. | |
| R2Status | r2RigidBody_SetAngularDamping (struct R2RigidBodyHandle handle, R2Real value) |
| Set the rigid body angular damping coefficient. | |
| R2Status | r2RigidBody_SetEnabled (struct R2RigidBodyHandle handle, R2Bool value) |
| Enable or disable the rigid body. | |
| R2Status | r2RigidBody_SetUserData (struct R2RigidBodyHandle handle, struct R2UserData value) |
| Set the rigid body application-owned 128-bit user value. | |
| R2Status | r2RigidBody_ApplyImpulse (struct R2RigidBodyHandle handle, struct R2Vector value, R2Bool wake_up) |
| Apply a world-space linear impulse. | |
| R2Status | r2RigidBody_ApplyImpulseAtPoint (struct R2RigidBodyHandle handle, struct R2Vector value, struct R2Vector point, R2Bool wake_up) |
| Apply a world-space impulse at a world-space point. | |
| R2Status | r2RigidBody_AddForce (struct R2RigidBodyHandle handle, struct R2Vector value, R2Bool wake_up) |
| Accumulate a world-space force; it persists until reset. | |
| R2Status | r2RigidBody_ResetForces (struct R2RigidBodyHandle handle, R2Bool wake_up) |
| Clear accumulated user forces. | |
| R2Status | r2RigidBody_Sleep (struct R2RigidBodyHandle handle) |
| Put the body to sleep. | |
| size_t | r2RigidBodyReadStates (const struct R2World *world, const struct R2RigidBodyHandle *handles, size_t handle_count, struct R2RigidBodyState *states, size_t capacity) |
| Copies states in the same order as handles, without allocating temporary storage. | |
| int8_t | r2RigidBody_DominanceGroup (struct R2RigidBodyHandle handle) |
| Return the rigid body signed dominance group. | |
| size_t | r2RigidBody_AdditionalSolverIterations (struct R2RigidBodyHandle handle) |
| Return the rigid body additional solver iterations for connected bodies. | |
| size_t | r2RigidBody_AdditionalPgsIterations (struct R2RigidBodyHandle handle) |
| Return the rigid body additional PGS iterations for connected bodies. | |
| R2Bool | r2RigidBody_IsFastRotationAllowed (struct R2RigidBodyHandle handle) |
| Return whether the rigid body may exceed the angular-velocity limit of its CCD. | |
| R2Status | r2RigidBody_SetAllowFastRotation (struct R2RigidBodyHandle handle, R2Bool value) |
| Allow or disallow the rigid body to exceed the angular-velocity limit of its CCD (e.g. | |
| R2Status | r2RigidBody_SetAdditionalMassProperties (struct R2RigidBodyHandle handle, struct R2MassProperties properties, R2Bool wake_up) |
| Set the rigid body local mass properties added to collider contributions. | |
| R2Status | r2RigidBody_RecomputeMassPropertiesFromColliders (struct R2RigidBodyHandle handle) |
| Recompute body mass and inertia from attached colliders and additional mass properties. | |
| R2Status | r2RigidBody_SetLockedAxes (struct R2RigidBodyHandle handle, uint8_t axes, R2Bool wake_up) |
| Set the rigid body translation/rotation lock bitmask. | |
| uint8_t | r2RigidBody_LockedAxes (struct R2RigidBodyHandle handle) |
| Return the rigid body translation/rotation lock bitmask. | |
| struct R2Pose | r2RigidBody_NextPosition (struct R2RigidBodyHandle handle) |
| Return the rigid body next kinematic world-space pose. | |
| struct R2Rotation | r2RigidBody_Rotation (struct R2RigidBodyHandle handle) |
| Return the rigid body world-space rotation. | |
| struct R2Vector | r2RigidBody_CenterOfMass (struct R2RigidBodyHandle handle) |
| Return the rigid body world-space center of mass. | |
| struct R2Vector | r2RigidBody_LocalCenterOfMass (struct R2RigidBodyHandle handle) |
| Return the rigid body body-local center of mass. | |
| struct R2Vector | r2RigidBody_UserForce (struct R2RigidBodyHandle handle) |
| Return the rigid body accumulated user-applied world-space force. | |
| R2AngVector | r2RigidBody_UserTorque (struct R2RigidBodyHandle handle) |
| Return the rigid body accumulated user-applied world-space torque. | |
| uint32_t | r2RigidBody_BodyType (struct R2RigidBodyHandle handle) |
| Return the rigid body body type (R2_DYNAMIC, R2_FIXED, or a kinematic kind). | |
| R2Real | r2RigidBody_Mass (struct R2RigidBodyHandle handle) |
| Return the rigid body mass. | |
| R2Real | r2RigidBody_GravityScale (struct R2RigidBodyHandle handle) |
| Return the rigid body gravity multiplier. | |
| R2Real | r2RigidBody_LinearDamping (struct R2RigidBodyHandle handle) |
| Return the rigid body linear damping coefficient. | |
| R2Real | r2RigidBody_AngularDamping (struct R2RigidBodyHandle handle) |
| Return the rigid body angular damping coefficient. | |
| R2Real | r2RigidBody_KineticEnergy (struct R2RigidBodyHandle handle) |
| Return the rigid body kinetic energy. | |
| R2Real | r2RigidBody_SoftCcdPrediction (struct R2RigidBodyHandle handle) |
| Return the rigid body soft-CCD prediction distance. | |
| R2Bool | r2RigidBody_IsCcdEnabled (struct R2RigidBodyHandle handle) |
| Return whether the rigid body is using continuous collision detection. | |
| R2Bool | r2RigidBody_IsDynamic (struct R2RigidBodyHandle handle) |
| Return whether the rigid body is dynamic. | |
| R2Bool | r2RigidBody_IsFixed (struct R2RigidBodyHandle handle) |
| Return whether the rigid body is fixed. | |
| R2Bool | r2RigidBody_IsKinematic (struct R2RigidBodyHandle handle) |
| Return whether the rigid body is kinematic. | |
| R2Bool | r2RigidBody_IsMoving (struct R2RigidBodyHandle handle) |
| Return whether the rigid body is moving. | |
| R2Bool | r2RigidBody_IsCcdActive (struct R2RigidBodyHandle handle) |
| Return whether the rigid body is currently using CCD for its motion. | |
| R2Status | r2RigidBody_SetRotation (struct R2RigidBodyHandle handle, struct R2Rotation value, R2Bool wake_up) |
| Set the rigid body world-space rotation. | |
| R2Status | r2RigidBody_SetBodyType (struct R2RigidBodyHandle handle, uint32_t value, R2Bool wake_up) |
| Set the rigid body body type (R2_DYNAMIC, R2_FIXED, or a kinematic kind). | |
| R2Status | r2RigidBody_SetNextKinematicRotation (struct R2RigidBodyHandle handle, struct R2Rotation value) |
| Set the rigid body next kinematic world-space rotation. | |
| R2Status | r2RigidBody_SetAdditionalMass (struct R2RigidBodyHandle handle, R2Real value, R2Bool wake_up) |
| Set the rigid body mass added to collider contributions. | |
| R2Status | r2RigidBody_SetSoftCcdPrediction (struct R2RigidBodyHandle handle, R2Real value) |
| Set the rigid body soft-CCD prediction distance. | |
| R2Status | r2RigidBody_SetCcdEnabled (struct R2RigidBodyHandle handle, R2Bool value) |
| Enable or disable using continuous collision detection for the rigid body. | |
| R2Status | r2RigidBody_SetTranslationsLocked (struct R2RigidBodyHandle handle, R2Bool value, R2Bool wake_up) |
| Enable or disable locking translation for the rigid body. | |
| R2Status | r2RigidBody_SetRotationsLocked (struct R2RigidBodyHandle handle, R2Bool value, R2Bool wake_up) |
| Enable or disable locking rotation for the rigid body. | |
| R2Status | r2RigidBody_SetDominanceGroup (struct R2RigidBodyHandle handle, int8_t value) |
| Set the rigid body signed dominance group. | |
| R2Status | r2RigidBody_SetAdditionalSolverIterations (struct R2RigidBodyHandle handle, size_t value) |
| Set the rigid body additional solver iterations for connected bodies. | |
| R2Status | r2RigidBody_SetAdditionalPgsIterations (struct R2RigidBodyHandle handle, size_t value) |
| Set the rigid body additional PGS iterations. | |
| R2Status | r2RigidBody_AddTorque (struct R2RigidBodyHandle handle, R2AngVector value, R2Bool wake_up) |
| Accumulate a world-space torque; it persists until reset. | |
| R2Status | r2RigidBody_ApplyTorqueImpulse (struct R2RigidBodyHandle handle, R2AngVector value, R2Bool wake_up) |
| Apply a world-space angular impulse. | |
| R2Status | r2RigidBody_AddForceAtPoint (struct R2RigidBodyHandle handle, struct R2Vector value, struct R2Vector point, R2Bool wake_up) |
| Accumulate a world-space force applied at a world-space point. | |
| R2Status | r2RigidBody_ResetTorques (struct R2RigidBodyHandle handle, R2Bool wake_up) |
| Clear accumulated user torques. | |
| struct R2Vector | r2RigidBody_VelocityAtPoint (struct R2RigidBodyHandle handle, struct R2Vector point) |
| Return world-space velocity at a world-space point, including angular motion. | |
| size_t | r2RigidBody_Colliders (struct R2RigidBodyHandle handle, struct R2ColliderHandle *buffer, size_t capacity) |
| Copy attached collider handles. | |
| R2Status | r2RigidBody_ValidateHandle (struct R2RigidBodyHandle handle) |
| Validate the index and generation in the live owning world. | |
Descriptions and live, world-bound handles.
Accessors return copies. Handle operations report INVALID_HANDLE for a removed/stale entity in a live world.
| #define R2_DYNAMIC 0 |
Dynamic body affected by forces and contacts.
| #define R2_FIXED 1 |
Immovable body.
| #define R2_KINEMATIC_POSITION_BASED 2 |
Kinematic body controlled by its next pose.
| #define R2_KINEMATIC_VELOCITY_BASED 3 |
Kinematic body controlled by its velocity.
| #define R2_LOCK_ROTATION_X 8 |
Rigid-body lock bit: rotation x.
| #define R2_LOCK_ROTATION_Y 16 |
Rigid-body lock bit: rotation y.
| #define R2_LOCK_ROTATION_Z 32 |
Rigid-body lock bit: rotation z.
| #define R2_LOCK_TRANSLATION_X 1 |
Rigid-body lock bit: translation x.
| #define R2_LOCK_TRANSLATION_Y 2 |
Rigid-body lock bit: translation y.
| #define R2_LOCK_TRANSLATION_Z 4 |
Rigid-body lock bit: translation z.
| typedef struct R2RigidBodyDesc R2RigidBodyDesc |
Stack-allocated rigid-body construction data.
Initialize with r2DynamicRigidBodyDesc, r2FixedRigidBodyDesc, or a kinematic description constructor. Copying this value is safe; it owns no resources and must never be freed by Rapier.
| typedef struct R2RigidBodyHandle R2RigidBodyHandle |
Copyable non-owning handle: world pointer plus entity index and generation.
The world must remain alive throughout every use. Copying does not retain it. UINT32_MAX/UINT32_MAX with a NULL world is invalid.
| typedef struct R2RigidBodyState R2RigidBodyState |
A copied state snapshot, with no pointers or ownership obligations.
| struct R2RigidBodyDesc r2DynamicRigidBodyDesc | ( | void | ) |
Return a dynamic rigid-body description with native defaults; no allocation.
| struct R2RigidBodyDesc r2FixedRigidBodyDesc | ( | void | ) |
Return a fixed rigid-body description with native defaults; no allocation.
| struct R2RigidBodyHandle r2InsertRigidBody | ( | struct R2World * | world, |
| const struct R2RigidBodyDesc * | desc ) |
Create a body from the description and return its world-bound handle.
The world owns the body.
| struct R2RigidBodyDesc r2KinematicPositionBasedRigidBodyDesc | ( | void | ) |
Return a kinematic position based rigid-body description with native defaults; no allocation.
| struct R2RigidBodyDesc r2KinematicVelocityBasedRigidBodyDesc | ( | void | ) |
Return a kinematic velocity based rigid-body description with native defaults; no allocation.
| R2Status r2RemoveRigidBody | ( | struct R2RigidBodyHandle | handle, |
| R2Bool | remove_attached_colliders ) |
Remove a body and its joints, optionally keeping colliders as standalone objects.
A removed or stale handle fails with R2_INVALID_HANDLE, like the other Remove functions. Removing a soft-body cluster proxy removes its cluster (see r2SoftBody_RemoveCluster). The root body of a soft body is rejected: remove the soft body with r2RemoveSoftBody.
| R2Status r2RigidBody_AddForce | ( | struct R2RigidBodyHandle | handle, |
| struct R2Vector | value, | ||
| R2Bool | wake_up ) |
Accumulate a world-space force; it persists until reset.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_AddForceAtPoint | ( | struct R2RigidBodyHandle | handle, |
| struct R2Vector | value, | ||
| struct R2Vector | point, | ||
| R2Bool | wake_up ) |
Accumulate a world-space force applied at a world-space point.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| size_t r2RigidBody_AdditionalPgsIterations | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body additional PGS iterations for connected bodies.
| size_t r2RigidBody_AdditionalSolverIterations | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body additional solver iterations for connected bodies.
| R2Status r2RigidBody_AddTorque | ( | struct R2RigidBodyHandle | handle, |
| R2AngVector | value, | ||
| R2Bool | wake_up ) |
Accumulate a world-space torque; it persists until reset.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Real r2RigidBody_AngularDamping | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body angular damping coefficient.
| R2AngVector r2RigidBody_Angvel | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body world-space angular velocity (radians per second).
| R2Status r2RigidBody_ApplyImpulse | ( | struct R2RigidBodyHandle | handle, |
| struct R2Vector | value, | ||
| R2Bool | wake_up ) |
Apply a world-space linear impulse.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_ApplyImpulseAtPoint | ( | struct R2RigidBodyHandle | handle, |
| struct R2Vector | value, | ||
| struct R2Vector | point, | ||
| R2Bool | wake_up ) |
Apply a world-space impulse at a world-space point.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_ApplyTorqueImpulse | ( | struct R2RigidBodyHandle | handle, |
| R2AngVector | value, | ||
| R2Bool | wake_up ) |
Apply a world-space angular impulse.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| uint32_t r2RigidBody_BodyType | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body body type (R2_DYNAMIC, R2_FIXED, or a kinematic kind).
| struct R2Vector r2RigidBody_CenterOfMass | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body world-space center of mass.
| size_t r2RigidBody_Colliders | ( | struct R2RigidBodyHandle | handle, |
| struct R2ColliderHandle * | buffer, | ||
| size_t | capacity ) |
Copy attached collider handles.
| R2Bool r2RigidBody_Contains | ( | struct R2RigidBodyHandle | handle | ) |
Test whether the live world contains this rigid body handle.
A removed/stale handle returns false.
| int8_t r2RigidBody_DominanceGroup | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body signed dominance group.
| R2Real r2RigidBody_GravityScale | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body gravity multiplier.
| R2Bool r2RigidBody_IsCcdActive | ( | struct R2RigidBodyHandle | handle | ) |
Return whether the rigid body is currently using CCD for its motion.
| R2Bool r2RigidBody_IsCcdEnabled | ( | struct R2RigidBodyHandle | handle | ) |
Return whether the rigid body is using continuous collision detection.
| R2Bool r2RigidBody_IsDynamic | ( | struct R2RigidBodyHandle | handle | ) |
Return whether the rigid body is dynamic.
| R2Bool r2RigidBody_IsEnabled | ( | struct R2RigidBodyHandle | handle | ) |
Return whether the rigid body is enabled.
| R2Bool r2RigidBody_IsFastRotationAllowed | ( | struct R2RigidBodyHandle | handle | ) |
Return whether the rigid body may exceed the angular-velocity limit of its CCD.
| R2Bool r2RigidBody_IsFixed | ( | struct R2RigidBodyHandle | handle | ) |
Return whether the rigid body is fixed.
| R2Bool r2RigidBody_IsKinematic | ( | struct R2RigidBodyHandle | handle | ) |
Return whether the rigid body is kinematic.
| R2Bool r2RigidBody_IsMoving | ( | struct R2RigidBodyHandle | handle | ) |
Return whether the rigid body is moving.
| R2Bool r2RigidBody_IsSleeping | ( | struct R2RigidBodyHandle | handle | ) |
Return whether the rigid body is sleeping.
| R2Real r2RigidBody_KineticEnergy | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body kinetic energy.
| R2Real r2RigidBody_LinearDamping | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body linear damping coefficient.
| struct R2Vector r2RigidBody_Linvel | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body world-space linear velocity.
| struct R2Vector r2RigidBody_LocalCenterOfMass | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body body-local center of mass.
| uint8_t r2RigidBody_LockedAxes | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body translation/rotation lock bitmask.
| R2Real r2RigidBody_Mass | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body mass.
| struct R2Pose r2RigidBody_NextPosition | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body next kinematic world-space pose.
| struct R2Pose r2RigidBody_Position | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body world-space pose.
| R2Status r2RigidBody_RecomputeMassPropertiesFromColliders | ( | struct R2RigidBodyHandle | handle | ) |
Recompute body mass and inertia from attached colliders and additional mass properties.
| R2Status r2RigidBody_ResetForces | ( | struct R2RigidBodyHandle | handle, |
| R2Bool | wake_up ) |
Clear accumulated user forces.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_ResetTorques | ( | struct R2RigidBodyHandle | handle, |
| R2Bool | wake_up ) |
Clear accumulated user torques.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| struct R2Rotation r2RigidBody_Rotation | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body world-space rotation.
| R2Status r2RigidBody_SetAdditionalMass | ( | struct R2RigidBodyHandle | handle, |
| R2Real | value, | ||
| R2Bool | wake_up ) |
Set the rigid body mass added to collider contributions.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_SetAdditionalMassProperties | ( | struct R2RigidBodyHandle | handle, |
| struct R2MassProperties | properties, | ||
| R2Bool | wake_up ) |
Set the rigid body local mass properties added to collider contributions.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_SetAdditionalPgsIterations | ( | struct R2RigidBodyHandle | handle, |
| size_t | value ) |
Set the rigid body additional PGS iterations.
| R2Status r2RigidBody_SetAdditionalSolverIterations | ( | struct R2RigidBodyHandle | handle, |
| size_t | value ) |
Set the rigid body additional solver iterations for connected bodies.
| R2Status r2RigidBody_SetAllowFastRotation | ( | struct R2RigidBodyHandle | handle, |
| R2Bool | value ) |
Allow or disallow the rigid body to exceed the angular-velocity limit of its CCD (e.g.
for wheels).
| R2Status r2RigidBody_SetAngularDamping | ( | struct R2RigidBodyHandle | handle, |
| R2Real | value ) |
Set the rigid body angular damping coefficient.
| R2Status r2RigidBody_SetAngvel | ( | struct R2RigidBodyHandle | handle, |
| R2AngVector | value, | ||
| R2Bool | wake_up ) |
Set the rigid body world-space angular velocity (radians per second).
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_SetBodyType | ( | struct R2RigidBodyHandle | handle, |
| uint32_t | value, | ||
| R2Bool | wake_up ) |
Set the rigid body body type (R2_DYNAMIC, R2_FIXED, or a kinematic kind).
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_SetCcdEnabled | ( | struct R2RigidBodyHandle | handle, |
| R2Bool | value ) |
Enable or disable using continuous collision detection for the rigid body.
| R2Status r2RigidBody_SetDominanceGroup | ( | struct R2RigidBodyHandle | handle, |
| int8_t | value ) |
Set the rigid body signed dominance group.
| R2Status r2RigidBody_SetEnabled | ( | struct R2RigidBodyHandle | handle, |
| R2Bool | value ) |
Enable or disable the rigid body.
| R2Status r2RigidBody_SetGravityScale | ( | struct R2RigidBodyHandle | handle, |
| R2Real | value, | ||
| R2Bool | wake_up ) |
Set the rigid body gravity multiplier.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_SetLinearDamping | ( | struct R2RigidBodyHandle | handle, |
| R2Real | value ) |
Set the rigid body linear damping coefficient.
| R2Status r2RigidBody_SetLinvel | ( | struct R2RigidBodyHandle | handle, |
| struct R2Vector | value, | ||
| R2Bool | wake_up ) |
Set the rigid body world-space linear velocity.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_SetLockedAxes | ( | struct R2RigidBodyHandle | handle, |
| uint8_t | axes, | ||
| R2Bool | wake_up ) |
Set the rigid body translation/rotation lock bitmask.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_SetNextKinematicPosition | ( | struct R2RigidBodyHandle | handle, |
| struct R2Pose | value ) |
Set the rigid body next kinematic world-space pose.
| R2Status r2RigidBody_SetNextKinematicRotation | ( | struct R2RigidBodyHandle | handle, |
| struct R2Rotation | value ) |
Set the rigid body next kinematic world-space rotation.
| R2Status r2RigidBody_SetNextKinematicTranslation | ( | struct R2RigidBodyHandle | handle, |
| struct R2Vector | value ) |
Set the rigid body next kinematic world-space translation.
| R2Status r2RigidBody_SetPosition | ( | struct R2RigidBodyHandle | handle, |
| struct R2Pose | value, | ||
| R2Bool | wake_up ) |
Set the rigid body world-space pose.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_SetRotation | ( | struct R2RigidBodyHandle | handle, |
| struct R2Rotation | value, | ||
| R2Bool | wake_up ) |
Set the rigid body world-space rotation.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_SetRotationsLocked | ( | struct R2RigidBodyHandle | handle, |
| R2Bool | value, | ||
| R2Bool | wake_up ) |
Enable or disable locking rotation for the rigid body.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_SetSoftCcdPrediction | ( | struct R2RigidBodyHandle | handle, |
| R2Real | value ) |
Set the rigid body soft-CCD prediction distance.
| R2Status r2RigidBody_SetTranslation | ( | struct R2RigidBodyHandle | handle, |
| struct R2Vector | value, | ||
| R2Bool | wake_up ) |
Set the rigid body world-space translation.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_SetTranslationsLocked | ( | struct R2RigidBodyHandle | handle, |
| R2Bool | value, | ||
| R2Bool | wake_up ) |
Enable or disable locking translation for the rigid body.
wake_up = 1 wakes affected bodies; 0 preserves their sleep state.
| R2Status r2RigidBody_SetUserData | ( | struct R2RigidBodyHandle | handle, |
| struct R2UserData | value ) |
Set the rigid body application-owned 128-bit user value.
| R2Status r2RigidBody_Sleep | ( | struct R2RigidBodyHandle | handle | ) |
Put the body to sleep.
| R2Real r2RigidBody_SoftCcdPrediction | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body soft-CCD prediction distance.
| struct R2Vector r2RigidBody_Translation | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body world-space translation.
| struct R2UserData r2RigidBody_UserData | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body application-owned 128-bit user value.
| struct R2Vector r2RigidBody_UserForce | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body accumulated user-applied world-space force.
| R2AngVector r2RigidBody_UserTorque | ( | struct R2RigidBodyHandle | handle | ) |
Return the rigid body accumulated user-applied world-space torque.
| R2Status r2RigidBody_ValidateHandle | ( | struct R2RigidBodyHandle | handle | ) |
Validate the index and generation in the live owning world.
Cannot detect a world pointer that has already been freed.
| struct R2Vector r2RigidBody_VelocityAtPoint | ( | struct R2RigidBodyHandle | handle, |
| struct R2Vector | point ) |
Return world-space velocity at a world-space point, including angular motion.
| R2Status r2RigidBody_WakeUp | ( | struct R2RigidBodyHandle | handle, |
| R2Bool | strong ) |
Wake a body by handle, including a soft-body cluster proxy.
| size_t r2RigidBodyCount | ( | const struct R2World * | world | ) |
Return the number of rigid body objects in the world.
| size_t r2RigidBodyHandles | ( | const struct R2World * | world, |
| struct R2RigidBodyHandle * | buffer, | ||
| size_t | capacity ) |
Copy entity handles.
Propagate all modified body poses to attached colliders.
Run collision detection or step before querying the broad phase.
| size_t r2RigidBodyReadStates | ( | const struct R2World * | world, |
| const struct R2RigidBodyHandle * | handles, | ||
| size_t | handle_count, | ||
| struct R2RigidBodyState * | states, | ||
| size_t | capacity ) |
Copies states in the same order as handles, without allocating temporary storage.
All handles are validated before writing. On INVALID_HANDLE outputs are unchanged. NULL/0 is a size query. BUFFER_TOO_SMALL returns the required count and leaves states untouched.