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

Collider descriptions, material properties, sensor flags, and filtering. More...

Data Structures

struct  R3ColliderDesc
 Copyable collider construction data. More...
struct  R3ColliderHandle
 Copyable non-owning handle: world pointer plus entity index and generation. More...

Macros

#define R3_MASS_DENSITY   0
 Mass density.
#define R3_MASS_TOTAL   1
 Mass total.
#define R3_MASS_PROPERTIES   2
 Mass properties.
#define R3_COLLISION_EVENTS   1
 Enable collision-start and collision-stop events for this collider.
#define R3_CONTACT_FORCE_EVENTS   2
 Enable contact-force events for this collider, subject to its force threshold.
#define R3_COMBINE_AVERAGE   0
 Combine the two material coefficients by their arithmetic mean.
#define R3_COMBINE_MIN   1
 Use the smaller of the two material coefficients.
#define R3_COMBINE_MULTIPLY   2
 Multiply the two material coefficients.
#define R3_COMBINE_MAX   3
 Use the larger of the two material coefficients.
#define R3_COMBINE_CLAMPED_SUM   4
 Use the sum of the two material coefficients, clamped to [0, 1].
#define R3_COMBINE_GEOMETRIC_MEAN   5
 Use the geometric mean (square root of the product) of the two material coefficients.
#define R3_COLLISION_TYPES_DYNAMIC_DYNAMIC   1
 Active collision type bit: contacts between two dynamic bodies.
#define R3_COLLISION_TYPES_DYNAMIC_KINEMATIC   12
 Active collision type bit: contacts between a dynamic and a kinematic body.
#define R3_COLLISION_TYPES_DYNAMIC_FIXED   2
 Active collision type bit: contacts between a dynamic and a fixed body (or a collider without parent).
#define R3_COLLISION_TYPES_KINEMATIC_KINEMATIC   52224
 Active collision type bit: contacts between two kinematic bodies.
#define R3_COLLISION_TYPES_KINEMATIC_FIXED   8704
 Active collision type bit: contacts between a kinematic and a fixed body (or a collider without parent).
#define R3_COLLISION_TYPES_FIXED_FIXED   32
 Active collision type bit: contacts between two fixed bodies (or colliders without parent).
#define R3_COLLISION_TYPES_DEFAULT   15
 Default active collision types: dynamic-dynamic, dynamic-kinematic, and dynamic-fixed.
#define R3_FILTER_CONTACT_PAIRS   1
 Invoke the contact-pair filtering hook for this collider.
#define R3_FILTER_INTERSECTION_PAIR   2
 Invoke the sensor-intersection filtering hook for this collider.
#define R3_MODIFY_SOLVER_CONTACTS   4
 Invoke the solver-contact modification hook for this collider.
#define R3_GROUPS_AND   0
 Require both membership/filter intersections to be nonempty.
#define R3_GROUPS_OR   1
 Accept either membership/filter intersection if both participants select OR; otherwise use AND.

Typedefs

typedef struct R3ColliderDesc R3ColliderDesc
 Copyable collider construction data.
typedef struct R3ColliderHandle R3ColliderHandle
 Copyable non-owning handle: world pointer plus entity index and generation.

Functions

struct R3ColliderHandle r3InsertDeformableCollider (const struct R3ColliderDesc *collider, const struct R3SoftMeshBindingDesc *binding, struct R3RigidBodyHandle parent)
 Create a deformable collider bound to a soft-body cluster.
struct R3ColliderDesc r3DefaultColliderDesc (void)
 Return native default collider desc.
struct R3ColliderDesc r3BallColliderDesc (R3Real radius)
 Return a ball description with the supplied radius.
struct R3ColliderDesc r3CuboidColliderDesc (struct R3Vector half_extents)
 Return an axis-aligned box description with the supplied half-extents.
struct R3ColliderHandle r3InsertCollider (struct R3RigidBodyHandle parent, const struct R3ColliderDesc *desc)
 Insert a collider attached to a rigid body, using the world stored in its handle.
struct R3ColliderHandle r3InsertColliderWithoutParent (struct R3World *world, const struct R3ColliderDesc *desc)
 Insert a collider without a rigid-body parent.
