Rapier C — 3D / f64 0.36.0+c.0
Loading...
Searching...
No Matches
Rigid bodies

Descriptions and live, world-bound handles. More...

Data Structures

struct  R3RigidBodyHandle
 Copyable non-owning handle: world pointer plus entity index and generation. More...
struct  R3RigidBodyDesc
 Stack-allocated rigid-body construction data. More...
struct  R3RigidBodyState
 A copied state snapshot, with no pointers or ownership obligations. More...

Macros

#define R3_DYNAMIC   0
 Dynamic body affected by forces and contacts.
#define R3_FIXED   1
 Immovable body.
#define R3_KINEMATIC_POSITION_BASED   2
 Kinematic body controlled by its next pose.
#define R3_KINEMATIC_VELOCITY_BASED   3
 Kinematic body controlled by its velocity.
#define R3_LOCK_TRANSLATION_X   1
 Rigid-body lock bit: translation x.
#define R3_LOCK_TRANSLATION_Y   2
 Rigid-body lock bit: translation y.
#define R3_LOCK_TRANSLATION_Z   4
 Rigid-body lock bit: translation z.
#define R3_LOCK_ROTATION_X   8
 Rigid-body lock bit: rotation x.
#define R3_LOCK_ROTATION_Y   16
 Rigid-body lock bit: rotation y.
#define R3_LOCK_ROTATION_Z   32
 Rigid-body lock bit: rotation z.

Typedefs

typedef struct R3RigidBodyHandle R3RigidBodyHandle
 Copyable non-owning handle: world pointer plus entity index and generation.
typedef struct R3RigidBodyDesc R3RigidBodyDesc
 Stack-allocated rigid-body construction data.
typedef struct R3RigidBodyState R3RigidBodyState
 A copied state snapshot, with no pointers or ownership obligations.

Functions

struct R3RigidBodyDesc r3DynamicRigidBodyDesc (void)
 Return a dynamic rigid-body description with native defaults; no allocation.
struct R3RigidBodyDesc r3FixedRigidBodyDesc (void)
 Return a fixed rigid-body description with native defaults; no allocation.
struct R3RigidBodyDesc r3KinematicPositionBasedRigidBodyDesc (void)
 Return a kinematic position based rigid-body description with native defaults; no allocation.
struct R3RigidBodyDesc r3KinematicVelocityBasedRigidBodyDesc (void)
 Return a kinematic velocity based rigid-body description with native defaults; no allocation.
struct R3RigidBodyHandle r3InsertRigidBody (struct R3World *world, const struct R3RigidBodyDesc *desc)
 Create a body from the description and return its world-bound handle.
R3Status r3RigidBodyPropagateModifiedBodyPositionsToColliders (struct R3World *world)
 Propagate all modified body poses to attached colliders.
R3Status r3RigidBody_WakeUp (struct R3RigidBodyHandle handle, R3Bool strong)
 Wake a body by handle, including a soft-body cluster proxy.
size_t r3RigidBodyCount (const struct R3World *world)
 Return the number of rigid body objects in the world.
size_t r3RigidBodyHandles (const struct R3World *world, struct R3RigidBodyHandle *buffer, size_t capacity)
 Copy entity handles.
R3Bool r3RigidBody_Contains (struct R3RigidBodyHandle handle)
 Test whether the live world contains this rigid body handle.
R3Status r3RemoveRigidBody (struct R3RigidBodyHandle handle, R3Bool remove_attached_colliders)
 Remove a body and its joints, optionally keeping colliders as standalone objects.
struct R3Pose r3RigidBody_Position (struct R3RigidBodyHandle handle)
 Return the rigid body world-space pose.
struct R3Vector r3RigidBody_Translation (struct R3RigidBodyHandle handle)
 Return the rigid body world-space translation.
struct R3Vector r3RigidBody_Linvel (struct R3RigidBodyHandle handle)
 Return the rigid body world-space linear velocity.
R3AngVector r3RigidBody_Angvel (struct R3RigidBodyHandle handle)
 Return the rigid body world-space angular velocity (radians per second).
R3Bool r3RigidBody_IsSleeping (struct R3RigidBodyHandle handle)
 Return whether the rigid body is sleeping.
R3Bool r3RigidBody_IsEnabled (struct R3RigidBodyHandle handle)
 Return whether the rigid body is enabled.
struct R3UserData r3RigidBody_UserData (struct R3RigidBodyHandle handle)
 Return the rigid body application-owned 128-bit user value.
