Rapier C — 2D / f32 0.36.0+c.0
Loading...
Searching...
No Matches
rapier.h File Reference

Rapier C ABI. More...

Go to the source code of this file.

Data Structures

struct  R2SpringCoefficients
 Spring softness expressed as natural frequency and damping ratio. More...
struct  R2OptionalReal
 Optional scalar override; enabled = 0 selects no override. More...
struct  R2OptionalU32
 Optional unsigned integer override; enabled = 0 selects no override. More...
struct  R2SoftBodyMaterial
 Plain configuration data; initialize defaults, edit, then apply. More...
struct  R2SoftRecoverySettings
 Plain configuration data; initialize defaults, edit, then apply. More...
struct  R2SoftFemParameters
 Plain configuration data; initialize defaults, edit, then apply. More...
struct  R2SoftBodiesSettings
 Plain configuration data; initialize defaults, edit, then apply. More...
struct  R2IntegrationParameters
 Plain configuration data; initialize defaults, edit, then apply. More...
struct  R2Vector
 Cartesian vector with two or three components. More...
struct  R2Rotation
 2D: angle in radians. More...
struct  R2Pose
 Rigid transform combining translation and rotation. More...
struct  R2JointLimits
 Lower and upper axis limits in length units or radians. More...
struct  R2JointMotor
 Position/velocity motor settings for one joint axis. More...
struct  R2UserData
 Application-defined 128-bit value. More...
struct  R2JointDesc
 Copyable joint configuration. More...
struct  R2ImpulseJointHandle
 Copyable non-owning handle: world pointer plus entity index and generation. More...
struct  R2RigidBodyHandle
 Copyable non-owning handle: world pointer plus entity index and generation. More...
struct  R2MultibodyJointHandle
 Copyable non-owning handle: world pointer plus entity index and generation. More...
struct  R2VolumeMeshParameters
 Parameters for the native volumetric mesher. More...
struct  R2VectorView
 Borrowed array of vector elements. More...
struct  R2RealView
 Borrowed array of real elements. More...
struct  R2IndexView
 Borrowed array of index elements. More...
struct  R2Edge
 Vertex indices for one edge; contiguous u32 fields with no padding. More...
struct  R2EdgeView
 Borrowed array of edge elements. More...
struct  R2SoftEdgeSoftness
 Spring-coefficient override for one soft-body edge. More...
struct  R2SoftEdgeSoftnessView
 Borrowed elements; count counts elements. More...
struct  R2SoftEdgeTear
 Tear-resistance override for one soft-body edge. More...
struct  R2SoftEdgeTearView
 Borrowed elements; count counts elements. More...
struct  R2Triangle
 Vertex indices for one triangle; contiguous u32 fields with no padding. More...
struct  R2TriangleView
 Borrowed array of triangle elements. More...
struct  R2Tetrahedron
 Vertex indices for one tetrahedron; contiguous u32 fields with no padding. More...
struct  R2TetrahedronView
 Borrowed array of tetrahedron elements. More...
struct  R2Dihedral
 Vertex indices for one dihedral; contiguous u32 fields with no padding. More...
struct  R2DihedralView
 Borrowed array of dihedral elements. More...
struct  R2SoftBodyDescView
 Borrowed array of soft-body descriptions. More...
struct  R2OptionalBool
 Optional boolean override. More...
struct  R2CompoundShapeView
 Borrowed elements; count counts elements. More...
struct  R2ShapeDesc
 Non-owning shape description. More...
struct  R2CompoundShapeDesc
 One compound child with a local pose and borrowed geometry description. More...
struct  R2MassProperties
 Explicit mass and principal inertia, matching MassProperties constructors. More...
struct  R2InteractionGroups
 Collision membership/filter masks and their pairwise combination rule. More...
struct  R2ColliderDesc
 Copyable collider construction data. More...
struct  R2SoftBodyDesc
 Copyable recipe, not an owned procedural builder. More...
struct  R2SoftBodyHandle
 Copyable non-owning handle: world pointer plus entity index and generation. More...
struct  R2SoftMeshBindingDesc
 Non-owning deformable binding description. More...
struct  R2ColliderHandle
 Copyable non-owning handle: world pointer plus entity index and generation. More...
struct  R2QueryFilter
 Scene-query flags, groups, and excluded handles. More...
struct  R2QueryOptions
 Copyable query settings. More...
struct  R2RayHit
 Closest ray intersection, with a world-space normal. More...
struct  R2PointProjection
 Closest projected world-space point and its collider. More...
struct  R2ShapeCastHit
 Shape-cast impact geometry; collider-side data is world-space, moving-shape data is local. More...
struct  R2ShapeCastOptions
 Sweep termination settings. More...
struct  R2Aabb
 Axis-aligned bounding box. More...
struct  R2RayToi
 Optional ray collider/time result. More...
struct  R2OptionalRayHit
 Optional full ray result. More...
struct  R2RigidBodyDesc
 Stack-allocated rigid-body construction data. More...
struct  R2PodLayout
 Sizes of the POD types in this library build, for foreign-language layout checks. More...
struct  R2CharacterLength
 CharacterLength counterpart: relative=1 scales with character height, relative=0 uses world units. More...
struct  R2CharacterAutostep
 Copy of the automatic stepping settings. More...
struct  R2CharacterMovement
 Allowed character motion and ground-contact state. More...
struct  R2CharacterCollision
 Collision recorded during character movement. More...
struct  R2PidGains
 Per-axis proportional, integral, and derivative controller gains. More...
struct  R2PdController
 Stateless proportional-derivative controller: a PID controller without integral term, stored as a plain value. More...
struct  R2VelocityCorrection
 Linear and angular velocity correction computed by a controller. More...
struct  R2CharacterControllerSettings
 Copy of character sliding, slope, and snapping settings. More...
struct  R2ErrorHandler
 An optional thread-local error handler. More...
struct  R2JointBodies
 World-bound handles of the two connected bodies. More...
struct  R2InverseKinematicsOptions
 Damped least-squares inverse-kinematics parameters. More...
struct  R2CollisionEvent
 Collision start/stop flags match Rapier CollisionEventFlags. More...
struct  R2ContactForceEvent
 Contact-force event, enabled by flags and the collider force threshold. More...
struct  R2ContactModification
 Mutable per-manifold properties. More...
struct  R2PhysicsHooks
 Callbacks must not unwind or retain arguments. More...
struct  R2ByteView
 Borrowed bytes. More...
struct  R2DebugLine
 World-space line segment produced by physics debug rendering. More...
struct  R2ParticleDestination
 Particle remapping after tearing. More...
struct  R2SoftClusterSplit
 Cluster and proxy remapping after a soft-body split. More...
struct  R2SoftJointMove
 Impulse-joint movement between rigid proxies after tearing. More...
struct  R2OptionalParticleDestination
 Optional particle remapping; check found before reading the destination. More...
struct  R2BuildInfo
 Runtime ABI identity and fundamental type sizes. More...
struct  R2BuildFeatures
 Features available through the loaded C library, independent of consumer defines. More...
struct  R2ContactPair
 Current narrow-phase pair and accumulated solver impulse summary. More...
struct  R2IntersectionPair
 Sensor intersection state for a collider pair. More...
struct  R2ContactPoint
 One manifold contact and its normal solver impulse. More...
struct  R2RigidBodyState
 A copied state snapshot, with no pointers or ownership obligations. More...
struct  R2SoftMeshId
 Stable identity of a live mesh within one soft body; matches Rapier's SoftMeshId. More...
struct  R2SoftMeshInfo
 Mesh identity and rendering metadata. More...
struct  R2VoxelKey
 Integer coordinates of a voxel cell. More...
struct  R2VoxelQuery
 Optional voxel lookup result; check found before reading voxel data. More...
struct  R2JointImpulses
 Impulses applied by an impulse joint during the last step, along the axes of its joint frame. More...
struct  R2OptionalShapeCastHit
 Optional shape-cast result. More...
struct  R2OptionalPointProjection
 Optional point projection. More...
struct  R2NonlinearRigidMotion
 Rigid motion with constant linear and angular velocities. More...
struct  R2OptionalContactPair
 Optional contact pair; check found before reading the pair. More...
struct  R2OptionalIntersectionPair
 Optional intersection pair; check found before reading the pair. More...
struct  R2ContactManifold
 Geometric contact manifold of a contact pair: contacts sharing one normal. More...
struct  R2SolverContact
 Contact seen by the constraint solver. More...
struct  R2EventCallbacks
 Callbacks invoked while stepping, in addition to collecting the events. More...
struct  R2DebugRenderStyle
 Debug-render colors and sizes. More...

Macros

#define R2_DIMENSION   2
 Spatial dimension selected by this header.
#define RAPIER_TYPE(name)
 Select an R2/R3 public type name.
#define RAPIER_CONST(name)
 Select an R2/R3 public constant name.
#define RAPIER_FN(name)
 Select an r2/r3 public function name.
#define RAPIER_CALL
 C ABI calling convention.
#define R2_JOINT_DOF_COUNT   3
 Number of translational and angular joint axes in this dimension.
#define R2_SOFT_DESC_PARTICLES   0
 Soft-body selector: desc particles.
#define R2_SOFT_DESC_ROPE   1
 Soft-body selector: desc rope.
#define R2_SOFT_DESC_GRID   2
 Soft-body selector: desc grid.
#define R2_SOFT_DESC_CLOTH   3
 Soft-body selector: desc cloth.
#define R2_SOFT_DESC_CUBOID   4
 Soft-body selector: desc cuboid.
#define R2_SOFT_DESC_SURFACE   5
 Soft-body selector: desc surface.
#define R2_SOFT_DESC_DISK   6
 Soft-body selector: desc disk.
#define R2_SOFT_DESC_SPHERE   7
 Soft-body selector: desc sphere.
#define R2_SOFT_DESC_CLOTH_TUBE   8
 Soft-body selector: desc cloth tube.
#define R2_SOFT_DESC_VOLUMETRIC   9
 Soft-body selector: desc volumetric.
#define R2_SOFT_DESC_POLYGON   10
 Soft-body selector: closed counter-clockwise polygon of particles preserving its area (2D).
#define R2_SOFT_DESC_TRIMESH   11
 Soft-body selector: triangle mesh without cells, held by shape matching (2D).
#define R2_SOFT_BINDING_SKINNED   0
 Soft-body selector: binding skinned.
#define R2_SOFT_BINDING_DIRECT   1
 Soft-body selector: binding direct.
#define R2_SOFT_BINDING_DIRECT_BY_POSITION   2
 Soft-body selector: binding direct by position.
#define R2_POLYLINE_ORIENTED   1
 Treat the 2D polyline as oriented when generating contact normals.
#define R2_POLYLINE_DEFORMABLE   2
 Prepare polyline acceleration data for deformation.
#define R2_SHAPE_DESC_BALL   0
 ShapeDesc kind selecting a ball.
#define R2_SHAPE_DESC_CUBOID   1
 ShapeDesc kind selecting a cuboid.
#define R2_SHAPE_DESC_ROUND_CUBOID   2
 ShapeDesc kind selecting a round cuboid.
#define R2_SHAPE_DESC_CAPSULE   3
 ShapeDesc kind selecting a capsule.
#define R2_SHAPE_DESC_SEGMENT   4
 ShapeDesc kind selecting a segment.
#define R2_SHAPE_DESC_TRIANGLE   5
 ShapeDesc kind selecting a triangle.
#define R2_SHAPE_DESC_HALFSPACE   6
 ShapeDesc kind selecting a half-space.
#define R2_SHAPE_DESC_CONVEX_HULL   7
 ShapeDesc kind selecting a convex hull.
#define R2_SHAPE_DESC_TRIMESH   8
 ShapeDesc kind selecting a triangle mesh.
#define R2_SHAPE_DESC_POLYLINE   9
 ShapeDesc kind selecting a polyline.
#define R2_SHAPE_DESC_SHARED   10
 ShapeDesc kind selecting borrowed shared geometry.
#define R2_SHAPE_DESC_HEIGHTFIELD   11
 ShapeDesc kind selecting a heightfield.
#define R2_SHAPE_DESC_CYLINDER   12
 ShapeDesc kind selecting a cylinder.
#define R2_SHAPE_DESC_CONE   13
 ShapeDesc kind selecting a cone.
#define R2_SHAPE_DESC_COMPOUND   14
 ShapeDesc kind selecting compound child shapes.
#define R2_SHAPE_DESC_ROUND_CYLINDER   15
 ShapeDesc kind selecting a round cylinder.
#define R2_SHAPE_DESC_ROUND_CONE   16
 ShapeDesc kind selecting a round cone.
#define R2_MASS_DENSITY   0
 Mass density.
#define R2_MASS_TOTAL   1
 Mass total.
#define R2_MASS_PROPERTIES   2
 Mass properties.
#define R2_ABI_VERSION   1
 C binary ABI revision expected by this header.
#define R2_DYNAMIC   0
 Dynamic body affected by forces and contacts.
#define R2_FIXED   1
 Immovable body.
#define R2_KINEMATIC_POSITION_BASED   2
 Kinematic body controlled by its next pose.
#define R2_KINEMATIC_VELOCITY_BASED   3
 Kinematic body controlled by its velocity.
#define R2_COLLISION_EVENTS   1
 Enable collision-start and collision-stop events for this collider.
#define R2_CONTACT_FORCE_EVENTS   2
 Enable contact-force events for this collider, subject to its force threshold.
#define R2_COMBINE_AVERAGE   0
 Combine the two material coefficients by their arithmetic mean.
#define R2_COMBINE_MIN   1
 Use the smaller of the two material coefficients.
#define R2_COMBINE_MULTIPLY   2
 Multiply the two material coefficients.
#define R2_COMBINE_MAX   3
 Use the larger of the two material coefficients.
#define R2_COMBINE_CLAMPED_SUM   4
 Use the sum of the two material coefficients, clamped to [0, 1].
#define R2_COMBINE_GEOMETRIC_MEAN   5
 Use the geometric mean (square root of the product) of the two material coefficients.
#define R2_COLLISION_TYPES_DYNAMIC_DYNAMIC   1
 Active collision type bit: contacts between two dynamic bodies.
#define R2_COLLISION_TYPES_DYNAMIC_KINEMATIC   12
 Active collision type bit: contacts between a dynamic and a kinematic body.
#define R2_COLLISION_TYPES_DYNAMIC_FIXED   2
 Active collision type bit: contacts between a dynamic and a fixed body (or a collider without parent).
#define R2_COLLISION_TYPES_KINEMATIC_KINEMATIC   52224
 Active collision type bit: contacts between two kinematic bodies.
#define R2_COLLISION_TYPES_KINEMATIC_FIXED   8704
 Active collision type bit: contacts between a kinematic and a fixed body (or a collider without parent).
#define R2_COLLISION_TYPES_FIXED_FIXED   32
 Active collision type bit: contacts between two fixed bodies (or colliders without parent).
#define R2_COLLISION_TYPES_DEFAULT   15
 Default active collision types: dynamic-dynamic, dynamic-kinematic, and dynamic-fixed.
#define R2_FILTER_CONTACT_PAIRS   1
 Invoke the contact-pair filtering hook for this collider.
#define R2_FILTER_INTERSECTION_PAIR   2
 Invoke the sensor-intersection filtering hook for this collider.
#define R2_MODIFY_SOLVER_CONTACTS   4
 Invoke the solver-contact modification hook for this collider.
#define R2_QUERY_EXCLUDE_FIXED   1
 Query filter: exclude fixed.
#define R2_QUERY_EXCLUDE_KINEMATIC   2
 Query filter: exclude kinematic.
#define R2_QUERY_EXCLUDE_DYNAMIC   4
 Query filter: exclude dynamic.
#define R2_QUERY_EXCLUDE_SENSORS   8
 Query filter: exclude sensors.
#define R2_QUERY_EXCLUDE_SOLIDS   16
 Query filter: exclude solids.
#define R2_QUERY_ONLY_DYNAMIC   3
 Query filter: only dynamic.
#define R2_QUERY_ONLY_KINEMATIC   5
 Query filter: only kinematic.
#define R2_QUERY_ONLY_FIXED   6
 Query filter: only fixed.
#define R2_DEBUG_COLLIDER_SHAPES   1
 Debug-render flag: collider shapes.
#define R2_DEBUG_RIGID_BODY_AXES   2
 Debug-render flag: rigid body axes.
#define R2_DEBUG_MULTIBODY_JOINTS   4
 Debug-render flag: multibody joints.
#define R2_DEBUG_IMPULSE_JOINTS   8
 Debug-render flag: impulse joints.
#define R2_DEBUG_SOLVER_CONTACTS   16
 Debug-render flag: solver contacts.
#define R2_DEBUG_CONTACTS   32
 Debug-render flag: contacts.
#define R2_DEBUG_COLLIDER_AABBS   64
 Debug-render flag: collider aabbs.
#define R2_DEBUG_SOFT_BODIES   128
 Debug-render flag: soft bodies.
#define R2_DEBUG_PSEUDO_NORMALS   256
 Debug-render flag: pseudo normals.
#define R2_DEBUG_SOFT_VOLUME_CONTACTS   512
 Debug-render flag: soft volume contacts.
#define R2_DEBUG_SOFT_BODY_STRESS   1024
 Debug-render flag: soft body stress.
#define R2_GROUPS_AND   0
 Require both membership/filter intersections to be nonempty.
#define R2_GROUPS_OR   1
 Accept either membership/filter intersection if both participants select OR; otherwise use AND.
#define R2_MOTOR_ACCELERATION_BASED   0
 Motor stiffness and damping are acceleration-based, independent of mass.
#define R2_MOTOR_FORCE_BASED   1
 Motor stiffness and damping are force-based, so response depends on mass.
#define R2_SOFT_CELL_VOLUME   0
 Cell model that constrains volume without elastic shear response.