R3Status r3RemoveCollider (struct R3ColliderHandle handle, R3Bool wake_up)
 Remove the collider and update its parent body mass properties.
size_t r3ColliderCount (const struct R3World *world)
 Return the number of collider objects in the world.
size_t r3ColliderHandles (const struct R3World *world, struct R3ColliderHandle *buffer, size_t capacity)
 Copy entity handles.
R3Bool r3Collider_Contains (struct R3ColliderHandle handle)
 Test whether the live world contains this collider handle.
struct R3Pose r3Collider_Position (struct R3ColliderHandle handle)
 Return the collider world-space pose.
struct R3Vector r3Collider_Translation (struct R3ColliderHandle handle)
 Return the collider world-space translation.
R3Real r3Collider_Friction (struct R3ColliderHandle handle)
 Return the collider friction coefficient.
R3Real r3Collider_Restitution (struct R3ColliderHandle handle)
 Return the collider restitution coefficient.
R3Bool r3Collider_IsSensor (struct R3ColliderHandle handle)
 Return whether the collider is a sensor (detects overlaps without contact forces).
struct R3RigidBodyHandle r3Collider_Parent (struct R3ColliderHandle handle)
 Return the parent body handle, or an invalid handle with OK status for a standalone collider.
R3Status r3Collider_SetPosition (struct R3ColliderHandle handle, struct R3Pose value)
 Set the collider world-space pose.
R3Status r3Collider_SetTranslation (struct R3ColliderHandle handle, struct R3Vector value)
 Set the collider world-space translation.
R3Status r3Collider_SetFriction (struct R3ColliderHandle handle, R3Real value)
 Set the collider friction coefficient.
R3Status r3Collider_SetRestitution (struct R3ColliderHandle handle, R3Real value)
 Set the collider restitution coefficient.
R3Status r3Collider_SetSensor (struct R3ColliderHandle handle, R3Bool value)
 Enable or disable a sensor (detects overlaps without contact forces) for the collider.
R3Status r3Collider_SetCollisionGroups (struct R3ColliderHandle handle, struct R3InteractionGroups value)
 Set the collider collision filtering groups.
R3Status r3Collider_SetUserData (struct R3ColliderHandle handle, struct R3UserData value)
 Set the collider application-owned 128-bit user value.
uint16_t r3Collider_ActiveCollisionTypes (struct R3ColliderHandle handle)
 Return the collider body-type collision activation bitmask (R3_COLLISION_TYPES_* bits).
uint32_t r3Collider_ActiveHooks (struct R3ColliderHandle handle)
 Return the collider physics-hook activation bitmask.
uint32_t r3Collider_FrictionCombineRule (struct R3ColliderHandle handle)
 Return the collider friction combination rule (R3_COMBINE_*).
uint32_t r3Collider_RestitutionCombineRule (struct R3ColliderHandle handle)
 Return the collider restitution combination rule (R3_COMBINE_*).
struct R3Pose r3Collider_PositionWrtParent (struct R3ColliderHandle handle)
 Return the collider pose relative to its parent rigid body, or its world-space pose if it has no parent.
R3Status r3Collider_SetRotation (struct R3ColliderHandle handle, struct R3Rotation value)
 Set the collider world-space rotation.
struct R3ColliderDesc r3RoundCuboidColliderDesc (struct R3Vector half_extents, R3Real border_radius)
 Return a rounded box description; half_extents exclude the added border_radius.
struct R3ColliderDesc r3CapsuleColliderDesc (struct R3Vector a, struct R3Vector b, R3Real radius)
 Return a capsule description with segment endpoints a/b and the supplied radius.
struct R3ColliderDesc r3SegmentColliderDesc (struct R3Vector a, struct R3Vector b)
 Return a segment description with endpoints a and b.
struct R3ColliderDesc r3TriangleColliderDesc (struct R3Vector a, struct R3Vector b, struct R3Vector c)
 Return a triangle description with vertices a, b, and c.
struct R3ColliderDesc r3HalfspaceColliderDesc (struct R3Vector normal)
 Return a half-space description bounded by a plane through the origin; normal points outward.
struct R3ColliderDesc r3CylinderColliderDesc (R3Real half_height, R3Real radius)
 Return a Y-aligned cylinder description with the supplied half-height and radius.