R3Status r3RigidBody_SetPosition (struct R3RigidBodyHandle handle, struct R3Pose value, R3Bool wake_up)
 Set the rigid body world-space pose.
R3Status r3RigidBody_SetTranslation (struct R3RigidBodyHandle handle, struct R3Vector value, R3Bool wake_up)
 Set the rigid body world-space translation.
R3Status r3RigidBody_SetLinvel (struct R3RigidBodyHandle handle, struct R3Vector value, R3Bool wake_up)
 Set the rigid body world-space linear velocity.
R3Status r3RigidBody_SetAngvel (struct R3RigidBodyHandle handle, R3AngVector value, R3Bool wake_up)
 Set the rigid body world-space angular velocity (radians per second).
R3Status r3RigidBody_SetNextKinematicPosition (struct R3RigidBodyHandle handle, struct R3Pose value)
 Set the rigid body next kinematic world-space pose.
R3Status r3RigidBody_SetNextKinematicTranslation (struct R3RigidBodyHandle handle, struct R3Vector value)
 Set the rigid body next kinematic world-space translation.
R3Status r3RigidBody_SetGravityScale (struct R3RigidBodyHandle handle, R3Real value, R3Bool wake_up)
 Set the rigid body gravity multiplier.
R3Status r3RigidBody_SetLinearDamping (struct R3RigidBodyHandle handle, R3Real value)
 Set the rigid body linear damping coefficient.
R3Status r3RigidBody_SetAngularDamping (struct R3RigidBodyHandle handle, R3Real value)
 Set the rigid body angular damping coefficient.
R3Status r3RigidBody_SetEnabled (struct R3RigidBodyHandle handle, R3Bool value)
 Enable or disable the rigid body.
R3Status r3RigidBody_SetUserData (struct R3RigidBodyHandle handle, struct R3UserData value)
 Set the rigid body application-owned 128-bit user value.
R3Status r3RigidBody_ApplyImpulse (struct R3RigidBodyHandle handle, struct R3Vector value, R3Bool wake_up)
 Apply a world-space linear impulse.
R3Status r3RigidBody_ApplyImpulseAtPoint (struct R3RigidBodyHandle handle, struct R3Vector value, struct R3Vector point, R3Bool wake_up)
 Apply a world-space impulse at a world-space point.
R3Status r3RigidBody_AddForce (struct R3RigidBodyHandle handle, struct R3Vector value, R3Bool wake_up)
 Accumulate a world-space force; it persists until reset.
R3Status r3RigidBody_ResetForces (struct R3RigidBodyHandle handle, R3Bool wake_up)
 Clear accumulated user forces.
R3Status r3RigidBody_Sleep (struct R3RigidBodyHandle handle)
 Put the body to sleep.
size_t r3RigidBodyReadStates (const struct R3World *world, const struct R3RigidBodyHandle *handles, size_t handle_count, struct R3RigidBodyState *states, size_t capacity)
 Copies states in the same order as handles, without allocating temporary storage.
int8_t r3RigidBody_DominanceGroup (struct R3RigidBodyHandle handle)
 Return the rigid body signed dominance group.
size_t r3RigidBody_AdditionalSolverIterations (struct R3RigidBodyHandle handle)
 Return the rigid body additional solver iterations for connected bodies.
size_t r3RigidBody_AdditionalPgsIterations (struct R3RigidBodyHandle handle)
 Return the rigid body additional PGS iterations for connected bodies.
R3Bool r3RigidBody_IsFastRotationAllowed (struct R3RigidBodyHandle handle)
 Return whether the rigid body may exceed the angular-velocity limit of its CCD.