#define R2_SOFT_CELL_COROTATIONAL   1
 Corotational elastic cell model.
#define R2_SOFT_CELL_NEO_HOOKEAN   2
 Neo-Hookean elastic cell model.
#define R2_SOFT_SOLVER_CONSTRAINTS   0
 Use the constraint-based soft-body solver.
#define R2_SOFT_SOLVER_FEM   1
 Use the finite-element solver; requires RAPIER_FEM.
#define R2_SOFT_EDGE_PLASTIC_FLOW_BOTH   0
 Edge plastic flow (R2SoftBodyMaterial::edgePlasticFlow): both a squeeze and a stretch set.
#define R2_SOFT_EDGE_PLASTIC_FLOW_COMPRESSION   1
 Edge plastic flow: only a squeeze sets; a stretched edge springs back.
#define R2_SOFT_EDGE_PLASTIC_FLOW_TENSION   2
 Edge plastic flow: only a stretch sets; a squeezed edge springs back.
#define R2_SOFT_PATCH_CONSTRAINTS_KEEP   0
 Overlap patch constraints (R2SoftRecoverySettings::overlapPatchConstraints): keep them.
#define R2_SOFT_PATCH_CONSTRAINTS_STAND_DOWN   1
 Overlap patch constraints: stand them down inside the patch.
#define R2_SOFT_PATCH_CONSTRAINTS_ALONG_NORMAL   2
 Overlap patch constraints: align them with the overlap normal.
#define R2_AXIS_LIN_X   0
 Joint axis index for translation along local X.
#define R2_AXIS_LIN_Y   1
 Joint axis index for translation along local Y.
#define R2_LOCK_TRANSLATION_X   1
 Rigid-body lock bit: translation x.
#define R2_LOCK_TRANSLATION_Y   2
 Rigid-body lock bit: translation y.
#define R2_LOCK_TRANSLATION_Z   4
 Rigid-body lock bit: translation z.
#define R2_LOCK_ROTATION_X   8
 Rigid-body lock bit: rotation x.
#define R2_LOCK_ROTATION_Y   16
 Rigid-body lock bit: rotation y.
#define R2_LOCK_ROTATION_Z   32
 Rigid-body lock bit: rotation z.
#define R2_AXIS_ANG_X   2
 Joint axis index for the first rotation: Z in 2D, local X in 3D.
#define R2_JOINT_FIXED_AXES   7
 Locked-axis mask for a fixed joint: all translations and rotations.
#define R2_JOINT_REVOLUTE_AXES   3
 Locked-axis mask for a revolute joint: only the first angular axis is free.
#define R2_JOINT_PRISMATIC_AXES   6
 Locked-axis mask for a prismatic joint: only translation along local X is free.
#define R2_SOFT_FRAME   4
 Read-only body type of soft-body cluster proxies; cannot be used to construct a rigid body.
#define R2_SHAPE_CAST_OUT_OF_ITERATIONS   0
 Shape-cast iteration limit reached before convergence.
#define R2_SHAPE_CAST_CONVERGED   1
 Shape cast converged to the reported impact.
#define R2_SHAPE_CAST_FAILED   2
 Shape-cast numerical solver failed to converge.
#define R2_SHAPE_CAST_PENETRATING   3
 Shapes overlap or are within the target distance at the start of the cast.
#define R2_FEATURE_UNKNOWN   0
 The hit feature is unspecified.
#define R2_FEATURE_VERTEX   1
 The feature ID denotes a vertex.
#define R2_FEATURE_EDGE   2
 The feature ID denotes an edge.
#define R2_FEATURE_FACE   3
 The feature ID denotes a face.
#define R2_MULTIBODY_JOINTS_ARE_KINEMATIC   1
 Insert reduced-coordinate joints as kinematic articulations.
#define R2_MULTIBODY_DISABLE_SELF_CONTACTS   2
 Disable contacts between colliders of the inserted articulation.
#define R2_MULTIBODY_SKIP_LOOP_CLOSURES   4
 Do not insert MJCF equality constraints (loop closures) as impulse joints.
#define R2_MULTIBODY_SKIP_JOINT_MOTORS   8
 Do not import joint motors into the articulation.
#define R2_MULTIBODY_SKIP_JOINT_LIMITS   16
 Do not import joint limits into the articulation.
#define R2_MULTIBODY_SKIP_JOINT_SPRINGS   32
 Do not import joint springs into the articulation.
#define R2_TRIMESH_HALF_EDGE_TOPOLOGY   1
 Compute the half-edge topology of the triangle mesh.
#define R2_TRIMESH_CONNECTED_COMPONENTS   2
 Compute the connected components of the triangle mesh.
#define R2_TRIMESH_DELETE_BAD_TOPOLOGY_TRIANGLES   4
 Delete the triangles breaking the half-edge topology.
#define R2_TRIMESH_ORIENTED   8
 Treat the triangle mesh as oriented (outward normals) and compute its pseudo-normals.
#define R2_TRIMESH_MERGE_DUPLICATE_VERTICES   16
 Merge triangle-mesh vertices with identical positions.
#define R2_TRIMESH_DELETE_DEGENERATE_TRIANGLES   32
 Delete the triangles with a zero area.
#define R2_TRIMESH_DELETE_DUPLICATE_TRIANGLES   64
 Delete the triangles sharing their three vertices with another triangle.
#define R2_TRIMESH_FIX_INTERNAL_EDGES   144
 Correct contact normals at internal mesh edges; includes duplicate-vertex merging.
#define R2_TRIMESH_DEFORMABLE   256
 Prepare triangle-mesh acceleration data for deformation.
#define R2_TRIMESH_FIX_INTERNAL_EDGES_TWO_SIDED   656
 Correct internal-edge contacts on both sides of the triangle mesh.
#define R2_HEIGHTFIELD_FIX_INTERNAL_EDGES   1
 Correct contact normals at internal heightfield edges.
#define R2_AXES_MASK_LIN_X   1
 Controller axis bit: translation along X.
#define R2_AXES_MASK_LIN_Y   2
 Controller axis bit: translation along Y.
#define R2_AXES_MASK_ANG_Z   32
 Controller axis bit: rotation about Z (the only rotation axis in 2D).
#define R2_ABI_FEATURE_FEM   1
 ABI feature bit: RAPIER_FEM, which changes the layout of R2IntegrationParameters.
#define R2_ABI_FEATURE_ROBOTICS   2
 ABI feature bit: RAPIER_ROBOTICS (3D, f32 only), which declares the URDF/MJCF API.
#define R2_ABI_FEATURES   1
 R2_ABI_FEATURE_* bits selected by the defines of this header; pass it to CheckAbi.
#define R2_COLLISION_EVENT_SENSOR   1
 Collision event flag: at least one of the colliders was a sensor when the event fired.
#define R2_COLLISION_EVENT_REMOVED   2
 Collision event flag: the collision stopped because at least one collider was removed.
#define R2_OK   0
 Operation succeeded.
#define R2_NULL_POINTER   1
 A required pointer was NULL.
#define R2_INVALID_ARGUMENT   2
 An argument failed validation.
#define R2_INVALID_HANDLE   3
 The entity handle is stale, invalid, or belongs to another world.
#define R2_BUFFER_TOO_SMALL   4
 Output capacity is insufficient; the returned count is the required capacity.
#define R2_UNSUPPORTED   5
 This build or object does not support the operation.
#define R2_PANIC   6
 Rust panicked; discard objects mutated by the call.
#define R2_NOT_FOUND   7
 No matching query result or object was found.
#define R2_WORLD_BUSY   8
 Conflicting or reentrant access to simulation state.

Typedefs

typedef struct R2Bytes R2Bytes
 Immutable owned byte buffer.
typedef struct R2ContactModificationContext R2ContactModificationContext
 Borrowed native contact context.
typedef struct R2EventCollector R2EventCollector
 Events accumulate across steps until r2EventCollector_Clear: reading them never drains the collector, allowing two-call buffer sizing.
typedef struct R2KinematicCharacterController R2KinematicCharacterController
 Controller plus reusable collision output from the last move_shape call.
typedef struct R2PidController R2PidController
 PID controller with persistent integral state.
typedef struct R2ReadContext R2ReadContext
 Callback-scoped read access to bodies and colliders.
typedef struct R2ShapeMesh R2ShapeMesh
 Owned tessellated shape: flat triangle vertices and independent line segments, in local space.
typedef struct R2SoftBodyTearEvent R2SoftBodyTearEvent
 Owned copy of a tear event.
typedef struct R2World R2World
 Sole owner of simulation state.
typedef float R2Real
 Floating-point scalar: float for f32, double for f64.
typedef struct R2SpringCoefficients R2SpringCoefficients
 Spring softness expressed as natural frequency and damping ratio.
typedef uint32_t R2Bool
 ABI booleans are uint32_t: zero is false, one is true.
typedef struct R2OptionalReal R2OptionalReal
 Optional scalar override; enabled = 0 selects no override.
typedef struct R2OptionalU32 R2OptionalU32
 Optional unsigned integer override; enabled = 0 selects no override.
typedef struct R2SoftBodyMaterial R2SoftBodyMaterial
 Plain configuration data; initialize defaults, edit, then apply.
typedef struct R2SoftRecoverySettings R2SoftRecoverySettings
 Plain configuration data; initialize defaults, edit, then apply.
typedef struct R2SoftFemParameters R2SoftFemParameters
 Plain configuration data; initialize defaults, edit, then apply.
typedef struct R2SoftBodiesSettings R2SoftBodiesSettings
 Plain configuration data; initialize defaults, edit, then apply.
typedef struct R2IntegrationParameters R2IntegrationParameters
 Plain configuration data; initialize defaults, edit, then apply.
typedef uint32_t R2Status
 Status-returning operations use these integer codes.
typedef struct R2Vector R2Vector
 Cartesian vector with two or three components.
typedef struct R2Rotation R2Rotation
 2D: angle in radians.
typedef struct R2Pose R2Pose
 Rigid transform combining translation and rotation.
typedef struct R2JointLimits R2JointLimits
 Lower and upper axis limits in length units or radians.
typedef struct R2JointMotor R2JointMotor
 Position/velocity motor settings for one joint axis.
typedef struct R2UserData R2UserData
 Application-defined 128-bit value.
typedef struct R2JointDesc R2JointDesc
 Copyable joint configuration.
typedef struct R2ImpulseJointHandle R2ImpulseJointHandle
 Copyable non-owning handle: world pointer plus entity index and generation.
typedef struct R2RigidBodyHandle R2RigidBodyHandle
 Copyable non-owning handle: world pointer plus entity index and generation.
typedef struct R2MultibodyJointHandle R2MultibodyJointHandle
 Copyable non-owning handle: world pointer plus entity index and generation.
typedef struct R2VolumeMeshParameters R2VolumeMeshParameters
 Parameters for the native volumetric mesher.
typedef struct R2VectorView R2VectorView
 Borrowed array of vector elements.
typedef struct R2RealView R2RealView
 Borrowed array of real elements.
typedef struct R2IndexView R2IndexView
 Borrowed array of index elements.
typedef struct R2Edge R2Edge
 Vertex indices for one edge; contiguous u32 fields with no padding.
typedef struct R2EdgeView R2EdgeView
 Borrowed array of edge elements.
typedef struct R2SoftEdgeSoftness R2SoftEdgeSoftness
 Spring-coefficient override for one soft-body edge.
typedef struct R2SoftEdgeSoftnessView R2SoftEdgeSoftnessView
 Borrowed elements; count counts elements.
typedef struct R2SoftEdgeTear R2SoftEdgeTear
 Tear-resistance override for one soft-body edge.
typedef struct R2SoftEdgeTearView R2SoftEdgeTearView
 Borrowed elements; count counts elements.
typedef struct R2Triangle R2Triangle
 Vertex indices for one triangle; contiguous u32 fields with no padding.
typedef struct R2TriangleView R2TriangleView
 Borrowed array of triangle elements.
typedef struct R2Tetrahedron R2Tetrahedron
 Vertex indices for one tetrahedron; contiguous u32 fields with no padding.
typedef struct R2TetrahedronView R2TetrahedronView
 Borrowed array of tetrahedron elements.
typedef struct R2TriangleView R2CellView
 Borrowed cell array: triangles in 2D, tetrahedra in 3D.
typedef struct R2EdgeView R2SurfaceElementView
 Borrowed surface array: edges in 2D, triangles in 3D.
typedef struct R2Dihedral R2Dihedral
 Vertex indices for one dihedral; contiguous u32 fields with no padding.
typedef struct R2DihedralView R2DihedralView
 Borrowed array of dihedral elements.
typedef struct R2SoftBodyDescView R2SoftBodyDescView
 Borrowed array of soft-body descriptions.
typedef struct R2OptionalBool R2OptionalBool
 Optional boolean override.
typedef struct R2SharedShape R2SharedShape
 Opaque SharedShape.
typedef struct R2CompoundShapeView R2CompoundShapeView
 Borrowed elements; count counts elements.
typedef struct R2ShapeDesc R2ShapeDesc
 Non-owning shape description.
typedef struct R2CompoundShapeDesc R2CompoundShapeDesc
 One compound child with a local pose and borrowed geometry description.
typedef R2Real R2AngVector
 Angular scalar in 2D or vector in 3D, in radians for angular displacement.
typedef struct R2MassProperties R2MassProperties
 Explicit mass and principal inertia, matching MassProperties constructors.
typedef struct R2InteractionGroups R2InteractionGroups
 Collision membership/filter masks and their pairwise combination rule.
typedef struct R2ColliderDesc R2ColliderDesc
 Copyable collider construction data.
typedef struct R2SoftBodyDesc R2SoftBodyDesc
 Copyable recipe, not an owned procedural builder.
typedef struct R2SoftBodyHandle R2SoftBodyHandle
 Copyable non-owning handle: world pointer plus entity index and generation.
typedef struct R2SoftMeshBindingDesc R2SoftMeshBindingDesc
 Non-owning deformable binding description.
typedef struct R2ColliderHandle R2ColliderHandle
 Copyable non-owning handle: world pointer plus entity index and generation.
typedef struct R2QueryFilter R2QueryFilter
 Scene-query flags, groups, and excluded handles.
typedef R2Bool(*) R2QueryPredicate(void *user_data, const struct R2ReadContext *read, struct R2ColliderHandle handle)
 Called with scoped read access and a collider handle.
typedef struct R2QueryOptions R2QueryOptions
 Copyable query settings.
typedef struct R2RayHit R2RayHit
 Closest ray intersection, with a world-space normal.
typedef struct R2PointProjection R2PointProjection
 Closest projected world-space point and its collider.
typedef struct R2ShapeCastHit R2ShapeCastHit
 Shape-cast impact geometry; collider-side data is world-space, moving-shape data is local.
typedef struct R2ShapeCastOptions R2ShapeCastOptions
 Sweep termination settings.
typedef struct R2Aabb R2Aabb
 Axis-aligned bounding box.
typedef struct R2RayToi R2RayToi
 Optional ray collider/time result.
typedef struct R2OptionalRayHit R2OptionalRayHit
 Optional full ray result.
typedef struct R2RigidBodyDesc R2RigidBodyDesc
 Stack-allocated rigid-body construction data.
typedef struct R2PodLayout R2PodLayout
 Sizes of the POD types in this library build, for foreign-language layout checks.
typedef struct R2CharacterLength R2CharacterLength
 CharacterLength counterpart: relative=1 scales with character height, relative=0 uses world units.
typedef struct R2CharacterAutostep R2CharacterAutostep
 Copy of the automatic stepping settings.
typedef struct R2CharacterMovement R2CharacterMovement
 Allowed character motion and ground-contact state.
typedef struct R2CharacterCollision R2CharacterCollision
 Collision recorded during character movement.
typedef struct R2PidGains R2PidGains
 Per-axis proportional, integral, and derivative controller gains.
typedef struct R2PdController R2PdController
 Stateless proportional-derivative controller: a PID controller without integral term, stored as a plain value.
typedef struct R2VelocityCorrection R2VelocityCorrection
 Linear and angular velocity correction computed by a controller.
typedef struct R2CharacterControllerSettings R2CharacterControllerSettings
 Copy of character sliding, slope, and snapping settings.
typedef void(*) R2ErrorCallback(R2Status, const char *, void *)
 Called synchronously on the calling thread when an operation reports an error.
typedef struct R2ErrorHandler R2ErrorHandler
 An optional thread-local error handler.
typedef struct R2JointBodies R2JointBodies
 World-bound handles of the two connected bodies.
typedef struct R2InverseKinematicsOptions R2InverseKinematicsOptions
 Damped least-squares inverse-kinematics parameters.
typedef R2Bool(*) R2IkJointCanMove(void *, struct R2RigidBodyHandle)
 Optional per-link filter, called synchronously.
typedef struct R2CollisionEvent R2CollisionEvent
 Collision start/stop flags match Rapier CollisionEventFlags.
typedef struct R2ContactForceEvent R2ContactForceEvent
 Contact-force event, enabled by flags and the collider force threshold.
typedef int32_t(*) R2PairFilter(void *user_data, const struct R2ReadContext *read, struct R2ColliderHandle collider1, struct R2ColliderHandle collider2, struct R2RigidBodyHandle body1, struct R2RigidBodyHandle body2)
 Pair callback: -1 rejects a contact pair; 0 detects contacts without impulses; 1 computes impulses.
typedef struct R2ContactModification R2ContactModification
 Mutable per-manifold properties.
typedef void(*) R2ModifyContacts(void *user_data, const struct R2ReadContext *read, struct R2ColliderHandle collider1, struct R2ColliderHandle collider2, struct R2ContactModification *contact)
 Modify aggregate contact properties for one pair; contact is mutable only during this callback.