struct R3ColliderDesc r3ConeColliderDesc (R3Real half_height, R3Real radius)
 Return a Y-aligned cone description with the supplied half-height and base radius.
struct R3ColliderDesc r3RoundCylinderColliderDesc (R3Real half_height, R3Real radius, R3Real border_radius)
 Return a rounded Y-aligned cylinder description; dimensions exclude border_radius.
struct R3ColliderDesc r3RoundConeColliderDesc (R3Real half_height, R3Real radius, R3Real border_radius)
 Return a rounded Y-aligned cone description; dimensions exclude border_radius.
struct R3ColliderDesc r3CapsuleXColliderDesc (R3Real half_height, R3Real radius)
 Return a X-aligned capsule description; half_height is half the segment length, excluding caps.
struct R3ColliderDesc r3CapsuleYColliderDesc (R3Real half_height, R3Real radius)
 Return a Y-aligned capsule description; half_height is half the segment length, excluding caps.
struct R3ColliderDesc r3CapsuleZColliderDesc (R3Real half_height, R3Real radius)
 Return a Z-aligned capsule description; half_height is half the segment length, excluding caps.
struct R3SoftBodyHandle r3Collider_SoftBody (struct R3ColliderHandle handle)
 Return the soft body owning this deformable collider (a soft-body collision mesh), or an invalid handle for any other collider.
R3Status r3Collider_SetMassProperties (struct R3ColliderHandle handle, struct R3MassProperties properties)
 Set the collider local mass properties.
struct R3MassProperties r3Collider_MassProperties (struct R3ColliderHandle handle)
 Return the collider local mass properties.
R3Bool r3Collider_IsVoxels (struct R3ColliderHandle handle)
 Return whether the collider is a voxel shape.
struct R3VoxelQuery r3Collider_VoxelAtFlatId (struct R3ColliderHandle handle, uint32_t id)
 Return voxel information at a flat index; found = 0 if absent.
R3Status r3Collider_SetVoxel (struct R3ColliderHandle handle, struct R3VoxelKey key, R3Bool filled)
 Fill or clear the voxel at key; the collider must have a voxel shape.
R3Status r3Collider_SetDensity (struct R3ColliderHandle handle, R3Real value)
 Set the collider mass per unit volume.
R3Status r3Collider_SetMass (struct R3ColliderHandle handle, R3Real value)
 Set the collider mass.
R3Status r3Collider_SetEnabled (struct R3ColliderHandle handle, R3Bool value)
 Enable or disable the collider.
R3Status r3Collider_SetSolverGroups (struct R3ColliderHandle handle, struct R3InteractionGroups value)
 Set the collider contact-force filtering groups.
R3Status r3Collider_SetFrictionCombineRule (struct R3ColliderHandle handle, uint32_t value)
 Set the collider friction combination rule (R3_COMBINE_*).
R3Status r3Collider_SetRestitutionCombineRule (struct R3ColliderHandle handle, uint32_t value)
 Set the collider restitution combination rule (R3_COMBINE_*).
R3Status r3Collider_SetContactSkin (struct R3ColliderHandle handle, R3Real value)
 Set the collider extra separation skin around the shape.
R3Status r3Collider_SetContactForceEventThreshold (struct R3ColliderHandle handle, R3Real value)
 Set the collider force threshold for contact-force events.
R3Status r3Collider_SetActiveEvents (struct R3ColliderHandle handle, uint32_t value)
 Set the collider event-generation bitmask (R3_COLLISION_EVENTS and R3_CONTACT_FORCE_EVENTS).
R3Status r3Collider_SetActiveHooks (struct R3ColliderHandle handle, uint32_t value)
 Set the collider physics-hook activation bitmask.
R3Status r3Collider_SetActiveCollisionTypes (struct R3ColliderHandle handle, uint16_t value)
 Set the collider body-type collision activation bitmask.
struct R3Rotation r3Collider_Rotation (struct R3ColliderHandle handle)
 Return the collider world-space rotation.
struct R3InteractionGroups r3Collider_CollisionGroups (struct R3ColliderHandle handle)
 Return the collider collision filtering groups.
struct R3InteractionGroups r3Collider_SolverGroups (struct R3ColliderHandle handle)
 Return the collider contact-force filtering groups.