R3Status r3RigidBody_SetAllowFastRotation (struct R3RigidBodyHandle handle, R3Bool value)
 Allow or disallow the rigid body to exceed the angular-velocity limit of its CCD (e.g.
R3Status r3RigidBody_SetAdditionalMassProperties (struct R3RigidBodyHandle handle, struct R3MassProperties properties, R3Bool wake_up)
 Set the rigid body local mass properties added to collider contributions.
R3Status r3RigidBody_RecomputeMassPropertiesFromColliders (struct R3RigidBodyHandle handle)
 Recompute body mass and inertia from attached colliders and additional mass properties.
R3Status r3RigidBody_SetLockedAxes (struct R3RigidBodyHandle handle, uint8_t axes, R3Bool wake_up)
 Set the rigid body translation/rotation lock bitmask.
uint8_t r3RigidBody_LockedAxes (struct R3RigidBodyHandle handle)
 Return the rigid body translation/rotation lock bitmask.
struct R3Pose r3RigidBody_NextPosition (struct R3RigidBodyHandle handle)
 Return the rigid body next kinematic world-space pose.
struct R3Rotation r3RigidBody_Rotation (struct R3RigidBodyHandle handle)
 Return the rigid body world-space rotation.
struct R3Vector r3RigidBody_CenterOfMass (struct R3RigidBodyHandle handle)
 Return the rigid body world-space center of mass.
struct R3Vector r3RigidBody_LocalCenterOfMass (struct R3RigidBodyHandle handle)
 Return the rigid body body-local center of mass.
struct R3Vector r3RigidBody_UserForce (struct R3RigidBodyHandle handle)
 Return the rigid body accumulated user-applied world-space force.
R3AngVector r3RigidBody_UserTorque (struct R3RigidBodyHandle handle)
 Return the rigid body accumulated user-applied world-space torque.
uint32_t r3RigidBody_BodyType (struct R3RigidBodyHandle handle)
 Return the rigid body body type (R3_DYNAMIC, R3_FIXED, or a kinematic kind).
R3Real r3RigidBody_Mass (struct R3RigidBodyHandle handle)
 Return the rigid body mass.
R3Real r3RigidBody_GravityScale (struct R3RigidBodyHandle handle)
 Return the rigid body gravity multiplier.
R3Real r3RigidBody_LinearDamping (struct R3RigidBodyHandle handle)
 Return the rigid body linear damping coefficient.
R3Real r3RigidBody_AngularDamping (struct R3RigidBodyHandle handle)
 Return the rigid body angular damping coefficient.
R3Real r3RigidBody_KineticEnergy (struct R3RigidBodyHandle handle)
 Return the rigid body kinetic energy.
R3Real r3RigidBody_SoftCcdPrediction (struct R3RigidBodyHandle handle)
 Return the rigid body soft-CCD prediction distance.
R3Bool r3RigidBody_IsCcdEnabled (struct R3RigidBodyHandle handle)
 Return whether the rigid body is using continuous collision detection.
R3Bool r3RigidBody_IsDynamic (struct R3RigidBodyHandle handle)
 Return whether the rigid body is dynamic.
R3Bool r3RigidBody_IsFixed (struct R3RigidBodyHandle handle)
 Return whether the rigid body is fixed.
R3Bool r3RigidBody_IsKinematic (struct R3RigidBodyHandle handle)
 Return whether the rigid body is kinematic.
R3Bool r3RigidBody_IsMoving (struct R3RigidBodyHandle handle)
 Return whether the rigid body is moving.
R3Bool r3RigidBody_IsCcdActive (struct R3RigidBodyHandle handle)
 Return whether the rigid body is currently using CCD for its motion.
R3Status r3RigidBody_SetRotation (struct R3RigidBodyHandle handle, struct R3Rotation value, R3Bool wake_up)
 Set the rigid body world-space rotation.
R3Status r3RigidBody_SetBodyType (struct R3RigidBodyHandle handle, uint32_t value, R3Bool wake_up)
 Set the rigid body body type (R3_DYNAMIC, R3_FIXED, or a kinematic kind).
R3Status r3RigidBody_SetNextKinematicRotation (struct R3RigidBodyHandle handle, struct R3Rotation value)
 Set the rigid body next kinematic world-space rotation.
R3Status r3RigidBody_SetAdditionalMass (struct R3RigidBodyHandle handle, R3Real value, R3Bool wake_up)
 Set the rigid body mass added to collider contributions.
R3Status r3RigidBody_SetSoftCcdPrediction (struct R3RigidBodyHandle handle, R3Real value)
 Set the rigid body soft-CCD prediction distance.
R3Status r3RigidBody_SetCcdEnabled (struct R3RigidBodyHandle handle, R3Bool value)
 Enable or disable using continuous collision detection for the rigid body.
R3Status r3RigidBody_SetTranslationsLocked (struct R3RigidBodyHandle handle, R3Bool value, R3Bool wake_up)
 Enable or disable locking translation for the rigid body.
R3Status r3RigidBody_SetRotationsLocked (struct R3RigidBodyHandle handle, R3Bool value, R3Bool wake_up)
 Enable or disable locking rotation for the rigid body.
R3Status r3RigidBody_SetDominanceGroup (struct R3RigidBodyHandle handle, int8_t value)
 Set the rigid body signed dominance group.
R3Status r3RigidBody_SetAdditionalSolverIterations (struct R3RigidBodyHandle handle, size_t value)
 Set the rigid body additional solver iterations for connected bodies.
R3Status r3RigidBody_SetAdditionalPgsIterations (struct R3RigidBodyHandle handle, size_t value)
 Set the rigid body additional PGS iterations.
R3Status r3RigidBody_AddTorque (struct R3RigidBodyHandle handle, R3AngVector value, R3Bool wake_up)
 Accumulate a world-space torque; it persists until reset.
R3Status r3RigidBody_ApplyTorqueImpulse (struct R3RigidBodyHandle handle, R3AngVector value, R3Bool wake_up)
 Apply a world-space angular impulse.
R3Status r3RigidBody_AddForceAtPoint (struct R3RigidBodyHandle handle, struct R3Vector value, struct R3Vector point, R3Bool wake_up)
 Accumulate a world-space force applied at a world-space point.
R3Status r3RigidBody_ResetTorques (struct R3RigidBodyHandle handle, R3Bool wake_up)
 Clear accumulated user torques.
struct R3Vector r3RigidBody_VelocityAtPoint (struct R3RigidBodyHandle handle, struct R3Vector point)
 Return world-space velocity at a world-space point, including angular motion.
size_t r3RigidBody_Colliders (struct R3RigidBodyHandle handle, struct R3ColliderHandle *buffer, size_t capacity)
 Copy attached collider handles.
R3Bool r3RigidBody_GyroscopicForcesEnabled (struct R3RigidBodyHandle handle)
 Return whether the rigid body is using gyroscopic forces.
R3Status r3RigidBody_SetGyroscopicForcesEnabled (struct R3RigidBodyHandle handle, R3Bool enabled)
 Enable or disable using gyroscopic forces for the rigid body.
R3Status r3RigidBody_ValidateHandle (struct R3RigidBodyHandle handle)
 Validate the index and generation in the live owning world.

Detailed Description

Descriptions and live, world-bound handles.

Accessors return copies. Handle operations report INVALID_HANDLE for a removed/stale entity in a live world.

Macro Definition Documentation

◆ R3_DYNAMIC

#define R3_DYNAMIC   0

Dynamic body affected by forces and contacts.

◆ R3_FIXED

#define R3_FIXED   1

Immovable body.

◆ R3_KINEMATIC_POSITION_BASED

#define R3_KINEMATIC_POSITION_BASED   2

Kinematic body controlled by its next pose.

◆ R3_KINEMATIC_VELOCITY_BASED

#define R3_KINEMATIC_VELOCITY_BASED   3

Kinematic body controlled by its velocity.

◆ R3_LOCK_ROTATION_X

#define R3_LOCK_ROTATION_X   8

Rigid-body lock bit: rotation x.

◆ R3_LOCK_ROTATION_Y

#define R3_LOCK_ROTATION_Y   16

Rigid-body lock bit: rotation y.

◆ R3_LOCK_ROTATION_Z

#define R3_LOCK_ROTATION_Z   32

Rigid-body lock bit: rotation z.

◆ R3_LOCK_TRANSLATION_X

#define R3_LOCK_TRANSLATION_X   1

Rigid-body lock bit: translation x.

◆ R3_LOCK_TRANSLATION_Y

#define R3_LOCK_TRANSLATION_Y   2

Rigid-body lock bit: translation y.

◆ R3_LOCK_TRANSLATION_Z

#define R3_LOCK_TRANSLATION_Z   4

Rigid-body lock bit: translation z.

Typedef Documentation

◆ R3RigidBodyDesc

typedef struct R3RigidBodyDesc R3RigidBodyDesc

Stack-allocated rigid-body construction data.

Initialize with r3DynamicRigidBodyDesc, r3FixedRigidBodyDesc, or a kinematic description constructor. Copying this value is safe; it owns no resources and must never be freed by Rapier.

◆ R3RigidBodyHandle

typedef struct R3RigidBodyHandle R3RigidBodyHandle

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.

◆ R3RigidBodyState

typedef struct R3RigidBodyState R3RigidBodyState

A copied state snapshot, with no pointers or ownership obligations.

Function Documentation

◆ r3DynamicRigidBodyDesc()

struct R3RigidBodyDesc r3DynamicRigidBodyDesc ( void )

Return a dynamic rigid-body description with native defaults; no allocation.

◆ r3FixedRigidBodyDesc()

struct R3RigidBodyDesc r3FixedRigidBodyDesc ( void )

Return a fixed rigid-body description with native defaults; no allocation.

◆ r3InsertRigidBody()

struct R3RigidBodyHandle r3InsertRigidBody ( struct R3World * world,
const struct R3RigidBodyDesc * desc )

Create a body from the description and return its world-bound handle.

The world owns the body.

◆ r3KinematicPositionBasedRigidBodyDesc()

struct R3RigidBodyDesc r3KinematicPositionBasedRigidBodyDesc ( void )

Return a kinematic position based rigid-body description with native defaults; no allocation.

◆ r3KinematicVelocityBasedRigidBodyDesc()

struct R3RigidBodyDesc r3KinematicVelocityBasedRigidBodyDesc ( void )

Return a kinematic velocity based rigid-body description with native defaults; no allocation.

◆ r3RemoveRigidBody()

R3Status r3RemoveRigidBody ( struct R3RigidBodyHandle handle,
R3Bool remove_attached_colliders )

Remove a body and its joints, optionally keeping colliders as standalone objects.

A removed or stale handle fails with R3_INVALID_HANDLE, like the other Remove functions. Removing a soft-body cluster proxy removes its cluster (see r3SoftBody_RemoveCluster). The root body of a soft body is rejected: remove the soft body with r3RemoveSoftBody.

◆ r3RigidBody_AddForce()

R3Status r3RigidBody_AddForce ( struct R3RigidBodyHandle handle,
struct R3Vector value,
R3Bool wake_up )

Accumulate a world-space force; it persists until reset.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_AddForceAtPoint()

R3Status r3RigidBody_AddForceAtPoint ( struct R3RigidBodyHandle handle,
struct R3Vector value,
struct R3Vector point,
R3Bool wake_up )

Accumulate a world-space force applied at a world-space point.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_AdditionalPgsIterations()

size_t r3RigidBody_AdditionalPgsIterations ( struct R3RigidBodyHandle handle)

Return the rigid body additional PGS iterations for connected bodies.

◆ r3RigidBody_AdditionalSolverIterations()

size_t r3RigidBody_AdditionalSolverIterations ( struct R3RigidBodyHandle handle)

Return the rigid body additional solver iterations for connected bodies.

◆ r3RigidBody_AddTorque()

R3Status r3RigidBody_AddTorque ( struct R3RigidBodyHandle handle,
R3AngVector value,
R3Bool wake_up )

Accumulate a world-space torque; it persists until reset.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_AngularDamping()

R3Real r3RigidBody_AngularDamping ( struct R3RigidBodyHandle handle)

Return the rigid body angular damping coefficient.

◆ r3RigidBody_Angvel()

R3AngVector r3RigidBody_Angvel ( struct R3RigidBodyHandle handle)

Return the rigid body world-space angular velocity (radians per second).

◆ r3RigidBody_ApplyImpulse()

R3Status r3RigidBody_ApplyImpulse ( struct R3RigidBodyHandle handle,
struct R3Vector value,
R3Bool wake_up )

Apply a world-space linear impulse.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_ApplyImpulseAtPoint()

R3Status r3RigidBody_ApplyImpulseAtPoint ( struct R3RigidBodyHandle handle,
struct R3Vector value,
struct R3Vector point,
R3Bool wake_up )

Apply a world-space impulse at a world-space point.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_ApplyTorqueImpulse()

R3Status r3RigidBody_ApplyTorqueImpulse ( struct R3RigidBodyHandle handle,
R3AngVector value,
R3Bool wake_up )

Apply a world-space angular impulse.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_BodyType()

uint32_t r3RigidBody_BodyType ( struct R3RigidBodyHandle handle)

Return the rigid body body type (R3_DYNAMIC, R3_FIXED, or a kinematic kind).

◆ r3RigidBody_CenterOfMass()

struct R3Vector r3RigidBody_CenterOfMass ( struct R3RigidBodyHandle handle)

Return the rigid body world-space center of mass.

◆ r3RigidBody_Colliders()

size_t r3RigidBody_Colliders ( struct R3RigidBodyHandle handle,
struct R3ColliderHandle * buffer,
size_t capacity )

Copy attached collider handles.

See also
Arrays and output buffers

◆ r3RigidBody_Contains()

R3Bool r3RigidBody_Contains ( struct R3RigidBodyHandle handle)

Test whether the live world contains this rigid body handle.

A removed/stale handle returns false.

◆ r3RigidBody_DominanceGroup()

int8_t r3RigidBody_DominanceGroup ( struct R3RigidBodyHandle handle)

Return the rigid body signed dominance group.

◆ r3RigidBody_GravityScale()

R3Real r3RigidBody_GravityScale ( struct R3RigidBodyHandle handle)

Return the rigid body gravity multiplier.

◆ r3RigidBody_GyroscopicForcesEnabled()

R3Bool r3RigidBody_GyroscopicForcesEnabled ( struct R3RigidBodyHandle handle)

Return whether the rigid body is using gyroscopic forces.

◆ r3RigidBody_IsCcdActive()

R3Bool r3RigidBody_IsCcdActive ( struct R3RigidBodyHandle handle)

Return whether the rigid body is currently using CCD for its motion.

◆ r3RigidBody_IsCcdEnabled()

R3Bool r3RigidBody_IsCcdEnabled ( struct R3RigidBodyHandle handle)

Return whether the rigid body is using continuous collision detection.

◆ r3RigidBody_IsDynamic()

R3Bool r3RigidBody_IsDynamic ( struct R3RigidBodyHandle handle)

Return whether the rigid body is dynamic.

◆ r3RigidBody_IsEnabled()

R3Bool r3RigidBody_IsEnabled ( struct R3RigidBodyHandle handle)

Return whether the rigid body is enabled.

◆ r3RigidBody_IsFastRotationAllowed()

R3Bool r3RigidBody_IsFastRotationAllowed ( struct R3RigidBodyHandle handle)

Return whether the rigid body may exceed the angular-velocity limit of its CCD.

◆ r3RigidBody_IsFixed()

R3Bool r3RigidBody_IsFixed ( struct R3RigidBodyHandle handle)

Return whether the rigid body is fixed.

◆ r3RigidBody_IsKinematic()

R3Bool r3RigidBody_IsKinematic ( struct R3RigidBodyHandle handle)

Return whether the rigid body is kinematic.

◆ r3RigidBody_IsMoving()

R3Bool r3RigidBody_IsMoving ( struct R3RigidBodyHandle handle)

Return whether the rigid body is moving.

◆ r3RigidBody_IsSleeping()

R3Bool r3RigidBody_IsSleeping ( struct R3RigidBodyHandle handle)

Return whether the rigid body is sleeping.

◆ r3RigidBody_KineticEnergy()

R3Real r3RigidBody_KineticEnergy ( struct R3RigidBodyHandle handle)

Return the rigid body kinetic energy.

◆ r3RigidBody_LinearDamping()

R3Real r3RigidBody_LinearDamping ( struct R3RigidBodyHandle handle)

Return the rigid body linear damping coefficient.

◆ r3RigidBody_Linvel()

struct R3Vector r3RigidBody_Linvel ( struct R3RigidBodyHandle handle)

Return the rigid body world-space linear velocity.

◆ r3RigidBody_LocalCenterOfMass()

struct R3Vector r3RigidBody_LocalCenterOfMass ( struct R3RigidBodyHandle handle)

Return the rigid body body-local center of mass.

◆ r3RigidBody_LockedAxes()

uint8_t r3RigidBody_LockedAxes ( struct R3RigidBodyHandle handle)

Return the rigid body translation/rotation lock bitmask.

◆ r3RigidBody_Mass()

R3Real r3RigidBody_Mass ( struct R3RigidBodyHandle handle)

Return the rigid body mass.

◆ r3RigidBody_NextPosition()

struct R3Pose r3RigidBody_NextPosition ( struct R3RigidBodyHandle handle)

Return the rigid body next kinematic world-space pose.

◆ r3RigidBody_Position()

struct R3Pose r3RigidBody_Position ( struct R3RigidBodyHandle handle)

Return the rigid body world-space pose.

◆ r3RigidBody_RecomputeMassPropertiesFromColliders()

R3Status r3RigidBody_RecomputeMassPropertiesFromColliders ( struct R3RigidBodyHandle handle)

Recompute body mass and inertia from attached colliders and additional mass properties.

◆ r3RigidBody_ResetForces()

R3Status r3RigidBody_ResetForces ( struct R3RigidBodyHandle handle,
R3Bool wake_up )

Clear accumulated user forces.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_ResetTorques()

R3Status r3RigidBody_ResetTorques ( struct R3RigidBodyHandle handle,
R3Bool wake_up )

Clear accumulated user torques.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_Rotation()

struct R3Rotation r3RigidBody_Rotation ( struct R3RigidBodyHandle handle)

Return the rigid body world-space rotation.

◆ r3RigidBody_SetAdditionalMass()

R3Status r3RigidBody_SetAdditionalMass ( struct R3RigidBodyHandle handle,
R3Real value,
R3Bool wake_up )

Set the rigid body mass added to collider contributions.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_SetAdditionalMassProperties()

R3Status r3RigidBody_SetAdditionalMassProperties ( struct R3RigidBodyHandle handle,
struct R3MassProperties properties,
R3Bool wake_up )

Set the rigid body local mass properties added to collider contributions.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_SetAdditionalPgsIterations()

R3Status r3RigidBody_SetAdditionalPgsIterations ( struct R3RigidBodyHandle handle,
size_t value )

Set the rigid body additional PGS iterations.

◆ r3RigidBody_SetAdditionalSolverIterations()

R3Status r3RigidBody_SetAdditionalSolverIterations ( struct R3RigidBodyHandle handle,
size_t value )

Set the rigid body additional solver iterations for connected bodies.

◆ r3RigidBody_SetAllowFastRotation()

R3Status r3RigidBody_SetAllowFastRotation ( struct R3RigidBodyHandle handle,
R3Bool value )

Allow or disallow the rigid body to exceed the angular-velocity limit of its CCD (e.g.

for wheels).

◆ r3RigidBody_SetAngularDamping()

R3Status r3RigidBody_SetAngularDamping ( struct R3RigidBodyHandle handle,
R3Real value )

Set the rigid body angular damping coefficient.

◆ r3RigidBody_SetAngvel()

R3Status r3RigidBody_SetAngvel ( struct R3RigidBodyHandle handle,
R3AngVector value,
R3Bool wake_up )

Set the rigid body world-space angular velocity (radians per second).

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_SetBodyType()

R3Status r3RigidBody_SetBodyType ( struct R3RigidBodyHandle handle,
uint32_t value,
R3Bool wake_up )

Set the rigid body body type (R3_DYNAMIC, R3_FIXED, or a kinematic kind).

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_SetCcdEnabled()

R3Status r3RigidBody_SetCcdEnabled ( struct R3RigidBodyHandle handle,
R3Bool value )

Enable or disable using continuous collision detection for the rigid body.

◆ r3RigidBody_SetDominanceGroup()

R3Status r3RigidBody_SetDominanceGroup ( struct R3RigidBodyHandle handle,
int8_t value )

Set the rigid body signed dominance group.

◆ r3RigidBody_SetEnabled()

R3Status r3RigidBody_SetEnabled ( struct R3RigidBodyHandle handle,
R3Bool value )

Enable or disable the rigid body.

◆ r3RigidBody_SetGravityScale()

R3Status r3RigidBody_SetGravityScale ( struct R3RigidBodyHandle handle,
R3Real value,
R3Bool wake_up )

Set the rigid body gravity multiplier.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_SetGyroscopicForcesEnabled()

R3Status r3RigidBody_SetGyroscopicForcesEnabled ( struct R3RigidBodyHandle handle,
R3Bool enabled )

Enable or disable using gyroscopic forces for the rigid body.

◆ r3RigidBody_SetLinearDamping()

R3Status r3RigidBody_SetLinearDamping ( struct R3RigidBodyHandle handle,
R3Real value )

Set the rigid body linear damping coefficient.

◆ r3RigidBody_SetLinvel()

R3Status r3RigidBody_SetLinvel ( struct R3RigidBodyHandle handle,
struct R3Vector value,
R3Bool wake_up )

Set the rigid body world-space linear velocity.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_SetLockedAxes()

R3Status r3RigidBody_SetLockedAxes ( struct R3RigidBodyHandle handle,
uint8_t axes,
R3Bool wake_up )

Set the rigid body translation/rotation lock bitmask.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_SetNextKinematicPosition()

R3Status r3RigidBody_SetNextKinematicPosition ( struct R3RigidBodyHandle handle,
struct R3Pose value )

Set the rigid body next kinematic world-space pose.

◆ r3RigidBody_SetNextKinematicRotation()

R3Status r3RigidBody_SetNextKinematicRotation ( struct R3RigidBodyHandle handle,
struct R3Rotation value )

Set the rigid body next kinematic world-space rotation.

◆ r3RigidBody_SetNextKinematicTranslation()

R3Status r3RigidBody_SetNextKinematicTranslation ( struct R3RigidBodyHandle handle,
struct R3Vector value )

Set the rigid body next kinematic world-space translation.

◆ r3RigidBody_SetPosition()

R3Status r3RigidBody_SetPosition ( struct R3RigidBodyHandle handle,
struct R3Pose value,
R3Bool wake_up )

Set the rigid body world-space pose.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_SetRotation()

R3Status r3RigidBody_SetRotation ( struct R3RigidBodyHandle handle,
struct R3Rotation value,
R3Bool wake_up )

Set the rigid body world-space rotation.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_SetRotationsLocked()

R3Status r3RigidBody_SetRotationsLocked ( struct R3RigidBodyHandle handle,
R3Bool value,
R3Bool wake_up )

Enable or disable locking rotation for the rigid body.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_SetSoftCcdPrediction()

R3Status r3RigidBody_SetSoftCcdPrediction ( struct R3RigidBodyHandle handle,
R3Real value )

Set the rigid body soft-CCD prediction distance.

◆ r3RigidBody_SetTranslation()

R3Status r3RigidBody_SetTranslation ( struct R3RigidBodyHandle handle,
struct R3Vector value,
R3Bool wake_up )

Set the rigid body world-space translation.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_SetTranslationsLocked()

R3Status r3RigidBody_SetTranslationsLocked ( struct R3RigidBodyHandle handle,
R3Bool value,
R3Bool wake_up )

Enable or disable locking translation for the rigid body.

wake_up = 1 wakes affected bodies; 0 preserves their sleep state.

◆ r3RigidBody_SetUserData()

R3Status r3RigidBody_SetUserData ( struct R3RigidBodyHandle handle,
struct R3UserData value )

Set the rigid body application-owned 128-bit user value.

◆ r3RigidBody_Sleep()

R3Status r3RigidBody_Sleep ( struct R3RigidBodyHandle handle)

Put the body to sleep.

◆ r3RigidBody_SoftCcdPrediction()

R3Real r3RigidBody_SoftCcdPrediction ( struct R3RigidBodyHandle handle)

Return the rigid body soft-CCD prediction distance.

◆ r3RigidBody_Translation()

struct R3Vector r3RigidBody_Translation ( struct R3RigidBodyHandle handle)

Return the rigid body world-space translation.

◆ r3RigidBody_UserData()

struct R3UserData r3RigidBody_UserData ( struct R3RigidBodyHandle handle)

Return the rigid body application-owned 128-bit user value.

◆ r3RigidBody_UserForce()

struct R3Vector r3RigidBody_UserForce ( struct R3RigidBodyHandle handle)

Return the rigid body accumulated user-applied world-space force.

◆ r3RigidBody_UserTorque()

R3AngVector r3RigidBody_UserTorque ( struct R3RigidBodyHandle handle)

Return the rigid body accumulated user-applied world-space torque.

◆ r3RigidBody_ValidateHandle()

R3Status r3RigidBody_ValidateHandle ( struct R3RigidBodyHandle handle)

Validate the index and generation in the live owning world.

Cannot detect a world pointer that has already been freed.

◆ r3RigidBody_VelocityAtPoint()

struct R3Vector r3RigidBody_VelocityAtPoint ( struct R3RigidBodyHandle handle,
struct R3Vector point )

Return world-space velocity at a world-space point, including angular motion.

◆ r3RigidBody_WakeUp()

R3Status r3RigidBody_WakeUp ( struct R3RigidBodyHandle handle,
R3Bool strong )

Wake a body by handle, including a soft-body cluster proxy.

◆ r3RigidBodyCount()

size_t r3RigidBodyCount ( const struct R3World * world)

Return the number of rigid body objects in the world.

◆ r3RigidBodyHandles()

size_t r3RigidBodyHandles ( const struct R3World * world,
struct R3RigidBodyHandle * buffer,
size_t capacity )

Copy entity handles.

See also
Arrays and output buffers

◆ r3RigidBodyPropagateModifiedBodyPositionsToColliders()

R3Status r3RigidBodyPropagateModifiedBodyPositionsToColliders ( struct R3World * world)

Propagate all modified body poses to attached colliders.

Run collision detection or step before querying the broad phase.

◆ r3RigidBodyReadStates()

size_t r3RigidBodyReadStates ( const struct R3World * world,
const struct R3RigidBodyHandle * handles,
size_t handle_count,
struct R3RigidBodyState * 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.