typedef void(*) R2ModifyContactContext(void *user_data, const struct R2ReadContext *read, struct R2ColliderHandle collider1, struct R2ColliderHandle collider2, struct R2ContactModificationContext *context)
 Modify individual solver contacts through a borrowed context, valid only during the callback.
typedef struct R2PhysicsHooks R2PhysicsHooks
 Callbacks must not unwind or retain arguments.
typedef struct R2ByteView R2ByteView
 Borrowed bytes.
typedef struct R2DebugLine R2DebugLine
 World-space line segment produced by physics debug rendering.
typedef struct R2ParticleDestination R2ParticleDestination
 Particle remapping after tearing.
typedef struct R2SoftClusterSplit R2SoftClusterSplit
 Cluster and proxy remapping after a soft-body split.
typedef struct R2SoftJointMove R2SoftJointMove
 Impulse-joint movement between rigid proxies after tearing.
typedef struct R2OptionalParticleDestination R2OptionalParticleDestination
 Optional particle remapping; check found before reading the destination.
typedef struct R2BuildInfo R2BuildInfo
 Runtime ABI identity and fundamental type sizes.
typedef struct R2BuildFeatures R2BuildFeatures
 Features available through the loaded C library, independent of consumer defines.
typedef struct R2ContactPair R2ContactPair
 Current narrow-phase pair and accumulated solver impulse summary.
typedef struct R2IntersectionPair R2IntersectionPair
 Sensor intersection state for a collider pair.
typedef struct R2ContactPoint R2ContactPoint
 One manifold contact and its normal solver impulse.
typedef struct R2RigidBodyState R2RigidBodyState
 A copied state snapshot, with no pointers or ownership obligations.
typedef struct R2SoftMeshId R2SoftMeshId
 Stable identity of a live mesh within one soft body; matches Rapier's SoftMeshId.
typedef struct R2SoftMeshInfo R2SoftMeshInfo
 Mesh identity and rendering metadata.
typedef int32_t R2VoxelCoord
 Voxel coordinates have DIM signed integer components.
typedef struct R2VoxelKey R2VoxelKey
 Integer coordinates of a voxel cell.
typedef struct R2VoxelQuery R2VoxelQuery
 Optional voxel lookup result; check found before reading voxel data.
typedef struct R2JointImpulses R2JointImpulses
 Impulses applied by an impulse joint during the last step, along the axes of its joint frame.
typedef struct R2OptionalShapeCastHit R2OptionalShapeCastHit
 Optional shape-cast result.
typedef struct R2OptionalPointProjection R2OptionalPointProjection
 Optional point projection.
typedef struct R2NonlinearRigidMotion R2NonlinearRigidMotion
 Rigid motion with constant linear and angular velocities.
typedef struct R2OptionalContactPair R2OptionalContactPair
 Optional contact pair; check found before reading the pair.
typedef struct R2OptionalIntersectionPair R2OptionalIntersectionPair
 Optional intersection pair; check found before reading the pair.
typedef struct R2ContactManifold R2ContactManifold
 Geometric contact manifold of a contact pair: contacts sharing one normal.
typedef struct R2SolverContact R2SolverContact
 Contact seen by the constraint solver.
typedef void(*) R2CollisionEventCallback(void *user_data, const struct R2ReadContext *read, const struct R2CollisionEvent *event, const struct R2ContactPoint *contacts, size_t contact_count)
 Called during the step for each collision event, after it was added to the collector.
typedef void(*) R2ContactForceEventCallback(void *user_data, const struct R2ReadContext *read, const struct R2ContactForceEvent *event)
 Called during the step for each contact-force event, after it was added to the collector.
typedef struct R2EventCallbacks R2EventCallbacks
 Callbacks invoked while stepping, in addition to collecting the events.
typedef struct R2DebugRenderStyle R2DebugRenderStyle
 Debug-render colors and sizes.

Functions

struct R2SoftBodyMaterial r2DefaultSoftBodyMaterial (void)
 Return native default soft body material.
struct R2SoftRecoverySettings r2DefaultSoftRecoverySettings (void)
 Return native default soft recovery settings.
struct R2SoftFemParameters r2DefaultSoftFemParameters (void)
 Return native default soft fem parameters.
struct R2SoftBodiesSettings r2DefaultSoftBodiesSettings (void)
 Return native default soft bodies settings.
struct R2IntegrationParameters r2DefaultIntegrationParameters (void)
 Return native default integration parameters.
struct R2IntegrationParameters r2IntegrationParameters (const struct R2World *world)
 Return a copy of all world integration settings.
R2Status r2SetIntegrationParameters (struct R2World *world, const struct R2IntegrationParameters *data)
 Copies validated values; does not expose a writable alias to Rust memory.
struct R2JointDesc r2DefaultJointDesc (void)
 Return native default joint desc.
struct R2JointDesc r2FixedJointDesc (void)
 Return a fixed joint description with native defaults; no allocation.
struct R2JointDesc r2RevoluteJointDesc (void)
 Return a revolute joint description with native defaults; no allocation.
struct R2JointDesc r2PrismaticJointDesc (struct R2Vector axis_vector)
 Returns a joint description.
struct R2JointDesc r2RopeJointDesc (R2Real length)
 Return a rope joint description with native defaults; no allocation.
struct R2JointDesc r2SpringJointDesc (R2Real length, R2Real stiffness, R2Real damping)
 Return a spring joint description with native defaults; no allocation.
struct R2JointDesc r2PinSlotJointDesc (struct R2Vector axis_vector)
 Returns a joint description.
struct R2ImpulseJointHandle r2InsertImpulseJoint (struct R2RigidBodyHandle body1, struct R2RigidBodyHandle body2, const struct R2JointDesc *joint)
 Create an impulse joint connecting two bodies in the same world.
struct R2MultibodyJointHandle r2InsertMultibodyJoint (struct R2RigidBodyHandle body1, struct R2RigidBodyHandle body2, const struct R2JointDesc *joint)
 Create an articulation joint between bodies in the same world.
struct R2SoftBodyDesc r2DefaultSoftBodyDesc (void)
 Return native default soft body desc.
struct R2SoftBodyHandle r2InsertSoftBody (struct R2World *world, const struct R2SoftBodyDesc *desc)
 Consumes no caller-owned resources.
struct R2SoftMeshBindingDesc r2DefaultSoftMeshBindingDesc (void)
 Return native default soft mesh binding desc.
struct R2ColliderHandle r2InsertDeformableCollider (const struct R2ColliderDesc *collider, const struct R2SoftMeshBindingDesc *binding, struct R2RigidBodyHandle parent)
 Create a deformable collider bound to a soft-body cluster.
struct R2QueryOptions r2DefaultQueryOptions (void)
 Return native default query options.
struct R2RayHit r2CastRay (const struct R2World *world, const struct R2QueryOptions *query_options, struct R2Vector origin, struct R2Vector direction, R2Real max_toi, R2Bool solid)
 Return the closest ray hit, or report R2_NOT_FOUND on a miss.
struct R2PointProjection r2ProjectPoint (const struct R2World *world, const struct R2QueryOptions *query_options, struct R2Vector point, R2Real max_distance, R2Bool solid)
 Return the closest surface projection within max_distance, or report R2_NOT_FOUND.
struct R2ShapeCastHit r2CastShape (const struct R2World *world, const struct R2QueryOptions *query_options, struct R2Pose pose, struct R2Vector velocity, const R2SharedShape *shape, struct R2ShapeCastOptions options)
 Sweep shape from pose along velocity and return the first hit; report R2_NOT_FOUND on a miss.
size_t r2IntersectPoint (const struct R2World *world, const struct R2QueryOptions *query_options, struct R2Vector point, struct R2ColliderHandle *buffer, size_t capacity)
 Copy handles of colliders containing the world-space point.
size_t r2IntersectShape (const struct R2World *world, const struct R2QueryOptions *query_options, struct R2Pose pose, const R2SharedShape *shape, struct R2ColliderHandle *buffer, size_t capacity)
 Copy handles of colliders intersecting the shape at its world-space pose.
size_t r2IntersectAabbConservative (const struct R2World *world, const struct R2QueryOptions *query_options, struct R2Aabb aabb, struct R2ColliderHandle *buffer, size_t capacity)
 Copy broad-phase candidates whose bounding boxes overlap the world-space AABB.
struct R2RayToi r2CastRayToi (const struct R2World *world, const struct R2QueryOptions *query_options, struct R2Vector origin, struct R2Vector direction, R2Real max_toi, R2Bool solid)
 Return the closest ray collider and time, with found = 0 on a miss (R2_OK).
struct R2OptionalRayHit r2TryCastRay (const struct R2World *world, const struct R2QueryOptions *query_options, struct R2Vector origin, struct R2Vector direction, R2Real max_toi, R2Bool solid)
 Return the closest ray hit with found = 0 on a miss (R2_OK).
struct R2RigidBodyDesc r2DynamicRigidBodyDesc (void)
 Return a dynamic rigid-body description with native defaults; no allocation.
struct R2RigidBodyDesc r2FixedRigidBodyDesc (void)
 Return a fixed rigid-body description with native defaults; no allocation.
struct R2RigidBodyDesc r2KinematicPositionBasedRigidBodyDesc (void)
 Return a kinematic position based rigid-body description with native defaults; no allocation.
struct R2RigidBodyDesc r2KinematicVelocityBasedRigidBodyDesc (void)
 Return a kinematic velocity based rigid-body description with native defaults; no allocation.
struct R2ShapeDesc r2DefaultShapeDesc (void)
 Return native default shape desc.
R2SharedShape * r2ShapeDesc_Build (const struct R2ShapeDesc *desc)
 Build an owned shared shape from a description; release it with r2FreeSharedShape.
struct R2ColliderDesc r2DefaultColliderDesc (void)
 Return native default collider desc.
struct R2ColliderDesc r2BallColliderDesc (R2Real radius)
 Return a ball description with the supplied radius.
struct R2ColliderDesc r2CuboidColliderDesc (struct R2Vector half_extents)
 Return an axis-aligned box description with the supplied half-extents.
struct R2RigidBodyHandle r2InsertRigidBody (struct R2World *world, const struct R2RigidBodyDesc *desc)
 Create a body from the description and return its world-bound handle.
struct R2ColliderHandle r2InsertCollider (struct R2RigidBodyHandle parent, const struct R2ColliderDesc *desc)
 Insert a collider attached to a rigid body, using the world stored in its handle.
struct R2ColliderHandle r2InsertColliderWithoutParent (struct R2World *world, const struct R2ColliderDesc *desc)
 Insert a collider without a rigid-body parent.
struct R2PodLayout r2PodLayout (void)
 Return POD structure sizes for checking foreign-language layouts against this library.
struct R2KinematicCharacterController * r2NewKinematicCharacterController (void)
 Allocate a character controller with native defaults; release it with r2FreeKinematicCharacterController.
R2Status r2FreeKinematicCharacterController (struct R2KinematicCharacterController *controller)
 Release an owned kinematic character controller.
R2Status r2KinematicCharacterController_SetUp (struct R2KinematicCharacterController *controller, struct R2Vector up)
 Set the up direction; it must be finite and nonzero and is normalized on input.
R2Status r2KinematicCharacterController_SetOffset (struct R2KinematicCharacterController *controller, struct R2CharacterLength offset)
 Set the collision separation margin; use a positive absolute or relative character length.
R2Status r2KinematicCharacterController_SetSlide (struct R2KinematicCharacterController *controller, R2Bool enabled)
 Enable or disable sliding along obstacles.
R2Status r2KinematicCharacterController_SetSlopes (struct R2KinematicCharacterController *controller, R2Real max_climb_angle, R2Real min_slide_angle)
 Set the maximum climb angle and minimum slide angle, in radians.
R2Status r2KinematicCharacterController_SetAutostep (struct R2KinematicCharacterController *controller, R2Bool enabled, struct R2CharacterLength max_height, struct R2CharacterLength min_width, R2Bool include_dynamic_bodies)
 Configure automatic stepping over obstacles.
R2Status r2KinematicCharacterController_SetSnapToGround (struct R2KinematicCharacterController *controller, R2Bool enabled, struct R2CharacterLength distance)
 Configure downward ground snapping.
struct R2Vector r2KinematicCharacterController_Up (const struct R2KinematicCharacterController *controller)
 Return the normalized up direction.
struct R2CharacterLength r2KinematicCharacterController_Offset (const struct R2KinematicCharacterController *controller)
 Return the collision separation margin.
struct R2CharacterAutostep r2KinematicCharacterController_Autostep (const struct R2KinematicCharacterController *controller)
 Return the automatic stepping settings.
R2Status r2KinematicCharacterController_SetNormalNudgeFactor (struct R2KinematicCharacterController *controller, R2Real value)
 Set the small distance by which sliding motion is pushed along hit normals to avoid getting stuck; it must be finite and nonnegative.
R2Real r2KinematicCharacterController_NormalNudgeFactor (const struct R2KinematicCharacterController *controller)
 Return the normal nudge factor set by SetNormalNudgeFactor.
struct R2CharacterMovement r2KinematicCharacterController_MoveShape (const struct R2World *world, const struct R2QueryOptions *options, struct R2KinematicCharacterController *controller, R2Real dt, const R2SharedShape *shape, struct R2Pose pose, struct R2Vector desired_translation)
 Computes movement without moving any collider.
size_t r2KinematicCharacterController_Collisions (const struct R2KinematicCharacterController *controller, struct R2CharacterCollision *buffer, size_t capacity)
 Copy collisions recorded by the most recent MoveShape call.
R2Status r2KinematicCharacterController_SolveCharacterCollisionImpulses (const struct R2KinematicCharacterController *controller, const R2SharedShape *shape, R2Real dt, R2Real mass, const struct R2QueryOptions *options)
 Applies impulses to the dynamic bodies hit by the most recent MoveShape call.
struct R2PidController * r2NewPidController (void)
 Allocate a PID controller with Rapier's defaults: kp = 60, ki = 1 and kd = 0.8 on every axis, all axes controlled, and zero integrals.
R2Status r2FreePidController (struct R2PidController *controller)
 Release an owned pid controller.
struct R2PidGains r2PidController_Gains (const struct R2PidController *controller)
 Return a copy of the proportional, integral, and derivative gains.
R2Status r2PidController_SetGains (struct R2PidController *controller, struct R2PidGains gains)
 Replace the proportional, integral, and derivative gains.
R2Status r2PidController_SetAxes (struct R2PidController *controller, uint32_t axes)
 Set the controlled axes, a combination of R2_AXES_MASK_* bits.
uint32_t r2PidController_Axes (const struct R2PidController *controller)
 Return the controlled axes as R2_AXES_MASK_* bits.
R2Status r2PidController_ResetIntegrals (struct R2PidController *controller)
 Reset to zero the linear and angular errors accumulated by the integral term.
struct R2PdController r2DefaultPdController (void)
 Return Rapier's default PD controller: kp = 60 and kd = 0.8 on every axis, all axes controlled.
struct R2VelocityCorrection r2PdController_RigidBodyCorrection (const struct R2PdController *controller, struct R2RigidBodyHandle body, struct R2Pose target_pose, struct R2Vector target_linvel, R2AngVector target_angvel)
 Compute the velocity change bringing the body toward the target pose and velocities.
struct R2VelocityCorrection r2PidController_RigidBodyCorrection (struct R2PidController *controller, R2Real dt, struct R2RigidBodyHandle body, struct R2Pose target_pose, struct R2Vector target_linvel, R2AngVector target_angvel)
 Compute a velocity correction, preserving the body's state and updating PID integrals.
struct R2CharacterControllerSettings r2KinematicCharacterController_Settings (const struct R2KinematicCharacterController *controller)
 Return a copy of slide, slope, and ground-snap settings.
R2Status r2RigidBodyPropagateModifiedBodyPositionsToColliders (struct R2World *world)
 Propagate all modified body poses to attached colliders.
size_t r2ActiveRigidBodies (const struct R2World *world, struct R2RigidBodyHandle *buffer, size_t capacity)
 Copies the island manager's active body handles.
R2Status r2RigidBody_WakeUp (struct R2RigidBodyHandle handle, R2Bool strong)
 Wake a body by handle, including a soft-body cluster proxy.
struct R2ErrorHandler r2SetErrorHandler (struct R2ErrorHandler handler)
 Replace this thread's error handler and return the previous handler so it can be restored at the end of a scope.
R2Status r2LastStatus (void)
 Status of the most recent fallible operation on this thread.
const char * r2LastError (void)
 Thread-local UTF-8 diagnostic, valid until the next fallible call on this thread.
R2SharedShape * r2BallSharedShape (R2Real radius)
 Create an owned ball shape.
R2SharedShape * r2CuboidSharedShape (struct R2Vector half_extents)
 Create an owned cuboid shape.
R2SharedShape * r2RoundCuboidSharedShape (struct R2Vector half_extents, R2Real border_radius)
 Create an owned round cuboid shape.
R2SharedShape * r2CapsuleSharedShape (struct R2Vector a, struct R2Vector b, R2Real radius)
 Create an owned capsule shape.
R2SharedShape * r2SegmentSharedShape (struct R2Vector a, struct R2Vector b)
 Create an owned segment shape.
R2SharedShape * r2TriangleSharedShape (struct R2Vector a, struct R2Vector b, struct R2Vector c)
 Create an owned triangle shape.
R2SharedShape * r2HalfspaceSharedShape (struct R2Vector normal)
 Create an owned halfspace shape.
R2SharedShape * r2CompoundSharedShape (struct R2CompoundShapeView children)
 Create an owned compound shape; each child pose is relative to the compound.
R2Status r2RemoveCollider (struct R2ColliderHandle handle, R2Bool wake_up)
 Remove the collider and update its parent body mass properties.
R2Status r2RemoveImpulseJoint (struct R2ImpulseJointHandle handle, R2Bool wake_up)
 Remove an impulse joint.