struct R3UserData r3Collider_UserData (struct R3ColliderHandle handle)
 Return the collider application-owned 128-bit user value.
uint32_t r3Collider_ActiveEvents (struct R3ColliderHandle handle)
 Return the collider event-generation bitmask (R3_COLLISION_EVENTS and R3_CONTACT_FORCE_EVENTS).
R3Real r3Collider_Mass (struct R3ColliderHandle handle)
 Return the collider mass.
R3Real r3Collider_Density (struct R3ColliderHandle handle)
 Return the collider mass per unit volume.
R3Real r3Collider_Volume (struct R3ColliderHandle handle)
 Return the collider current volume.
R3Real r3Collider_ContactSkin (struct R3ColliderHandle handle)
 Return the collider extra separation skin around the shape.
R3Real r3Collider_ContactForceEventThreshold (struct R3ColliderHandle handle)
 Return the collider force threshold for contact-force events.
R3Bool r3Collider_IsEnabled (struct R3ColliderHandle handle)
 Return whether the collider is enabled.
struct R3Aabb r3Collider_ComputeAabb (struct R3ColliderHandle handle)
 Return the current world-space axis-aligned bounds.
R3Status r3Collider_SetPositionWrtParent (struct R3ColliderHandle handle, struct R3Pose value)
 Set the collider pose relative to the parent rigid body.
R3Status r3Collider_ValidateHandle (struct R3ColliderHandle handle)
 Validate the index and generation in the live owning world.

Detailed Description

Collider descriptions, material properties, sensor flags, and filtering.

A parented collider's description pose is relative to its rigid body.

Macro Definition Documentation

◆ R3_COLLISION_EVENTS

#define R3_COLLISION_EVENTS   1

Enable collision-start and collision-stop events for this collider.

◆ R3_COLLISION_TYPES_DEFAULT

#define R3_COLLISION_TYPES_DEFAULT   15

Default active collision types: dynamic-dynamic, dynamic-kinematic, and dynamic-fixed.

◆ R3_COLLISION_TYPES_DYNAMIC_DYNAMIC

#define R3_COLLISION_TYPES_DYNAMIC_DYNAMIC   1

Active collision type bit: contacts between two dynamic bodies.

◆ R3_COLLISION_TYPES_DYNAMIC_FIXED

#define R3_COLLISION_TYPES_DYNAMIC_FIXED   2

Active collision type bit: contacts between a dynamic and a fixed body (or a collider without parent).

◆ R3_COLLISION_TYPES_DYNAMIC_KINEMATIC

#define R3_COLLISION_TYPES_DYNAMIC_KINEMATIC   12

Active collision type bit: contacts between a dynamic and a kinematic body.

◆ R3_COLLISION_TYPES_FIXED_FIXED

#define R3_COLLISION_TYPES_FIXED_FIXED   32

Active collision type bit: contacts between two fixed bodies (or colliders without parent).

◆ R3_COLLISION_TYPES_KINEMATIC_FIXED

#define R3_COLLISION_TYPES_KINEMATIC_FIXED   8704

Active collision type bit: contacts between a kinematic and a fixed body (or a collider without parent).

◆ R3_COLLISION_TYPES_KINEMATIC_KINEMATIC

#define R3_COLLISION_TYPES_KINEMATIC_KINEMATIC   52224

Active collision type bit: contacts between two kinematic bodies.

◆ R3_COMBINE_AVERAGE

#define R3_COMBINE_AVERAGE   0

Combine the two material coefficients by their arithmetic mean.

◆ R3_COMBINE_CLAMPED_SUM

#define R3_COMBINE_CLAMPED_SUM   4

Use the sum of the two material coefficients, clamped to [0, 1].

◆ R3_COMBINE_GEOMETRIC_MEAN

#define R3_COMBINE_GEOMETRIC_MEAN   5

Use the geometric mean (square root of the product) of the two material coefficients.

◆ R3_COMBINE_MAX

#define R3_COMBINE_MAX   3

Use the larger of the two material coefficients.

◆ R3_COMBINE_MIN

#define R3_COMBINE_MIN   1

Use the smaller of the two material coefficients.

◆ R3_COMBINE_MULTIPLY

