Rapier C — 3D / f32 0.36.0+c.0
Loading...
Searching...
No Matches
Callback read access

Read* functions resolve handles through the callback context. More...

Data Structures

struct  R3PhysicsHooks
 Callbacks must not unwind or retain arguments. More...

Typedefs

typedef struct R3ContactModificationContext R3ContactModificationContext
 Borrowed native contact context.
typedef struct R3ReadContext R3ReadContext
 Callback-scoped read access to bodies and colliders.
typedef int32_t(*) R3PairFilter(void *user_data, const struct R3ReadContext *read, struct R3ColliderHandle collider1, struct R3ColliderHandle collider2, struct R3RigidBodyHandle body1, struct R3RigidBodyHandle body2)
 Pair callback: -1 rejects a contact pair; 0 detects contacts without impulses; 1 computes impulses.
typedef void(*) R3ModifyContacts(void *user_data, const struct R3ReadContext *read, struct R3ColliderHandle collider1, struct R3ColliderHandle collider2, struct R3ContactModification *contact)
 Modify aggregate contact properties for one pair; contact is mutable only during this callback.
typedef void(*) R3ModifyContactContext(void *user_data, const struct R3ReadContext *read, struct R3ColliderHandle collider1, struct R3ColliderHandle collider2, struct R3ContactModificationContext *context)
 Modify individual solver contacts through a borrowed context, valid only during the callback.
typedef struct R3PhysicsHooks R3PhysicsHooks
 Callbacks must not unwind or retain arguments.

Functions

R3Status r3ContactModificationContext_UpdateAsOnewayPlatform (struct R3ContactModificationContext *context, struct R3Vector allowed_local_n1, R3Real allowed_angle)
 Applies Rapier's persistent one-way platform logic to the borrowed manifold.
R3Status r3ContactModificationContext_SetTangentVelocity (struct R3ContactModificationContext *context, struct R3Vector velocity)
 Sets the tangent velocity of every rigid solver contact in this manifold.