size_t r2ImpulseJointHandles (const struct R2World *world, struct R2ImpulseJointHandle *buffer, size_t capacity)
 Copy entity handles.
R2Status r2RemoveMultibodyJoint (struct R2MultibodyJointHandle handle, R2Bool wake_up)
 Remove an articulation joint.
size_t r2MultibodyJointHandles (const struct R2World *world, struct R2MultibodyJointHandle *buffer, size_t capacity)
 Copy entity handles.
struct R2JointBodies r2ImpulseJoint_Bodies (struct R2ImpulseJointHandle handle)
 Return the two bodies connected by an impulse joint.
struct R2InverseKinematicsOptions r2DefaultInverseKinematicsOptions (void)
 Return native default inverse kinematics options.
size_t r2MultibodyJoint_Ndofs (struct R2MultibodyJointHandle handle)
 Return the degrees of freedom of the whole multibody containing the joint (not of the joint alone), including the free root of a dynamic multibody.
R2Status r2MultibodyJoint_InverseKinematics (struct R2MultibodyJointHandle handle, const struct R2InverseKinematicsOptions *options, struct R2Pose target, R2IkJointCanMove can_move, void *user_data, R2Real *displacements, size_t count)
 Read/write displacement buffer must contain exactly ndofs entries; zero it for a fresh solve.
R2Status r2MultibodyJoint_ApplyDisplacements (struct R2MultibodyJointHandle handle, const R2Real *displacements, size_t count)
 Apply generalized articulation displacements in native degree-of-freedom order.
R2Status r2FreeSharedShape (R2SharedShape *object)
 Frees an owned object; NULL is allowed.
R2SharedShape * r2SharedShape_Clone (const R2SharedShape *object)
 Create an owned wrapper sharing the same immutable geometry.
size_t r2RigidBodyCount (const struct R2World *world)
 Return the number of rigid body objects in the world.
size_t r2RigidBodyHandles (const struct R2World *world, struct R2RigidBodyHandle *buffer, size_t capacity)
 Copy entity handles.
R2Bool r2RigidBody_Contains (struct R2RigidBodyHandle handle)
 Test whether the live world contains this rigid body handle.
size_t r2ColliderCount (const struct R2World *world)
 Return the number of collider objects in the world.
size_t r2ColliderHandles (const struct R2World *world, struct R2ColliderHandle *buffer, size_t capacity)
 Copy entity handles.
R2Bool r2Collider_Contains (struct R2ColliderHandle handle)
 Test whether the live world contains this collider handle.
size_t r2SoftBodyCount (const struct R2World *world)
 Return the number of soft body objects in the world.
size_t r2SoftBodyHandles (const struct R2World *world, struct R2SoftBodyHandle *buffer, size_t capacity)
 Copy entity handles.
R2Bool r2SoftBody_Contains (struct R2SoftBodyHandle handle)
 Test whether the live world contains this soft body handle.
R2Status r2RemoveRigidBody (struct R2RigidBodyHandle handle, R2Bool remove_attached_colliders)
 Remove a body and its joints, optionally keeping colliders as standalone objects.