#define R3_COMBINE_MULTIPLY   2

Multiply the two material coefficients.

◆ R3_CONTACT_FORCE_EVENTS

#define R3_CONTACT_FORCE_EVENTS   2

Enable contact-force events for this collider, subject to its force threshold.

◆ R3_FILTER_CONTACT_PAIRS

#define R3_FILTER_CONTACT_PAIRS   1

Invoke the contact-pair filtering hook for this collider.

◆ R3_FILTER_INTERSECTION_PAIR

#define R3_FILTER_INTERSECTION_PAIR   2

Invoke the sensor-intersection filtering hook for this collider.

◆ R3_GROUPS_AND

#define R3_GROUPS_AND   0

Require both membership/filter intersections to be nonempty.

◆ R3_GROUPS_OR

#define R3_GROUPS_OR   1

Accept either membership/filter intersection if both participants select OR; otherwise use AND.

◆ R3_MASS_DENSITY

#define R3_MASS_DENSITY   0

Mass density.

◆ R3_MASS_PROPERTIES

#define R3_MASS_PROPERTIES   2

Mass properties.

◆ R3_MASS_TOTAL

#define R3_MASS_TOTAL   1

Mass total.

◆ R3_MODIFY_SOLVER_CONTACTS

#define R3_MODIFY_SOLVER_CONTACTS   4

Invoke the solver-contact modification hook for this collider.

Typedef Documentation

◆ R3ColliderDesc

typedef struct R3ColliderDesc R3ColliderDesc

Copyable collider construction data.

Shape inputs are borrowed, never owned.

◆ R3ColliderHandle

typedef struct R3ColliderHandle R3ColliderHandle

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.

Function Documentation

◆ r3BallColliderDesc()

struct R3ColliderDesc r3BallColliderDesc ( R3Real radius)

Return a ball description with the supplied radius.

Returns a description without allocating or validating. Build/insert validates its fields.

◆ r3CapsuleColliderDesc()

struct R3ColliderDesc r3CapsuleColliderDesc ( struct R3Vector a,
struct R3Vector b,
R3Real radius )

Return a capsule description with segment endpoints a/b and the supplied radius.

Returns a description without allocating or validating. Build/insert validates its fields.

◆ r3CapsuleXColliderDesc()

struct R3ColliderDesc r3CapsuleXColliderDesc ( R3Real half_height,
R3Real radius )

Return a X-aligned capsule description; half_height is half the segment length, excluding caps.

Returns a description without allocating or validating. Build/insert validates its fields.

◆ r3CapsuleYColliderDesc()

struct R3ColliderDesc r3CapsuleYColliderDesc ( R3Real half_height,
R3Real radius )

Return a Y-aligned capsule description; half_height is half the segment length, excluding caps.

Returns a description without allocating or validating. Build/insert validates its fields.

◆ r3CapsuleZColliderDesc()

struct R3ColliderDesc r3CapsuleZColliderDesc ( R3Real half_height,
R3Real radius )

Return a Z-aligned capsule description; half_height is half the segment length, excluding caps.

Returns a description without allocating or validating. Build/insert validates its fields.

◆ r3Collider_ActiveCollisionTypes()

uint16_t r3Collider_ActiveCollisionTypes ( struct R3ColliderHandle handle)

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

◆ r3Collider_ActiveEvents()

uint32_t r3Collider_ActiveEvents ( struct R3ColliderHandle handle)

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

◆ r3Collider_ActiveHooks()

uint32_t r3Collider_ActiveHooks ( struct R3ColliderHandle handle)

Return the collider physics-hook activation bitmask.

◆ r3Collider_CollisionGroups()

struct R3InteractionGroups r3Collider_CollisionGroups ( struct R3ColliderHandle handle)

Return the collider collision filtering groups.

◆ r3Collider_ComputeAabb()

struct R3Aabb r3Collider_ComputeAabb ( struct R3ColliderHandle handle)

Return the current world-space axis-aligned bounds.

◆ r3Collider_ContactForceEventThreshold()

R3Real r3Collider_ContactForceEventThreshold ( struct R3ColliderHandle handle)

Return the collider force threshold for contact-force events.

◆ r3Collider_ContactSkin()

R3Real r3Collider_ContactSkin ( struct R3ColliderHandle handle)