struct R3SoftBodyHandle r3ReadCollider_SoftBody (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the soft body owning this deformable collider, or an invalid handle for any other collider.
struct R3VelocityCorrection r3ReadPidController_RigidBodyCorrection (const struct R3ReadContext *context, struct R3PidController *controller, R3Real dt, struct R3RigidBodyHandle body, struct R3Pose target_pose, struct R3Vector target_linvel, R3AngVector target_angvel)
 Compute a velocity correction from callback-visible body state, updating the PID controller history.
struct R3VelocityCorrection r3ReadPdController_RigidBodyCorrection (const struct R3ReadContext *context, const struct R3PdController *controller, struct R3RigidBodyHandle body, struct R3Pose target_pose, struct R3Vector target_linvel, R3AngVector target_angvel)
 Compute a PD velocity correction from callback-visible body state.
size_t r3ReadRigidBodyCount (const struct R3ReadContext *context)
 Return the number of rigid body objects in the world.
size_t r3ReadRigidBodyHandles (const struct R3ReadContext *context, struct R3RigidBodyHandle *buffer, size_t capacity)
 Copy entity handles.
R3Bool r3ReadRigidBody_Contains (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Test whether the live world contains this rigid body handle.
size_t r3ReadColliderCount (const struct R3ReadContext *context)
 Return the number of collider objects in the world.
size_t r3ReadColliderHandles (const struct R3ReadContext *context, struct R3ColliderHandle *buffer, size_t capacity)
 Copy entity handles.
R3Bool r3ReadCollider_Contains (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Test whether the live world contains this collider handle.
size_t r3ReadCollider_ShapeIdentity (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return a process-local geometry identity for caching, not a serializable ID.
struct R3MassProperties r3ReadCollider_MassProperties (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider local mass properties.
uint8_t r3ReadRigidBody_LockedAxes (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body translation/rotation lock bitmask.
R3Bool r3ReadCollider_IsVoxels (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return whether the collider is a voxel shape.
struct R3VoxelQuery r3ReadCollider_VoxelAtFlatId (const struct R3ReadContext *context, struct R3ColliderHandle handle, uint32_t id)
 Return voxel information at a flat index; found = 0 if absent.
struct R3Pose r3ReadRigidBody_NextPosition (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body next kinematic world-space pose.
struct R3Rotation r3ReadRigidBody_Rotation (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body world-space rotation.
struct R3Vector r3ReadRigidBody_CenterOfMass (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body world-space center of mass.
struct R3Vector r3ReadRigidBody_LocalCenterOfMass (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body body-local center of mass.
struct R3Vector r3ReadRigidBody_UserForce (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body accumulated user-applied world-space force.
R3AngVector r3ReadRigidBody_UserTorque (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body accumulated user-applied world-space torque.
uint32_t r3ReadRigidBody_BodyType (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body body type (R3_DYNAMIC, R3_FIXED, or a kinematic kind).
R3Real r3ReadRigidBody_Mass (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body mass.
R3Real r3ReadRigidBody_GravityScale (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body gravity multiplier.
R3Real r3ReadRigidBody_LinearDamping (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body linear damping coefficient.
R3Real r3ReadRigidBody_AngularDamping (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body angular damping coefficient.
R3Real r3ReadRigidBody_KineticEnergy (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body kinetic energy.
R3Real r3ReadRigidBody_SoftCcdPrediction (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body soft-CCD prediction distance.
R3Bool r3ReadRigidBody_IsCcdEnabled (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return whether the rigid body is using continuous collision detection.
R3Bool r3ReadRigidBody_IsDynamic (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return whether the rigid body is dynamic.
struct R3SoftBodyHandle r3ReadRigidBody_SoftBody (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the associated soft-body handle, or an invalid handle if this is not a soft proxy.
R3Bool r3ReadRigidBody_IsSoftFrame (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return whether the rigid body is a soft-body proxy.
R3Bool r3ReadRigidBody_IsFixed (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return whether the rigid body is fixed.
R3Bool r3ReadRigidBody_IsKinematic (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return whether the rigid body is kinematic.
R3Bool r3ReadRigidBody_IsMoving (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return whether the rigid body is moving.
R3Bool r3ReadRigidBody_IsCcdActive (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return whether the rigid body is currently using CCD for its motion.
struct R3Vector r3ReadRigidBody_VelocityAtPoint (const struct R3ReadContext *context, struct R3RigidBodyHandle handle, struct R3Vector point)
 Return world-space velocity at a world-space point, including angular motion.
size_t r3ReadRigidBody_Colliders (const struct R3ReadContext *context, struct R3RigidBodyHandle handle, struct R3ColliderHandle *buffer, size_t capacity)
 Copy attached collider handles.
R3Bool r3ReadRigidBody_GyroscopicForcesEnabled (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return whether the rigid body is using gyroscopic forces.
struct R3Rotation r3ReadCollider_Rotation (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider world-space rotation.
struct R3InteractionGroups r3ReadCollider_CollisionGroups (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider collision filtering groups.
struct R3InteractionGroups r3ReadCollider_SolverGroups (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider contact-force filtering groups.
struct R3UserData r3ReadCollider_UserData (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider application-owned 128-bit user value.
uint32_t r3ReadCollider_ActiveEvents (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider event-generation bitmask (R3_COLLISION_EVENTS and R3_CONTACT_FORCE_EVENTS).
R3Real r3ReadCollider_Mass (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider mass.
R3Real r3ReadCollider_Density (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider mass per unit volume.
R3Real r3ReadCollider_Volume (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider current volume.
R3Real r3ReadCollider_ContactSkin (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider extra separation skin around the shape.
R3Real r3ReadCollider_ContactForceEventThreshold (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider force threshold for contact-force events.
R3Bool r3ReadCollider_IsEnabled (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return whether the collider is enabled.
struct R3Aabb r3ReadCollider_ComputeAabb (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the current world-space axis-aligned bounds.
R3SharedShape * r3ReadCollider_CloneShape (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return an owned wrapper sharing the collider geometry.
R3Status r3ReadRigidBody_ValidateHandle (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Validate the index and generation in the live owning world.
R3Status r3ReadCollider_ValidateHandle (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Validate the index and generation in the live owning world.
struct R3Pose r3ReadRigidBody_Position (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body world-space pose.
struct R3Vector r3ReadRigidBody_Translation (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body world-space translation.
struct R3Vector r3ReadRigidBody_Linvel (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body world-space linear velocity.
R3AngVector r3ReadRigidBody_Angvel (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body world-space angular velocity (radians per second).
R3Bool r3ReadRigidBody_IsSleeping (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return whether the rigid body is sleeping.
R3Bool r3ReadRigidBody_IsEnabled (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return whether the rigid body is enabled.
struct R3UserData r3ReadRigidBody_UserData (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body application-owned 128-bit user value.
struct R3Pose r3ReadCollider_Position (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider world-space pose.
struct R3Vector r3ReadCollider_Translation (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider world-space translation.
R3Real r3ReadCollider_Friction (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider friction coefficient.
R3Real r3ReadCollider_Restitution (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider restitution coefficient.
R3Bool r3ReadCollider_IsSensor (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return whether the collider is a sensor (detects overlaps without contact forces).
struct R3RigidBodyHandle r3ReadCollider_Parent (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Read the parent body handle during a callback; a standalone collider returns an invalid handle with OK status.
size_t r3ReadRigidBodyReadStates (const struct R3ReadContext *context, const struct R3RigidBodyHandle *handles, size_t handle_count, struct R3RigidBodyState *states, size_t capacity)
 Copy callback-visible body states in the supplied handle order.
uint16_t r3ReadCollider_ActiveCollisionTypes (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider body-type collision activation bitmask (R3_COLLISION_TYPES_* bits).
uint32_t r3ReadCollider_ActiveHooks (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider physics-hook activation bitmask.
uint32_t r3ReadCollider_FrictionCombineRule (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider friction combination rule (R3_COMBINE_*).
uint32_t r3ReadCollider_RestitutionCombineRule (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider restitution combination rule (R3_COMBINE_*).
struct R3Pose r3ReadCollider_PositionWrtParent (const struct R3ReadContext *context, struct R3ColliderHandle handle)
 Return the collider pose relative to its parent rigid body, or its world-space pose if it has no parent.
int8_t r3ReadRigidBody_DominanceGroup (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body signed dominance group.
size_t r3ReadRigidBody_AdditionalSolverIterations (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body additional solver iterations for connected bodies.
size_t r3ReadRigidBody_AdditionalPgsIterations (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return the rigid body additional PGS iterations for connected bodies.
R3Bool r3ReadRigidBody_IsFastRotationAllowed (const struct R3ReadContext *context, struct R3RigidBodyHandle handle)
 Return whether the rigid body may exceed the angular-velocity limit of its CCD.
R3Bool r3ContactModificationContext_IsSoft (const struct R3ContactModificationContext *context)
 Return whether the context holds the contact candidates of two soft surfaces rather than a manifold.
size_t r3ContactModificationContext_SolverContactCount (const struct R3ContactModificationContext *context)
 Return the number of solver contacts of the manifold; zero for a soft context.
struct R3SolverContact r3ContactModificationContext_SolverContact (const struct R3ContactModificationContext *context, size_t index)
 Return a solver contact of the manifold.
R3Status r3ContactModificationContext_SetSolverContact (struct R3ContactModificationContext *context, size_t index, const struct R3SolverContact *contact)
 Replace the points, distance and tangent velocity of a solver contact of the manifold.
R3Status r3ContactModificationContext_RemoveSolverContact (struct R3ContactModificationContext *context, size_t index)
 Remove a solver contact of the manifold.

Detailed Description

Read* functions resolve handles through the callback context.

This context is borrowed for that callback only and cannot mutate the world.

Typedef Documentation

◆ R3ContactModificationContext

Borrowed native contact context.

Valid only during its callback; never retain or free it.

◆ R3ModifyContactContext

typedef void(*) R3ModifyContactContext(void *user_data, const struct R3ReadContext *read, struct R3ColliderHandle collider1, struct R3ColliderHandle collider2, struct R3ContactModificationContext *context)

Modify individual solver contacts through a borrowed context, valid only during the callback.

◆ R3ModifyContacts

typedef void(*) R3ModifyContacts(void *user_data, const struct R3ReadContext *read, struct R3ColliderHandle collider1, struct R3ColliderHandle collider2, struct R3ContactModification *contact)

Modify aggregate contact properties for one pair; contact is mutable only during this callback.

◆ R3PairFilter

typedef int32_t(*) R3PairFilter(void *user_data, const struct R3ReadContext *read, struct R3ColliderHandle collider1, struct R3ColliderHandle collider2, struct R3RigidBodyHandle body1, struct R3RigidBodyHandle body2)

Pair callback: -1 rejects a contact pair; 0 detects contacts without impulses; 1 computes impulses.

For sensor intersections only, zero rejects and any positive value accepts.

◆ R3PhysicsHooks

typedef struct R3PhysicsHooks R3PhysicsHooks

Callbacks must not unwind or retain arguments.

Use their ReadContext to inspect bodies and colliders; ordinary access to the stepping world returns WORLD_BUSY. Mutations must be performed after stepping. With parallel builds callbacks and their user_data must be safe for concurrent invocation. NULL callbacks use defaults.

◆ R3ReadContext

typedef struct R3ReadContext R3ReadContext

Callback-scoped read access to bodies and colliders.

Never retain or free it. Only the Read* functions accept this context; it cannot mutate the world.

Function Documentation

◆ r3ContactModificationContext_IsSoft()

R3Bool r3ContactModificationContext_IsSoft ( const struct R3ContactModificationContext * context)

Return whether the context holds the contact candidates of two soft surfaces rather than a manifold.

Solver-contact accessors see no contacts in a soft context.

◆ r3ContactModificationContext_RemoveSolverContact()

R3Status r3ContactModificationContext_RemoveSolverContact ( struct R3ContactModificationContext * context,
size_t index )

Remove a solver contact of the manifold.

The last solver contact takes its index.

◆ r3ContactModificationContext_SetSolverContact()

R3Status r3ContactModificationContext_SetSolverContact ( struct R3ContactModificationContext * context,
size_t index,
const struct R3SolverContact * contact )

Replace the points, distance and tangent velocity of a solver contact of the manifold.

Points are world-space; a distance differing from their gap along the normal shifts the contact.

◆ r3ContactModificationContext_SetTangentVelocity()

R3Status r3ContactModificationContext_SetTangentVelocity ( struct R3ContactModificationContext * context,
struct R3Vector velocity )

Sets the tangent velocity of every rigid solver contact in this manifold.

◆ r3ContactModificationContext_SolverContact()

struct R3SolverContact r3ContactModificationContext_SolverContact ( const struct R3ContactModificationContext * context,
size_t index )

Return a solver contact of the manifold.

Inside the hook, points are world-space.

◆ r3ContactModificationContext_SolverContactCount()

size_t r3ContactModificationContext_SolverContactCount ( const struct R3ContactModificationContext * context)

Return the number of solver contacts of the manifold; zero for a soft context.

◆ r3ContactModificationContext_UpdateAsOnewayPlatform()

R3Status r3ContactModificationContext_UpdateAsOnewayPlatform ( struct R3ContactModificationContext * context,
struct R3Vector allowed_local_n1,
R3Real allowed_angle )

Applies Rapier's persistent one-way platform logic to the borrowed manifold.

◆ r3ReadCollider_ActiveCollisionTypes()

uint16_t r3ReadCollider_ActiveCollisionTypes ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider body-type collision activation bitmask (R3_COLLISION_TYPES_* bits).

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_ActiveEvents()

uint32_t r3ReadCollider_ActiveEvents ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider event-generation bitmask (R3_COLLISION_EVENTS and R3_CONTACT_FORCE_EVENTS).

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_ActiveHooks()

uint32_t r3ReadCollider_ActiveHooks ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider physics-hook activation bitmask.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_CloneShape()

R3SharedShape * r3ReadCollider_CloneShape ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return an owned wrapper sharing the collider geometry.

Release with r3FreeSharedShape. Uses only the callback-scoped read context; never retain the context. Returns an owned shape wrapper sharing the geometry. Release it with FreeSharedShape.

◆ r3ReadCollider_CollisionGroups()

struct R3InteractionGroups r3ReadCollider_CollisionGroups ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider collision filtering groups.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_ComputeAabb()

struct R3Aabb r3ReadCollider_ComputeAabb ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the current world-space axis-aligned bounds.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_ContactForceEventThreshold()

R3Real r3ReadCollider_ContactForceEventThreshold ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider force threshold for contact-force events.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_ContactSkin()

R3Real r3ReadCollider_ContactSkin ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider extra separation skin around the shape.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_Contains()

R3Bool r3ReadCollider_Contains ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Test whether the live world contains this collider handle.

A removed/stale handle returns false. Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_Density()

R3Real r3ReadCollider_Density ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider mass per unit volume.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_Friction()

R3Real r3ReadCollider_Friction ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider friction coefficient.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_FrictionCombineRule()

uint32_t r3ReadCollider_FrictionCombineRule ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider friction combination rule (R3_COMBINE_*).

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_IsEnabled()

R3Bool r3ReadCollider_IsEnabled ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return whether the collider is enabled.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_IsSensor()

R3Bool r3ReadCollider_IsSensor ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return whether the collider is a sensor (detects overlaps without contact forces).

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_IsVoxels()

R3Bool r3ReadCollider_IsVoxels ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return whether the collider is a voxel shape.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_Mass()

R3Real r3ReadCollider_Mass ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider mass.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_MassProperties()

struct R3MassProperties r3ReadCollider_MassProperties ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider local mass properties.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_Parent()

struct R3RigidBodyHandle r3ReadCollider_Parent ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Read the parent body handle during a callback; a standalone collider returns an invalid handle with OK status.

◆ r3ReadCollider_Position()

struct R3Pose r3ReadCollider_Position ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider world-space pose.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_PositionWrtParent()

struct R3Pose r3ReadCollider_PositionWrtParent ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider pose relative to its parent rigid body, or its world-space pose if it has no parent.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_Restitution()

R3Real r3ReadCollider_Restitution ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider restitution coefficient.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_RestitutionCombineRule()

uint32_t r3ReadCollider_RestitutionCombineRule ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider restitution combination rule (R3_COMBINE_*).

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_Rotation()

struct R3Rotation r3ReadCollider_Rotation ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider world-space rotation.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_ShapeIdentity()

size_t r3ReadCollider_ShapeIdentity ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return a process-local geometry identity for caching, not a serializable ID.

Keep a shared-shape clone alive while using it as a cache key. Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_SoftBody()

struct R3SoftBodyHandle r3ReadCollider_SoftBody ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the soft body owning this deformable collider, or an invalid handle for any other collider.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_SolverGroups()

struct R3InteractionGroups r3ReadCollider_SolverGroups ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider contact-force filtering groups.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_Translation()

struct R3Vector r3ReadCollider_Translation ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider world-space translation.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_UserData()

struct R3UserData r3ReadCollider_UserData ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider application-owned 128-bit user value.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_ValidateHandle()

R3Status r3ReadCollider_ValidateHandle ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Validate the index and generation in the live owning world.

Cannot detect a world pointer that has already been freed. Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_Volume()

R3Real r3ReadCollider_Volume ( const struct R3ReadContext * context,
struct R3ColliderHandle handle )

Return the collider current volume.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadCollider_VoxelAtFlatId()

struct R3VoxelQuery r3ReadCollider_VoxelAtFlatId ( const struct R3ReadContext * context,
struct R3ColliderHandle handle,
uint32_t id )

Return voxel information at a flat index; found = 0 if absent.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadColliderCount()

size_t r3ReadColliderCount ( const struct R3ReadContext * context)

Return the number of collider objects in the world.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadColliderHandles()

size_t r3ReadColliderHandles ( const struct R3ReadContext * context,
struct R3ColliderHandle * buffer,
size_t capacity )

Copy entity handles.

Uses only the callback-scoped read context; never retain the context.

See also
Arrays and output buffers

◆ r3ReadPdController_RigidBodyCorrection()

struct R3VelocityCorrection r3ReadPdController_RigidBodyCorrection ( const struct R3ReadContext * context,
const struct R3PdController * controller,
struct R3RigidBodyHandle body,
struct R3Pose target_pose,
struct R3Vector target_linvel,
R3AngVector target_angvel )

Compute a PD velocity correction from callback-visible body state.

Neither the body nor the controller is modified. The context is valid only during its callback.

◆ r3ReadPidController_RigidBodyCorrection()

struct R3VelocityCorrection r3ReadPidController_RigidBodyCorrection ( const struct R3ReadContext * context,
struct R3PidController * controller,
R3Real dt,
struct R3RigidBodyHandle body,
struct R3Pose target_pose,
struct R3Vector target_linvel,
R3AngVector target_angvel )

Compute a velocity correction from callback-visible body state, updating the PID controller history.

The context is valid only during its callback.

◆ r3ReadRigidBody_AdditionalPgsIterations()

size_t r3ReadRigidBody_AdditionalPgsIterations ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body additional PGS iterations for connected bodies.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_AdditionalSolverIterations()

size_t r3ReadRigidBody_AdditionalSolverIterations ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body additional solver iterations for connected bodies.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_AngularDamping()

R3Real r3ReadRigidBody_AngularDamping ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body angular damping coefficient.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_Angvel()

R3AngVector r3ReadRigidBody_Angvel ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

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

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_BodyType()

uint32_t r3ReadRigidBody_BodyType ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

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

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_CenterOfMass()

struct R3Vector r3ReadRigidBody_CenterOfMass ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body world-space center of mass.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_Colliders()

size_t r3ReadRigidBody_Colliders ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle,
struct R3ColliderHandle * buffer,
size_t capacity )

Copy attached collider handles.

Uses only the callback-scoped read context; never retain the context.

See also
Arrays and output buffers

◆ r3ReadRigidBody_Contains()

R3Bool r3ReadRigidBody_Contains ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Test whether the live world contains this rigid body handle.

A removed/stale handle returns false. Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_DominanceGroup()

int8_t r3ReadRigidBody_DominanceGroup ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body signed dominance group.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_GravityScale()

R3Real r3ReadRigidBody_GravityScale ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body gravity multiplier.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_GyroscopicForcesEnabled()

R3Bool r3ReadRigidBody_GyroscopicForcesEnabled ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return whether the rigid body is using gyroscopic forces.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_IsCcdActive()

R3Bool r3ReadRigidBody_IsCcdActive ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

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

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_IsCcdEnabled()

R3Bool r3ReadRigidBody_IsCcdEnabled ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return whether the rigid body is using continuous collision detection.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_IsDynamic()

R3Bool r3ReadRigidBody_IsDynamic ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return whether the rigid body is dynamic.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_IsEnabled()

R3Bool r3ReadRigidBody_IsEnabled ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return whether the rigid body is enabled.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_IsFastRotationAllowed()

R3Bool r3ReadRigidBody_IsFastRotationAllowed ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

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

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_IsFixed()

R3Bool r3ReadRigidBody_IsFixed ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return whether the rigid body is fixed.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_IsKinematic()

R3Bool r3ReadRigidBody_IsKinematic ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return whether the rigid body is kinematic.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_IsMoving()

R3Bool r3ReadRigidBody_IsMoving ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return whether the rigid body is moving.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_IsSleeping()

R3Bool r3ReadRigidBody_IsSleeping ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return whether the rigid body is sleeping.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_IsSoftFrame()

R3Bool r3ReadRigidBody_IsSoftFrame ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return whether the rigid body is a soft-body proxy.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_KineticEnergy()

R3Real r3ReadRigidBody_KineticEnergy ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body kinetic energy.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_LinearDamping()

R3Real r3ReadRigidBody_LinearDamping ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body linear damping coefficient.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_Linvel()

struct R3Vector r3ReadRigidBody_Linvel ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body world-space linear velocity.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_LocalCenterOfMass()

struct R3Vector r3ReadRigidBody_LocalCenterOfMass ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body body-local center of mass.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_LockedAxes()

uint8_t r3ReadRigidBody_LockedAxes ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body translation/rotation lock bitmask.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_Mass()

R3Real r3ReadRigidBody_Mass ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body mass.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_NextPosition()

struct R3Pose r3ReadRigidBody_NextPosition ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body next kinematic world-space pose.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_Position()

struct R3Pose r3ReadRigidBody_Position ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body world-space pose.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_Rotation()

struct R3Rotation r3ReadRigidBody_Rotation ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body world-space rotation.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_SoftBody()

struct R3SoftBodyHandle r3ReadRigidBody_SoftBody ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the associated soft-body handle, or an invalid handle if this is not a soft proxy.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_SoftCcdPrediction()

R3Real r3ReadRigidBody_SoftCcdPrediction ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body soft-CCD prediction distance.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_Translation()

struct R3Vector r3ReadRigidBody_Translation ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Return the rigid body world-space translation.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_UserData()

struct R3UserData r3ReadRigidBody_UserData ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

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

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_UserForce()

struct R3Vector r3ReadRigidBody_UserForce ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

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

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_UserTorque()

R3AngVector r3ReadRigidBody_UserTorque ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

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

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_ValidateHandle()

R3Status r3ReadRigidBody_ValidateHandle ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle )

Validate the index and generation in the live owning world.

Cannot detect a world pointer that has already been freed. Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBody_VelocityAtPoint()

struct R3Vector r3ReadRigidBody_VelocityAtPoint ( const struct R3ReadContext * context,
struct R3RigidBodyHandle handle,
struct R3Vector point )

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

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBodyCount()

size_t r3ReadRigidBodyCount ( const struct R3ReadContext * context)

Return the number of rigid body objects in the world.

Uses only the callback-scoped read context; never retain the context.

◆ r3ReadRigidBodyHandles()

size_t r3ReadRigidBodyHandles ( const struct R3ReadContext * context,
struct R3RigidBodyHandle * buffer,
size_t capacity )

Copy entity handles.

Uses only the callback-scoped read context; never retain the context.

See also
Arrays and output buffers

◆ r3ReadRigidBodyReadStates()

size_t r3ReadRigidBodyReadStates ( const struct R3ReadContext * context,
const struct R3RigidBodyHandle * handles,
size_t handle_count,
struct R3RigidBodyState * states,
size_t capacity )

Copy callback-visible body states in the supplied handle order.

All handles must belong to the context world.

See also
Arrays and output buffers