R2Real r2TimeStep (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::dt.
R2Status r2SetTimeStep (struct R2World *world, R2Real value)
 Set the world setting documented by R2IntegrationParameters::dt.
R2Real r2MinCcdDt (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::minCcdDt.
R2Status r2SetMinCcdDt (struct R2World *world, R2Real value)
 Set the world setting documented by R2IntegrationParameters::minCcdDt.
R2Real r2LengthUnit (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::lengthUnit.
R2Status r2SetLengthUnit (struct R2World *world, R2Real value)
 Set the world setting documented by R2IntegrationParameters::lengthUnit.
R2Real r2WarmstartCoefficient (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::warmstartCoefficient.
R2Status r2SetWarmstartCoefficient (struct R2World *world, R2Real value)
 Set the world setting documented by R2IntegrationParameters::warmstartCoefficient.
R2Real r2NormalizedAllowedLinearError (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::normalizedAllowedLinearError.
R2Status r2SetNormalizedAllowedLinearError (struct R2World *world, R2Real value)
 Set the world setting documented by R2IntegrationParameters::normalizedAllowedLinearError.
R2Real r2NormalizedMaxCorrectiveVelocity (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::normalizedMaxCorrectiveVelocity.
R2Status r2SetNormalizedMaxCorrectiveVelocity (struct R2World *world, R2Real value)
 Set the world setting documented by R2IntegrationParameters::normalizedMaxCorrectiveVelocity.
R2Real r2NormalizedPredictionDistance (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::normalizedPredictionDistance.
R2Status r2SetNormalizedPredictionDistance (struct R2World *world, R2Real value)
 Set the world setting documented by R2IntegrationParameters::normalizedPredictionDistance.
R2Real r2NormalizedMaxLinearVelocity (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::normalizedMaxLinearVelocity.
R2Status r2SetNormalizedMaxLinearVelocity (struct R2World *world, R2Real value)
 Set the world setting documented by R2IntegrationParameters::normalizedMaxLinearVelocity.
R2Real r2NormalizedContactRecycleDistance (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::normalizedContactRecycleDistance.
R2Status r2SetNormalizedContactRecycleDistance (struct R2World *world, R2Real value)
 Set the world setting documented by R2IntegrationParameters::normalizedContactRecycleDistance.
size_t r2NumSolverIterations (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::numSolverIterations.
R2Status r2SetNumSolverIterations (struct R2World *world, size_t value)
 Set the world setting documented by R2IntegrationParameters::numSolverIterations.
size_t r2NumInternalPgsIterations (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::numInternalPgsIterations.
R2Status r2SetNumInternalPgsIterations (struct R2World *world, size_t value)
 Set the world setting documented by R2IntegrationParameters::numInternalPgsIterations.
size_t r2NumInternalStabilizationIterations (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::numInternalStabilizationIterations.
R2Status r2SetNumInternalStabilizationIterations (struct R2World *world, size_t value)
 Set the world setting documented by R2IntegrationParameters::numInternalStabilizationIterations.
size_t r2MaxCcdSubsteps (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::maxCcdSubsteps.
R2Status r2SetMaxCcdSubsteps (struct R2World *world, size_t value)
 Set the world setting documented by R2IntegrationParameters::maxCcdSubsteps.
R2Bool r2ContactClustering (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::contactClustering.
R2Status r2SetContactClustering (struct R2World *world, R2Bool value)
 Set the world setting documented by R2IntegrationParameters::contactClustering.
R2Bool r2ContactRecycling (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::contactRecycling.
R2Status r2SetContactRecycling (struct R2World *world, R2Bool value)
 Set the world setting documented by R2IntegrationParameters::contactRecycling.
R2Bool r2FrictionInBiasPass (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::frictionInBiasPass.
R2Status r2SetFrictionInBiasPass (struct R2World *world, R2Bool value)
 Set the world setting documented by R2IntegrationParameters::frictionInBiasPass.
R2Bool r2WarmstartJoints (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::warmstartJoints.
R2Status r2SetWarmstartJoints (struct R2World *world, R2Bool value)
 Set the world setting documented by R2IntegrationParameters::warmstartJoints.
struct R2SpringCoefficients r2ContactSoftness (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::contactSoftness.
R2Status r2SetContactSoftness (struct R2World *world, struct R2SpringCoefficients value)
 Set the world setting documented by R2IntegrationParameters::contactSoftness.
struct R2SpringCoefficients r2StaticContactSoftness (const struct R2World *world)
 Return the world setting documented by R2IntegrationParameters::staticContactSoftness.
R2Status r2SetStaticContactSoftness (struct R2World *world, struct R2SpringCoefficients value)
 Set the world setting documented by R2IntegrationParameters::staticContactSoftness.
R2Status r2ContactModificationContext_UpdateAsOnewayPlatform (struct R2ContactModificationContext *context, struct R2Vector allowed_local_n1, R2Real allowed_angle)
 Applies Rapier's persistent one-way platform logic to the borrowed manifold.
R2Status r2ContactModificationContext_SetTangentVelocity (struct R2ContactModificationContext *context, struct R2Vector velocity)
 Sets the tangent velocity of every rigid solver contact in this manifold.
struct R2EventCollector * r2NewEventCollector (void)
 Allocate an empty event collector; release it with r2FreeEventCollector.
R2Status r2FreeEventCollector (struct R2EventCollector *events)
 Release an owned event collector.
R2Status r2EventCollector_Clear (struct R2EventCollector *events)
 Discard all collected events.
size_t r2EventCollector_CollisionEvents (const struct R2EventCollector *events, struct R2CollisionEvent *buffer, size_t capacity)
 Copy the collision start/stop events collected since the last clear, without removing them.
size_t r2EventCollector_ContactForceEvents (const struct R2EventCollector *events, struct R2ContactForceEvent *buffer, size_t capacity)
 Copy the contact-force events collected since the last clear, without removing them.
size_t r2EventCollector_TearEventCount (const struct R2EventCollector *events)
 Return the number of soft-body tear events collected since the last clear.
struct R2SoftBodyTearEvent * r2EventCollector_TearEvent (const struct R2EventCollector *events, size_t index)
 Return an owned copy of a queued tear event; release with r2FreeSoftBodyTearEvent.
struct R2Vector r2Gravity (const struct R2World *world)
 Return the world-space gravitational acceleration.
R2Status r2SetGravity (struct R2World *world, struct R2Vector value)
 Set the world-space gravitational acceleration.
R2Status r2Step (struct R2World *world, const struct R2PhysicsHooks *hooks, const struct R2EventCollector *events)
 Advance simulation by one timestep.
R2Status r2DetectCollisions (struct R2World *world, const struct R2PhysicsHooks *hooks, const struct R2EventCollector *events)
 Refresh collision detection without advancing simulation.
struct R2ByteView r2Bytes_Data (const struct R2Bytes *bytes)
 Borrow snapshot bytes without copying; valid until r2FreeBytes.
R2Status r2FreeBytes (struct R2Bytes *bytes)
 Release an owned snapshot byte buffer.
struct R2Bytes * r2SerializeWorld (const struct R2World *world)
 Return owned snapshot bytes; release them with r2FreeBytes.
struct R2World * r2DeserializeWorld (const uint8_t *data, size_t count)
 Restore ONLY trusted snapshots produced by the identical Rapier build.
size_t r2DebugRender (const struct R2World *world, uint32_t mode, struct R2DebugLine *buffer, size_t capacity)
 Copy the debug-render lines of the world with the default style.
R2Status r2SoftBodiesSetResweepStrain (struct R2World *world, R2Real value)
 Set the world setting documented by R2SoftBodiesSettings::resweepStrain.
R2Real r2SoftBodiesResweepStrain (const struct R2World *world)
 Return the world setting documented by R2SoftBodiesSettings::resweepStrain.
R2Status r2SoftBodiesSetContactStiffening (struct R2World *world, R2Real value)
 Set the world setting documented by R2SoftBodiesSettings::contactStiffening.
R2Real r2SoftBodiesContactStiffening (const struct R2World *world)
 Return the world setting documented by R2SoftBodiesSettings::contactStiffening.
R2Status r2SoftBodiesSetMaxExtraSubsteps (struct R2World *world, size_t value)
 Set the world setting documented by R2SoftBodiesSettings::maxExtraSubsteps.
size_t r2SoftBodiesMaxExtraSubsteps (const struct R2World *world)
 Return the world setting documented by R2SoftBodiesSettings::maxExtraSubsteps.
R2Status r2RecoverySetAuthoredVelocityMargin (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::authoredVelocityMargin.
R2Status r2RecoverySetEdgeSpeculation (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::edgeSpeculation.
R2Status r2RecoverySetInvertedCellDetection (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::invertedCellDetection.
R2Status r2RecoverySetSelfCrossingDetection (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::selfCrossingDetection.
R2Status r2RecoverySetDetectionMotionGating (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::detectionMotionGating.
R2Status r2RecoverySetCrossBodyDetection (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::crossBodyDetection.
R2Status r2RecoverySetSelfStandDown (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::selfStandDown.
R2Status r2RecoverySetCrossBodyExpelGate (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::crossBodyExpelGate.
R2Status r2RecoverySetEdgeStandDown (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::edgeStandDown.
R2Status r2RecoverySetCrossingRepulsion (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::crossingRepulsion.
R2Status r2RecoverySetCrossingRepulsionGuide (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::crossingRepulsionGuide.
R2Status r2RecoverySetCrossingRepulsionSelfGuide (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::crossingRepulsionSelfGuide.
R2Status r2RecoverySetRecoveryPace (struct R2World *world, R2Real value)
 Set the world setting documented by R2SoftRecoverySettings::recoveryPace.
R2Status r2RecoverySetOverlapConstraints (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::overlapConstraints.
R2Status r2RecoverySetOverlapRigid (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::overlapRigid.
R2Status r2RecoverySetOverlapSkipSelfTangled (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::overlapSkipSelfTangled.
R2Status r2RecoverySetOverlapEdgeStandDown (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::overlapEdgeStandDown.
R2Status r2RecoverySetOverlapConstraintPace (struct R2World *world, R2Real value)
 Set the world setting documented by R2SoftRecoverySettings::overlapConstraintPace.
R2Status r2RecoverySetOverlapSkinVolume (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::overlapSkinVolume.
R2Status r2RecoverySetOverlapKeptDepth (struct R2World *world, R2Real value)
 Set the world setting documented by R2SoftRecoverySettings::overlapKeptDepth.
R2Status r2RecoverySetOverlapSelfRegions (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::overlapSelfRegions.
R2Status r2RecoverySetOverlapNormalPush (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::overlapNormalPush.
R2Status r2RecoverySetOverlapMultiVolume (struct R2World *world, R2Bool value)
 Set the world setting documented by R2SoftRecoverySettings::overlapMultiVolume.
R2Status r2RecoverySetOverlapProgressMargin (struct R2World *world, R2Real value)
 Set the world setting documented by R2SoftRecoverySettings::overlapProgressMargin.
R2Status r2FemSetLinearTolerance (struct R2World *world, R2Real value)
 Set the world setting documented by R2SoftFemParameters::linearTolerance.
R2Status r2FemSetMaxLinearIterations (struct R2World *world, size_t value)
 Set the world setting documented by R2SoftFemParameters::maxLinearIterations.
R2Status r2FemSetMaxDenseDofs (struct R2World *world, size_t value)
 Set the world setting documented by R2SoftFemParameters::maxDenseDofs.
R2Status r2SetNumThreads (struct R2World *world, size_t num_threads)
 Configures a dedicated pool for this world's parallel work.
R2Status r2ClearThreadPool (struct R2World *world)
 Removes the world's dedicated pool.
size_t r2NumThreads (const struct R2World *world)
 Size of the world's dedicated pool, or zero if a parallel build has no dedicated pool configured.
R2Status r2SetCountersEnabled (struct R2World *world, R2Bool enabled)
 Enable or disable the native pipeline profiling counters.
double r2StepTimeMs (const struct R2World *world)
 Native engine time of the most recent step, in milliseconds, as in the Rust testbed.
struct R2World * r2DeserializeRigidState (const uint8_t *data, size_t count)
 Read ONLY trusted legacy rigid-world snapshots from debug_deserialize3.rs, produced by the identical Rapier build.
struct R2QueryFilter r2DefaultQueryFilter (void)
 Return native default query filter.
struct R2ShapeCastOptions r2DefaultShapeCastOptions (void)
 Return native default shape cast options.
R2Status r2RemoveSoftBody (struct R2SoftBodyHandle handle)
 Remove a soft body and its associated simulation objects.
R2Status r2SoftBody_WakeUp (struct R2SoftBodyHandle handle)
 Wake the soft body and its rigid proxies.
R2Status r2FreeSoftBodyTearEvent (struct R2SoftBodyTearEvent *event)
 Release an owned soft body tear event.
struct R2SoftBodyHandle r2SoftBodyTearEvent_SoftBody (const struct R2SoftBodyTearEvent *event)
 Return the source soft-body handle for this tear event.
size_t r2SoftBodyTearEvent_Bodies (const struct R2SoftBodyTearEvent *event, struct R2SoftBodyHandle *buffer, size_t capacity)
 Copy the soft bodies the torn body is in after the tear, the one keeping the handle first: the torn body alone when nothing was split off.
struct R2ParticleDestination r2SoftBodyTearEvent_ParticleDestination (const struct R2SoftBodyTearEvent *event, uint32_t particle)
 Return the destination body and particle index for an original particle.
size_t r2SoftBodyTearEvent_TornEdges (const struct R2SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity)
 Flat indices; element arity follows the corresponding Rust event field.
size_t r2SoftBodyTearEvent_TornCells (const struct R2SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity)
 Flat indices; element arity follows the corresponding Rust event field.
size_t r2SoftBodyTearEvent_RemovedEdges (const struct R2SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity)
 Flat indices; element arity follows the corresponding Rust event field.
size_t r2SoftBodyTearEvent_SplitParticles (const struct R2SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity)
 Flat indices; element arity follows the corresponding Rust event field.
size_t r2SoftBodyTearEvent_InsertedParticles (const struct R2SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity)
 Flat indices; element arity follows the corresponding Rust event field.
size_t r2SoftBodyTearEvent_PieceParticles (const struct R2SoftBodyTearEvent *event, size_t piece_index, uint32_t *buffer, size_t capacity)
 Copy the particles of the piece_index-th body of r2SoftBodyTearEvent_Bodies, as indices in the torn body after the tear (the indices the other event fields use); entry i is the piece's particle i.
size_t r2SoftBodyTearEvent_Clusters (const struct R2SoftBodyTearEvent *event, struct R2SoftClusterSplit *buffer, size_t capacity)
 Copy cluster-to-piece and rigid-proxy remapping records.
size_t r2SoftBodyTearEvent_MovedJoints (const struct R2SoftBodyTearEvent *event, struct R2SoftJointMove *buffer, size_t capacity)
 Copy impulse-joint remapping records produced by the tear.
struct R2SoftBodyTearEvent * r2SoftBody_Tear (struct R2SoftBodyHandle handle, const uint32_t *edges, size_t edge_count, const uint32_t *cells, size_t cell_count)
 Tear the selected edges and return an owned remapping event.
uint32_t r2SoftBody_AddCluster (struct R2SoftBodyHandle handle, const uint32_t *particles, size_t count)
 Create a rigid proxy cluster from the supplied particle indices and return its cluster index.
R2Status r2SoftBody_RemoveCluster (struct R2SoftBodyHandle handle, uint32_t cluster)
 Remove the selected cluster and its rigid proxy.
struct R2OptionalParticleDestination r2SoftBodyTearEvent_TryParticleDestination (const struct R2SoftBodyTearEvent *event, uint32_t particle)
 Optional particle destination after a tear.
struct R2SoftBodyTearEvent * r2CutSoftBody (struct R2SoftBodyHandle handle, const struct R2Vector *blade)
 Cut using DIM points (a segment in 2D, triangle in 3D).
struct R2VolumeMeshParameters r2NewVolumeMeshParameters (R2Real cell_size)
 Return volume-meshing settings for the supplied cell size; this POD value requires no destructor.
struct R2BuildInfo r2BuildInfo (void)
 Return ABI version, dimension, scalar size, and pointer size of the linked library.
const char * r2Version (void)
 Release version of the loaded C bindings, e.g.
const char * r2BuildProfile (void)
 Cargo profile of the loaded physics library: "debug" or "release".
struct R2BuildFeatures r2BuildFeatures (void)
 Return profiling, SIMD width, parallelism, and determinism of the linked library.
R2SharedShape * r2HeightfieldSharedShape (struct R2RealView heights, size_t rows, size_t columns, struct R2Vector scale)
 Create an owned heightfield shape from copied samples.
struct R2Aabb r2SharedShape_ComputeAabb (const R2SharedShape *shape, struct R2Pose pose)
 Compute the shape axis-aligned bounds at the supplied world-space pose.
struct R2MassProperties r2SharedShape_MassProperties (const R2SharedShape *shape, R2Real density)
 Compute local mass properties for the supplied nonnegative density.
R2Bool r2SharedShape_ContainsPoint (const R2SharedShape *shape, struct R2Pose pose, struct R2Vector point)
 Test whether the world-space point lies inside the shape at pose.
size_t r2ContactPairs (const struct R2World *world, struct R2ContactPair *buffer, size_t capacity)
 Copy current narrow-phase contact pairs, including pairs without active solver contacts.
struct R2ContactPair r2ContactPair (struct R2ColliderHandle collider1, struct R2ColliderHandle collider2)
 Return the narrow-phase contact pair for two colliders, or report R2_NOT_FOUND.
size_t r2IntersectionPairs (const struct R2World *world, struct R2IntersectionPair *buffer, size_t capacity)
 Copy current sensor intersection pairs from the narrow phase.
size_t r2ContactPoints (struct R2ColliderHandle collider1, struct R2ColliderHandle collider2, struct R2ContactPoint *buffer, size_t capacity)
 Contact points in collider-local space; normal in world space.
size_t r2MultibodyJoint_GeneralizedVelocity (struct R2MultibodyJointHandle handle, R2Real *buffer, size_t capacity)
 Copy the articulation generalized velocities in native degree-of-freedom order.
R2Status r2MultibodyJoint_SetGeneralizedVelocity (struct R2MultibodyJointHandle handle, const R2Real *values, size_t count)
 Replace articulation generalized velocities; the array length must match its degrees of freedom.
R2Status r2CheckAbi (uint32_t version, uint32_t dimension, size_t real_size, size_t vector_size, size_t pose_size, uint32_t features)
 Check that the header matches the linked library before passing any structure across the ABI.
size_t r2QuarantinedRigidBodies (const struct R2World *world, struct R2RigidBodyHandle *buffer, size_t capacity)
 Copy the rigid bodies quarantined by the most recent Step because their pose or velocity became non-finite (NaN or infinite).
size_t r2QuarantinedColliders (const struct R2World *world, struct R2ColliderHandle *buffer, size_t capacity)
 Copy the colliders quarantined by the most recent Step because their own pose or shape became non-finite, independently of their parent.
size_t r2QuarantinedSoftBodies (const struct R2World *world, struct R2SoftBodyHandle *buffer, size_t capacity)
 Copy the soft bodies quarantined by the most recent Step because a particle position or velocity became non-finite.
R2Real r2Sin (R2Real x)
 Sine of an angle in radians, computed by Rapier's math backend.
R2Real r2Cos (R2Real x)
 Cosine of an angle in radians, computed by Rapier's math backend.
R2Real r2Tan (R2Real x)
 Tangent of an angle in radians, computed by Rapier's math backend.
R2Real r2Asin (R2Real x)
 Arcsine in radians, computed by Rapier's math backend.
R2Real r2Acos (R2Real x)
 Arccosine in radians, computed by Rapier's math backend.
R2Real r2Atan2 (R2Real y, R2Real x)
 Angle in radians of the point (x, y), in [-pi, pi], computed by Rapier's math backend.
R2Real r2Exp (R2Real x)
 Exponential e^x, computed by Rapier's math backend.
R2Real r2Ln (R2Real x)
 Natural logarithm, computed by Rapier's math backend.
R2Real r2Powf (R2Real base, R2Real exponent)
 base raised to the power exponent, computed by Rapier's math backend.
struct R2ShapeMesh * r2SharedShape_Tessellate (const R2SharedShape *shape, uint32_t subdivisions)
 Return owned local-space rendering geometry; release it with r2FreeShapeMesh.
size_t r2ShapeMesh_Triangles (const struct R2ShapeMesh *mesh, struct R2Vector *buffer, size_t capacity)
 Flat groups of three vertices.
size_t r2ShapeMesh_Lines (const struct R2ShapeMesh *mesh, struct R2Vector *buffer, size_t capacity)
 Flat groups of two vertices.
R2Status r2FreeShapeMesh (struct R2ShapeMesh *mesh)
 Release an owned shape mesh.
struct R2Pose r2RigidBody_Position (struct R2RigidBodyHandle handle)
 Return the rigid body world-space pose.
struct R2Vector r2RigidBody_Translation (struct R2RigidBodyHandle handle)
 Return the rigid body world-space translation.
struct R2Vector r2RigidBody_Linvel (struct R2RigidBodyHandle handle)
 Return the rigid body world-space linear velocity.
R2AngVector r2RigidBody_Angvel (struct R2RigidBodyHandle handle)
 Return the rigid body world-space angular velocity (radians per second).
R2Bool r2RigidBody_IsSleeping (struct R2RigidBodyHandle handle)
 Return whether the rigid body is sleeping.
R2Bool r2RigidBody_IsEnabled (struct R2RigidBodyHandle handle)
 Return whether the rigid body is enabled.
struct R2UserData r2RigidBody_UserData (struct R2RigidBodyHandle handle)
 Return the rigid body application-owned 128-bit user value.
R2Status r2RigidBody_SetPosition (struct R2RigidBodyHandle handle, struct R2Pose value, R2Bool wake_up)
 Set the rigid body world-space pose.
R2Status r2RigidBody_SetTranslation (struct R2RigidBodyHandle handle, struct R2Vector value, R2Bool wake_up)
 Set the rigid body world-space translation.
R2Status r2RigidBody_SetLinvel (struct R2RigidBodyHandle handle, struct R2Vector value, R2Bool wake_up)
 Set the rigid body world-space linear velocity.
R2Status r2RigidBody_SetAngvel (struct R2RigidBodyHandle handle, R2AngVector value, R2Bool wake_up)
 Set the rigid body world-space angular velocity (radians per second).
R2Status r2RigidBody_SetNextKinematicPosition (struct R2RigidBodyHandle handle, struct R2Pose value)
 Set the rigid body next kinematic world-space pose.
R2Status r2RigidBody_SetNextKinematicTranslation (struct R2RigidBodyHandle handle, struct R2Vector value)
 Set the rigid body next kinematic world-space translation.
R2Status r2RigidBody_SetGravityScale (struct R2RigidBodyHandle handle, R2Real value, R2Bool wake_up)
 Set the rigid body gravity multiplier.
R2Status r2RigidBody_SetLinearDamping (struct R2RigidBodyHandle handle, R2Real value)
 Set the rigid body linear damping coefficient.
R2Status r2RigidBody_SetAngularDamping (struct R2RigidBodyHandle handle, R2Real value)
 Set the rigid body angular damping coefficient.
R2Status r2RigidBody_SetEnabled (struct R2RigidBodyHandle handle, R2Bool value)
 Enable or disable the rigid body.
R2Status r2RigidBody_SetUserData (struct R2RigidBodyHandle handle, struct R2UserData value)
 Set the rigid body application-owned 128-bit user value.
R2Status r2RigidBody_ApplyImpulse (struct R2RigidBodyHandle handle, struct R2Vector value, R2Bool wake_up)
 Apply a world-space linear impulse.
R2Status r2RigidBody_ApplyImpulseAtPoint (struct R2RigidBodyHandle handle, struct R2Vector value, struct R2Vector point, R2Bool wake_up)
 Apply a world-space impulse at a world-space point.
R2Status r2RigidBody_AddForce (struct R2RigidBodyHandle handle, struct R2Vector value, R2Bool wake_up)
 Accumulate a world-space force; it persists until reset.
R2Status r2RigidBody_ResetForces (struct R2RigidBodyHandle handle, R2Bool wake_up)
 Clear accumulated user forces.
R2Status r2RigidBody_Sleep (struct R2RigidBodyHandle handle)
 Put the body to sleep.
struct R2Pose r2Collider_Position (struct R2ColliderHandle handle)
 Return the collider world-space pose.
struct R2Vector r2Collider_Translation (struct R2ColliderHandle handle)
 Return the collider world-space translation.
R2Real r2Collider_Friction (struct R2ColliderHandle handle)
 Return the collider friction coefficient.
R2Real r2Collider_Restitution (struct R2ColliderHandle handle)
 Return the collider restitution coefficient.
R2Bool r2Collider_IsSensor (struct R2ColliderHandle handle)
 Return whether the collider is a sensor (detects overlaps without contact forces).
struct R2RigidBodyHandle r2Collider_Parent (struct R2ColliderHandle handle)
 Return the parent body handle, or an invalid handle with OK status for a standalone collider.
R2Status r2Collider_SetPosition (struct R2ColliderHandle handle, struct R2Pose value)
 Set the collider world-space pose.
R2Status r2Collider_SetTranslation (struct R2ColliderHandle handle, struct R2Vector value)
 Set the collider world-space translation.
R2Status r2Collider_SetFriction (struct R2ColliderHandle handle, R2Real value)
 Set the collider friction coefficient.
R2Status r2Collider_SetRestitution (struct R2ColliderHandle handle, R2Real value)
 Set the collider restitution coefficient.
R2Status r2Collider_SetSensor (struct R2ColliderHandle handle, R2Bool value)
 Enable or disable a sensor (detects overlaps without contact forces) for the collider.
R2Status r2Collider_SetCollisionGroups (struct R2ColliderHandle handle, struct R2InteractionGroups value)
 Set the collider collision filtering groups.
R2Status r2Collider_SetUserData (struct R2ColliderHandle handle, struct R2UserData value)
 Set the collider application-owned 128-bit user value.
struct R2Vector r2SoftBody_ParticlePosition (struct R2SoftBodyHandle handle, size_t index)
 Return the world-space position of the indexed particle.
size_t r2SoftBody_ParticlePositions (struct R2SoftBodyHandle handle, struct R2Vector *buffer, size_t capacity)
 Copy world-space particle positions.
struct R2SoftBodyMaterial r2SoftBody_Material (struct R2SoftBodyHandle handle)
 Return a copy of the soft body material parameters.
R2Status r2SoftBody_SetParticlePosition (struct R2SoftBodyHandle handle, size_t index, struct R2Vector value)
 Set the world-space position of the indexed particle.
R2Status r2SoftBody_SetMaterial (struct R2SoftBodyHandle handle, const struct R2SoftBodyMaterial *data)
 Copy material parameters into the soft body.
R2Status r2SoftBody_AddParticleForce (struct R2SoftBodyHandle handle, size_t index, struct R2Vector value, R2Bool wake_up)
 Add a world-space force to the indexed particle.
size_t r2RigidBodyReadStates (const struct R2World *world, const struct R2RigidBodyHandle *handles, size_t handle_count, struct R2RigidBodyState *states, size_t capacity)
 Copies states in the same order as handles, without allocating temporary storage.
struct R2JointDesc r2ImpulseJoint_Desc (struct R2ImpulseJointHandle handle)
 Copies joint configuration without returning a borrowed joint pointer.
R2Status r2ImpulseJoint_SetDesc (struct R2ImpulseJointHandle handle, const struct R2JointDesc *desc, R2Bool wake_up)
 Replaces configuration after validation, resetting cached limit/motor impulses.
uint16_t r2Collider_ActiveCollisionTypes (struct R2ColliderHandle handle)
 Return the collider body-type collision activation bitmask (R2_COLLISION_TYPES_* bits).
uint32_t r2Collider_ActiveHooks (struct R2ColliderHandle handle)
 Return the collider physics-hook activation bitmask.
uint32_t r2Collider_FrictionCombineRule (struct R2ColliderHandle handle)
 Return the collider friction combination rule (R2_COMBINE_*).
uint32_t r2Collider_RestitutionCombineRule (struct R2ColliderHandle handle)
 Return the collider restitution combination rule (R2_COMBINE_*).
struct R2Pose r2Collider_PositionWrtParent (struct R2ColliderHandle handle)
 Return the collider pose relative to its parent rigid body, or its world-space pose if it has no parent.
int8_t r2RigidBody_DominanceGroup (struct R2RigidBodyHandle handle)
 Return the rigid body signed dominance group.
size_t r2RigidBody_AdditionalSolverIterations (struct R2RigidBodyHandle handle)
 Return the rigid body additional solver iterations for connected bodies.
size_t r2RigidBody_AdditionalPgsIterations (struct R2RigidBodyHandle handle)
 Return the rigid body additional PGS iterations for connected bodies.
R2Bool r2RigidBody_IsFastRotationAllowed (struct R2RigidBodyHandle handle)
 Return whether the rigid body may exceed the angular-velocity limit of its CCD.
R2Status r2Collider_SetRotation (struct R2ColliderHandle handle, struct R2Rotation value)
 Set the collider world-space rotation.
R2Status r2RigidBody_SetAllowFastRotation (struct R2RigidBodyHandle handle, R2Bool value)
 Allow or disallow the rigid body to exceed the angular-velocity limit of its CCD (e.g.
R2Status r2ShapeDesc_SetTrimesh (struct R2ShapeDesc *desc, struct R2VectorView vertices, struct R2TriangleView indices, uint32_t flags)
 Replace the shape geometry with a borrowed tri mesh.
R2Status r2ShapeDesc_SetPolyline (struct R2ShapeDesc *desc, struct R2VectorView vertices, struct R2EdgeView indices, uint32_t flags)
 Replace the shape geometry with a borrowed polyline.
R2Status r2ShapeDesc_SetConvexHull (struct R2ShapeDesc *desc, struct R2VectorView vertices)
 Replace the shape geometry with a borrowed convex hull point cloud.
R2Status r2SoftBodyDesc_SetParticles (struct R2SoftBodyDesc *desc, struct R2VectorView positions)
 Select an explicit particle recipe and borrow its positions.
R2Status r2SoftBodyDesc_SetSurfaceMesh (struct R2SoftBodyDesc *desc, struct R2VectorView vertices, R2SurfaceElementView elements)
 Select a surface recipe and borrow its vertices and elements.
R2Status r2SoftBodyDesc_SetTrimesh (struct R2SoftBodyDesc *desc, struct R2VectorView vertices, struct R2TriangleView triangles)
 Select a 2D triangle-mesh recipe and borrow its vertices and triangles (stored in positions and cells).
R2Status r2SoftBodyDesc_SetAppended (struct R2SoftBodyDesc *desc, struct R2SoftBodyDescView view)
 Borrow descriptions to merge into this body (see R2SoftBodyDesc::appended); preserve all other fields.
R2Status r2SoftBodyDesc_SetAddedEdges (struct R2SoftBodyDesc *desc, struct R2EdgeView view)
 Borrow structural edges added after appending (see R2SoftBodyDesc::addedEdges); preserve all other fields.
R2Status r2SoftBodyDesc_SetSkin (struct R2SoftBodyDesc *desc, struct R2VectorView vertices, R2SurfaceElementView elements)
 Borrow skin geometry.
R2Status r2SoftBodyDesc_SetMasses (struct R2SoftBodyDesc *desc, struct R2RealView view)
 Borrow masses; preserve all other fields.
R2Status r2SoftBodyDesc_SetPinnedParticles (struct R2SoftBodyDesc *desc, struct R2IndexView view)
 Borrow pinned particles; preserve all other fields.
R2Status r2SoftBodyDesc_SetEdges (struct R2SoftBodyDesc *desc, struct R2EdgeView view)
 Borrow edges; preserve all other fields.
R2Status r2SoftBodyDesc_SetBendEdges (struct R2SoftBodyDesc *desc, struct R2EdgeView view)
 Borrow bend edges; preserve all other fields.
R2Status r2SoftBodyDesc_SetCells (struct R2SoftBodyDesc *desc, R2CellView view)
 Borrow cells; preserve all other fields.
R2Status r2SoftBodyDesc_SetSurface (struct R2SoftBodyDesc *desc, R2SurfaceElementView view)
 Borrow surface; preserve all other fields.
R2Status r2SoftBodyDesc_SetTensionOnlyEdges (struct R2SoftBodyDesc *desc, struct R2IndexView view)
 Borrow tension only edges; preserve all other fields.
struct R2ColliderDesc r2RoundCuboidColliderDesc (struct R2Vector half_extents, R2Real border_radius)
 Return a rounded box description; half_extents exclude the added border_radius.
struct R2ColliderDesc r2CapsuleColliderDesc (struct R2Vector a, struct R2Vector b, R2Real radius)
 Return a capsule description with segment endpoints a/b and the supplied radius.
struct R2ColliderDesc r2SegmentColliderDesc (struct R2Vector a, struct R2Vector b)
 Return a segment description with endpoints a and b.
struct R2ColliderDesc r2TriangleColliderDesc (struct R2Vector a, struct R2Vector b, struct R2Vector c)
 Return a triangle description with vertices a, b, and c.
struct R2ColliderDesc r2HalfspaceColliderDesc (struct R2Vector normal)
 Return a half-space description bounded by a plane through the origin; normal points outward.
struct R2ColliderDesc r2CapsuleXColliderDesc (R2Real half_height, R2Real radius)
 Return a X-aligned capsule description; half_height is half the segment length, excluding caps.
struct R2ColliderDesc r2CapsuleYColliderDesc (R2Real half_height, R2Real radius)
 Return a Y-aligned capsule description; half_height is half the segment length, excluding caps.
struct R2SoftBodyDesc r2RopeSoftBodyDesc (struct R2Vector a, struct R2Vector b, size_t particles)
 Return a rope recipe with particles evenly spaced from a to b, including both endpoints.
struct R2SoftBodyDesc r2GridSoftBodyDesc (struct R2Vector center, struct R2Vector half_extents, size_t nx, size_t ny)
 Return a solid rectangle recipe on an nx by ny particle grid.
struct R2SoftBodyDesc r2PolygonSoftBodyDesc (struct R2VectorView points)
 Return a closed polygon recipe from at least 3 counter-clockwise points: structural edges along the boundary, bending edges between second neighbors, and area preservation.
struct R2SoftBodyDesc r2DiskSoftBodyDesc (struct R2Vector center, R2Real radius, size_t particles)
 Return a closed regular polygon recipe with the specified boundary particle count and area preservation.
struct R2SoftBodyDesc r2VolumetricSoftBodyDesc (struct R2VectorView vertices, R2SurfaceElementView surface, struct R2VolumeMeshParameters parameters)
 Initializes a borrowed meshing recipe.
struct R2SoftBodyMaterial r2UniformSoftBodyMaterial (struct R2SpringCoefficients value)
 Returns a material with the same softness for each constraint family.
size_t r2SoftBodyDesc_ParticlePositions (const struct R2SoftBodyDesc *desc, struct R2Vector *buffer, size_t capacity)
 Copies generated particle positions into caller-owned storage; no persistent builder.
size_t r2SoftBodyDesc_CellIndices (const struct R2SoftBodyDesc *desc, uint32_t *buffer, size_t capacity)
 Copies generated cell indices into caller-owned storage.
struct R2Vector r2SoftBody_ParticleVelocity (struct R2SoftBodyHandle handle, size_t index)
 Return the world-space velocity of the indexed particle.
uint32_t r2SoftBody_Solver (struct R2SoftBodyHandle handle)
 Return the solver simulating the soft body's elasticity (R2_SOFT_SOLVER_*).
R2Status r2SoftBody_SetClusterEdgeSoftness (struct R2SoftBodyHandle handle, uint32_t cluster, const struct R2SpringCoefficients *softness)
 Override the softness of every structural or bending edge fully contained in a live cluster: regional stiffness for cloth and ropes.
R2Status r2SoftBody_ApplyImpulseAtPoint (struct R2SoftBodyHandle handle, struct R2Vector impulse, struct R2Vector point, R2Real falloff_radius, R2Bool wake_up)
 Apply a world-space impulse to every free particle within falloff_radius of the world-space point, scaled linearly from 1 at the point to 0 at that radius and divided by the particle's mass.
R2Status r2SoftBody_ApplyRadialImpulse (struct R2SoftBodyHandle handle, struct R2Vector center, R2Real magnitude, R2Real falloff_radius, R2Bool wake_up)
 Apply an impulse of the given magnitude pointing away from the world-space center to every free particle within falloff_radius, scaled linearly from 1 at the center to 0 at that radius and divided by the particle's mass.
R2Status r2SoftBody_ResetPlasticity (struct R2SoftBodyHandle handle)
 Undo every permanent (plastic) deformation: edge rest lengths, dihedral rest angles, cell rest shapes and particle rest positions return to their creation state.
R2Status r2SoftBody_TearEdge (struct R2SoftBodyHandle handle, size_t index)
 Mark the indexed edge as torn.
R2Status r2SoftBody_TearCell (struct R2SoftBodyHandle handle, size_t index)
 Mark the indexed cell as torn.
struct R2SoftBodyHandle r2Collider_SoftBody (struct R2ColliderHandle handle)
 Return the soft body owning this deformable collider (a soft-body collision mesh), or an invalid handle for any other collider.
struct R2SoftBodyHandle r2ReadCollider_SoftBody (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the soft body owning this deformable collider, or an invalid handle for any other collider.
size_t r2SoftBodyTearEvent_PieceCount (const struct R2SoftBodyTearEvent *event)
 Return the number of soft bodies the torn body is in after the tear: the length of r2SoftBodyTearEvent_Bodies, and the exclusive bound of the piece_index of r2SoftBodyTearEvent_PieceParticles.
R2Bool r2RecoveryAuthoredVelocityMargin (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::authoredVelocityMargin.
R2Bool r2RecoveryEdgeSpeculation (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::edgeSpeculation.
R2Bool r2RecoveryInvertedCellDetection (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::invertedCellDetection.
R2Bool r2RecoverySelfCrossingDetection (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::selfCrossingDetection.
R2Bool r2RecoveryDetectionMotionGating (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::detectionMotionGating.
R2Bool r2RecoveryCrossBodyDetection (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::crossBodyDetection.
R2Bool r2RecoverySelfStandDown (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::selfStandDown.
R2Bool r2RecoveryCrossBodyExpelGate (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::crossBodyExpelGate.
R2Bool r2RecoveryEdgeStandDown (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::edgeStandDown.
R2Bool r2RecoveryCrossingRepulsion (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::crossingRepulsion.
R2Bool r2RecoveryCrossingRepulsionGuide (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::crossingRepulsionGuide.
R2Bool r2RecoveryCrossingRepulsionSelfGuide (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::crossingRepulsionSelfGuide.
R2Real r2RecoveryRecoveryPace (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::recoveryPace.
R2Bool r2RecoveryOverlapConstraints (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::overlapConstraints.
R2Bool r2RecoveryOverlapRigid (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::overlapRigid.
R2Bool r2RecoveryOverlapSkipSelfTangled (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::overlapSkipSelfTangled.
R2Bool r2RecoveryOverlapEdgeStandDown (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::overlapEdgeStandDown.
R2Real r2RecoveryOverlapConstraintPace (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::overlapConstraintPace.
uint32_t r2RecoveryOverlapPatchConstraints (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::overlapPatchConstraints.
R2Status r2RecoverySetOverlapPatchConstraints (struct R2World *world, uint32_t value)
 Set the world setting documented by R2SoftRecoverySettings::overlapPatchConstraints.
R2Bool r2RecoveryOverlapSkinVolume (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::overlapSkinVolume.
R2Real r2RecoveryOverlapKeptDepth (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::overlapKeptDepth.
R2Bool r2RecoveryOverlapSelfRegions (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::overlapSelfRegions.
R2Bool r2RecoveryOverlapNormalPush (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::overlapNormalPush.
R2Bool r2RecoveryOverlapMultiVolume (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::overlapMultiVolume.
uint32_t r2RecoveryOverlapSplit (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::overlapSplit.
R2Status r2RecoverySetOverlapSplit (struct R2World *world, uint32_t value)
 Set the world setting documented by R2SoftRecoverySettings::overlapSplit.
uint32_t r2RecoveryOverlapPatience (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::overlapPatience.
R2Status r2RecoverySetOverlapPatience (struct R2World *world, uint32_t value)
 Set the world setting documented by R2SoftRecoverySettings::overlapPatience.
R2Real r2RecoveryOverlapProgressMargin (const struct R2World *world)
 Return the world setting documented by R2SoftRecoverySettings::overlapProgressMargin.
R2Real r2FemLinearTolerance (const struct R2World *world)
 Return the world setting documented by R2SoftFemParameters::linearTolerance.
size_t r2FemMaxLinearIterations (const struct R2World *world)
 Return the world setting documented by R2SoftFemParameters::maxLinearIterations.
size_t r2FemMaxDenseDofs (const struct R2World *world)
 Return the world setting documented by R2SoftFemParameters::maxDenseDofs.
size_t r2Collider_ShapeIdentity (struct R2ColliderHandle handle)
 Return a process-local geometry identity for caching, not a serializable ID.
size_t r2SoftBody_NumParticles (struct R2SoftBodyHandle handle)
 Return the soft body particle count.
uint32_t r2SoftBody_TopologyVersion (struct R2SoftBodyHandle handle)
 Return a counter that changes when particle connectivity changes; use it to invalidate mesh caches.
R2Real r2SoftBody_Mass (struct R2SoftBodyHandle handle)
 Return the soft body mass.
R2Real r2SoftBody_Volume (struct R2SoftBodyHandle handle)
 Return the soft body current volume.
R2Real r2SoftBody_RestVolume (struct R2SoftBodyHandle handle)
 Return the soft body undeformed volume.
R2Real r2SoftBody_VolumeFactor (struct R2SoftBodyHandle handle)
 Return the soft body target volume multiplier.
struct R2Vector r2SoftBody_CenterOfMass (struct R2SoftBodyHandle handle)
 Return the soft body world-space center of mass.
struct R2RigidBodyHandle r2SoftBody_RootBody (struct R2SoftBodyHandle handle)
 Return the soft body root rigid-proxy handle.
R2Bool r2SoftBody_IsEnabled (struct R2SoftBodyHandle handle)
 Return whether the soft body is enabled.
R2Bool r2SoftBody_IsSleeping (struct R2SoftBodyHandle handle)
 Return whether the soft body is sleeping.
size_t r2SoftBody_ParticleVelocities (struct R2SoftBodyHandle handle, struct R2Vector *buffer, size_t capacity)
 Copy world-space particle velocities.
size_t r2SoftBody_Edges (struct R2SoftBodyHandle handle, uint32_t *buffer, size_t capacity)
 Copy flattened edge vertex indices.
size_t r2SoftBody_Cells (struct R2SoftBodyHandle handle, uint32_t *buffer, size_t capacity)
 Copy flattened cell vertex indices.
size_t r2SoftBody_Boundary (struct R2SoftBodyHandle handle, uint32_t *buffer, size_t capacity)
 Copy flattened boundary element indices.
size_t r2SoftBody_Pieces (struct R2SoftBodyHandle handle, struct R2SoftBodyHandle *buffer, size_t capacity)
 Copy piece identifiers.
R2Status r2SoftBody_SetParticleVelocity (struct R2SoftBodyHandle handle, size_t index, struct R2Vector value)
 Set the soft body particle world-space velocity.
R2Status r2SoftBody_SetParticleKinematicTarget (struct R2SoftBodyHandle handle, size_t index, struct R2Vector value)
 Set the next world-space target position of a pinned particle.
R2Status r2SoftBody_SetParticlePinned (struct R2SoftBodyHandle handle, size_t index, R2Bool value)
 Enable or disable pinning the particle for the soft body.
R2Status r2SoftBody_ApplyParticleImpulse (struct R2SoftBodyHandle handle, size_t index, struct R2Vector value, R2Bool wake_up)
 Apply a world-space impulse to one particle.
R2Status r2SoftBody_AddForce (struct R2SoftBodyHandle handle, struct R2Vector value, R2Bool wake_up)
 Accumulate a world-space force; it persists until reset.
R2Status r2SoftBody_ApplyImpulse (struct R2SoftBodyHandle handle, struct R2Vector value, R2Bool wake_up)
 Add the same world-space velocity change to every free particle: the whole body is kicked at the same velocity, whatever the particle masses (the value is not divided by the mass).
R2Status r2SoftBody_ResetForces (struct R2SoftBodyHandle handle, R2Bool wake_up)
 Clear accumulated user forces.
R2Status r2SoftBody_SetEnabled (struct R2SoftBodyHandle handle, R2Bool value)
 Enable or disable the soft body.
R2Status r2SoftBody_SetVolumeFactor (struct R2SoftBodyHandle handle, R2Real value)
 Set the soft body target volume multiplier.
R2Status r2SoftBody_AttachParticle (struct R2SoftBodyHandle handle, size_t index, struct R2RigidBodyHandle rigid_body)
 Attach a particle to a rigid body by a two-way point-to-point constraint (unlike pinning).
R2Bool r2SoftBody_DetachParticle (struct R2SoftBodyHandle handle, size_t index)
 Detach a particle from every rigid body it was attached to with r2SoftBody_AttachParticle.
size_t r2SoftBody_Clusters (struct R2SoftBodyHandle handle, uint32_t *buffer, size_t capacity)
 Copy cluster indices.
struct R2RigidBodyHandle r2SoftBody_ClusterProxy (struct R2SoftBodyHandle handle, uint32_t cluster)
 Return the rigid proxy for the selected cluster.
size_t r2SoftBody_ClusterParticles (struct R2SoftBodyHandle handle, uint32_t cluster, uint32_t *buffer, size_t capacity)
 Copy particle indices for a cluster.
R2Status r2SoftBody_SetClusterPinned (struct R2SoftBodyHandle handle, uint32_t cluster, R2Bool value)
 Enable or disable pinning the cluster for the soft body.
R2Status r2SoftBody_SetClusterKinematicTarget (struct R2SoftBodyHandle handle, uint32_t cluster, struct R2Pose value)
 Set the next world-space target pose of a pinned cluster.
R2Status r2SoftBody_SetClusterShapeMatchingEnabled (struct R2SoftBodyHandle handle, uint32_t cluster, R2Bool value)
 Enable or disable using cluster shape matching for the soft body.
R2Status r2SoftBody_SetClusterStiffnessScale (struct R2SoftBodyHandle handle, uint32_t cluster, R2Real value)
 Scale the material stiffness (Young modulus) of every cell fully contained in a live cluster: regional materials without a separate body.
R2Status r2SoftBody_SetClusterTearResistance (struct R2SoftBodyHandle handle, uint32_t cluster, R2Real value)
 Set the soft body cluster tear-resistance multiplier.
size_t r2SoftBody_Meshes (struct R2SoftBodyHandle handle, struct R2SoftMeshInfo *buffer, size_t capacity)
 Copy collision mesh metadata.
size_t r2SoftBody_MeshVerticesById (struct R2SoftBodyHandle handle, struct R2SoftMeshId id, struct R2Vector *buffer, size_t capacity)
 Copy world-space vertices for a mesh ID.
size_t r2SoftBody_MeshIndicesById (struct R2SoftBodyHandle handle, struct R2SoftMeshId id, uint32_t *buffer, size_t capacity)
 Copy flattened indices for a mesh ID.
size_t r2SoftBody_MeshColliders (struct R2SoftBodyHandle handle, struct R2ColliderHandle *buffer, size_t capacity)
 Copy collision mesh collider handles.
size_t r2SoftBody_MeshVertices (struct R2SoftBodyHandle handle, struct R2ColliderHandle collider, struct R2Vector *buffer, size_t capacity)
 Copy world-space collision mesh vertices.
size_t r2SoftBody_MeshIndices (struct R2SoftBodyHandle handle, struct R2ColliderHandle collider, uint32_t *buffer, size_t capacity)
 Copy flattened collision mesh indices.
size_t r2SoftBody_MeshArity (struct R2SoftBodyHandle handle, struct R2ColliderHandle collider)
 Return indices per collision-mesh element (2 for segments, 3 for triangles).
uint32_t r2SoftBody_MeshTopologyVersion (struct R2SoftBodyHandle handle, struct R2ColliderHandle collider)
 Return the selected collision mesh topology revision for cache invalidation.
R2Status r2SoftBody_SetSolver (struct R2SoftBodyHandle handle, uint32_t solver)
 Set the soft body soft solver kind (R2_SOFT_SOLVER_*).
R2Status r2SoftBody_SetClusterShapeMatchingTarget (struct R2SoftBodyHandle handle, uint32_t cluster, const struct R2Pose *target)
 Set the soft body cluster shape-matching target pose.
R2Status r2SoftBody_SetEdgeTearResistance (struct R2SoftBodyHandle handle, size_t index, R2Real resistance)
 Set the soft body edge tear-resistance multiplier.
R2Bool r2SoftBody_MeshIsClosed (struct R2SoftBodyHandle handle, struct R2ColliderHandle collider)
 Return whether the selected collision mesh is closed.
R2Status r2RigidBody_SetAdditionalMassProperties (struct R2RigidBodyHandle handle, struct R2MassProperties properties, R2Bool wake_up)
 Set the rigid body local mass properties added to collider contributions.
R2Status r2RigidBody_RecomputeMassPropertiesFromColliders (struct R2RigidBodyHandle handle)
 Recompute body mass and inertia from attached colliders and additional mass properties.
R2Status r2Collider_SetMassProperties (struct R2ColliderHandle handle, struct R2MassProperties properties)
 Set the collider local mass properties.
struct R2MassProperties r2Collider_MassProperties (struct R2ColliderHandle handle)
 Return the collider local mass properties.
R2Status r2RigidBody_SetLockedAxes (struct R2RigidBodyHandle handle, uint8_t axes, R2Bool wake_up)
 Set the rigid body translation/rotation lock bitmask.
uint8_t r2RigidBody_LockedAxes (struct R2RigidBodyHandle handle)
 Return the rigid body translation/rotation lock bitmask.
R2Bool r2Collider_IsVoxels (struct R2ColliderHandle handle)
 Return whether the collider is a voxel shape.
struct R2VoxelQuery r2Collider_VoxelAtFlatId (struct R2ColliderHandle handle, uint32_t id)
 Return voxel information at a flat index; found = 0 if absent.
R2Status r2Collider_SetVoxel (struct R2ColliderHandle handle, struct R2VoxelKey key, R2Bool filled)
 Fill or clear the voxel at key; the collider must have a voxel shape.
struct R2Pose r2RigidBody_NextPosition (struct R2RigidBodyHandle handle)
 Return the rigid body next kinematic world-space pose.
struct R2Rotation r2RigidBody_Rotation (struct R2RigidBodyHandle handle)
 Return the rigid body world-space rotation.
struct R2Vector r2RigidBody_CenterOfMass (struct R2RigidBodyHandle handle)
 Return the rigid body world-space center of mass.
struct R2Vector r2RigidBody_LocalCenterOfMass (struct R2RigidBodyHandle handle)
 Return the rigid body body-local center of mass.
struct R2Vector r2RigidBody_UserForce (struct R2RigidBodyHandle handle)
 Return the rigid body accumulated user-applied world-space force.
R2AngVector r2RigidBody_UserTorque (struct R2RigidBodyHandle handle)
 Return the rigid body accumulated user-applied world-space torque.
uint32_t r2RigidBody_BodyType (struct R2RigidBodyHandle handle)
 Return the rigid body body type (R2_DYNAMIC, R2_FIXED, or a kinematic kind).
R2Real r2RigidBody_Mass (struct R2RigidBodyHandle handle)
 Return the rigid body mass.
R2Real r2RigidBody_GravityScale (struct R2RigidBodyHandle handle)
 Return the rigid body gravity multiplier.
R2Real r2RigidBody_LinearDamping (struct R2RigidBodyHandle handle)
 Return the rigid body linear damping coefficient.
R2Real r2RigidBody_AngularDamping (struct R2RigidBodyHandle handle)
 Return the rigid body angular damping coefficient.
R2Real r2RigidBody_KineticEnergy (struct R2RigidBodyHandle handle)
 Return the rigid body kinetic energy.
R2Real r2RigidBody_SoftCcdPrediction (struct R2RigidBodyHandle handle)
 Return the rigid body soft-CCD prediction distance.
R2Bool r2RigidBody_IsCcdEnabled (struct R2RigidBodyHandle handle)
 Return whether the rigid body is using continuous collision detection.
R2Bool r2RigidBody_IsDynamic (struct R2RigidBodyHandle handle)
 Return whether the rigid body is dynamic.
struct R2SoftBodyHandle r2RigidBody_SoftBody (struct R2RigidBodyHandle handle)
 Return the associated soft-body handle, or an invalid handle if this is not a soft proxy.
R2Bool r2RigidBody_IsSoftFrame (struct R2RigidBodyHandle handle)
 Return whether the rigid body is a soft-body proxy.
R2Bool r2RigidBody_IsFixed (struct R2RigidBodyHandle handle)
 Return whether the rigid body is fixed.
R2Bool r2RigidBody_IsKinematic (struct R2RigidBodyHandle handle)
 Return whether the rigid body is kinematic.
R2Bool r2RigidBody_IsMoving (struct R2RigidBodyHandle handle)
 Return whether the rigid body is moving.
R2Bool r2RigidBody_IsCcdActive (struct R2RigidBodyHandle handle)
 Return whether the rigid body is currently using CCD for its motion.
R2Status r2RigidBody_SetRotation (struct R2RigidBodyHandle handle, struct R2Rotation value, R2Bool wake_up)
 Set the rigid body world-space rotation.
R2Status r2RigidBody_SetBodyType (struct R2RigidBodyHandle handle, uint32_t value, R2Bool wake_up)
 Set the rigid body body type (R2_DYNAMIC, R2_FIXED, or a kinematic kind).
R2Status r2RigidBody_SetNextKinematicRotation (struct R2RigidBodyHandle handle, struct R2Rotation value)
 Set the rigid body next kinematic world-space rotation.
R2Status r2RigidBody_SetAdditionalMass (struct R2RigidBodyHandle handle, R2Real value, R2Bool wake_up)
 Set the rigid body mass added to collider contributions.
R2Status r2RigidBody_SetSoftCcdPrediction (struct R2RigidBodyHandle handle, R2Real value)
 Set the rigid body soft-CCD prediction distance.
R2Status r2RigidBody_SetCcdEnabled (struct R2RigidBodyHandle handle, R2Bool value)
 Enable or disable using continuous collision detection for the rigid body.
R2Status r2RigidBody_SetTranslationsLocked (struct R2RigidBodyHandle handle, R2Bool value, R2Bool wake_up)
 Enable or disable locking translation for the rigid body.
R2Status r2RigidBody_SetRotationsLocked (struct R2RigidBodyHandle handle, R2Bool value, R2Bool wake_up)
 Enable or disable locking rotation for the rigid body.
R2Status r2RigidBody_SetDominanceGroup (struct R2RigidBodyHandle handle, int8_t value)
 Set the rigid body signed dominance group.
R2Status r2RigidBody_SetAdditionalSolverIterations (struct R2RigidBodyHandle handle, size_t value)
 Set the rigid body additional solver iterations for connected bodies.
R2Status r2RigidBody_SetAdditionalPgsIterations (struct R2RigidBodyHandle handle, size_t value)
 Set the rigid body additional PGS iterations.
R2Status r2RigidBody_AddTorque (struct R2RigidBodyHandle handle, R2AngVector value, R2Bool wake_up)
 Accumulate a world-space torque; it persists until reset.
R2Status r2RigidBody_ApplyTorqueImpulse (struct R2RigidBodyHandle handle, R2AngVector value, R2Bool wake_up)
 Apply a world-space angular impulse.
R2Status r2RigidBody_AddForceAtPoint (struct R2RigidBodyHandle handle, struct R2Vector value, struct R2Vector point, R2Bool wake_up)
 Accumulate a world-space force applied at a world-space point.
R2Status r2RigidBody_ResetTorques (struct R2RigidBodyHandle handle, R2Bool wake_up)
 Clear accumulated user torques.
struct R2Vector r2RigidBody_VelocityAtPoint (struct R2RigidBodyHandle handle, struct R2Vector point)
 Return world-space velocity at a world-space point, including angular motion.
size_t r2RigidBody_Colliders (struct R2RigidBodyHandle handle, struct R2ColliderHandle *buffer, size_t capacity)
 Copy attached collider handles.
R2Status r2Collider_SetDensity (struct R2ColliderHandle handle, R2Real value)
 Set the collider mass per unit volume.
R2Status r2Collider_SetMass (struct R2ColliderHandle handle, R2Real value)
 Set the collider mass.
R2Status r2Collider_SetEnabled (struct R2ColliderHandle handle, R2Bool value)
 Enable or disable the collider.
R2Status r2Collider_SetSolverGroups (struct R2ColliderHandle handle, struct R2InteractionGroups value)
 Set the collider contact-force filtering groups.
R2Status r2Collider_SetFrictionCombineRule (struct R2ColliderHandle handle, uint32_t value)
 Set the collider friction combination rule (R2_COMBINE_*).
R2Status r2Collider_SetRestitutionCombineRule (struct R2ColliderHandle handle, uint32_t value)
 Set the collider restitution combination rule (R2_COMBINE_*).
R2Status r2Collider_SetContactSkin (struct R2ColliderHandle handle, R2Real value)
 Set the collider extra separation skin around the shape.
R2Status r2Collider_SetContactForceEventThreshold (struct R2ColliderHandle handle, R2Real value)
 Set the collider force threshold for contact-force events.
R2Status r2Collider_SetActiveEvents (struct R2ColliderHandle handle, uint32_t value)
 Set the collider event-generation bitmask (R2_COLLISION_EVENTS and R2_CONTACT_FORCE_EVENTS).
R2Status r2Collider_SetActiveHooks (struct R2ColliderHandle handle, uint32_t value)
 Set the collider physics-hook activation bitmask.
R2Status r2Collider_SetActiveCollisionTypes (struct R2ColliderHandle handle, uint16_t value)
 Set the collider body-type collision activation bitmask.
struct R2Rotation r2Collider_Rotation (struct R2ColliderHandle handle)
 Return the collider world-space rotation.
struct R2InteractionGroups r2Collider_CollisionGroups (struct R2ColliderHandle handle)
 Return the collider collision filtering groups.
struct R2InteractionGroups r2Collider_SolverGroups (struct R2ColliderHandle handle)
 Return the collider contact-force filtering groups.
struct R2UserData r2Collider_UserData (struct R2ColliderHandle handle)
 Return the collider application-owned 128-bit user value.
uint32_t r2Collider_ActiveEvents (struct R2ColliderHandle handle)
 Return the collider event-generation bitmask (R2_COLLISION_EVENTS and R2_CONTACT_FORCE_EVENTS).
R2Real r2Collider_Mass (struct R2ColliderHandle handle)
 Return the collider mass.
R2Real r2Collider_Density (struct R2ColliderHandle handle)
 Return the collider mass per unit volume.
R2Real r2Collider_Volume (struct R2ColliderHandle handle)
 Return the collider current volume.
R2Real r2Collider_ContactSkin (struct R2ColliderHandle handle)
 Return the collider extra separation skin around the shape.
R2Real r2Collider_ContactForceEventThreshold (struct R2ColliderHandle handle)
 Return the collider force threshold for contact-force events.
R2Bool r2Collider_IsEnabled (struct R2ColliderHandle handle)
 Return whether the collider is enabled.
struct R2Aabb r2Collider_ComputeAabb (struct R2ColliderHandle handle)
 Return the current world-space axis-aligned bounds.
R2SharedShape * r2Collider_CloneShape (struct R2ColliderHandle handle)
 Return an owned wrapper sharing the collider geometry.
R2Status r2Collider_SetShape (struct R2ColliderHandle handle, const R2SharedShape *shape)
 Replace collider geometry by sharing shape; the supplied wrapper is not consumed.
R2Status r2Collider_SetPositionWrtParent (struct R2ColliderHandle handle, struct R2Pose value)
 Set the collider pose relative to the parent rigid body.
R2Status r2RigidBody_ValidateHandle (struct R2RigidBodyHandle handle)
 Validate the index and generation in the live owning world.
R2Status r2Collider_ValidateHandle (struct R2ColliderHandle handle)
 Validate the index and generation in the live owning world.
R2Status r2SoftBody_ValidateHandle (struct R2SoftBodyHandle handle)
 Validate the index and generation in the live owning world.
R2Status r2JointDesc_SetLocalFrame1 (struct R2JointDesc *desc, struct R2Pose value)
 Set the joint desc joint frame relative to body 1.
R2Status r2ImpulseJoint_SetLocalFrame1 (struct R2ImpulseJointHandle handle, struct R2Pose value, R2Bool wake_up)
 Set the impulse joint joint frame relative to body 1.
R2Status r2JointDesc_SetLocalFrame2 (struct R2JointDesc *desc, struct R2Pose value)
 Set the joint desc joint frame relative to body 2.
R2Status r2ImpulseJoint_SetLocalFrame2 (struct R2ImpulseJointHandle handle, struct R2Pose value, R2Bool wake_up)
 Set the impulse joint joint frame relative to body 2.
R2Status r2JointDesc_SetLocalAnchor1 (struct R2JointDesc *desc, struct R2Vector value)
 Set the joint desc joint anchor relative to body 1.
R2Status r2ImpulseJoint_SetLocalAnchor1 (struct R2ImpulseJointHandle handle, struct R2Vector value, R2Bool wake_up)
 Set the impulse joint joint anchor relative to body 1.
R2Status r2JointDesc_SetLocalAnchor2 (struct R2JointDesc *desc, struct R2Vector value)
 Set the joint desc joint anchor relative to body 2.
R2Status r2ImpulseJoint_SetLocalAnchor2 (struct R2ImpulseJointHandle handle, struct R2Vector value, R2Bool wake_up)
 Set the impulse joint joint anchor relative to body 2.
R2Status r2JointDesc_SetContactsEnabled (struct R2JointDesc *desc, R2Bool value)
 Enable or disable allowing contacts between connected bodies for the joint desc.
R2Status r2ImpulseJoint_SetContactsEnabled (struct R2ImpulseJointHandle handle, R2Bool value, R2Bool wake_up)
 Enable or disable allowing contacts between connected bodies for the impulse joint.
R2Status r2JointDesc_SetEnabled (struct R2JointDesc *desc, R2Bool value)
 Enable or disable the joint desc.
R2Status r2ImpulseJoint_SetEnabled (struct R2ImpulseJointHandle handle, R2Bool value, R2Bool wake_up)
 Enable or disable the impulse joint.
R2Status r2JointDesc_SetSoftness (struct R2JointDesc *desc, struct R2SpringCoefficients value)
 Set the joint desc joint spring coefficients.
R2Status r2ImpulseJoint_SetSoftness (struct R2ImpulseJointHandle handle, struct R2SpringCoefficients value, R2Bool wake_up)
 Set the impulse joint joint spring coefficients.
R2Status r2JointDesc_SetLockedAxes (struct R2JointDesc *desc, uint8_t value)
 Set the joint desc translation/rotation lock bitmask.
R2Status r2ImpulseJoint_SetLockedAxes (struct R2ImpulseJointHandle handle, uint8_t value, R2Bool wake_up)
 Set the impulse joint translation/rotation lock bitmask.
R2Status r2JointDesc_SetLimitAxes (struct R2JointDesc *desc, uint8_t value)
 Set the joint desc joint axis mask with limits enabled.
R2Status r2ImpulseJoint_SetLimitAxes (struct R2ImpulseJointHandle handle, uint8_t value, R2Bool wake_up)
 Set the impulse joint joint axis mask with limits enabled.
R2Status r2JointDesc_SetMotorAxes (struct R2JointDesc *desc, uint8_t value)
 Set the joint desc joint axis mask with motors enabled.
R2Status r2ImpulseJoint_SetMotorAxes (struct R2ImpulseJointHandle handle, uint8_t value, R2Bool wake_up)
 Set the impulse joint joint axis mask with motors enabled.
R2Status r2JointDesc_SetCoupledAxes (struct R2JointDesc *desc, uint8_t value)
 Set the joint desc coupled joint axis mask.
R2Status r2ImpulseJoint_SetCoupledAxes (struct R2ImpulseJointHandle handle, uint8_t value, R2Bool wake_up)
 Set the impulse joint coupled joint axis mask.
R2Status r2JointDesc_SetLocalAxis1 (struct R2JointDesc *desc, struct R2Vector value)
 Set the joint desc joint principal axis in body 1 local coordinates.
R2Status r2ImpulseJoint_SetLocalAxis1 (struct R2ImpulseJointHandle handle, struct R2Vector value, R2Bool wake_up)
 Set the impulse joint joint principal axis in body 1 local coordinates.
R2Status r2JointDesc_SetLocalAxis2 (struct R2JointDesc *desc, struct R2Vector value)
 Set the joint desc joint principal axis in body 2 local coordinates.
R2Status r2ImpulseJoint_SetLocalAxis2 (struct R2ImpulseJointHandle handle, struct R2Vector value, R2Bool wake_up)
 Set the impulse joint joint principal axis in body 2 local coordinates.
R2Status r2JointDesc_SetLimits (struct R2JointDesc *desc, uint32_t joint_axis, R2Real min, R2Real max)
 Set the joint desc minimum and maximum limits on an axis (linear distance or angular radians).
R2Status r2ImpulseJoint_SetLimits (struct R2ImpulseJointHandle handle, uint32_t joint_axis, R2Real min, R2Real max, R2Bool wake_up)
 Set the impulse joint minimum and maximum limits on an axis (linear distance or angular radians).
R2Status r2JointDesc_SetMotor (struct R2JointDesc *desc, uint32_t joint_axis, R2Real target_position, R2Real target_velocity, R2Real stiffness, R2Real damping)
 Set the joint desc motor position/velocity targets and spring coefficients on an axis.
R2Status r2ImpulseJoint_SetMotor (struct R2ImpulseJointHandle handle, uint32_t joint_axis, R2Real target_position, R2Real target_velocity, R2Real stiffness, R2Real damping, R2Bool wake_up)
 Set the impulse joint motor position/velocity targets and spring coefficients on an axis.
R2Status r2JointDesc_SetMotorMaxForce (struct R2JointDesc *desc, uint32_t joint_axis, R2Real max_force)
 Set the joint desc maximum motor force or torque on an axis.
R2Status r2ImpulseJoint_SetMotorMaxForce (struct R2ImpulseJointHandle handle, uint32_t joint_axis, R2Real max_force, R2Bool wake_up)
 Set the impulse joint maximum motor force or torque on an axis.
R2Status r2JointDesc_SetMotorModel (struct R2JointDesc *desc, uint32_t joint_axis, uint32_t model)
 Set the joint desc motor model on an axis (0 = acceleration-based, 1 = force-based).
R2Status r2ImpulseJoint_SetMotorModel (struct R2ImpulseJointHandle handle, uint32_t joint_axis, uint32_t model, R2Bool wake_up)
 Set the impulse joint motor model on an axis (0 = acceleration-based, 1 = force-based).
R2Status r2JointDesc_SetUserData (struct R2JointDesc *desc, struct R2UserData value)
 Set the joint desc application-owned 128-bit user value.
R2Status r2ImpulseJoint_SetUserData (struct R2ImpulseJointHandle handle, struct R2UserData value, R2Bool wake_up)
 Set the impulse joint application-owned 128-bit user value.
R2Status r2JointDesc_SetMotorPosition (struct R2JointDesc *desc, uint32_t joint_axis, R2Real target_position, R2Real stiffness, R2Real damping)
 Set the joint desc motor position target and spring coefficients on an axis.
R2Status r2ImpulseJoint_SetMotorPosition (struct R2ImpulseJointHandle handle, uint32_t joint_axis, R2Real target_position, R2Real stiffness, R2Real damping, R2Bool wake_up)
 Set the impulse joint motor position target and spring coefficients on an axis.
R2Status r2JointDesc_SetMotorVelocity (struct R2JointDesc *desc, uint32_t joint_axis, R2Real target_velocity, R2Real factor)
 Set the joint desc motor velocity target and damping factor on an axis.
R2Status r2ImpulseJoint_SetMotorVelocity (struct R2ImpulseJointHandle handle, uint32_t joint_axis, R2Real target_velocity, R2Real factor, R2Bool wake_up)
 Set the impulse joint motor velocity target and damping factor on an axis.
struct R2JointImpulses r2ImpulseJoint_Impulses (struct R2ImpulseJointHandle handle)
 Return the impulses applied by the impulse joint during the last step.
struct R2UserData r2ImpulseJoint_UserData (struct R2ImpulseJointHandle handle)
 Return the impulse joint application-owned 128-bit user value.
size_t r2ImpulseJointCount (const struct R2World *world)
 Return the number of impulse joints in the world.
size_t r2MultibodyJointCount (const struct R2World *world)
 Return the number of multibody joints in the world, which is the number of handles copied by r2MultibodyJointHandles.
struct R2JointDesc r2MultibodyJoint_Desc (struct R2MultibodyJointHandle handle)
 Copies the multibody joint configuration without returning a borrowed joint pointer.
R2Status r2MultibodyJoint_SetDesc (struct R2MultibodyJointHandle handle, const struct R2JointDesc *desc, R2Bool wake_up)
 Replaces the multibody joint configuration after validation.
struct R2JointBodies r2MultibodyJoint_Bodies (struct R2MultibodyJointHandle handle)
 Return the two bodies connected by a multibody joint: its parent link, then its own link.
R2SharedShape * r2ConvexDecompositionSharedShape (struct R2VectorView vertices, R2SurfaceElementView indices)
 Create an owned compound shape by convex decomposition of the input surface.
R2SharedShape * r2VoxelsSharedShapeFromPoints (struct R2Vector voxel_size, struct R2VectorView points)
 Create an owned voxel shape by quantizing points with the supplied per-axis voxel size.
R2SharedShape * r2VoxelizedMeshSharedShape (struct R2VectorView vertices, R2SurfaceElementView indices, R2Real voxel_size)
 Create an owned voxel shape from a surface mesh with the supplied uniform voxel size.
R2SharedShape * r2ConvexHullSharedShape (struct R2VectorView vertices)
 Create an owned convex hull of the supplied vertices.
R2SharedShape * r2TrimeshSharedShape (struct R2VectorView vertices, struct R2TriangleView indices)
 Create an owned triangle mesh from vertices and triangle indices.
R2SharedShape * r2PolylineSharedShape (struct R2VectorView vertices, struct R2EdgeView indices)
 Create an owned polyline from vertices and edge indices.
R2SharedShape * r2OrientedPolylineSharedShape (struct R2VectorView vertices, struct R2EdgeView indices)
 Create an owned oriented 2D polyline from vertices and edge indices.
R2SharedShape * r2ConvexPolylineSharedShape (struct R2VectorView vertices)
 Create an owned convex polygon from vertices already ordered along its boundary.
R2SharedShape * r2RoundConvexHullSharedShape (struct R2VectorView vertices, R2Real border_radius)
 Create an owned round convex hull shape.
R2SharedShape * r2TrimeshSharedShapeWithFlags (struct R2VectorView vertices, struct R2TriangleView indices, uint32_t flags)
 Create an owned triangle mesh with the supplied TRIMESH_* processing flags.
struct R2World * r2NewWorld (void)
 Create an owned world.
R2Status r2FreeWorld (struct R2World *world)
 Free a world.
struct R2VelocityCorrection r2ReadPidController_RigidBodyCorrection (const struct R2ReadContext *context, struct R2PidController *controller, R2Real dt, struct R2RigidBodyHandle body, struct R2Pose target_pose, struct R2Vector target_linvel, R2AngVector target_angvel)
 Compute a velocity correction from callback-visible body state, updating the PID controller history.
struct R2VelocityCorrection r2ReadPdController_RigidBodyCorrection (const struct R2ReadContext *context, const struct R2PdController *controller, struct R2RigidBodyHandle body, struct R2Pose target_pose, struct R2Vector target_linvel, R2AngVector target_angvel)
 Compute a PD velocity correction from callback-visible body state.
size_t r2ReadRigidBodyCount (const struct R2ReadContext *context)
 Return the number of rigid body objects in the world.
size_t r2ReadRigidBodyHandles (const struct R2ReadContext *context, struct R2RigidBodyHandle *buffer, size_t capacity)
 Copy entity handles.
R2Bool r2ReadRigidBody_Contains (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Test whether the live world contains this rigid body handle.
size_t r2ReadColliderCount (const struct R2ReadContext *context)
 Return the number of collider objects in the world.
size_t r2ReadColliderHandles (const struct R2ReadContext *context, struct R2ColliderHandle *buffer, size_t capacity)
 Copy entity handles.
R2Bool r2ReadCollider_Contains (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Test whether the live world contains this collider handle.
size_t r2ReadCollider_ShapeIdentity (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return a process-local geometry identity for caching, not a serializable ID.
struct R2MassProperties r2ReadCollider_MassProperties (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider local mass properties.
uint8_t r2ReadRigidBody_LockedAxes (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body translation/rotation lock bitmask.
R2Bool r2ReadCollider_IsVoxels (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return whether the collider is a voxel shape.
struct R2VoxelQuery r2ReadCollider_VoxelAtFlatId (const struct R2ReadContext *context, struct R2ColliderHandle handle, uint32_t id)
 Return voxel information at a flat index; found = 0 if absent.
struct R2Pose r2ReadRigidBody_NextPosition (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body next kinematic world-space pose.
struct R2Rotation r2ReadRigidBody_Rotation (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body world-space rotation.
struct R2Vector r2ReadRigidBody_CenterOfMass (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body world-space center of mass.
struct R2Vector r2ReadRigidBody_LocalCenterOfMass (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body body-local center of mass.
struct R2Vector r2ReadRigidBody_UserForce (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body accumulated user-applied world-space force.
R2AngVector r2ReadRigidBody_UserTorque (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body accumulated user-applied world-space torque.
uint32_t r2ReadRigidBody_BodyType (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body body type (R2_DYNAMIC, R2_FIXED, or a kinematic kind).
R2Real r2ReadRigidBody_Mass (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body mass.
R2Real r2ReadRigidBody_GravityScale (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body gravity multiplier.
R2Real r2ReadRigidBody_LinearDamping (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body linear damping coefficient.
R2Real r2ReadRigidBody_AngularDamping (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body angular damping coefficient.
R2Real r2ReadRigidBody_KineticEnergy (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body kinetic energy.
R2Real r2ReadRigidBody_SoftCcdPrediction (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body soft-CCD prediction distance.
R2Bool r2ReadRigidBody_IsCcdEnabled (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return whether the rigid body is using continuous collision detection.
R2Bool r2ReadRigidBody_IsDynamic (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return whether the rigid body is dynamic.
struct R2SoftBodyHandle r2ReadRigidBody_SoftBody (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the associated soft-body handle, or an invalid handle if this is not a soft proxy.
R2Bool r2ReadRigidBody_IsSoftFrame (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return whether the rigid body is a soft-body proxy.
R2Bool r2ReadRigidBody_IsFixed (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return whether the rigid body is fixed.
R2Bool r2ReadRigidBody_IsKinematic (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return whether the rigid body is kinematic.
R2Bool r2ReadRigidBody_IsMoving (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return whether the rigid body is moving.
R2Bool r2ReadRigidBody_IsCcdActive (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return whether the rigid body is currently using CCD for its motion.
struct R2Vector r2ReadRigidBody_VelocityAtPoint (const struct R2ReadContext *context, struct R2RigidBodyHandle handle, struct R2Vector point)
 Return world-space velocity at a world-space point, including angular motion.
size_t r2ReadRigidBody_Colliders (const struct R2ReadContext *context, struct R2RigidBodyHandle handle, struct R2ColliderHandle *buffer, size_t capacity)
 Copy attached collider handles.
struct R2Rotation r2ReadCollider_Rotation (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider world-space rotation.
struct R2InteractionGroups r2ReadCollider_CollisionGroups (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider collision filtering groups.
struct R2InteractionGroups r2ReadCollider_SolverGroups (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider contact-force filtering groups.
struct R2UserData r2ReadCollider_UserData (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider application-owned 128-bit user value.
uint32_t r2ReadCollider_ActiveEvents (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider event-generation bitmask (R2_COLLISION_EVENTS and R2_CONTACT_FORCE_EVENTS).
R2Real r2ReadCollider_Mass (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider mass.
R2Real r2ReadCollider_Density (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider mass per unit volume.
R2Real r2ReadCollider_Volume (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider current volume.
R2Real r2ReadCollider_ContactSkin (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider extra separation skin around the shape.
R2Real r2ReadCollider_ContactForceEventThreshold (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider force threshold for contact-force events.
R2Bool r2ReadCollider_IsEnabled (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return whether the collider is enabled.
struct R2Aabb r2ReadCollider_ComputeAabb (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the current world-space axis-aligned bounds.
R2SharedShape * r2ReadCollider_CloneShape (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return an owned wrapper sharing the collider geometry.
R2Status r2ReadRigidBody_ValidateHandle (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Validate the index and generation in the live owning world.
R2Status r2ReadCollider_ValidateHandle (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Validate the index and generation in the live owning world.
struct R2Pose r2ReadRigidBody_Position (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body world-space pose.
struct R2Vector r2ReadRigidBody_Translation (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body world-space translation.
struct R2Vector r2ReadRigidBody_Linvel (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body world-space linear velocity.
R2AngVector r2ReadRigidBody_Angvel (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body world-space angular velocity (radians per second).
R2Bool r2ReadRigidBody_IsSleeping (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return whether the rigid body is sleeping.
R2Bool r2ReadRigidBody_IsEnabled (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return whether the rigid body is enabled.
struct R2UserData r2ReadRigidBody_UserData (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body application-owned 128-bit user value.
struct R2Pose r2ReadCollider_Position (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider world-space pose.
struct R2Vector r2ReadCollider_Translation (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider world-space translation.
R2Real r2ReadCollider_Friction (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider friction coefficient.
R2Real r2ReadCollider_Restitution (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider restitution coefficient.
R2Bool r2ReadCollider_IsSensor (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return whether the collider is a sensor (detects overlaps without contact forces).
struct R2RigidBodyHandle r2ReadCollider_Parent (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Read the parent body handle during a callback; a standalone collider returns an invalid handle with OK status.
size_t r2ReadRigidBodyReadStates (const struct R2ReadContext *context, const struct R2RigidBodyHandle *handles, size_t handle_count, struct R2RigidBodyState *states, size_t capacity)
 Copy callback-visible body states in the supplied handle order.
uint16_t r2ReadCollider_ActiveCollisionTypes (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider body-type collision activation bitmask (R2_COLLISION_TYPES_* bits).
uint32_t r2ReadCollider_ActiveHooks (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider physics-hook activation bitmask.
uint32_t r2ReadCollider_FrictionCombineRule (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider friction combination rule (R2_COMBINE_*).
uint32_t r2ReadCollider_RestitutionCombineRule (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider restitution combination rule (R2_COMBINE_*).
struct R2Pose r2ReadCollider_PositionWrtParent (const struct R2ReadContext *context, struct R2ColliderHandle handle)
 Return the collider pose relative to its parent rigid body, or its world-space pose if it has no parent.
int8_t r2ReadRigidBody_DominanceGroup (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body signed dominance group.
size_t r2ReadRigidBody_AdditionalSolverIterations (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body additional solver iterations for connected bodies.
size_t r2ReadRigidBody_AdditionalPgsIterations (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return the rigid body additional PGS iterations for connected bodies.
R2Bool r2ReadRigidBody_IsFastRotationAllowed (const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
 Return whether the rigid body may exceed the angular-velocity limit of its CCD.
size_t r2IntersectRay (const struct R2World *world, const struct R2QueryOptions *query_options, struct R2Vector origin, struct R2Vector direction, R2Real max_toi, R2Bool solid, struct R2RayHit *buffer, size_t capacity)
 Copy the hits of every collider intersected by the ray, in no particular order.
struct R2OptionalShapeCastHit r2TryCastShape (const struct R2World *world, const struct R2QueryOptions *query_options, struct R2Pose pose, struct R2Vector velocity, const R2SharedShape *shape, struct R2ShapeCastOptions options)
 Sweep shape from pose along velocity and return the first hit, with found = 0 on a miss (R2_OK).
struct R2OptionalPointProjection r2TryProjectPoint (const struct R2World *world, const struct R2QueryOptions *query_options, struct R2Vector point, R2Real max_distance, R2Bool solid)
 Return the closest surface projection within max_distance, with found = 0 if there is none (R2_OK).
struct R2Pose r2NonlinearRigidMotion_PositionAtTime (const struct R2NonlinearRigidMotion *motion, R2Real time)
 Return the world-space pose of the motion at the given time.
struct R2OptionalShapeCastHit r2TryCastShapeNonlinear (const struct R2World *world, const struct R2QueryOptions *query_options, const struct R2NonlinearRigidMotion *motion, const R2SharedShape *shape, R2Real start_time, R2Real end_time, R2Bool stop_at_penetration)
 Sweep shape along a rotating motion and return the first hit between start_time and end_time, with found = 0 on a miss (R2_OK).
struct R2OptionalContactPair r2TryContactPair (struct R2ColliderHandle collider1, struct R2ColliderHandle collider2)
 Return the narrow-phase contact pair for two colliders, with found = 0 if the broad phase found no potential contact between them (R2_OK).
struct R2IntersectionPair r2IntersectionPair (struct R2ColliderHandle collider1, struct R2ColliderHandle collider2)
 Return the intersection state of two colliders involving a sensor, or report R2_NOT_FOUND if the broad phase found no potential intersection.
struct R2OptionalIntersectionPair r2TryIntersectionPair (struct R2ColliderHandle collider1, struct R2ColliderHandle collider2)
 Return the intersection state of two colliders involving a sensor, with found = 0 if the broad phase found no potential intersection (R2_OK).
size_t r2Collider_ContactPairs (struct R2ColliderHandle handle, struct R2ContactPair *buffer, size_t capacity)
 Copy the narrow-phase contact pairs involving the collider, including pairs without active solver contacts.
size_t r2Collider_IntersectionPairs (struct R2ColliderHandle handle, struct R2IntersectionPair *buffer, size_t capacity)
 Copy the intersection pairs involving the collider, in the narrow-phase order.
size_t r2ContactManifolds (struct R2ColliderHandle collider1, struct R2ColliderHandle collider2, struct R2ContactManifold *buffer, size_t capacity)
 Copy the geometric contact manifolds of a contact pair, or report R2_NOT_FOUND without a pair.
size_t r2SolverContacts (struct R2ColliderHandle collider1, struct R2ColliderHandle collider2, size_t manifold_index, struct R2SolverContact *buffer, size_t capacity)
 Copy the solver contacts of one manifold of a contact pair, or report R2_NOT_FOUND without a pair.
R2Bool r2ContactModificationContext_IsSoft (const struct R2ContactModificationContext *context)
 Return whether the context holds the contact candidates of two soft surfaces rather than a manifold.
size_t r2ContactModificationContext_SolverContactCount (const struct R2ContactModificationContext *context)
 Return the number of solver contacts of the manifold; zero for a soft context.
struct R2SolverContact r2ContactModificationContext_SolverContact (const struct R2ContactModificationContext *context, size_t index)
 Return a solver contact of the manifold.
R2Status r2ContactModificationContext_SetSolverContact (struct R2ContactModificationContext *context, size_t index, const struct R2SolverContact *contact)
 Replace the points, distance and tangent velocity of a solver contact of the manifold.
R2Status r2ContactModificationContext_RemoveSolverContact (struct R2ContactModificationContext *context, size_t index)
 Remove a solver contact of the manifold.
R2Status r2EventCollector_SetCallbacks (struct R2EventCollector *events, const struct R2EventCallbacks *callbacks)
 Replace the callbacks invoked while stepping with this collector; NULL removes them.
struct R2DebugRenderStyle r2DefaultDebugRenderStyle (void)
 Return native default debug-render style.
size_t r2DebugRenderWithStyle (const struct R2World *world, uint32_t mode, const struct R2DebugRenderStyle *style, struct R2DebugLine *buffer, size_t capacity)
 Copy the debug-render lines of the world drawn with the given style.

Detailed Description

Rapier C ABI.

Select dimension and precision before including this file. Select one variant per translation unit; flags must match its linked library. Read README.md for ownership, pointer lifetime, callbacks and threading.

Macro Definition Documentation

◆ R2_DIMENSION

#define R2_DIMENSION   2

Spatial dimension selected by this header.

◆ RAPIER_CALL

#define RAPIER_CALL

C ABI calling convention.

◆ RAPIER_CONST

#define RAPIER_CONST ( name)
Value:
R2_##name

Select an R2/R3 public constant name.

Examples
falling_ball.c.

◆ RAPIER_FN

#define RAPIER_FN ( name)
Value:
r2##name

Select an r2/r3 public function name.

Examples
falling_ball.c.

◆ RAPIER_TYPE

#define RAPIER_TYPE ( name)
Value:
R2##name

Select an R2/R3 public type name.

Examples
falling_ball.c.