Return the collider extra separation skin around the shape.

◆ r3Collider_Contains()

R3Bool r3Collider_Contains ( struct R3ColliderHandle handle)

Test whether the live world contains this collider handle.

A removed/stale handle returns false.

◆ r3Collider_Density()

R3Real r3Collider_Density ( struct R3ColliderHandle handle)

Return the collider mass per unit volume.

◆ r3Collider_Friction()

R3Real r3Collider_Friction ( struct R3ColliderHandle handle)

Return the collider friction coefficient.

◆ r3Collider_FrictionCombineRule()

uint32_t r3Collider_FrictionCombineRule ( struct R3ColliderHandle handle)

Return the collider friction combination rule (R3_COMBINE_*).

◆ r3Collider_IsEnabled()

R3Bool r3Collider_IsEnabled ( struct R3ColliderHandle handle)

Return whether the collider is enabled.

◆ r3Collider_IsSensor()

R3Bool r3Collider_IsSensor ( struct R3ColliderHandle handle)

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

◆ r3Collider_IsVoxels()

R3Bool r3Collider_IsVoxels ( struct R3ColliderHandle handle)

Return whether the collider is a voxel shape.

◆ r3Collider_Mass()

R3Real r3Collider_Mass ( struct R3ColliderHandle handle)

Return the collider mass.

◆ r3Collider_MassProperties()

struct R3MassProperties r3Collider_MassProperties ( struct R3ColliderHandle handle)

Return the collider local mass properties.

◆ r3Collider_Parent()

struct R3RigidBodyHandle r3Collider_Parent ( struct R3ColliderHandle handle)

Return the parent body handle, or an invalid handle with OK status for a standalone collider.

◆ r3Collider_Position()

struct R3Pose r3Collider_Position ( struct R3ColliderHandle handle)

Return the collider world-space pose.

◆ r3Collider_PositionWrtParent()

struct R3Pose r3Collider_PositionWrtParent ( struct R3ColliderHandle handle)

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

◆ r3Collider_Restitution()

R3Real r3Collider_Restitution ( struct R3ColliderHandle handle)

Return the collider restitution coefficient.

◆ r3Collider_RestitutionCombineRule()

uint32_t r3Collider_RestitutionCombineRule ( struct R3ColliderHandle handle)

Return the collider restitution combination rule (R3_COMBINE_*).

◆ r3Collider_Rotation()

struct R3Rotation r3Collider_Rotation ( struct R3ColliderHandle handle)

Return the collider world-space rotation.

◆ r3Collider_SetActiveCollisionTypes()

R3Status r3Collider_SetActiveCollisionTypes ( struct R3ColliderHandle handle,
uint16_t value )

Set the collider body-type collision activation bitmask.

◆ r3Collider_SetActiveEvents()

R3Status r3Collider_SetActiveEvents ( struct R3ColliderHandle handle,
uint32_t value )

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

◆ r3Collider_SetActiveHooks()

R3Status r3Collider_SetActiveHooks ( struct R3ColliderHandle handle,
uint32_t value )

Set the collider physics-hook activation bitmask.

◆ r3Collider_SetCollisionGroups()

R3Status r3Collider_SetCollisionGroups ( struct R3ColliderHandle handle,
struct R3InteractionGroups value )

Set the collider collision filtering groups.

◆ r3Collider_SetContactForceEventThreshold()

R3Status r3Collider_SetContactForceEventThreshold ( struct R3ColliderHandle handle,
R3Real value )

Set the collider force threshold for contact-force events.

◆ r3Collider_SetContactSkin()

R3Status r3Collider_SetContactSkin ( struct R3ColliderHandle handle,
R3Real value )

Set the collider extra separation skin around the shape.

◆ r3Collider_SetDensity()

R3Status r3Collider_SetDensity ( struct R3ColliderHandle handle,
R3Real value )

Set the collider mass per unit volume.

◆ r3Collider_SetEnabled()

R3Status r3Collider_SetEnabled ( struct R3ColliderHandle handle,
R3Bool value )

Enable or disable the collider.

◆ r3Collider_SetFriction()

R3Status r3Collider_SetFriction ( struct R3ColliderHandle handle,
R3Real value )

Set the collider friction coefficient.

◆ r3Collider_SetFrictionCombineRule()

R3Status r3Collider_SetFrictionCombineRule ( struct R3ColliderHandle handle,
uint32_t value )

Set the collider friction combination rule (R3_COMBINE_*).

◆ r3Collider_SetMass()

R3Status r3Collider_SetMass ( struct R3ColliderHandle handle,
R3Real value )

Set the collider mass.

◆ r3Collider_SetMassProperties()

R3Status r3Collider_SetMassProperties ( struct R3ColliderHandle handle,
struct R3MassProperties properties )

Set the collider local mass properties.

◆ r3Collider_SetPosition()

R3Status r3Collider_SetPosition ( struct R3ColliderHandle handle,
struct R3Pose value )

Set the collider world-space pose.

For a collider attached to a rigid body, prefer SetPositionWrtParent: the body pose overwrites it at the next step.

◆ r3Collider_SetPositionWrtParent()

R3Status r3Collider_SetPositionWrtParent ( struct R3ColliderHandle handle,
struct R3Pose value )

Set the collider pose relative to the parent rigid body.

◆ r3Collider_SetRestitution()

R3Status r3Collider_SetRestitution ( struct R3ColliderHandle handle,
R3Real value )

Set the collider restitution coefficient.

◆ r3Collider_SetRestitutionCombineRule()

R3Status r3Collider_SetRestitutionCombineRule ( struct R3ColliderHandle handle,
uint32_t value )

Set the collider restitution combination rule (R3_COMBINE_*).

◆ r3Collider_SetRotation()

R3Status r3Collider_SetRotation ( struct R3ColliderHandle handle,
struct R3Rotation value )

Set the collider world-space rotation.

For a collider attached to a rigid body, prefer SetPositionWrtParent: the body pose overwrites it at the next step.

◆ r3Collider_SetSensor()

R3Status r3Collider_SetSensor ( struct R3ColliderHandle handle,
R3Bool value )

Enable or disable a sensor (detects overlaps without contact forces) for the collider.

◆ r3Collider_SetSolverGroups()

R3Status r3Collider_SetSolverGroups ( struct R3ColliderHandle handle,
struct R3InteractionGroups value )

Set the collider contact-force filtering groups.

◆ r3Collider_SetTranslation()

R3Status r3Collider_SetTranslation ( struct R3ColliderHandle handle,
struct R3Vector value )

Set the collider world-space translation.

For a collider attached to a rigid body, prefer SetPositionWrtParent: the body pose overwrites it at the next step.

◆ r3Collider_SetUserData()

R3Status r3Collider_SetUserData ( struct R3ColliderHandle handle,
struct R3UserData value )

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

◆ r3Collider_SetVoxel()

R3Status r3Collider_SetVoxel ( struct R3ColliderHandle handle,
struct R3VoxelKey key,
R3Bool filled )

Fill or clear the voxel at key; the collider must have a voxel shape.

◆ r3Collider_SoftBody()

struct R3SoftBodyHandle r3Collider_SoftBody ( struct R3ColliderHandle handle)

Return the soft body owning this deformable collider (a soft-body collision mesh), or an invalid handle for any other collider.

◆ r3Collider_SolverGroups()

struct R3InteractionGroups r3Collider_SolverGroups ( struct R3ColliderHandle handle)

Return the collider contact-force filtering groups.

◆ r3Collider_Translation()

struct R3Vector r3Collider_Translation ( struct R3ColliderHandle handle)

Return the collider world-space translation.

◆ r3Collider_UserData()

struct R3UserData r3Collider_UserData ( struct R3ColliderHandle handle)

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

◆ r3Collider_ValidateHandle()

R3Status r3Collider_ValidateHandle ( struct R3ColliderHandle handle)

Validate the index and generation in the live owning world.

Cannot detect a world pointer that has already been freed.

◆ r3Collider_Volume()

R3Real r3Collider_Volume ( struct R3ColliderHandle handle)

Return the collider current volume.

◆ r3Collider_VoxelAtFlatId()

struct R3VoxelQuery r3Collider_VoxelAtFlatId ( struct R3ColliderHandle handle,
uint32_t id )

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

◆ r3ColliderCount()

size_t r3ColliderCount ( const struct R3World * world)

Return the number of collider objects in the world.

◆ r3ColliderHandles()

size_t r3ColliderHandles ( const struct R3World * world,
struct R3ColliderHandle * buffer,
size_t capacity )

Copy entity handles.

See also
Arrays and output buffers

◆ r3ConeColliderDesc()

struct R3ColliderDesc r3ConeColliderDesc ( R3Real half_height,
R3Real radius )

Return a Y-aligned cone description with the supplied half-height and base radius.

Returns a description without allocating or validating. Build/insert validates its fields.

◆ r3CuboidColliderDesc()

struct R3ColliderDesc r3CuboidColliderDesc ( struct R3Vector half_extents)

Return an axis-aligned box description with the supplied half-extents.

Returns a description without allocating or validating. Build/insert validates its fields.

◆ r3CylinderColliderDesc()

struct R3ColliderDesc r3CylinderColliderDesc ( R3Real half_height,
R3Real radius )

Return a Y-aligned cylinder description with the supplied half-height and radius.

Returns a description without allocating or validating. Build/insert validates its fields.

◆ r3DefaultColliderDesc()

struct R3ColliderDesc r3DefaultColliderDesc ( void )

Return native default collider desc.

This POD value owns no resources.

◆ r3HalfspaceColliderDesc()

struct R3ColliderDesc r3HalfspaceColliderDesc ( struct R3Vector normal)

Return a half-space description bounded by a plane through the origin; normal points outward.

Returns a description without allocating or validating. Build/insert validates its fields.

◆ r3InsertCollider()

struct R3ColliderHandle r3InsertCollider ( struct R3RigidBodyHandle parent,
const struct R3ColliderDesc * desc )

Insert a collider attached to a rigid body, using the world stored in its handle.

The parent handle is copied by value. The description is borrowed through this call. Invalid or removed parents fail without inserting a collider.

◆ r3InsertColliderWithoutParent()

struct R3ColliderHandle r3InsertColliderWithoutParent ( struct R3World * world,
const struct R3ColliderDesc * desc )

Insert a collider without a rigid-body parent.

The world owns the collider. The description is borrowed through this call.

◆ r3InsertDeformableCollider()

struct R3ColliderHandle r3InsertDeformableCollider ( const struct R3ColliderDesc * collider,
const struct R3SoftMeshBindingDesc * binding,
struct R3RigidBodyHandle parent )

Create a deformable collider bound to a soft-body cluster.

The world owns the collider; binding arrays are borrowed only during insertion.

◆ r3RemoveCollider()

R3Status r3RemoveCollider ( struct R3ColliderHandle handle,
R3Bool wake_up )

Remove the collider and update its parent body mass properties.

wake_up wakes the parent.

◆ r3RoundConeColliderDesc()

struct R3ColliderDesc r3RoundConeColliderDesc ( R3Real half_height,
R3Real radius,
R3Real border_radius )

Return a rounded Y-aligned cone description; dimensions exclude border_radius.

Returns a description without allocating or validating. Build/insert validates its fields.

◆ r3RoundCuboidColliderDesc()

struct R3ColliderDesc r3RoundCuboidColliderDesc ( struct R3Vector half_extents,
R3Real border_radius )

Return a rounded box description; half_extents exclude the added border_radius.

Returns a description without allocating or validating. Build/insert validates its fields.

◆ r3RoundCylinderColliderDesc()

struct R3ColliderDesc r3RoundCylinderColliderDesc ( R3Real half_height,
R3Real radius,
R3Real border_radius )

Return a rounded Y-aligned cylinder description; dimensions exclude border_radius.

Returns a description without allocating or validating. Build/insert validates its fields.

◆ r3SegmentColliderDesc()

struct R3ColliderDesc r3SegmentColliderDesc ( struct R3Vector a,
struct R3Vector b )

Return a segment description with endpoints a and b.

Returns a description without allocating or validating. Build/insert validates its fields.

◆ r3TriangleColliderDesc()

struct R3ColliderDesc r3TriangleColliderDesc ( struct R3Vector a,
struct R3Vector b,
struct R3Vector c )

Return a triangle description with vertices a, b, and c.

Returns a description without allocating or validating. Build/insert validates its fields.