5#if !defined(RAPIER_DIM2) && !defined(RAPIER_DIM3)
8#if defined(RAPIER_DIM2) && defined(RAPIER_DIM3)
9#error Select exactly one Rapier dimension
11#if !defined(RAPIER_F32) && !defined(RAPIER_F64)
14#if defined(RAPIER_F32) && defined(RAPIER_F64)
15#error Select exactly one Rapier precision
17#if defined(RAPIER_DIM2)
21#define RAPIER_TYPE(name) R2##name
23#define RAPIER_CONST(name) R2_##name
25#define RAPIER_FN(name) r2##name
30#define RAPIER_TYPE(name) R3##name
32#define RAPIER_CONST(name) R3_##name
34#define RAPIER_FN(name) r3##name
38#define RAPIER_CALL __cdecl
44#if defined(_WIN32) && !defined(RAPIER_STATIC)
46#define RAPIER_API __declspec(dllimport)
65#if defined(RAPIER_DIM2)
67#if defined(RAPIER_DIM3)
73#define R2_FRICTION_MODEL_SIMPLIFIED 0
76#if defined(RAPIER_DIM3)
81#define R2_FRICTION_MODEL_COULOMB 1
84#if defined(RAPIER_DIM2)
89#define R2_JOINT_DOF_COUNT 3
92#if defined(RAPIER_DIM3)
97#define R2_JOINT_DOF_COUNT 6
104#define R2_SOFT_DESC_PARTICLES 0
110#define R2_SOFT_DESC_ROPE 1
116#define R2_SOFT_DESC_GRID 2
122#define R2_SOFT_DESC_CLOTH 3
128#define R2_SOFT_DESC_CUBOID 4
134#define R2_SOFT_DESC_SURFACE 5
140#define R2_SOFT_DESC_DISK 6
146#define R2_SOFT_DESC_SPHERE 7
152#define R2_SOFT_DESC_CLOTH_TUBE 8
158#define R2_SOFT_DESC_VOLUMETRIC 9
160#if defined(RAPIER_DIM2)
165#define R2_SOFT_DESC_POLYGON 10
168#if defined(RAPIER_DIM2)
173#define R2_SOFT_DESC_TRIMESH 11
176#if defined(RAPIER_DIM3)
181#define R2_SOFT_DESC_CLOTH_ANISOTROPIC 12
188#define R2_SOFT_BINDING_SKINNED 0
194#define R2_SOFT_BINDING_DIRECT 1
200#define R2_SOFT_BINDING_DIRECT_BY_POSITION 2
202#if defined(RAPIER_DIM2)
207#define R2_POLYLINE_ORIENTED 1
214#define R2_POLYLINE_DEFORMABLE 2
220#define R2_SHAPE_DESC_BALL 0
226#define R2_SHAPE_DESC_CUBOID 1
232#define R2_SHAPE_DESC_ROUND_CUBOID 2
238#define R2_SHAPE_DESC_CAPSULE 3
244#define R2_SHAPE_DESC_SEGMENT 4
250#define R2_SHAPE_DESC_TRIANGLE 5
256#define R2_SHAPE_DESC_HALFSPACE 6
262#define R2_SHAPE_DESC_CONVEX_HULL 7
268#define R2_SHAPE_DESC_TRIMESH 8
274#define R2_SHAPE_DESC_POLYLINE 9
280#define R2_SHAPE_DESC_SHARED 10
286#define R2_SHAPE_DESC_HEIGHTFIELD 11
292#define R2_SHAPE_DESC_CYLINDER 12
298#define R2_SHAPE_DESC_CONE 13
304#define R2_SHAPE_DESC_COMPOUND 14
310#define R2_SHAPE_DESC_ROUND_CYLINDER 15
316#define R2_SHAPE_DESC_ROUND_CONE 16
322#define R2_MASS_DENSITY 0
328#define R2_MASS_TOTAL 1
334#define R2_MASS_PROPERTIES 2
340#define R2_ABI_VERSION 1
358#define R2_KINEMATIC_POSITION_BASED 2
364#define R2_KINEMATIC_VELOCITY_BASED 3
370#define R2_COLLISION_EVENTS 1
376#define R2_CONTACT_FORCE_EVENTS 2
382#define R2_COMBINE_AVERAGE 0
388#define R2_COMBINE_MIN 1
394#define R2_COMBINE_MULTIPLY 2
400#define R2_COMBINE_MAX 3
406#define R2_COMBINE_CLAMPED_SUM 4
412#define R2_COMBINE_GEOMETRIC_MEAN 5
418#define R2_COLLISION_TYPES_DYNAMIC_DYNAMIC 1
424#define R2_COLLISION_TYPES_DYNAMIC_KINEMATIC 12
430#define R2_COLLISION_TYPES_DYNAMIC_FIXED 2
436#define R2_COLLISION_TYPES_KINEMATIC_KINEMATIC 52224
442#define R2_COLLISION_TYPES_KINEMATIC_FIXED 8704
448#define R2_COLLISION_TYPES_FIXED_FIXED 32
454#define R2_COLLISION_TYPES_DEFAULT 15
460#define R2_FILTER_CONTACT_PAIRS 1
466#define R2_FILTER_INTERSECTION_PAIR 2
472#define R2_MODIFY_SOLVER_CONTACTS 4
478#define R2_QUERY_EXCLUDE_FIXED 1
484#define R2_QUERY_EXCLUDE_KINEMATIC 2
490#define R2_QUERY_EXCLUDE_DYNAMIC 4
496#define R2_QUERY_EXCLUDE_SENSORS 8
502#define R2_QUERY_EXCLUDE_SOLIDS 16
508#define R2_QUERY_ONLY_DYNAMIC 3
514#define R2_QUERY_ONLY_KINEMATIC 5
520#define R2_QUERY_ONLY_FIXED 6
526#define R2_DEBUG_COLLIDER_SHAPES 1
532#define R2_DEBUG_RIGID_BODY_AXES 2
538#define R2_DEBUG_MULTIBODY_JOINTS 4
544#define R2_DEBUG_IMPULSE_JOINTS 8
550#define R2_DEBUG_SOLVER_CONTACTS 16
556#define R2_DEBUG_CONTACTS 32
562#define R2_DEBUG_COLLIDER_AABBS 64
568#define R2_DEBUG_SOFT_BODIES 128
574#define R2_DEBUG_PSEUDO_NORMALS 256
580#define R2_DEBUG_SOFT_VOLUME_CONTACTS 512
586#define R2_DEBUG_SOFT_BODY_STRESS 1024
592#define R2_GROUPS_AND 0
598#define R2_GROUPS_OR 1
604#define R2_MOTOR_ACCELERATION_BASED 0
610#define R2_MOTOR_FORCE_BASED 1
616#define R2_SOFT_CELL_VOLUME 0
622#define R2_SOFT_CELL_COROTATIONAL 1
628#define R2_SOFT_CELL_NEO_HOOKEAN 2
634#define R2_SOFT_SOLVER_CONSTRAINTS 0
640#define R2_SOFT_SOLVER_FEM 1
646#define R2_SOFT_EDGE_PLASTIC_FLOW_BOTH 0
652#define R2_SOFT_EDGE_PLASTIC_FLOW_COMPRESSION 1
658#define R2_SOFT_EDGE_PLASTIC_FLOW_TENSION 2
664#define R2_SOFT_PATCH_CONSTRAINTS_KEEP 0
670#define R2_SOFT_PATCH_CONSTRAINTS_STAND_DOWN 1
676#define R2_SOFT_PATCH_CONSTRAINTS_ALONG_NORMAL 2
682#define R2_AXIS_LIN_X 0
688#define R2_AXIS_LIN_Y 1
694#define R2_LOCK_TRANSLATION_X 1
700#define R2_LOCK_TRANSLATION_Y 2
706#define R2_LOCK_TRANSLATION_Z 4
712#define R2_LOCK_ROTATION_X 8
718#define R2_LOCK_ROTATION_Y 16
724#define R2_LOCK_ROTATION_Z 32
726#if defined(RAPIER_DIM2)
731#define R2_AXIS_ANG_X 2
734#if defined(RAPIER_DIM3)
739#define R2_AXIS_ANG_X 3
742#if defined(RAPIER_DIM2)
747#define R2_JOINT_FIXED_AXES 7
750#if defined(RAPIER_DIM3)
755#define R2_JOINT_FIXED_AXES 63
758#if defined(RAPIER_DIM2)
763#define R2_JOINT_REVOLUTE_AXES 3
766#if defined(RAPIER_DIM3)
771#define R2_JOINT_REVOLUTE_AXES 55
774#if defined(RAPIER_DIM2)
779#define R2_JOINT_PRISMATIC_AXES 6
782#if defined(RAPIER_DIM3)
787#define R2_JOINT_PRISMATIC_AXES 62
790#if defined(RAPIER_DIM3)
795#define R2_AXIS_LIN_Z 2
798#if defined(RAPIER_DIM3)
803#define R2_AXIS_ANG_Y 4
806#if defined(RAPIER_DIM3)
811#define R2_AXIS_ANG_Z 5
814#if defined(RAPIER_DIM3)
819#define R2_JOINT_SPHERICAL_AXES 7
826#define R2_SOFT_FRAME 4
832#define R2_SHAPE_CAST_OUT_OF_ITERATIONS 0
838#define R2_SHAPE_CAST_CONVERGED 1
844#define R2_SHAPE_CAST_FAILED 2
850#define R2_SHAPE_CAST_PENETRATING 3
856#define R2_FEATURE_UNKNOWN 0
862#define R2_FEATURE_VERTEX 1
868#define R2_FEATURE_EDGE 2
874#define R2_FEATURE_FACE 3
880#define R2_MULTIBODY_JOINTS_ARE_KINEMATIC 1
886#define R2_MULTIBODY_DISABLE_SELF_CONTACTS 2
893#define R2_MULTIBODY_SKIP_LOOP_CLOSURES 4
899#define R2_MULTIBODY_SKIP_JOINT_MOTORS 8
905#define R2_MULTIBODY_SKIP_JOINT_LIMITS 16
911#define R2_MULTIBODY_SKIP_JOINT_SPRINGS 32
917#define R2_TRIMESH_HALF_EDGE_TOPOLOGY 1
923#define R2_TRIMESH_CONNECTED_COMPONENTS 2
929#define R2_TRIMESH_DELETE_BAD_TOPOLOGY_TRIANGLES 4
935#define R2_TRIMESH_ORIENTED 8
941#define R2_TRIMESH_MERGE_DUPLICATE_VERTICES 16
947#define R2_TRIMESH_DELETE_DEGENERATE_TRIANGLES 32
953#define R2_TRIMESH_DELETE_DUPLICATE_TRIANGLES 64
959#define R2_TRIMESH_FIX_INTERNAL_EDGES 144
965#define R2_TRIMESH_DEFORMABLE 256
971#define R2_TRIMESH_FIX_INTERNAL_EDGES_TWO_SIDED 656
977#define R2_HEIGHTFIELD_FIX_INTERNAL_EDGES 1
983#define R2_AXES_MASK_LIN_X 1
989#define R2_AXES_MASK_LIN_Y 2
991#if defined(RAPIER_DIM3)
996#define R2_AXES_MASK_LIN_Z 4
999#if defined(RAPIER_DIM3)
1004#define R2_AXES_MASK_ANG_X 8
1007#if defined(RAPIER_DIM3)
1012#define R2_AXES_MASK_ANG_Y 16
1019#define R2_AXES_MASK_ANG_Z 32
1025#define R2_ABI_FEATURE_FEM 1
1031#define R2_ABI_FEATURE_ROBOTICS 2
1033#if (defined(RAPIER_FEM) && defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1038#define R2_ABI_FEATURES 3
1041#if (defined(RAPIER_FEM) && !(defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32)))
1046#define R2_ABI_FEATURES 1
1049#if (!defined(RAPIER_FEM) && defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1054#define R2_ABI_FEATURES 2
1057#if (!defined(RAPIER_FEM) && !(defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32)))
1062#define R2_ABI_FEATURES 0
1065#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1070#define R2_MESH_CONVERTER_TRIMESH 0
1073#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1078#define R2_MESH_CONVERTER_OBB 1
1081#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1086#define R2_MESH_CONVERTER_AABB 2
1089#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1094#define R2_MESH_CONVERTER_CONVEX_HULL 3
1097#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1102#define R2_MESH_CONVERTER_CONVEX_DECOMPOSITION 4
1109#define R2_COLLISION_EVENT_SENSOR 1
1115#define R2_COLLISION_EVENT_REMOVED 2
1129#if defined(RAPIER_DIM3)
1134typedef struct R2DynamicRayCastVehicleController R2DynamicRayCastVehicleController;
1153#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1159typedef struct R2LoadedMeshes R2LoadedMeshes;
1162#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1168typedef struct R2MjcfContactHooks R2MjcfContactHooks;
1171#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1176typedef struct R2MjcfRobot R2MjcfRobot;
1179#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1185typedef struct R2MjcfRobotHandles R2MjcfRobotHandles;
1216#if defined(RAPIER_DIM3)
1221typedef struct R2TriMeshData R2TriMeshData;
1224#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1230typedef struct R2UrdfRobot R2UrdfRobot;
1233#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1239typedef struct R2UrdfRobotHandles R2UrdfRobotHandles;
1250#if defined(RAPIER_F32)
1258#if defined(RAPIER_F64)
1524#if defined(RAPIER_FEM)
1566#if defined(RAPIER_FEM)
1659#if defined(RAPIER_DIM3)
1663 uint32_t frictionModel;
1686#if defined(RAPIER_DIM3)
1699#if defined(RAPIER_DIM2)
1705#if defined(RAPIER_DIM3)
1711#if defined(RAPIER_DIM3)
1717#if defined(RAPIER_DIM3)
1723#if defined(RAPIER_DIM3)
1936#if defined(RAPIER_DIM2)
1942#if defined(RAPIER_DIM3)
1948#if defined(RAPIER_DIM3)
1952 uint32_t cover_smoothing;
1954#if defined(RAPIER_DIM3)
1960#if defined(RAPIER_DIM3)
1964 uint32_t cover_subdivisions;
2193#if defined(RAPIER_DIM2)
2201#if defined(RAPIER_DIM3)
2209#if defined(RAPIER_DIM2)
2217#if defined(RAPIER_DIM3)
2415#if defined(RAPIER_DIM2)
2423#if defined(RAPIER_DIM3)
2449#if defined(RAPIER_DIM3)
2453 struct R2Rotation principal_inertia_local_frame;
2594#if defined(RAPIER_DIM3)
2600#if defined(RAPIER_DIM3)
2606#if defined(RAPIER_DIM3)
2684#if defined(RAPIER_DIM3)
2690#if defined(RAPIER_DIM3)
3409#if defined(RAPIER_DIM3)
3414typedef struct R2WheelTuning {
3418 R2Real suspension_stiffness;
3422 R2Real suspension_compression;
3426 R2Real suspension_damping;
3430 R2Real max_suspension_travel;
3438 R2Real max_suspension_force;
3442 R2Real side_friction_stiffness;
3446#if defined(RAPIER_DIM3)
3451typedef struct R2WheelState {
3475 R2Real suspension_length;
3962#if defined(RAPIER_DIM2)
3968#if defined(RAPIER_DIM3)
3976#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
3982typedef struct R2UrdfLoaderOptions {
3986 R2Bool createCollidersFromCollisionShapes;
3990 R2Bool createCollidersFromVisualShapes;
3994 R2Bool applyImportedMassProps;
3998 R2Bool enableJointCollisions;
4006 R2Bool squeezeEmptyFixedLinks;
4023} R2UrdfLoaderOptions;
4026#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
4032typedef struct R2MjcfLoaderOptions {
4036 R2Bool createCollidersFromCollisionShapes;
4040 R2Bool createCollidersFromVisualShapes;
4044 R2Bool applyImportedMassProps;
4048 R2Bool enableJointCollisions;
4060 R2Bool disableJointMotors;
4077} R2MjcfLoaderOptions;
4080#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
4085typedef struct R2MjcfVisualMesh R2MjcfVisualMesh;
4088#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
4093typedef struct R2RenderMaterial {
4113#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
4118typedef struct R2MjcfVisualMeshInfo {
4122 struct R2Pose local_pose;
4130 struct R2RenderMaterial material;
4143} R2MjcfVisualMeshInfo;
4219#if defined(RAPIER_F32)
4227#if defined(RAPIER_F64)
4248#if defined(RAPIER_DIM3)
4459 size_t contact_count);
4618#define R2_NULL_POINTER 1
4624#define R2_INVALID_ARGUMENT 2
4630#define R2_INVALID_HANDLE 3
4636#define R2_BUFFER_TOO_SMALL 4
4642#define R2_UNSUPPORTED 5
4654#define R2_NOT_FOUND 7
4660#define R2_WORLD_BUSY 8
4678#if defined(RAPIER_FEM)
4724#if defined(RAPIER_DIM2)
4732#if defined(RAPIER_DIM3)
4761#if defined(RAPIER_DIM3)
4769#if defined(RAPIER_DIM2)
5100 R2Bool include_dynamic_bodies);
5163 struct
R2Vector desired_translation);
5253 struct
R2Pose target_pose,
5265 struct
R2Pose target_pose,
5276#if defined(RAPIER_DIM3)
5281RAPIER_API
struct R2WheelTuning
RAPIER_CALL r2DefaultWheelTuning(void);
5284#if defined(RAPIER_DIM3)
5294#if defined(RAPIER_DIM3)
5301R2Status RAPIER_CALL r2FreeDynamicRayCastVehicleController(
struct R2DynamicRayCastVehicleController *controller);
5304#if defined(RAPIER_DIM3)
5311size_t RAPIER_CALL r2DynamicRayCastVehicleController_AddWheel(
struct R2DynamicRayCastVehicleController *controller,
5317 const struct R2WheelTuning *tuning);
5320#if defined(RAPIER_DIM3)
5326R2Status RAPIER_CALL r2DynamicRayCastVehicleController_SetAxes(
struct R2DynamicRayCastVehicleController *controller,
5331#if defined(RAPIER_DIM3)
5337R2Status RAPIER_CALL r2DynamicRayCastVehicleController_SetWheelControls(
struct R2DynamicRayCastVehicleController *controller,
5344#if defined(RAPIER_DIM3)
5354R2Status RAPIER_CALL r2DynamicRayCastVehicleController_UpdateVehicle(
struct R2DynamicRayCastVehicleController *controller,
5359#if defined(RAPIER_DIM3)
5365R2Real RAPIER_CALL r2DynamicRayCastVehicleController_CurrentVehicleSpeed(
const struct R2DynamicRayCastVehicleController *controller);
5368#if defined(RAPIER_DIM3)
5375size_t RAPIER_CALL r2DynamicRayCastVehicleController_Wheels(
const struct R2DynamicRayCastVehicleController *controller,
5376 struct R2WheelState *buffer,
5478#if defined(RAPIER_DIM3)
5486#if defined(RAPIER_DIM3)
5580 const R2Real *displacements,
5673 R2Bool remove_attached_colliders);
6261#if defined(RAPIER_FEM)
6269#if defined(RAPIER_FEM)
6277#if defined(RAPIER_FEM)
6482 const uint32_t *edges,
6484 const uint32_t *cells,
6493 const uint32_t *particles,
6713#if defined(RAPIER_DIM3)
6721#if defined(RAPIER_DIM3)
6792 uint32_t subdivisions);
6821#if defined(RAPIER_DIM3)
6832#if defined(RAPIER_DIM3)
6843#if defined(RAPIER_DIM3)
6857#if defined(RAPIER_DIM3)
6864size_t RAPIER_CALL r2TriMeshData_Vertices(
const struct R2TriMeshData *mesh,
6869#if defined(RAPIER_DIM3)
6876size_t RAPIER_CALL r2TriMeshData_Indices(
const struct R2TriMeshData *mesh,
6881#if defined(RAPIER_DIM3)
6890#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6895RAPIER_API
struct R2UrdfLoaderOptions
RAPIER_CALL r2DefaultUrdfLoaderOptions(void);
6898#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6907#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6914struct R2UrdfRobot *
RAPIER_CALL r2UrdfRobotFromFile(
const char *path,
6915 const struct R2UrdfLoaderOptions *options);
6918#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6925 struct R2Pose transform);
6928#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6934RAPIER_API
R2Status RAPIER_CALL r2FreeUrdfRobotHandles(
struct R2UrdfRobotHandles *handles);
6937#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6943struct R2UrdfRobotHandles *
RAPIER_CALL r2UrdfRobot_InsertUsingImpulseJoints(
struct R2World *world,
6944 const struct R2UrdfRobot *robot);
6947#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6953struct R2UrdfRobotHandles *
RAPIER_CALL r2UrdfRobot_InsertUsingMultibodyJoints(
struct R2World *world,
6954 const struct R2UrdfRobot *robot,
6958#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6966size_t RAPIER_CALL r2UrdfRobotHandles_Bodies(
const struct R2UrdfRobotHandles *handles,
6971#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6976RAPIER_API
struct R2MjcfLoaderOptions
RAPIER_CALL r2DefaultMjcfLoaderOptions(void);
6979#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6988#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6995struct R2MjcfRobot *
RAPIER_CALL r2MjcfRobotFromFile(
const char *path,
6996 const struct R2MjcfLoaderOptions *options);
6999#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7006 struct R2Pose transform);
7009#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7015RAPIER_API
R2Status RAPIER_CALL r2FreeMjcfRobotHandles(
struct R2MjcfRobotHandles *handles);
7018#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7024struct R2MjcfRobotHandles *
RAPIER_CALL r2MjcfRobot_InsertUsingImpulseJoints(
struct R2World *world,
7025 const struct R2MjcfRobot *robot);
7028#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7034struct R2MjcfRobotHandles *
RAPIER_CALL r2MjcfRobot_InsertUsingMultibodyJoints(
struct R2World *world,
7035 const struct R2MjcfRobot *robot,
7039#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7046size_t RAPIER_CALL r2MjcfRobotHandles_Bodies(
const struct R2MjcfRobotHandles *handles,
7051#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7056RAPIER_API
struct R2Vector RAPIER_CALL r2MjcfRobot_Gravity(const struct R2MjcfRobot *robot);
7059#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7064RAPIER_API
size_t RAPIER_CALL r2MjcfRobot_BodyCount(
const struct R2MjcfRobot *robot);
7067#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7072RAPIER_API
size_t RAPIER_CALL r2MjcfRobot_BodyColliderCount(
const struct R2MjcfRobot *robot,
size_t body);
7075#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7087#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7092RAPIER_API
size_t RAPIER_CALL r2MjcfRobot_KeyframeCount(
const struct R2MjcfRobot *robot);
7095#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7102size_t RAPIER_CALL r2MjcfRobot_KeyframeName(
const struct R2MjcfRobot *robot,
7108#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7115 const struct R2MjcfRobot *source,
7119#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7126size_t RAPIER_CALL r2MjcfRobot_KeyframeControls(
const struct R2MjcfRobot *robot,
7132#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7137RAPIER_API
size_t RAPIER_CALL r2MjcfRobotHandles_ActuatorCount(
const struct R2MjcfRobotHandles *handles);
7140#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7146R2Status RAPIER_CALL r2MjcfRobotHandles_ApplyKeyframe(
const struct R2MjcfRobotHandles *handles,
7147 const struct R2MjcfRobot *robot,
7151#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7157R2Status RAPIER_CALL r2MjcfRobotHandles_ApplyControlsScaled(
const struct R2MjcfRobotHandles *handles,
7163#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7168RAPIER_API
size_t RAPIER_CALL r2MjcfRobot_BodyVisualCount(
const struct R2MjcfRobot *robot,
size_t body);
7171#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7178const R2MjcfVisualMesh *
RAPIER_CALL r2MjcfRobot_BodyVisual(
const struct R2MjcfRobot *robot,
7183#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7188RAPIER_API
struct R2MjcfVisualMeshInfo
RAPIER_CALL r2MjcfVisualMesh_Info(const R2MjcfVisualMesh *visual);
7191#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7200#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7207size_t RAPIER_CALL r2MjcfVisualMesh_Uvs(
const R2MjcfVisualMesh *visual,
7212#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7219size_t RAPIER_CALL r2MjcfVisualMesh_Normals(
const R2MjcfVisualMesh *visual,
7224#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7231size_t RAPIER_CALL r2MjcfVisualMesh_Texture(
const R2MjcfVisualMesh *visual,
7236#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7244struct R2UrdfRobot *
RAPIER_CALL r2UrdfRobotFromString(
const char *urdf,
7245 const char *mesh_dir,
7246 const struct R2UrdfLoaderOptions *options);
7249#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7258#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7265struct R2MjcfContactHooks *
RAPIER_CALL r2MjcfRobotHandles_ContactHooks(
const struct R2MjcfRobotHandles *handles,
7266 const struct R2MjcfRobot *robot);
7269#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7280#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7289#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7298struct R2LoadedMeshes *
RAPIER_CALL r2LoadedMeshesFromFile(
const char *path,
7300 uint32_t trimesh_flags,
7304#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7309RAPIER_API
size_t RAPIER_CALL r2LoadedMeshes_Count(
const struct R2LoadedMeshes *meshes);
7312#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7324#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7331struct R2Pose RAPIER_CALL r2LoadedMeshes_Pose(const struct R2LoadedMeshes *meshes,
7666 size_t handle_count,
7808#if defined(RAPIER_DIM2)
7925#if defined(RAPIER_DIM3)
7938#if defined(RAPIER_DIM3)
7994#if defined(RAPIER_DIM3)
8003#if defined(RAPIER_DIM3)
8012#if defined(RAPIER_DIM3)
8024#if defined(RAPIER_DIM3)
8050#if defined(RAPIER_DIM3)
8069#if defined(RAPIER_DIM2)
8082#if defined(RAPIER_DIM3)
8096#if defined(RAPIER_DIM3)
8110#if defined(RAPIER_DIM3)
8129#if defined(RAPIER_DIM2)
8140#if defined(RAPIER_DIM2)
8153#if defined(RAPIER_DIM3)
8162 uint32_t subdivisions);
8165#if defined(RAPIER_DIM3)
8502#if defined(RAPIER_FEM)
8510#if defined(RAPIER_FEM)
8518#if defined(RAPIER_FEM)
8899#if defined(RAPIER_FEM)
8914 const struct R2Pose *target);
9285#if defined(RAPIER_DIM3)
9293#if defined(RAPIER_DIM3)
9726 uint32_t joint_axis,
9738 uint32_t joint_axis,
9749 uint32_t joint_axis,
9762 uint32_t joint_axis,
9775 uint32_t joint_axis,
9785 uint32_t joint_axis,
9795 uint32_t joint_axis,
9805 uint32_t joint_axis,
9833 uint32_t joint_axis,
9845 uint32_t joint_axis,
9857 uint32_t joint_axis,
9868 uint32_t joint_axis,
9960#if defined(RAPIER_DIM3)
9992#if defined(RAPIER_DIM2)
10004#if defined(RAPIER_DIM2)
10057 struct
R2Pose target_pose,
10070 struct
R2Pose target_pose,
10384#if defined(RAPIER_DIM3)
10656 size_t handle_count,
10815 R2Bool stop_at_penetration);
10890 size_t manifold_index,
10969#if defined(RAPIER_DIM3)
10975#define R3_FRICTION_MODEL_SIMPLIFIED 0
10978#if defined(RAPIER_DIM3)
10983#define R3_FRICTION_MODEL_COULOMB 1
10986#if defined(RAPIER_DIM2)
10991#define R3_JOINT_DOF_COUNT 3
10994#if defined(RAPIER_DIM3)
10999#define R3_JOINT_DOF_COUNT 6
11006#define R3_SOFT_DESC_PARTICLES 0
11012#define R3_SOFT_DESC_ROPE 1
11018#define R3_SOFT_DESC_GRID 2
11024#define R3_SOFT_DESC_CLOTH 3
11030#define R3_SOFT_DESC_CUBOID 4
11036#define R3_SOFT_DESC_SURFACE 5
11042#define R3_SOFT_DESC_DISK 6
11048#define R3_SOFT_DESC_SPHERE 7
11054#define R3_SOFT_DESC_CLOTH_TUBE 8
11060#define R3_SOFT_DESC_VOLUMETRIC 9
11062#if defined(RAPIER_DIM2)
11067#define R3_SOFT_DESC_POLYGON 10
11070#if defined(RAPIER_DIM2)
11075#define R3_SOFT_DESC_TRIMESH 11
11078#if defined(RAPIER_DIM3)
11083#define R3_SOFT_DESC_CLOTH_ANISOTROPIC 12
11090#define R3_SOFT_BINDING_SKINNED 0
11096#define R3_SOFT_BINDING_DIRECT 1
11102#define R3_SOFT_BINDING_DIRECT_BY_POSITION 2
11104#if defined(RAPIER_DIM2)
11109#define R3_POLYLINE_ORIENTED 1
11116#define R3_POLYLINE_DEFORMABLE 2
11122#define R3_SHAPE_DESC_BALL 0
11128#define R3_SHAPE_DESC_CUBOID 1
11134#define R3_SHAPE_DESC_ROUND_CUBOID 2
11140#define R3_SHAPE_DESC_CAPSULE 3
11146#define R3_SHAPE_DESC_SEGMENT 4
11152#define R3_SHAPE_DESC_TRIANGLE 5
11158#define R3_SHAPE_DESC_HALFSPACE 6
11164#define R3_SHAPE_DESC_CONVEX_HULL 7
11170#define R3_SHAPE_DESC_TRIMESH 8
11176#define R3_SHAPE_DESC_POLYLINE 9
11182#define R3_SHAPE_DESC_SHARED 10
11188#define R3_SHAPE_DESC_HEIGHTFIELD 11
11194#define R3_SHAPE_DESC_CYLINDER 12
11200#define R3_SHAPE_DESC_CONE 13
11206#define R3_SHAPE_DESC_COMPOUND 14
11212#define R3_SHAPE_DESC_ROUND_CYLINDER 15
11218#define R3_SHAPE_DESC_ROUND_CONE 16
11224#define R3_MASS_DENSITY 0
11230#define R3_MASS_TOTAL 1
11236#define R3_MASS_PROPERTIES 2
11242#define R3_ABI_VERSION 1
11248#define R3_DYNAMIC 0
11260#define R3_KINEMATIC_POSITION_BASED 2
11266#define R3_KINEMATIC_VELOCITY_BASED 3
11272#define R3_COLLISION_EVENTS 1
11278#define R3_CONTACT_FORCE_EVENTS 2
11284#define R3_COMBINE_AVERAGE 0
11290#define R3_COMBINE_MIN 1
11296#define R3_COMBINE_MULTIPLY 2
11302#define R3_COMBINE_MAX 3
11308#define R3_COMBINE_CLAMPED_SUM 4
11314#define R3_COMBINE_GEOMETRIC_MEAN 5
11320#define R3_COLLISION_TYPES_DYNAMIC_DYNAMIC 1
11326#define R3_COLLISION_TYPES_DYNAMIC_KINEMATIC 12
11332#define R3_COLLISION_TYPES_DYNAMIC_FIXED 2
11338#define R3_COLLISION_TYPES_KINEMATIC_KINEMATIC 52224
11344#define R3_COLLISION_TYPES_KINEMATIC_FIXED 8704
11350#define R3_COLLISION_TYPES_FIXED_FIXED 32
11356#define R3_COLLISION_TYPES_DEFAULT 15
11362#define R3_FILTER_CONTACT_PAIRS 1
11368#define R3_FILTER_INTERSECTION_PAIR 2
11374#define R3_MODIFY_SOLVER_CONTACTS 4
11380#define R3_QUERY_EXCLUDE_FIXED 1
11386#define R3_QUERY_EXCLUDE_KINEMATIC 2
11392#define R3_QUERY_EXCLUDE_DYNAMIC 4
11398#define R3_QUERY_EXCLUDE_SENSORS 8
11404#define R3_QUERY_EXCLUDE_SOLIDS 16
11410#define R3_QUERY_ONLY_DYNAMIC 3
11416#define R3_QUERY_ONLY_KINEMATIC 5
11422#define R3_QUERY_ONLY_FIXED 6
11428#define R3_DEBUG_COLLIDER_SHAPES 1
11434#define R3_DEBUG_RIGID_BODY_AXES 2
11440#define R3_DEBUG_MULTIBODY_JOINTS 4
11446#define R3_DEBUG_IMPULSE_JOINTS 8
11452#define R3_DEBUG_SOLVER_CONTACTS 16
11458#define R3_DEBUG_CONTACTS 32
11464#define R3_DEBUG_COLLIDER_AABBS 64
11470#define R3_DEBUG_SOFT_BODIES 128
11476#define R3_DEBUG_PSEUDO_NORMALS 256
11482#define R3_DEBUG_SOFT_VOLUME_CONTACTS 512
11488#define R3_DEBUG_SOFT_BODY_STRESS 1024
11494#define R3_GROUPS_AND 0
11500#define R3_GROUPS_OR 1
11506#define R3_MOTOR_ACCELERATION_BASED 0
11512#define R3_MOTOR_FORCE_BASED 1
11518#define R3_SOFT_CELL_VOLUME 0
11524#define R3_SOFT_CELL_COROTATIONAL 1
11530#define R3_SOFT_CELL_NEO_HOOKEAN 2
11536#define R3_SOFT_SOLVER_CONSTRAINTS 0
11542#define R3_SOFT_SOLVER_FEM 1
11548#define R3_SOFT_EDGE_PLASTIC_FLOW_BOTH 0
11554#define R3_SOFT_EDGE_PLASTIC_FLOW_COMPRESSION 1
11560#define R3_SOFT_EDGE_PLASTIC_FLOW_TENSION 2
11566#define R3_SOFT_PATCH_CONSTRAINTS_KEEP 0
11572#define R3_SOFT_PATCH_CONSTRAINTS_STAND_DOWN 1
11578#define R3_SOFT_PATCH_CONSTRAINTS_ALONG_NORMAL 2
11584#define R3_AXIS_LIN_X 0
11590#define R3_AXIS_LIN_Y 1
11596#define R3_LOCK_TRANSLATION_X 1
11602#define R3_LOCK_TRANSLATION_Y 2
11608#define R3_LOCK_TRANSLATION_Z 4
11614#define R3_LOCK_ROTATION_X 8
11620#define R3_LOCK_ROTATION_Y 16
11626#define R3_LOCK_ROTATION_Z 32
11628#if defined(RAPIER_DIM2)
11633#define R3_AXIS_ANG_X 2
11636#if defined(RAPIER_DIM3)
11641#define R3_AXIS_ANG_X 3
11644#if defined(RAPIER_DIM2)
11649#define R3_JOINT_FIXED_AXES 7
11652#if defined(RAPIER_DIM3)
11657#define R3_JOINT_FIXED_AXES 63
11660#if defined(RAPIER_DIM2)
11665#define R3_JOINT_REVOLUTE_AXES 3
11668#if defined(RAPIER_DIM3)
11673#define R3_JOINT_REVOLUTE_AXES 55
11676#if defined(RAPIER_DIM2)
11681#define R3_JOINT_PRISMATIC_AXES 6
11684#if defined(RAPIER_DIM3)
11689#define R3_JOINT_PRISMATIC_AXES 62
11692#if defined(RAPIER_DIM3)
11697#define R3_AXIS_LIN_Z 2
11700#if defined(RAPIER_DIM3)
11705#define R3_AXIS_ANG_Y 4
11708#if defined(RAPIER_DIM3)
11713#define R3_AXIS_ANG_Z 5
11716#if defined(RAPIER_DIM3)
11721#define R3_JOINT_SPHERICAL_AXES 7
11728#define R3_SOFT_FRAME 4
11734#define R3_SHAPE_CAST_OUT_OF_ITERATIONS 0
11740#define R3_SHAPE_CAST_CONVERGED 1
11746#define R3_SHAPE_CAST_FAILED 2
11752#define R3_SHAPE_CAST_PENETRATING 3
11758#define R3_FEATURE_UNKNOWN 0
11764#define R3_FEATURE_VERTEX 1
11770#define R3_FEATURE_EDGE 2
11776#define R3_FEATURE_FACE 3
11782#define R3_MULTIBODY_JOINTS_ARE_KINEMATIC 1
11788#define R3_MULTIBODY_DISABLE_SELF_CONTACTS 2
11795#define R3_MULTIBODY_SKIP_LOOP_CLOSURES 4
11801#define R3_MULTIBODY_SKIP_JOINT_MOTORS 8
11807#define R3_MULTIBODY_SKIP_JOINT_LIMITS 16
11813#define R3_MULTIBODY_SKIP_JOINT_SPRINGS 32
11819#define R3_TRIMESH_HALF_EDGE_TOPOLOGY 1
11825#define R3_TRIMESH_CONNECTED_COMPONENTS 2
11831#define R3_TRIMESH_DELETE_BAD_TOPOLOGY_TRIANGLES 4
11837#define R3_TRIMESH_ORIENTED 8
11843#define R3_TRIMESH_MERGE_DUPLICATE_VERTICES 16
11849#define R3_TRIMESH_DELETE_DEGENERATE_TRIANGLES 32
11855#define R3_TRIMESH_DELETE_DUPLICATE_TRIANGLES 64
11861#define R3_TRIMESH_FIX_INTERNAL_EDGES 144
11867#define R3_TRIMESH_DEFORMABLE 256
11873#define R3_TRIMESH_FIX_INTERNAL_EDGES_TWO_SIDED 656
11879#define R3_HEIGHTFIELD_FIX_INTERNAL_EDGES 1
11885#define R3_AXES_MASK_LIN_X 1
11891#define R3_AXES_MASK_LIN_Y 2
11893#if defined(RAPIER_DIM3)
11898#define R3_AXES_MASK_LIN_Z 4
11901#if defined(RAPIER_DIM3)
11906#define R3_AXES_MASK_ANG_X 8
11909#if defined(RAPIER_DIM3)
11914#define R3_AXES_MASK_ANG_Y 16
11921#define R3_AXES_MASK_ANG_Z 32
11927#define R3_ABI_FEATURE_FEM 1
11933#define R3_ABI_FEATURE_ROBOTICS 2
11935#if (defined(RAPIER_FEM) && defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
11940#define R3_ABI_FEATURES 3
11943#if (defined(RAPIER_FEM) && !(defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32)))
11948#define R3_ABI_FEATURES 1
11951#if (!defined(RAPIER_FEM) && defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
11956#define R3_ABI_FEATURES 2
11959#if (!defined(RAPIER_FEM) && !(defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32)))
11964#define R3_ABI_FEATURES 0
11967#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
11972#define R3_MESH_CONVERTER_TRIMESH 0
11975#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
11980#define R3_MESH_CONVERTER_OBB 1
11983#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
11988#define R3_MESH_CONVERTER_AABB 2
11991#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
11996#define R3_MESH_CONVERTER_CONVEX_HULL 3
11999#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
12004#define R3_MESH_CONVERTER_CONVEX_DECOMPOSITION 4
12011#define R3_COLLISION_EVENT_SENSOR 1
12017#define R3_COLLISION_EVENT_REMOVED 2
12023typedef struct R3Bytes R3Bytes;
12029typedef struct R3ContactModificationContext R3ContactModificationContext;
12031#if defined(RAPIER_DIM3)
12036typedef struct R3DynamicRayCastVehicleController R3DynamicRayCastVehicleController;
12045typedef struct R3EventCollector R3EventCollector;
12053typedef struct R3KinematicCharacterController R3KinematicCharacterController;
12055#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
12061typedef struct R3LoadedMeshes R3LoadedMeshes;
12064#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
12070typedef struct R3MjcfContactHooks R3MjcfContactHooks;
12073#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
12078typedef struct R3MjcfRobot R3MjcfRobot;
12081#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
12087typedef struct R3MjcfRobotHandles R3MjcfRobotHandles;
12095typedef struct R3PidController R3PidController;
12102typedef struct R3ReadContext R3ReadContext;
12110typedef struct R3ShapeMesh R3ShapeMesh;
12116typedef struct R3SoftBodyTearEvent R3SoftBodyTearEvent;
12118#if defined(RAPIER_DIM3)
12123typedef struct R3TriMeshData R3TriMeshData;
12126#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
12132typedef struct R3UrdfRobot R3UrdfRobot;
12135#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
12141typedef struct R3UrdfRobotHandles R3UrdfRobotHandles;
12150typedef struct R3World R3World;
12152#if defined(RAPIER_F32)
12157typedef float R3Real;
12160#if defined(RAPIER_F64)
12165typedef double R3Real;
12172typedef struct R3SpringCoefficients {
12176 R3Real natural_frequency;
12180 R3Real damping_ratio;
12181} R3SpringCoefficients;
12187typedef uint32_t R3Bool;
12193typedef struct R3OptionalReal {
12208typedef struct R3OptionalU32 {
12223typedef struct R3SoftBodyMaterial {
12227 struct R3SpringCoefficients edgeSoftness;
12231 struct R3SpringCoefficients bendSoftness;
12235 struct R3SpringCoefficients volumeSoftness;
12239 struct R3SpringCoefficients shapeMatchingSoftness;
12243 R3Real youngModulus;
12247 R3Real poissonRatio;
12251 R3Real elasticDampingRatio;
12255 R3Real plasticYield;
12259 R3Real plasticCreep;
12267 R3Real deformationDamping;
12271 R3Real edgePlasticYield;
12275 R3Real edgePlasticCreep;
12279 R3Real edgePlasticMax;
12283 uint32_t edgePlasticFlow;
12287 struct R3OptionalReal tearStrain;
12291 struct R3OptionalReal tearForce;
12295 R3Real tearSmoothing;
12299 R3Real interiorStrength;
12303 uint32_t maxTearsPerStep;
12307 struct R3OptionalU32 minPiece;
12308} R3SoftBodyMaterial;
12314typedef struct R3SoftRecoverySettings {
12318 R3Bool authoredVelocityMargin;
12322 R3Bool edgeSpeculation;
12326 R3Bool invertedCellDetection;
12330 R3Bool selfCrossingDetection;
12334 R3Bool detectionMotionGating;
12338 R3Bool crossBodyDetection;
12342 R3Bool selfStandDown;
12346 R3Bool crossBodyExpelGate;
12350 R3Bool edgeStandDown;
12354 R3Bool crossingRepulsion;
12358 R3Bool crossingRepulsionGuide;
12362 R3Bool crossingRepulsionSelfGuide;
12366 R3Real recoveryPace;
12370 R3Bool overlapConstraints;
12374 R3Bool overlapRigid;
12378 R3Bool overlapSkipSelfTangled;
12382 R3Bool overlapEdgeStandDown;
12386 R3Real overlapConstraintPace;
12391 uint32_t overlapPatchConstraints;
12395 R3Bool overlapSkinVolume;
12399 R3Real overlapKeptDepth;
12403 R3Bool overlapSelfRegions;
12407 R3Bool overlapNormalPush;
12411 R3Bool overlapMultiVolume;
12415 uint32_t overlapSplit;
12419 uint32_t overlapPatience;
12423 R3Real overlapProgressMargin;
12424} R3SoftRecoverySettings;
12426#if defined(RAPIER_FEM)
12431typedef struct R3SoftFemParameters {
12435 R3Real linearTolerance;
12439 size_t maxLinearIterations;
12443 size_t maxDenseDofs;
12444} R3SoftFemParameters;
12451typedef struct R3SoftBodiesSettings {
12455 struct R3SoftRecoverySettings recovery;
12459 R3Real resweepStrain;
12463 size_t maxExtraSubsteps;
12467 R3Real contactStiffening;
12468#if defined(RAPIER_FEM)
12472 struct R3SoftFemParameters fem;
12474} R3SoftBodiesSettings;
12480typedef struct R3IntegrationParameters {
12492 struct R3SpringCoefficients contactSoftness;
12496 struct R3SpringCoefficients staticContactSoftness;
12500 R3Real warmstartCoefficient;
12508 struct R3SoftBodiesSettings softBodies;
12512 R3Real normalizedAllowedLinearError;
12516 R3Real normalizedMaxCorrectiveVelocity;
12520 R3Real normalizedPredictionDistance;
12524 R3Real normalizedMaxLinearVelocity;
12528 size_t numSolverIterations;
12532 size_t numInternalPgsIterations;
12536 size_t numInternalStabilizationIterations;
12540 size_t maxCcdSubsteps;
12544 R3Bool contactClustering;
12548 R3Bool contactRecycling;
12552 R3Real normalizedContactRecycleDistance;
12556 R3Bool frictionInBiasPass;
12560 R3Bool warmstartJoints;
12561#if defined(RAPIER_DIM3)
12565 uint32_t frictionModel;
12567} R3IntegrationParameters;
12573typedef uint32_t R3Status;
12579typedef struct R3Vector {
12588#if defined(RAPIER_DIM3)
12600typedef struct R3Rotation {
12601#if defined(RAPIER_DIM2)
12607#if defined(RAPIER_DIM3)
12613#if defined(RAPIER_DIM3)
12619#if defined(RAPIER_DIM3)
12625#if defined(RAPIER_DIM3)
12638typedef struct R3Pose {
12642 struct R3Vector translation;
12646 struct R3Rotation rotation;
12653typedef struct R3JointLimits {
12668typedef struct R3JointMotor {
12699typedef struct R3UserData {
12715typedef struct R3JointDesc {
12719 struct R3Pose localFrame1;
12723 struct R3Pose localFrame2;
12727 uint8_t lockedAxes;
12739 uint8_t coupledAxes;
12743 struct R3JointLimits limits[R3_JOINT_DOF_COUNT];
12747 struct R3JointMotor motors[R3_JOINT_DOF_COUNT];
12751 struct R3SpringCoefficients softness;
12755 R3Bool contactsEnabled;
12763 struct R3UserData userData;
12772typedef struct R3ImpulseJointHandle {
12776 struct R3World *world;
12784 uint32_t generation;
12785} R3ImpulseJointHandle;
12793typedef struct R3RigidBodyHandle {
12797 struct R3World *world;
12805 uint32_t generation;
12806} R3RigidBodyHandle;
12814typedef struct R3MultibodyJointHandle {
12818 struct R3World *world;
12826 uint32_t generation;
12827} R3MultibodyJointHandle;
12833typedef struct R3VolumeMeshParameters {
12838#if defined(RAPIER_DIM2)
12844#if defined(RAPIER_DIM3)
12848 uint32_t enclosure;
12850#if defined(RAPIER_DIM3)
12854 uint32_t cover_smoothing;
12856#if defined(RAPIER_DIM3)
12860 R3Real cover_guard;
12862#if defined(RAPIER_DIM3)
12866 uint32_t cover_subdivisions;
12868} R3VolumeMeshParameters;
12877typedef struct R3VectorView {
12881 const struct R3Vector *data;
12895typedef struct R3RealView {
12899 const R3Real *data;
12913typedef struct R3IndexView {
12917 const uint32_t *data;
12928typedef struct R3Edge {
12946typedef struct R3EdgeView {
12950 const struct R3Edge *data;
12961typedef struct R3SoftEdgeSoftness {
12969 struct R3SpringCoefficients softness;
12970} R3SoftEdgeSoftness;
12976typedef struct R3SoftEdgeSoftnessView {
12980 const struct R3SoftEdgeSoftness *data;
12985} R3SoftEdgeSoftnessView;
12991typedef struct R3SoftEdgeTear {
13006typedef struct R3SoftEdgeTearView {
13010 const struct R3SoftEdgeTear *data;
13015} R3SoftEdgeTearView;
13021typedef struct R3Triangle {
13043typedef struct R3TriangleView {
13047 const struct R3Triangle *data;
13058typedef struct R3Tetrahedron {
13084typedef struct R3TetrahedronView {
13088 const struct R3Tetrahedron *data;
13093} R3TetrahedronView;
13095#if defined(RAPIER_DIM2)
13100typedef struct R3TriangleView R3CellView;
13103#if defined(RAPIER_DIM3)
13108typedef struct R3TetrahedronView R3CellView;
13111#if defined(RAPIER_DIM2)
13116typedef struct R3EdgeView R3SurfaceElementView;
13119#if defined(RAPIER_DIM3)
13124typedef struct R3TriangleView R3SurfaceElementView;
13131typedef struct R3Dihedral {
13157typedef struct R3DihedralView {
13161 const struct R3Dihedral *data;
13174typedef struct R3SoftBodyDescView {
13178 const struct R3SoftBodyDesc *data;
13183} R3SoftBodyDescView;
13189typedef struct R3OptionalBool {
13204typedef struct R3SharedShape R3SharedShape;
13211typedef struct R3CompoundShapeView {
13215 const struct R3CompoundShapeDesc *data;
13220} R3CompoundShapeView;
13230typedef struct R3ShapeDesc {
13258 R3Real borderRadius;
13262 struct R3VectorView vertices;
13266 struct R3TriangleView triangles;
13270 struct R3EdgeView edges;
13278 struct R3RealView heights;
13290 struct R3Vector scale;
13294 const R3SharedShape *sharedShape;
13298 struct R3CompoundShapeView children;
13305typedef struct R3CompoundShapeDesc {
13309 struct R3Pose pose;
13313 struct R3ShapeDesc shape;
13314} R3CompoundShapeDesc;
13317#if defined(RAPIER_DIM2)
13322typedef R3Real R3AngVector;
13325#if defined(RAPIER_DIM3)
13330typedef struct R3Vector R3AngVector;
13338typedef struct R3MassProperties {
13342 struct R3Vector local_com;
13350 R3AngVector principal_inertia;
13351#if defined(RAPIER_DIM3)
13355 struct R3Rotation principal_inertia_local_frame;
13363typedef struct R3InteractionGroups {
13367 uint32_t memberships;
13375 uint32_t test_mode;
13376} R3InteractionGroups;
13382typedef struct R3ColliderDesc {
13386 struct R3ShapeDesc shape;
13390 struct R3Pose position;
13406 struct R3MassProperties massProperties;
13414 R3Real restitution;
13418 uint32_t frictionCombineRule;
13422 uint32_t restitutionCombineRule;
13434 struct R3InteractionGroups collisionGroups;
13438 struct R3InteractionGroups solverGroups;
13442 uint16_t activeCollisionTypes;
13446 uint32_t activeHooks;
13450 uint32_t activeEvents;
13454 R3Real contactForceEventThreshold;
13458 R3Real contactSkin;
13462 struct R3UserData userData;
13475typedef struct R3SoftBodyDesc {
13491 struct R3Vector du;
13495 struct R3Vector dv;
13496#if defined(RAPIER_DIM3)
13500 struct R3SpringCoefficients warpSoftness;
13502#if defined(RAPIER_DIM3)
13506 struct R3SpringCoefficients weftSoftness;
13508#if defined(RAPIER_DIM3)
13512 struct R3SpringCoefficients shearSoftness;
13537 struct R3Vector translation;
13541 struct R3OptionalReal totalMass;
13545 struct R3VolumeMeshParameters meshing;
13549 struct R3VectorView positions;
13553 struct R3RealView masses;
13557 struct R3IndexView pinned;
13561 struct R3EdgeView edges;
13565 struct R3EdgeView bendEdges;
13569 struct R3IndexView tensionOnlyEdges;
13573 struct R3SoftEdgeSoftnessView edgeSoftness;
13577 struct R3SoftEdgeTearView edgeTearResistance;
13585 R3SurfaceElementView surface;
13586#if defined(RAPIER_DIM3)
13590 struct R3DihedralView dihedrals;
13592#if defined(RAPIER_DIM3)
13596 struct R3EdgeView wire;
13601 struct R3VectorView skinVertices;
13605 R3SurfaceElementView skinIndices;
13612 struct R3SoftBodyDescView appended;
13617 struct R3EdgeView addedEdges;
13621 struct R3SoftBodyMaterial material;
13625 uint32_t cellModel;
13633 R3Real particleMass;
13637 struct R3OptionalReal particleRadius;
13641 R3Bool volumePreservation;
13645 R3Real volumeFactor;
13649 struct R3OptionalBool shapeMatching;
13654 struct R3OptionalBool oriented;
13658 R3Bool selfContacts;
13662 R3Bool skinCollision;
13666 R3Bool collisionEnabled;
13670 struct R3ColliderDesc collider;
13674 R3Real linearDamping;
13678 R3Real gravityScale;
13682 size_t additionalSolverIterations;
13686 size_t additionalPgsIterations;
13694 int8_t dominanceGroup;
13698 struct R3UserData userData;
13707typedef struct R3SoftBodyHandle {
13711 struct R3World *world;
13719 uint32_t generation;
13726typedef struct R3SoftMeshBindingDesc {
13734 struct R3IndexView particles;
13742 R3Bool selfContacts;
13743} R3SoftMeshBindingDesc;
13751typedef struct R3ColliderHandle {
13755 struct R3World *world;
13763 uint32_t generation;
13770typedef struct R3QueryFilter {
13782 struct R3InteractionGroups groups;
13786 struct R3ColliderHandle exclude_collider;
13790 struct R3RigidBodyHandle exclude_rigid_body;
13798typedef R3Bool (
RAPIER_CALL *R3QueryPredicate)(
void *user_data,
13799 const struct R3ReadContext *read,
13800 struct R3ColliderHandle handle);
13806typedef struct R3QueryOptions {
13810 struct R3QueryFilter filter;
13814 R3QueryPredicate predicate;
13825typedef struct R3RayHit {
13829 struct R3ColliderHandle collider;
13833 R3Real time_of_impact;
13837 struct R3Vector normal;
13842 uint32_t feature_type;
13846 uint32_t feature_id;
13853typedef struct R3PointProjection {
13857 struct R3ColliderHandle collider;
13861 struct R3Vector point;
13866} R3PointProjection;
13872typedef struct R3ShapeCastHit {
13876 struct R3ColliderHandle collider;
13880 R3Real time_of_impact;
13884 struct R3Vector witness1;
13888 struct R3Vector witness2;
13892 struct R3Vector normal1;
13896 struct R3Vector normal2;
13908typedef struct R3ShapeCastOptions {
13912 R3Real max_time_of_impact;
13916 R3Real target_distance;
13920 R3Bool stop_at_penetration;
13924 R3Bool compute_impact_geometry_on_penetration;
13925} R3ShapeCastOptions;
13931typedef struct R3Aabb {
13935 struct R3Vector mins;
13939 struct R3Vector maxs;
13946typedef struct R3RayToi {
13950 struct R3ColliderHandle collider;
13965typedef struct R3OptionalRayHit {
13969 struct R3RayHit hit;
13982typedef struct R3RigidBodyDesc {
13986 struct R3Pose position;
13990 struct R3Vector linvel;
13994 R3AngVector angvel;
14002 R3Real gravityScale;
14006 R3Real linearDamping;
14010 R3Real angularDamping;
14014 R3Real additionalMass;
14018 R3Bool useAdditionalMassProperties;
14022 struct R3MassProperties additionalMassProperties;
14026 uint8_t lockedAxes;
14042 R3Real softCcdPrediction;
14046 R3Bool allowFastRotation;
14054 int8_t dominanceGroup;
14058 size_t additionalSolverIterations;
14062 size_t additionalPgsIterations;
14066 R3Bool gyroscopicForcesEnabled;
14070 struct R3UserData userData;
14077typedef struct R3PodLayout {
14081 size_t rigidBodyDesc;
14085 size_t colliderDesc;
14097 size_t softBodyMaterial;
14101 size_t integrationParameters;
14105 size_t softBodyDesc;
14109 size_t softMeshBindingDesc;
14117 size_t urdfLoaderOptions;
14121 size_t mjcfLoaderOptions;
14129typedef struct R3CharacterLength {
14139} R3CharacterLength;
14145typedef struct R3CharacterAutostep {
14153 struct R3CharacterLength max_height;
14157 struct R3CharacterLength min_width;
14161 R3Bool include_dynamic_bodies;
14162} R3CharacterAutostep;
14168typedef struct R3CharacterMovement {
14172 struct R3Vector translation;
14180 R3Bool is_sliding_down_slope;
14181} R3CharacterMovement;
14187typedef struct R3CharacterCollision {
14191 struct R3ColliderHandle collider;
14195 struct R3Pose character_pos;
14199 struct R3Vector translation_applied;
14203 struct R3Vector translation_remaining;
14207 struct R3ShapeCastHit hit;
14208} R3CharacterCollision;
14214typedef struct R3PidGains {
14218 struct R3Vector lin_kp;
14222 struct R3Vector lin_ki;
14226 struct R3Vector lin_kd;
14230 R3AngVector ang_kp;
14234 R3AngVector ang_ki;
14238 R3AngVector ang_kd;
14246typedef struct R3PdController {
14250 struct R3Vector lin_kp;
14254 struct R3Vector lin_kd;
14258 R3AngVector ang_kp;
14262 R3AngVector ang_kd;
14273typedef struct R3VelocityCorrection {
14277 struct R3Vector linear;
14281 R3AngVector angularVelocity;
14282} R3VelocityCorrection;
14288typedef struct R3CharacterControllerSettings {
14296 R3Real max_slope_climb_angle;
14300 R3Real min_slope_slide_angle;
14304 R3Bool snap_to_ground;
14308 struct R3CharacterLength snap_distance;
14309} R3CharacterControllerSettings;
14311#if defined(RAPIER_DIM3)
14316typedef struct R3WheelTuning {
14320 R3Real suspension_stiffness;
14324 R3Real suspension_compression;
14328 R3Real suspension_damping;
14332 R3Real max_suspension_travel;
14336 R3Real friction_slip;
14340 R3Real max_suspension_force;
14344 R3Real side_friction_stiffness;
14348#if defined(RAPIER_DIM3)
14353typedef struct R3WheelState {
14357 struct R3Vector center;
14361 struct R3Vector suspension;
14365 struct R3Vector axle;
14373 R3Real suspension_force;
14377 R3Real suspension_length;
14381 R3Bool is_in_contact;
14385 struct R3ColliderHandle ground_object;
14389 struct R3Vector contact_point;
14393 struct R3Vector contact_normal;
14404typedef void (
RAPIER_CALL *R3ErrorCallback)(R3Status,
const char*,
void*);
14411typedef struct R3ErrorHandler {
14415 R3ErrorCallback callback;
14426typedef struct R3JointBodies {
14430 struct R3RigidBodyHandle body1;
14434 struct R3RigidBodyHandle body2;
14441typedef struct R3InverseKinematicsOptions {
14453 uint8_t constrained_axes;
14457 R3Real epsilon_linear;
14461 R3Real epsilon_angular;
14462} R3InverseKinematicsOptions;
14468typedef R3Bool (
RAPIER_CALL *R3IkJointCanMove)(
void*,
struct R3RigidBodyHandle);
14474typedef struct R3CollisionEvent {
14478 struct R3ColliderHandle collider1;
14482 struct R3ColliderHandle collider2;
14497typedef struct R3ContactForceEvent {
14501 struct R3ColliderHandle collider1;
14505 struct R3ColliderHandle collider2;
14509 struct R3Vector total_force;
14513 R3Real total_force_magnitude;
14517 struct R3Vector max_force_direction;
14521 R3Real max_force_magnitude;
14527} R3ContactForceEvent;
14535typedef int32_t (
RAPIER_CALL *R3PairFilter)(
void *user_data,
14536 const struct R3ReadContext *read,
14537 struct R3ColliderHandle collider1,
14538 struct R3ColliderHandle collider2,
14539 struct R3RigidBodyHandle body1,
14540 struct R3RigidBodyHandle body2);
14546typedef struct R3ContactModification {
14550 struct R3Vector normal;
14558 R3Real restitution;
14562 uint32_t user_data;
14567} R3ContactModification;
14573typedef void (
RAPIER_CALL *R3ModifyContacts)(
void *user_data,
14574 const struct R3ReadContext *read,
14575 struct R3ColliderHandle collider1,
14576 struct R3ColliderHandle collider2,
14577 struct R3ContactModification *contact);
14583typedef void (
RAPIER_CALL *R3ModifyContactContext)(
void *user_data,
14584 const struct R3ReadContext *read,
14585 struct R3ColliderHandle collider1,
14586 struct R3ColliderHandle collider2,
14587 struct R3ContactModificationContext *context);
14597typedef struct R3PhysicsHooks {
14605 R3PairFilter filter_contact_pair;
14609 R3PairFilter filter_intersection_pair;
14613 R3ModifyContacts modify_solver_contacts;
14617 R3ModifyContactContext modify_solver_contacts_context;
14624typedef struct R3ByteView {
14628 const uint8_t *data;
14639typedef struct R3DebugLine {
14658typedef struct R3ParticleDestination {
14662 struct R3SoftBodyHandle body;
14667} R3ParticleDestination;
14673typedef struct R3SoftClusterSplit {
14677 uint32_t source_cluster;
14689 struct R3RigidBodyHandle proxy;
14693 R3Bool keeps_proxy;
14694} R3SoftClusterSplit;
14700typedef struct R3SoftJointMove {
14704 struct R3ImpulseJointHandle
joint;
14708 struct R3RigidBodyHandle from;
14712 struct R3RigidBodyHandle to;
14719typedef struct R3OptionalParticleDestination {
14723 struct R3SoftBodyHandle body;
14732} R3OptionalParticleDestination;
14738typedef struct R3BuildInfo {
14742 uint32_t abi_version;
14746 uint32_t dimension;
14750 uint32_t real_size;
14754 uint32_t pointer_size;
14761typedef struct R3BuildFeatures {
14769 uint32_t simd_lanes;
14778 R3Bool enhanced_determinism;
14785typedef struct R3ContactPair {
14789 struct R3ColliderHandle collider1;
14793 struct R3ColliderHandle collider2;
14797 R3Bool has_any_active_contact;
14801 struct R3Vector total_impulse;
14805 R3Real total_impulse_magnitude;
14809 R3Real max_impulse;
14813 struct R3Vector max_impulse_direction;
14820typedef struct R3IntersectionPair {
14824 struct R3ColliderHandle collider1;
14828 struct R3ColliderHandle collider2;
14832 R3Bool intersecting;
14833} R3IntersectionPair;
14839typedef struct R3ContactPoint {
14843 size_t manifold_index;
14847 struct R3Vector local_p1;
14851 struct R3Vector local_p2;
14855 struct R3Vector normal;
14864#if defined(RAPIER_DIM2)
14868 R3Real tangent_impulse[1];
14870#if defined(RAPIER_DIM3)
14874 R3Real tangent_impulse[2];
14878#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
14884typedef struct R3UrdfLoaderOptions {
14888 R3Bool createCollidersFromCollisionShapes;
14892 R3Bool createCollidersFromVisualShapes;
14896 R3Bool applyImportedMassProps;
14900 R3Bool enableJointCollisions;
14904 R3Bool makeRootsFixed;
14908 R3Bool squeezeEmptyFixedLinks;
14912 struct R3Pose shift;
14920 struct R3ColliderDesc colliderBlueprint;
14924 struct R3RigidBodyDesc rigidBodyBlueprint;
14925} R3UrdfLoaderOptions;
14928#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
14934typedef struct R3MjcfLoaderOptions {
14938 R3Bool createCollidersFromCollisionShapes;
14942 R3Bool createCollidersFromVisualShapes;
14946 R3Bool applyImportedMassProps;
14950 R3Bool enableJointCollisions;
14954 R3Bool makeRootsFixed;
14958 R3Bool skipPlaneGeoms;
14962 R3Bool disableJointMotors;
14966 struct R3Pose shift;
14974 struct R3ColliderDesc colliderBlueprint;
14978 struct R3RigidBodyDesc rigidBodyBlueprint;
14979} R3MjcfLoaderOptions;
14982#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
14987typedef struct R3MjcfVisualMesh R3MjcfVisualMesh;
14990#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
14995typedef struct R3RenderMaterial {
15015#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
15020typedef struct R3MjcfVisualMeshInfo {
15024 struct R3Pose local_pose;
15032 struct R3RenderMaterial material;
15040 R3Bool has_material;
15045} R3MjcfVisualMeshInfo;
15052typedef struct R3RigidBodyState {
15056 struct R3Pose position;
15060 struct R3Vector linvel;
15064 R3AngVector angvel;
15076 struct R3UserData userData;
15083typedef struct R3SoftMeshId {
15098typedef struct R3SoftMeshInfo {
15102 struct R3SoftMeshId id;
15106 struct R3ColliderHandle collider;
15118 R3Bool collision_enabled;
15121#if defined(RAPIER_F32)
15126typedef int32_t R3VoxelCoord;
15129#if defined(RAPIER_F64)
15134typedef int64_t R3VoxelCoord;
15141typedef struct R3VoxelKey {
15150#if defined(RAPIER_DIM3)
15162typedef struct R3VoxelQuery {
15166 struct R3VoxelKey key;
15170 struct R3Vector center;
15174 struct R3Vector size;
15185typedef struct R3JointImpulses {
15189 struct R3Vector linear;
15193 R3AngVector angular;
15197 R3Real limits[R3_JOINT_DOF_COUNT];
15201 R3Real motors[R3_JOINT_DOF_COUNT];
15208typedef struct R3OptionalShapeCastHit {
15212 struct R3ShapeCastHit hit;
15217} R3OptionalShapeCastHit;
15223typedef struct R3OptionalPointProjection {
15227 struct R3PointProjection projection;
15232} R3OptionalPointProjection;
15239typedef struct R3NonlinearRigidMotion {
15243 struct R3Pose start;
15247 struct R3Vector local_center;
15251 struct R3Vector linvel;
15255 R3AngVector angvel;
15256} R3NonlinearRigidMotion;
15262typedef struct R3OptionalContactPair {
15266 struct R3ContactPair pair;
15271} R3OptionalContactPair;
15277typedef struct R3OptionalIntersectionPair {
15281 struct R3IntersectionPair pair;
15286} R3OptionalIntersectionPair;
15293typedef struct R3ContactManifold {
15297 struct R3Vector local_n1;
15301 struct R3Vector local_n2;
15305 struct R3Vector normal;
15309 uint32_t subshape1;
15313 uint32_t subshape2;
15321 size_t num_solver_contacts;
15325 uint32_t user_data;
15326} R3ContactManifold;
15332typedef struct R3SolverContact {
15336 struct R3Vector point1;
15340 struct R3Vector point2;
15348 struct R3Vector tangent_velocity;
15357typedef void (
RAPIER_CALL *R3CollisionEventCallback)(
void *user_data,
15358 const struct R3ReadContext *read,
15359 const struct R3CollisionEvent *event,
15360 const struct R3ContactPoint *contacts,
15361 size_t contact_count);
15367typedef void (
RAPIER_CALL *R3ContactForceEventCallback)(
void *user_data,
15368 const struct R3ReadContext *read,
15369 const struct R3ContactForceEvent *event);
15378typedef struct R3EventCallbacks {
15386 R3CollisionEventCallback collision_event;
15390 R3ContactForceEventCallback contact_force_event;
15399typedef struct R3DebugRenderStyle {
15403 uint32_t subdivisions;
15407 uint32_t border_subdivisions;
15411 float collider_dynamic_color[4];
15415 float collider_fixed_color[4];
15419 float collider_kinematic_color[4];
15423 float collider_parentless_color[4];
15427 float impulse_joint_anchor_color[4];
15431 float impulse_joint_separation_color[4];
15435 float multibody_joint_anchor_color[4];
15439 float multibody_joint_separation_color[4];
15443 float sleep_color_multiplier[4];
15447 float sleep_eligible_color_multiplier[4];
15451 float disabled_color_multiplier[4];
15455 R3Real rigid_body_axes_length;
15459 float contact_depth_color[4];
15463 float contact_normal_color[4];
15467 R3Real contact_normal_length;
15471 float soft_body_element_color[4];
15475 float soft_body_slack_color[4];
15479 float soft_body_loaded_color[4];
15483 float soft_body_frame_color[4];
15487 float collider_aabb_color[4];
15491 float vertex_pseudo_normal_color[4];
15495 float edge_pseudo_normal_color[4];
15499 R3Real pseudo_normal_length;
15503 float volume_contact_normal_color[4];
15507 float volume_gradient_color[4];
15508} R3DebugRenderStyle;
15520#define R3_NULL_POINTER 1
15526#define R3_INVALID_ARGUMENT 2
15532#define R3_INVALID_HANDLE 3
15538#define R3_BUFFER_TOO_SMALL 4
15544#define R3_UNSUPPORTED 5
15556#define R3_NOT_FOUND 7
15562#define R3_WORLD_BUSY 8
15572RAPIER_API
struct R3SoftBodyMaterial
RAPIER_CALL r3DefaultSoftBodyMaterial(void);
15578RAPIER_API
struct R3SoftRecoverySettings
RAPIER_CALL r3DefaultSoftRecoverySettings(void);
15580#if defined(RAPIER_FEM)
15585RAPIER_API
struct R3SoftFemParameters
RAPIER_CALL r3DefaultSoftFemParameters(void);
15592RAPIER_API
struct R3SoftBodiesSettings
RAPIER_CALL r3DefaultSoftBodiesSettings(void);
15598RAPIER_API
struct R3IntegrationParameters
RAPIER_CALL r3DefaultIntegrationParameters(void);
15604RAPIER_API
struct R3IntegrationParameters
RAPIER_CALL r3IntegrationParameters(const struct R3World *world);
15611R3Status
RAPIER_CALL r3SetIntegrationParameters(
struct R3World *world,
15612 const struct R3IntegrationParameters *data);
15618RAPIER_API
struct R3JointDesc
RAPIER_CALL r3DefaultJointDesc(void);
15624RAPIER_API
struct R3JointDesc
RAPIER_CALL r3FixedJointDesc(void);
15626#if defined(RAPIER_DIM2)
15631RAPIER_API
struct R3JointDesc
RAPIER_CALL r3RevoluteJointDesc(void);
15634#if defined(RAPIER_DIM3)
15639RAPIER_API
struct R3JointDesc
RAPIER_CALL r3RevoluteJointDesc(struct R3Vector axis_vector);
15646RAPIER_API
struct R3JointDesc
RAPIER_CALL r3PrismaticJointDesc(struct R3Vector axis_vector);
15652RAPIER_API
struct R3JointDesc
RAPIER_CALL r3RopeJointDesc(R3Real length);
15659struct R3JointDesc
RAPIER_CALL r3SpringJointDesc(R3Real length,
15663#if defined(RAPIER_DIM3)
15668RAPIER_API
struct R3JointDesc
RAPIER_CALL r3SphericalJointDesc(void);
15671#if defined(RAPIER_DIM2)
15676RAPIER_API
struct R3JointDesc
RAPIER_CALL r3PinSlotJointDesc(struct R3Vector axis_vector);
15685struct R3ImpulseJointHandle
RAPIER_CALL r3InsertImpulseJoint(struct R3RigidBodyHandle body1,
15686 struct R3RigidBodyHandle body2,
15687 const struct R3JointDesc *
joint);
15695struct R3MultibodyJointHandle
RAPIER_CALL r3InsertMultibodyJoint(struct R3RigidBodyHandle body1,
15696 struct R3RigidBodyHandle body2,
15697 const struct R3JointDesc *
joint);
15703RAPIER_API
struct R3SoftBodyDesc
RAPIER_CALL r3DefaultSoftBodyDesc(void);
15710struct R3SoftBodyHandle
RAPIER_CALL r3InsertSoftBody(struct R3World *world,
15711 const struct R3SoftBodyDesc *desc);
15717RAPIER_API
struct R3SoftMeshBindingDesc
RAPIER_CALL r3DefaultSoftMeshBindingDesc(void);
15725struct R3ColliderHandle
RAPIER_CALL r3InsertDeformableCollider(const struct R3ColliderDesc *collider,
15726 const struct R3SoftMeshBindingDesc *binding,
15727 struct R3RigidBodyHandle parent);
15733RAPIER_API
struct R3QueryOptions
RAPIER_CALL r3DefaultQueryOptions(void);
15744struct R3RayHit
RAPIER_CALL r3CastRay(const struct R3World *world,
15745 const struct R3QueryOptions *query_options,
15746 struct R3Vector origin,
15747 struct R3Vector direction,
15759struct R3PointProjection
RAPIER_CALL r3ProjectPoint(const struct R3World *world,
15760 const struct R3QueryOptions *query_options,
15761 struct R3Vector point,
15762 R3Real max_distance,
15773struct R3ShapeCastHit
RAPIER_CALL r3CastShape(const struct R3World *world,
15774 const struct R3QueryOptions *query_options,
15775 struct R3Pose pose,
15776 struct R3Vector velocity,
15777 const R3SharedShape *shape,
15778 struct R3ShapeCastOptions options);
15788size_t RAPIER_CALL r3IntersectPoint(
const struct R3World *world,
15789 const struct R3QueryOptions *query_options,
15790 struct R3Vector point,
15791 struct R3ColliderHandle *buffer,
15803size_t RAPIER_CALL r3IntersectShape(
const struct R3World *world,
15804 const struct R3QueryOptions *query_options,
15805 struct R3Pose pose,
15806 const R3SharedShape *shape,
15807 struct R3ColliderHandle *buffer,
15819size_t RAPIER_CALL r3IntersectAabbConservative(
const struct R3World *world,
15820 const struct R3QueryOptions *query_options,
15821 struct R3Aabb aabb,
15822 struct R3ColliderHandle *buffer,
15833struct R3RayToi
RAPIER_CALL r3CastRayToi(const struct R3World *world,
15834 const struct R3QueryOptions *query_options,
15835 struct R3Vector origin,
15836 struct R3Vector direction,
15848struct R3OptionalRayHit
RAPIER_CALL r3TryCastRay(const struct R3World *world,
15849 const struct R3QueryOptions *query_options,
15850 struct R3Vector origin,
15851 struct R3Vector direction,
15859RAPIER_API
struct R3RigidBodyDesc
RAPIER_CALL r3DynamicRigidBodyDesc(void);
15865RAPIER_API
struct R3RigidBodyDesc
RAPIER_CALL r3FixedRigidBodyDesc(void);
15871RAPIER_API
struct R3RigidBodyDesc
RAPIER_CALL r3KinematicPositionBasedRigidBodyDesc(void);
15877RAPIER_API
struct R3RigidBodyDesc
RAPIER_CALL r3KinematicVelocityBasedRigidBodyDesc(void);
15883RAPIER_API
struct R3ShapeDesc
RAPIER_CALL r3DefaultShapeDesc(void);
15890RAPIER_API R3SharedShape *
RAPIER_CALL r3ShapeDesc_Build(
const struct R3ShapeDesc *desc);
15896RAPIER_API
struct R3ColliderDesc
RAPIER_CALL r3DefaultColliderDesc(void);
15903RAPIER_API
struct R3ColliderDesc
RAPIER_CALL r3BallColliderDesc(R3Real radius);
15910RAPIER_API
struct R3ColliderDesc
RAPIER_CALL r3CuboidColliderDesc(struct R3Vector half_extents);
15917struct R3RigidBodyHandle
RAPIER_CALL r3InsertRigidBody(struct R3World *world,
15918 const struct R3RigidBodyDesc *desc);
15927struct R3ColliderHandle
RAPIER_CALL r3InsertCollider(struct R3RigidBodyHandle parent,
15928 const struct R3ColliderDesc *desc);
15936struct R3ColliderHandle
RAPIER_CALL r3InsertColliderWithoutParent(struct R3World *world,
15937 const struct R3ColliderDesc *desc);
15943RAPIER_API
struct R3PodLayout
RAPIER_CALL r3PodLayout(void);
15950RAPIER_API
struct R3KinematicCharacterController *
RAPIER_CALL r3NewKinematicCharacterController(
void);
15958R3Status
RAPIER_CALL r3FreeKinematicCharacterController(
struct R3KinematicCharacterController *controller);
15965R3Status
RAPIER_CALL r3KinematicCharacterController_SetUp(
struct R3KinematicCharacterController *controller,
15966 struct R3Vector up);
15973R3Status
RAPIER_CALL r3KinematicCharacterController_SetOffset(
struct R3KinematicCharacterController *controller,
15974 struct R3CharacterLength offset);
15981R3Status
RAPIER_CALL r3KinematicCharacterController_SetSlide(
struct R3KinematicCharacterController *controller,
15989R3Status
RAPIER_CALL r3KinematicCharacterController_SetSlopes(
struct R3KinematicCharacterController *controller,
15990 R3Real max_climb_angle,
15991 R3Real min_slide_angle);
15998R3Status
RAPIER_CALL r3KinematicCharacterController_SetAutostep(
struct R3KinematicCharacterController *controller,
16000 struct R3CharacterLength max_height,
16001 struct R3CharacterLength min_width,
16002 R3Bool include_dynamic_bodies);
16009R3Status
RAPIER_CALL r3KinematicCharacterController_SetSnapToGround(
struct R3KinematicCharacterController *controller,
16011 struct R3CharacterLength distance);
16018struct R3Vector
RAPIER_CALL r3KinematicCharacterController_Up(const struct R3KinematicCharacterController *controller);
16025struct R3CharacterLength
RAPIER_CALL r3KinematicCharacterController_Offset(const struct R3KinematicCharacterController *controller);
16033struct R3CharacterAutostep
RAPIER_CALL r3KinematicCharacterController_Autostep(const struct R3KinematicCharacterController *controller);
16041R3Status
RAPIER_CALL r3KinematicCharacterController_SetNormalNudgeFactor(
struct R3KinematicCharacterController *controller,
16049R3Real
RAPIER_CALL r3KinematicCharacterController_NormalNudgeFactor(
const struct R3KinematicCharacterController *controller);
16059struct R3CharacterMovement
RAPIER_CALL r3KinematicCharacterController_MoveShape(const struct R3World *world,
16060 const struct R3QueryOptions *options,
16061 struct R3KinematicCharacterController *controller,
16063 const R3SharedShape *shape,
16064 struct R3Pose pose,
16065 struct R3Vector desired_translation);
16073size_t RAPIER_CALL r3KinematicCharacterController_Collisions(
const struct R3KinematicCharacterController *controller,
16074 struct R3CharacterCollision *buffer,
16085R3Status
RAPIER_CALL r3KinematicCharacterController_SolveCharacterCollisionImpulses(
const struct R3KinematicCharacterController *controller,
16086 const R3SharedShape *shape,
16089 const struct R3QueryOptions *options);
16096RAPIER_API
struct R3PidController *
RAPIER_CALL r3NewPidController(
void);
16103RAPIER_API R3Status
RAPIER_CALL r3FreePidController(
struct R3PidController *controller);
16109RAPIER_API
struct R3PidGains
RAPIER_CALL r3PidController_Gains(const struct R3PidController *controller);
16116R3Status
RAPIER_CALL r3PidController_SetGains(
struct R3PidController *controller,
16117 struct R3PidGains gains);
16125R3Status
RAPIER_CALL r3PidController_SetAxes(
struct R3PidController *controller,
16132RAPIER_API uint32_t
RAPIER_CALL r3PidController_Axes(
const struct R3PidController *controller);
16138RAPIER_API R3Status
RAPIER_CALL r3PidController_ResetIntegrals(
struct R3PidController *controller);
16145RAPIER_API
struct R3PdController
RAPIER_CALL r3DefaultPdController(void);
16153struct R3VelocityCorrection
RAPIER_CALL r3PdController_RigidBodyCorrection(const struct R3PdController *controller,
16154 struct R3RigidBodyHandle body,
16155 struct R3Pose target_pose,
16156 struct R3Vector target_linvel,
16157 R3AngVector target_angvel);
16164struct R3VelocityCorrection
RAPIER_CALL r3PidController_RigidBodyCorrection(struct R3PidController *controller,
16166 struct R3RigidBodyHandle body,
16167 struct R3Pose target_pose,
16168 struct R3Vector target_linvel,
16169 R3AngVector target_angvel);
16176struct R3CharacterControllerSettings
RAPIER_CALL r3KinematicCharacterController_Settings(const struct R3KinematicCharacterController *controller);
16178#if defined(RAPIER_DIM3)
16183RAPIER_API
struct R3WheelTuning
RAPIER_CALL r3DefaultWheelTuning(void);
16186#if defined(RAPIER_DIM3)
16193struct R3DynamicRayCastVehicleController *
RAPIER_CALL r3NewDynamicRayCastVehicleController(
struct R3RigidBodyHandle chassis);
16196#if defined(RAPIER_DIM3)
16203R3Status
RAPIER_CALL r3FreeDynamicRayCastVehicleController(
struct R3DynamicRayCastVehicleController *controller);
16206#if defined(RAPIER_DIM3)
16213size_t RAPIER_CALL r3DynamicRayCastVehicleController_AddWheel(
struct R3DynamicRayCastVehicleController *controller,
16214 struct R3Vector connection,
16215 struct R3Vector direction,
16216 struct R3Vector axle,
16217 R3Real rest_length,
16219 const struct R3WheelTuning *tuning);
16222#if defined(RAPIER_DIM3)
16228R3Status
RAPIER_CALL r3DynamicRayCastVehicleController_SetAxes(
struct R3DynamicRayCastVehicleController *controller,
16233#if defined(RAPIER_DIM3)
16239R3Status
RAPIER_CALL r3DynamicRayCastVehicleController_SetWheelControls(
struct R3DynamicRayCastVehicleController *controller,
16242 R3Real engine_force,
16246#if defined(RAPIER_DIM3)
16256R3Status
RAPIER_CALL r3DynamicRayCastVehicleController_UpdateVehicle(
struct R3DynamicRayCastVehicleController *controller,
16258 const struct R3QueryOptions *options);
16261#if defined(RAPIER_DIM3)
16267R3Real
RAPIER_CALL r3DynamicRayCastVehicleController_CurrentVehicleSpeed(
const struct R3DynamicRayCastVehicleController *controller);
16270#if defined(RAPIER_DIM3)
16277size_t RAPIER_CALL r3DynamicRayCastVehicleController_Wheels(
const struct R3DynamicRayCastVehicleController *controller,
16278 struct R3WheelState *buffer,
16288R3Status
RAPIER_CALL r3RigidBodyPropagateModifiedBodyPositionsToColliders(
struct R3World *world);
16296size_t RAPIER_CALL r3ActiveRigidBodies(
const struct R3World *world,
16297 struct R3RigidBodyHandle *buffer,
16304RAPIER_API R3Status
RAPIER_CALL r3RigidBody_WakeUp(
struct R3RigidBodyHandle handle, R3Bool strong);
16313RAPIER_API
struct R3ErrorHandler
RAPIER_CALL r3SetErrorHandler(struct R3ErrorHandler handler);
16322RAPIER_API R3Status
RAPIER_CALL r3LastStatus(
void);
16328RAPIER_API
const char *
RAPIER_CALL r3LastError(
void);
16334RAPIER_API R3SharedShape *
RAPIER_CALL r3BallSharedShape(R3Real radius);
16340RAPIER_API R3SharedShape *
RAPIER_CALL r3CuboidSharedShape(
struct R3Vector half_extents);
16347R3SharedShape *
RAPIER_CALL r3RoundCuboidSharedShape(
struct R3Vector half_extents,
16348 R3Real border_radius);
16355R3SharedShape *
RAPIER_CALL r3CapsuleSharedShape(
struct R3Vector a,
16363RAPIER_API R3SharedShape *
RAPIER_CALL r3SegmentSharedShape(
struct R3Vector a,
struct R3Vector b);
16370R3SharedShape *
RAPIER_CALL r3TriangleSharedShape(
struct R3Vector a,
16372 struct R3Vector c);
16378RAPIER_API R3SharedShape *
RAPIER_CALL r3HalfspaceSharedShape(
struct R3Vector normal);
16380#if defined(RAPIER_DIM3)
16385RAPIER_API R3SharedShape *
RAPIER_CALL r3CylinderSharedShape(R3Real half_height, R3Real radius);
16388#if defined(RAPIER_DIM3)
16393RAPIER_API R3SharedShape *
RAPIER_CALL r3ConeSharedShape(R3Real half_height, R3Real radius);
16401RAPIER_API R3SharedShape *
RAPIER_CALL r3CompoundSharedShape(
struct R3CompoundShapeView children);
16407RAPIER_API R3Status
RAPIER_CALL r3RemoveCollider(
struct R3ColliderHandle handle, R3Bool wake_up);
16413RAPIER_API R3Status
RAPIER_CALL r3RemoveImpulseJoint(
struct R3ImpulseJointHandle handle, R3Bool wake_up);
16421size_t RAPIER_CALL r3ImpulseJointHandles(
const struct R3World *world,
16422 struct R3ImpulseJointHandle *buffer,
16430R3Status
RAPIER_CALL r3RemoveMultibodyJoint(
struct R3MultibodyJointHandle handle,
16439size_t RAPIER_CALL r3MultibodyJointHandles(
const struct R3World *world,
16440 struct R3MultibodyJointHandle *buffer,
16447RAPIER_API
struct R3JointBodies
RAPIER_CALL r3ImpulseJoint_Bodies(struct R3ImpulseJointHandle handle);
16453RAPIER_API
struct R3InverseKinematicsOptions
RAPIER_CALL r3DefaultInverseKinematicsOptions(void);
16461RAPIER_API
size_t RAPIER_CALL r3MultibodyJoint_Ndofs(
struct R3MultibodyJointHandle handle);
16468R3Status
RAPIER_CALL r3MultibodyJoint_InverseKinematics(
struct R3MultibodyJointHandle handle,
16469 const struct R3InverseKinematicsOptions *options,
16470 struct R3Pose target,
16471 R3IkJointCanMove can_move,
16473 R3Real *displacements,
16481R3Status
RAPIER_CALL r3MultibodyJoint_ApplyDisplacements(
struct R3MultibodyJointHandle handle,
16482 const R3Real *displacements,
16489RAPIER_API R3Status
RAPIER_CALL r3FreeSharedShape(R3SharedShape *
object);
16496RAPIER_API R3SharedShape *
RAPIER_CALL r3SharedShape_Clone(
const R3SharedShape *
object);
16502RAPIER_API
size_t RAPIER_CALL r3RigidBodyCount(
const struct R3World *world);
16510size_t RAPIER_CALL r3RigidBodyHandles(
const struct R3World *world,
16511 struct R3RigidBodyHandle *buffer,
16519RAPIER_API R3Bool
RAPIER_CALL r3RigidBody_Contains(
struct R3RigidBodyHandle handle);
16525RAPIER_API
size_t RAPIER_CALL r3ColliderCount(
const struct R3World *world);
16533size_t RAPIER_CALL r3ColliderHandles(
const struct R3World *world,
16534 struct R3ColliderHandle *buffer,
16541RAPIER_API R3Bool
RAPIER_CALL r3Collider_Contains(
struct R3ColliderHandle handle);
16547RAPIER_API
size_t RAPIER_CALL r3SoftBodyCount(
const struct R3World *world);
16555size_t RAPIER_CALL r3SoftBodyHandles(
const struct R3World *world,
16556 struct R3SoftBodyHandle *buffer,
16564RAPIER_API R3Bool
RAPIER_CALL r3SoftBody_Contains(
struct R3SoftBodyHandle handle);
16574R3Status
RAPIER_CALL r3RemoveRigidBody(
struct R3RigidBodyHandle handle,
16575 R3Bool remove_attached_colliders);
16581RAPIER_API R3Real
RAPIER_CALL r3TimeStep(
const struct R3World *world);
16587RAPIER_API R3Status
RAPIER_CALL r3SetTimeStep(
struct R3World *world, R3Real value);
16593RAPIER_API R3Real
RAPIER_CALL r3MinCcdDt(
const struct R3World *world);
16599RAPIER_API R3Status
RAPIER_CALL r3SetMinCcdDt(
struct R3World *world, R3Real value);
16605RAPIER_API R3Real
RAPIER_CALL r3LengthUnit(
const struct R3World *world);
16611RAPIER_API R3Status
RAPIER_CALL r3SetLengthUnit(
struct R3World *world, R3Real value);
16617RAPIER_API R3Real
RAPIER_CALL r3WarmstartCoefficient(
const struct R3World *world);
16623RAPIER_API R3Status
RAPIER_CALL r3SetWarmstartCoefficient(
struct R3World *world, R3Real value);
16629RAPIER_API R3Real
RAPIER_CALL r3NormalizedAllowedLinearError(
const struct R3World *world);
16635RAPIER_API R3Status
RAPIER_CALL r3SetNormalizedAllowedLinearError(
struct R3World *world, R3Real value);
16642RAPIER_API R3Real
RAPIER_CALL r3NormalizedMaxCorrectiveVelocity(
const struct R3World *world);
16649R3Status
RAPIER_CALL r3SetNormalizedMaxCorrectiveVelocity(
struct R3World *world,
16656RAPIER_API R3Real
RAPIER_CALL r3NormalizedPredictionDistance(
const struct R3World *world);
16662RAPIER_API R3Status
RAPIER_CALL r3SetNormalizedPredictionDistance(
struct R3World *world, R3Real value);
16668RAPIER_API R3Real
RAPIER_CALL r3NormalizedMaxLinearVelocity(
const struct R3World *world);
16674RAPIER_API R3Status
RAPIER_CALL r3SetNormalizedMaxLinearVelocity(
struct R3World *world, R3Real value);
16681RAPIER_API R3Real
RAPIER_CALL r3NormalizedContactRecycleDistance(
const struct R3World *world);
16688R3Status
RAPIER_CALL r3SetNormalizedContactRecycleDistance(
struct R3World *world,
16695RAPIER_API
size_t RAPIER_CALL r3NumSolverIterations(
const struct R3World *world);
16701RAPIER_API R3Status
RAPIER_CALL r3SetNumSolverIterations(
struct R3World *world,
size_t value);
16707RAPIER_API
size_t RAPIER_CALL r3NumInternalPgsIterations(
const struct R3World *world);
16713RAPIER_API R3Status
RAPIER_CALL r3SetNumInternalPgsIterations(
struct R3World *world,
size_t value);
16720RAPIER_API
size_t RAPIER_CALL r3NumInternalStabilizationIterations(
const struct R3World *world);
16728R3Status
RAPIER_CALL r3SetNumInternalStabilizationIterations(
struct R3World *world,
16735RAPIER_API
size_t RAPIER_CALL r3MaxCcdSubsteps(
const struct R3World *world);
16741RAPIER_API R3Status
RAPIER_CALL r3SetMaxCcdSubsteps(
struct R3World *world,
size_t value);
16747RAPIER_API R3Bool
RAPIER_CALL r3ContactClustering(
const struct R3World *world);
16753RAPIER_API R3Status
RAPIER_CALL r3SetContactClustering(
struct R3World *world, R3Bool value);
16759RAPIER_API R3Bool
RAPIER_CALL r3ContactRecycling(
const struct R3World *world);
16765RAPIER_API R3Status
RAPIER_CALL r3SetContactRecycling(
struct R3World *world, R3Bool value);
16771RAPIER_API R3Bool
RAPIER_CALL r3FrictionInBiasPass(
const struct R3World *world);
16777RAPIER_API R3Status
RAPIER_CALL r3SetFrictionInBiasPass(
struct R3World *world, R3Bool value);
16783RAPIER_API R3Bool
RAPIER_CALL r3WarmstartJoints(
const struct R3World *world);
16789RAPIER_API R3Status
RAPIER_CALL r3SetWarmstartJoints(
struct R3World *world, R3Bool value);
16795RAPIER_API
struct R3SpringCoefficients
RAPIER_CALL r3ContactSoftness(const struct R3World *world);
16802R3Status
RAPIER_CALL r3SetContactSoftness(
struct R3World *world,
16803 struct R3SpringCoefficients value);
16809RAPIER_API
struct R3SpringCoefficients
RAPIER_CALL r3StaticContactSoftness(const struct R3World *world);
16816R3Status
RAPIER_CALL r3SetStaticContactSoftness(
struct R3World *world,
16817 struct R3SpringCoefficients value);
16824R3Status
RAPIER_CALL r3ContactModificationContext_UpdateAsOnewayPlatform(
struct R3ContactModificationContext *context,
16825 struct R3Vector allowed_local_n1,
16826 R3Real allowed_angle);
16833R3Status
RAPIER_CALL r3ContactModificationContext_SetTangentVelocity(
struct R3ContactModificationContext *context,
16834 struct R3Vector velocity);
16840RAPIER_API
struct R3EventCollector *
RAPIER_CALL r3NewEventCollector(
void);
16847RAPIER_API R3Status
RAPIER_CALL r3FreeEventCollector(
struct R3EventCollector *events);
16853RAPIER_API R3Status
RAPIER_CALL r3EventCollector_Clear(
struct R3EventCollector *events);
16861size_t RAPIER_CALL r3EventCollector_CollisionEvents(
const struct R3EventCollector *events,
16862 struct R3CollisionEvent *buffer,
16871size_t RAPIER_CALL r3EventCollector_ContactForceEvents(
const struct R3EventCollector *events,
16872 struct R3ContactForceEvent *buffer,
16879RAPIER_API
size_t RAPIER_CALL r3EventCollector_TearEventCount(
const struct R3EventCollector *events);
16887struct R3SoftBodyTearEvent *
RAPIER_CALL r3EventCollector_TearEvent(
const struct R3EventCollector *events,
16894RAPIER_API
struct R3Vector
RAPIER_CALL r3Gravity(const struct R3World *world);
16900RAPIER_API R3Status
RAPIER_CALL r3SetGravity(
struct R3World *world,
struct R3Vector value);
16909R3Status
RAPIER_CALL r3Step(
struct R3World *world,
16910 const struct R3PhysicsHooks *hooks,
16911 const struct R3EventCollector *events);
16919R3Status
RAPIER_CALL r3DetectCollisions(
struct R3World *world,
16920 const struct R3PhysicsHooks *hooks,
16921 const struct R3EventCollector *events);
16928RAPIER_API
struct R3ByteView
RAPIER_CALL r3Bytes_Data(const struct R3Bytes *bytes);
16935RAPIER_API R3Status
RAPIER_CALL r3FreeBytes(
struct R3Bytes *bytes);
16942RAPIER_API
struct R3Bytes *
RAPIER_CALL r3SerializeWorld(
const struct R3World *world);
16949RAPIER_API
struct R3World *
RAPIER_CALL r3DeserializeWorld(
const uint8_t *data,
size_t count);
16958size_t RAPIER_CALL r3DebugRender(
const struct R3World *world,
16960 struct R3DebugLine *buffer,
16967RAPIER_API R3Status
RAPIER_CALL r3SoftBodiesSetResweepStrain(
struct R3World *world, R3Real value);
16973RAPIER_API R3Real
RAPIER_CALL r3SoftBodiesResweepStrain(
const struct R3World *world);
16979RAPIER_API R3Status
RAPIER_CALL r3SoftBodiesSetContactStiffening(
struct R3World *world, R3Real value);
16985RAPIER_API R3Real
RAPIER_CALL r3SoftBodiesContactStiffening(
const struct R3World *world);
16991RAPIER_API R3Status
RAPIER_CALL r3SoftBodiesSetMaxExtraSubsteps(
struct R3World *world,
size_t value);
16997RAPIER_API
size_t RAPIER_CALL r3SoftBodiesMaxExtraSubsteps(
const struct R3World *world);
17004R3Status
RAPIER_CALL r3RecoverySetAuthoredVelocityMargin(
struct R3World *world,
17011RAPIER_API R3Status
RAPIER_CALL r3RecoverySetEdgeSpeculation(
struct R3World *world, R3Bool value);
17018R3Status
RAPIER_CALL r3RecoverySetInvertedCellDetection(
struct R3World *world,
17026R3Status
RAPIER_CALL r3RecoverySetSelfCrossingDetection(
struct R3World *world,
17034R3Status
RAPIER_CALL r3RecoverySetDetectionMotionGating(
struct R3World *world,
17041RAPIER_API R3Status
RAPIER_CALL r3RecoverySetCrossBodyDetection(
struct R3World *world, R3Bool value);
17047RAPIER_API R3Status
RAPIER_CALL r3RecoverySetSelfStandDown(
struct R3World *world, R3Bool value);
17053RAPIER_API R3Status
RAPIER_CALL r3RecoverySetCrossBodyExpelGate(
struct R3World *world, R3Bool value);
17059RAPIER_API R3Status
RAPIER_CALL r3RecoverySetEdgeStandDown(
struct R3World *world, R3Bool value);
17065RAPIER_API R3Status
RAPIER_CALL r3RecoverySetCrossingRepulsion(
struct R3World *world, R3Bool value);
17072R3Status
RAPIER_CALL r3RecoverySetCrossingRepulsionGuide(
struct R3World *world,
17080R3Status
RAPIER_CALL r3RecoverySetCrossingRepulsionSelfGuide(
struct R3World *world,
17087RAPIER_API R3Status
RAPIER_CALL r3RecoverySetRecoveryPace(
struct R3World *world, R3Real value);
17093RAPIER_API R3Status
RAPIER_CALL r3RecoverySetOverlapConstraints(
struct R3World *world, R3Bool value);
17099RAPIER_API R3Status
RAPIER_CALL r3RecoverySetOverlapRigid(
struct R3World *world, R3Bool value);
17106R3Status
RAPIER_CALL r3RecoverySetOverlapSkipSelfTangled(
struct R3World *world,
17114R3Status
RAPIER_CALL r3RecoverySetOverlapEdgeStandDown(
struct R3World *world,
17122R3Status
RAPIER_CALL r3RecoverySetOverlapConstraintPace(
struct R3World *world,
17129RAPIER_API R3Status
RAPIER_CALL r3RecoverySetOverlapSkinVolume(
struct R3World *world, R3Bool value);
17135RAPIER_API R3Status
RAPIER_CALL r3RecoverySetOverlapKeptDepth(
struct R3World *world, R3Real value);
17141RAPIER_API R3Status
RAPIER_CALL r3RecoverySetOverlapSelfRegions(
struct R3World *world, R3Bool value);
17147RAPIER_API R3Status
RAPIER_CALL r3RecoverySetOverlapNormalPush(
struct R3World *world, R3Bool value);
17153RAPIER_API R3Status
RAPIER_CALL r3RecoverySetOverlapMultiVolume(
struct R3World *world, R3Bool value);
17160R3Status
RAPIER_CALL r3RecoverySetOverlapProgressMargin(
struct R3World *world,
17163#if defined(RAPIER_FEM)
17168RAPIER_API R3Status
RAPIER_CALL r3FemSetLinearTolerance(
struct R3World *world, R3Real value);
17171#if defined(RAPIER_FEM)
17176RAPIER_API R3Status
RAPIER_CALL r3FemSetMaxLinearIterations(
struct R3World *world,
size_t value);
17179#if defined(RAPIER_FEM)
17184RAPIER_API R3Status
RAPIER_CALL r3FemSetMaxDenseDofs(
struct R3World *world,
size_t value);
17194RAPIER_API R3Status
RAPIER_CALL r3SetNumThreads(
struct R3World *world,
size_t num_threads);
17202RAPIER_API R3Status
RAPIER_CALL r3ClearThreadPool(
struct R3World *world);
17209RAPIER_API
size_t RAPIER_CALL r3NumThreads(
const struct R3World *world);
17216RAPIER_API R3Status
RAPIER_CALL r3SetCountersEnabled(
struct R3World *world, R3Bool enabled);
17224RAPIER_API
double RAPIER_CALL r3StepTimeMs(
const struct R3World *world);
17234RAPIER_API
struct R3World *
RAPIER_CALL r3DeserializeRigidState(
const uint8_t *data,
size_t count);
17240RAPIER_API
struct R3QueryFilter
RAPIER_CALL r3DefaultQueryFilter(void);
17246RAPIER_API
struct R3ShapeCastOptions
RAPIER_CALL r3DefaultShapeCastOptions(void);
17252RAPIER_API R3Status
RAPIER_CALL r3RemoveSoftBody(
struct R3SoftBodyHandle handle);
17258RAPIER_API R3Status
RAPIER_CALL r3SoftBody_WakeUp(
struct R3SoftBodyHandle handle);
17265RAPIER_API R3Status
RAPIER_CALL r3FreeSoftBodyTearEvent(
struct R3SoftBodyTearEvent *event);
17272struct R3SoftBodyHandle
RAPIER_CALL r3SoftBodyTearEvent_SoftBody(const struct R3SoftBodyTearEvent *event);
17282size_t RAPIER_CALL r3SoftBodyTearEvent_Bodies(
const struct R3SoftBodyTearEvent *event,
17283 struct R3SoftBodyHandle *buffer,
17291struct R3ParticleDestination
RAPIER_CALL r3SoftBodyTearEvent_ParticleDestination(const struct R3SoftBodyTearEvent *event,
17292 uint32_t particle);
17300size_t RAPIER_CALL r3SoftBodyTearEvent_TornEdges(
const struct R3SoftBodyTearEvent *event,
17310size_t RAPIER_CALL r3SoftBodyTearEvent_TornCells(
const struct R3SoftBodyTearEvent *event,
17320size_t RAPIER_CALL r3SoftBodyTearEvent_RemovedEdges(
const struct R3SoftBodyTearEvent *event,
17330size_t RAPIER_CALL r3SoftBodyTearEvent_SplitParticles(
const struct R3SoftBodyTearEvent *event,
17340size_t RAPIER_CALL r3SoftBodyTearEvent_InsertedParticles(
const struct R3SoftBodyTearEvent *event,
17352size_t RAPIER_CALL r3SoftBodyTearEvent_PieceParticles(
const struct R3SoftBodyTearEvent *event,
17353 size_t piece_index,
17363size_t RAPIER_CALL r3SoftBodyTearEvent_Clusters(
const struct R3SoftBodyTearEvent *event,
17364 struct R3SoftClusterSplit *buffer,
17373size_t RAPIER_CALL r3SoftBodyTearEvent_MovedJoints(
const struct R3SoftBodyTearEvent *event,
17374 struct R3SoftJointMove *buffer,
17383struct R3SoftBodyTearEvent *
RAPIER_CALL r3SoftBody_Tear(
struct R3SoftBodyHandle handle,
17384 const uint32_t *edges,
17386 const uint32_t *cells,
17387 size_t cell_count);
17394uint32_t
RAPIER_CALL r3SoftBody_AddCluster(
struct R3SoftBodyHandle handle,
17395 const uint32_t *particles,
17403R3Status
RAPIER_CALL r3SoftBody_RemoveCluster(
struct R3SoftBodyHandle handle,
17412struct R3OptionalParticleDestination
RAPIER_CALL r3SoftBodyTearEvent_TryParticleDestination(const struct R3SoftBodyTearEvent *event,
17413 uint32_t particle);
17421struct R3SoftBodyTearEvent *
RAPIER_CALL r3CutSoftBody(
struct R3SoftBodyHandle handle,
17422 const struct R3Vector *blade);
17429RAPIER_API
struct R3VolumeMeshParameters
RAPIER_CALL r3NewVolumeMeshParameters(R3Real cell_size);
17435RAPIER_API
struct R3BuildInfo
RAPIER_CALL r3BuildInfo(void);
17444RAPIER_API
const char *
RAPIER_CALL r3Version(
void);
17453RAPIER_API
const char *
RAPIER_CALL r3BuildProfile(
void);
17459RAPIER_API
struct R3BuildFeatures
RAPIER_CALL r3BuildFeatures(void);
17467R3SharedShape *
RAPIER_CALL r3HeightfieldSharedShape(
struct R3RealView heights,
17470 struct R3Vector scale);
17477struct R3Aabb
RAPIER_CALL r3SharedShape_ComputeAabb(const R3SharedShape *shape,
17478 struct R3Pose pose);
17485struct R3MassProperties
RAPIER_CALL r3SharedShape_MassProperties(const R3SharedShape *shape,
17493R3Bool
RAPIER_CALL r3SharedShape_ContainsPoint(
const R3SharedShape *shape,
17494 struct R3Pose pose,
17495 struct R3Vector point);
17503size_t RAPIER_CALL r3ContactPairs(
const struct R3World *world,
17504 struct R3ContactPair *buffer,
17513struct R3ContactPair
RAPIER_CALL r3ContactPair(struct R3ColliderHandle collider1,
17514 struct R3ColliderHandle collider2);
17522size_t RAPIER_CALL r3IntersectionPairs(
const struct R3World *world,
17523 struct R3IntersectionPair *buffer,
17536size_t RAPIER_CALL r3ContactPoints(
struct R3ColliderHandle collider1,
17537 struct R3ColliderHandle collider2,
17538 struct R3ContactPoint *buffer,
17547size_t RAPIER_CALL r3MultibodyJoint_GeneralizedVelocity(
struct R3MultibodyJointHandle handle,
17556R3Status
RAPIER_CALL r3MultibodyJoint_SetGeneralizedVelocity(
struct R3MultibodyJointHandle handle,
17557 const R3Real *values,
17570 uint32_t dimension,
17572 size_t vector_size,
17574 uint32_t features);
17585size_t RAPIER_CALL r3QuarantinedRigidBodies(
const struct R3World *world,
17586 struct R3RigidBodyHandle *buffer,
17598size_t RAPIER_CALL r3QuarantinedColliders(
const struct R3World *world,
17599 struct R3ColliderHandle *buffer,
17611size_t RAPIER_CALL r3QuarantinedSoftBodies(
const struct R3World *world,
17612 struct R3SoftBodyHandle *buffer,
17615#if defined(RAPIER_DIM3)
17620RAPIER_API uint32_t
RAPIER_CALL r3FrictionModel(
const struct R3World *world);
17623#if defined(RAPIER_DIM3)
17628RAPIER_API R3Status
RAPIER_CALL r3SetFrictionModel(
struct R3World *world, uint32_t value);
17667RAPIER_API R3Real
RAPIER_CALL r3Atan2(R3Real y, R3Real x);
17685RAPIER_API R3Real
RAPIER_CALL r3Powf(R3Real base, R3Real exponent);
17693struct R3ShapeMesh *
RAPIER_CALL r3SharedShape_Tessellate(
const R3SharedShape *shape,
17694 uint32_t subdivisions);
17702size_t RAPIER_CALL r3ShapeMesh_Triangles(
const struct R3ShapeMesh *mesh,
17703 struct R3Vector *buffer,
17712size_t RAPIER_CALL r3ShapeMesh_Lines(
const struct R3ShapeMesh *mesh,
17713 struct R3Vector *buffer,
17721RAPIER_API R3Status
RAPIER_CALL r3FreeShapeMesh(
struct R3ShapeMesh *mesh);
17723#if defined(RAPIER_DIM3)
17729R3SharedShape *
RAPIER_CALL r3RoundCylinderSharedShape(R3Real half_height,
17731 R3Real border_radius);
17734#if defined(RAPIER_DIM3)
17740R3SharedShape *
RAPIER_CALL r3RoundConeSharedShape(R3Real half_height,
17742 R3Real border_radius);
17745#if defined(RAPIER_DIM3)
17754struct R3TriMeshData *
RAPIER_CALL r3SharedShape_ToTrimesh(
const R3SharedShape *shape,
17759#if defined(RAPIER_DIM3)
17766size_t RAPIER_CALL r3TriMeshData_Vertices(
const struct R3TriMeshData *mesh,
17767 struct R3Vector *buffer,
17771#if defined(RAPIER_DIM3)
17778size_t RAPIER_CALL r3TriMeshData_Indices(
const struct R3TriMeshData *mesh,
17783#if defined(RAPIER_DIM3)
17789RAPIER_API R3Status
RAPIER_CALL r3FreeTriMeshData(
struct R3TriMeshData *mesh);
17792#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17797RAPIER_API
struct R3UrdfLoaderOptions
RAPIER_CALL r3DefaultUrdfLoaderOptions(void);
17800#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17806RAPIER_API R3Status
RAPIER_CALL r3FreeUrdfRobot(
struct R3UrdfRobot *
object);
17809#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17816struct R3UrdfRobot *
RAPIER_CALL r3UrdfRobotFromFile(
const char *path,
17817 const struct R3UrdfLoaderOptions *options);
17820#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17826R3Status
RAPIER_CALL r3UrdfRobot_AppendTransform(
struct R3UrdfRobot *robot,
17827 struct R3Pose transform);
17830#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17836RAPIER_API R3Status
RAPIER_CALL r3FreeUrdfRobotHandles(
struct R3UrdfRobotHandles *handles);
17839#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17845struct R3UrdfRobotHandles *
RAPIER_CALL r3UrdfRobot_InsertUsingImpulseJoints(
struct R3World *world,
17846 const struct R3UrdfRobot *robot);
17849#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17855struct R3UrdfRobotHandles *
RAPIER_CALL r3UrdfRobot_InsertUsingMultibodyJoints(
struct R3World *world,
17856 const struct R3UrdfRobot *robot,
17860#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17868size_t RAPIER_CALL r3UrdfRobotHandles_Bodies(
const struct R3UrdfRobotHandles *handles,
17869 struct R3RigidBodyHandle *buffer,
17873#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17878RAPIER_API
struct R3MjcfLoaderOptions
RAPIER_CALL r3DefaultMjcfLoaderOptions(void);
17881#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17887RAPIER_API R3Status
RAPIER_CALL r3FreeMjcfRobot(
struct R3MjcfRobot *
object);
17890#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17897struct R3MjcfRobot *
RAPIER_CALL r3MjcfRobotFromFile(
const char *path,
17898 const struct R3MjcfLoaderOptions *options);
17901#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17907R3Status
RAPIER_CALL r3MjcfRobot_AppendTransform(
struct R3MjcfRobot *robot,
17908 struct R3Pose transform);
17911#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17917RAPIER_API R3Status
RAPIER_CALL r3FreeMjcfRobotHandles(
struct R3MjcfRobotHandles *handles);
17920#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17926struct R3MjcfRobotHandles *
RAPIER_CALL r3MjcfRobot_InsertUsingImpulseJoints(
struct R3World *world,
17927 const struct R3MjcfRobot *robot);
17930#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17936struct R3MjcfRobotHandles *
RAPIER_CALL r3MjcfRobot_InsertUsingMultibodyJoints(
struct R3World *world,
17937 const struct R3MjcfRobot *robot,
17941#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17948size_t RAPIER_CALL r3MjcfRobotHandles_Bodies(
const struct R3MjcfRobotHandles *handles,
17949 struct R3RigidBodyHandle *buffer,
17953#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17958RAPIER_API
struct R3Vector
RAPIER_CALL r3MjcfRobot_Gravity(const struct R3MjcfRobot *robot);
17961#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17966RAPIER_API
size_t RAPIER_CALL r3MjcfRobot_BodyCount(
const struct R3MjcfRobot *robot);
17969#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17974RAPIER_API
size_t RAPIER_CALL r3MjcfRobot_BodyColliderCount(
const struct R3MjcfRobot *robot,
size_t body);
17977#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17983R3Status
RAPIER_CALL r3MjcfRobot_SetBodyColliderCollisionGroups(
struct R3MjcfRobot *robot,
17986 struct R3InteractionGroups groups);
17989#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17994RAPIER_API
size_t RAPIER_CALL r3MjcfRobot_KeyframeCount(
const struct R3MjcfRobot *robot);
17997#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18004size_t RAPIER_CALL r3MjcfRobot_KeyframeName(
const struct R3MjcfRobot *robot,
18010#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18016R3Status
RAPIER_CALL r3MjcfRobot_AppendKeyframe(
struct R3MjcfRobot *robot,
18017 const struct R3MjcfRobot *source,
18021#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18028size_t RAPIER_CALL r3MjcfRobot_KeyframeControls(
const struct R3MjcfRobot *robot,
18034#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18039RAPIER_API
size_t RAPIER_CALL r3MjcfRobotHandles_ActuatorCount(
const struct R3MjcfRobotHandles *handles);
18042#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18048R3Status
RAPIER_CALL r3MjcfRobotHandles_ApplyKeyframe(
const struct R3MjcfRobotHandles *handles,
18049 const struct R3MjcfRobot *robot,
18053#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18059R3Status
RAPIER_CALL r3MjcfRobotHandles_ApplyControlsScaled(
const struct R3MjcfRobotHandles *handles,
18060 const R3Real *controls,
18065#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18070RAPIER_API
size_t RAPIER_CALL r3MjcfRobot_BodyVisualCount(
const struct R3MjcfRobot *robot,
size_t body);
18073#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18080const R3MjcfVisualMesh *
RAPIER_CALL r3MjcfRobot_BodyVisual(
const struct R3MjcfRobot *robot,
18085#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18090RAPIER_API
struct R3MjcfVisualMeshInfo
RAPIER_CALL r3MjcfVisualMesh_Info(const R3MjcfVisualMesh *visual);
18093#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18099RAPIER_API R3SharedShape *
RAPIER_CALL r3MjcfVisualMesh_CloneShape(
const R3MjcfVisualMesh *visual);
18102#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18109size_t RAPIER_CALL r3MjcfVisualMesh_Uvs(
const R3MjcfVisualMesh *visual,
18114#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18121size_t RAPIER_CALL r3MjcfVisualMesh_Normals(
const R3MjcfVisualMesh *visual,
18126#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18133size_t RAPIER_CALL r3MjcfVisualMesh_Texture(
const R3MjcfVisualMesh *visual,
18138#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18146struct R3UrdfRobot *
RAPIER_CALL r3UrdfRobotFromString(
const char *urdf,
18147 const char *mesh_dir,
18148 const struct R3UrdfLoaderOptions *options);
18151#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18157RAPIER_API R3Status
RAPIER_CALL r3FreeMjcfContactHooks(
struct R3MjcfContactHooks *hooks);
18160#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18167struct R3MjcfContactHooks *
RAPIER_CALL r3MjcfRobotHandles_ContactHooks(
const struct R3MjcfRobotHandles *handles,
18168 const struct R3MjcfRobot *robot);
18171#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18179struct R3PhysicsHooks
RAPIER_CALL r3MjcfContactHooks_PhysicsHooks(const struct R3MjcfContactHooks *hooks);
18182#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18188RAPIER_API R3Status
RAPIER_CALL r3FreeLoadedMeshes(
struct R3LoadedMeshes *meshes);
18191#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18200struct R3LoadedMeshes *
RAPIER_CALL r3LoadedMeshesFromFile(
const char *path,
18201 uint32_t converter,
18202 uint32_t trimesh_flags,
18203 struct R3Vector scale);
18206#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18211RAPIER_API
size_t RAPIER_CALL r3LoadedMeshes_Count(
const struct R3LoadedMeshes *meshes);
18214#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18222R3SharedShape *
RAPIER_CALL r3LoadedMeshes_CloneShape(
const struct R3LoadedMeshes *meshes,
18226#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18233struct R3Pose
RAPIER_CALL r3LoadedMeshes_Pose(const struct R3LoadedMeshes *meshes,
18241RAPIER_API
struct R3Pose
RAPIER_CALL r3RigidBody_Position(struct R3RigidBodyHandle handle);
18247RAPIER_API
struct R3Vector
RAPIER_CALL r3RigidBody_Translation(struct R3RigidBodyHandle handle);
18253RAPIER_API
struct R3Vector
RAPIER_CALL r3RigidBody_Linvel(struct R3RigidBodyHandle handle);
18259RAPIER_API R3AngVector
RAPIER_CALL r3RigidBody_Angvel(
struct R3RigidBodyHandle handle);
18265RAPIER_API R3Bool
RAPIER_CALL r3RigidBody_IsSleeping(
struct R3RigidBodyHandle handle);
18271RAPIER_API R3Bool
RAPIER_CALL r3RigidBody_IsEnabled(
struct R3RigidBodyHandle handle);
18277RAPIER_API
struct R3UserData
RAPIER_CALL r3RigidBody_UserData(struct R3RigidBodyHandle handle);
18285R3Status
RAPIER_CALL r3RigidBody_SetPosition(
struct R3RigidBodyHandle handle,
18286 struct R3Pose value,
18295R3Status
RAPIER_CALL r3RigidBody_SetTranslation(
struct R3RigidBodyHandle handle,
18296 struct R3Vector value,
18305R3Status
RAPIER_CALL r3RigidBody_SetLinvel(
struct R3RigidBodyHandle handle,
18306 struct R3Vector value,
18315R3Status
RAPIER_CALL r3RigidBody_SetAngvel(
struct R3RigidBodyHandle handle,
18324R3Status
RAPIER_CALL r3RigidBody_SetNextKinematicPosition(
struct R3RigidBodyHandle handle,
18325 struct R3Pose value);
18332R3Status
RAPIER_CALL r3RigidBody_SetNextKinematicTranslation(
struct R3RigidBodyHandle handle,
18333 struct R3Vector value);
18341R3Status
RAPIER_CALL r3RigidBody_SetGravityScale(
struct R3RigidBodyHandle handle,
18350R3Status
RAPIER_CALL r3RigidBody_SetLinearDamping(
struct R3RigidBodyHandle handle,
18358R3Status
RAPIER_CALL r3RigidBody_SetAngularDamping(
struct R3RigidBodyHandle handle,
18365RAPIER_API R3Status
RAPIER_CALL r3RigidBody_SetEnabled(
struct R3RigidBodyHandle handle, R3Bool value);
18372R3Status
RAPIER_CALL r3RigidBody_SetUserData(
struct R3RigidBodyHandle handle,
18373 struct R3UserData value);
18381R3Status
RAPIER_CALL r3RigidBody_ApplyImpulse(
struct R3RigidBodyHandle handle,
18382 struct R3Vector value,
18391R3Status
RAPIER_CALL r3RigidBody_ApplyImpulseAtPoint(
struct R3RigidBodyHandle handle,
18392 struct R3Vector value,
18393 struct R3Vector point,
18402R3Status
RAPIER_CALL r3RigidBody_AddForce(
struct R3RigidBodyHandle handle,
18403 struct R3Vector value,
18411RAPIER_API R3Status
RAPIER_CALL r3RigidBody_ResetForces(
struct R3RigidBodyHandle handle, R3Bool wake_up);
18417RAPIER_API R3Status
RAPIER_CALL r3RigidBody_Sleep(
struct R3RigidBodyHandle handle);
18423RAPIER_API
struct R3Pose
RAPIER_CALL r3Collider_Position(struct R3ColliderHandle handle);
18429RAPIER_API
struct R3Vector
RAPIER_CALL r3Collider_Translation(struct R3ColliderHandle handle);
18435RAPIER_API R3Real
RAPIER_CALL r3Collider_Friction(
struct R3ColliderHandle handle);
18441RAPIER_API R3Real
RAPIER_CALL r3Collider_Restitution(
struct R3ColliderHandle handle);
18447RAPIER_API R3Bool
RAPIER_CALL r3Collider_IsSensor(
struct R3ColliderHandle handle);
18453RAPIER_API
struct R3RigidBodyHandle
RAPIER_CALL r3Collider_Parent(struct R3ColliderHandle handle);
18461R3Status
RAPIER_CALL r3Collider_SetPosition(
struct R3ColliderHandle handle,
18462 struct R3Pose value);
18470R3Status
RAPIER_CALL r3Collider_SetTranslation(
struct R3ColliderHandle handle,
18471 struct R3Vector value);
18477RAPIER_API R3Status
RAPIER_CALL r3Collider_SetFriction(
struct R3ColliderHandle handle, R3Real value);
18483RAPIER_API R3Status
RAPIER_CALL r3Collider_SetRestitution(
struct R3ColliderHandle handle, R3Real value);
18489RAPIER_API R3Status
RAPIER_CALL r3Collider_SetSensor(
struct R3ColliderHandle handle, R3Bool value);
18496R3Status
RAPIER_CALL r3Collider_SetCollisionGroups(
struct R3ColliderHandle handle,
18497 struct R3InteractionGroups value);
18504R3Status
RAPIER_CALL r3Collider_SetUserData(
struct R3ColliderHandle handle,
18505 struct R3UserData value);
18512struct R3Vector
RAPIER_CALL r3SoftBody_ParticlePosition(struct R3SoftBodyHandle handle,
18521size_t RAPIER_CALL r3SoftBody_ParticlePositions(
struct R3SoftBodyHandle handle,
18522 struct R3Vector *buffer,
18529RAPIER_API
struct R3SoftBodyMaterial
RAPIER_CALL r3SoftBody_Material(struct R3SoftBodyHandle handle);
18536R3Status
RAPIER_CALL r3SoftBody_SetParticlePosition(
struct R3SoftBodyHandle handle,
18538 struct R3Vector value);
18545R3Status
RAPIER_CALL r3SoftBody_SetMaterial(
struct R3SoftBodyHandle handle,
18546 const struct R3SoftBodyMaterial *data);
18554R3Status
RAPIER_CALL r3SoftBody_AddParticleForce(
struct R3SoftBodyHandle handle,
18556 struct R3Vector value,
18566size_t RAPIER_CALL r3RigidBodyReadStates(
const struct R3World *world,
18567 const struct R3RigidBodyHandle *handles,
18568 size_t handle_count,
18569 struct R3RigidBodyState *states,
18576RAPIER_API
struct R3JointDesc
RAPIER_CALL r3ImpulseJoint_Desc(struct R3ImpulseJointHandle handle);
18584R3Status
RAPIER_CALL r3ImpulseJoint_SetDesc(
struct R3ImpulseJointHandle handle,
18585 const struct R3JointDesc *desc,
18592RAPIER_API uint16_t
RAPIER_CALL r3Collider_ActiveCollisionTypes(
struct R3ColliderHandle handle);
18598RAPIER_API uint32_t
RAPIER_CALL r3Collider_ActiveHooks(
struct R3ColliderHandle handle);
18604RAPIER_API uint32_t
RAPIER_CALL r3Collider_FrictionCombineRule(
struct R3ColliderHandle handle);
18610RAPIER_API uint32_t
RAPIER_CALL r3Collider_RestitutionCombineRule(
struct R3ColliderHandle handle);
18617RAPIER_API
struct R3Pose
RAPIER_CALL r3Collider_PositionWrtParent(struct R3ColliderHandle handle);
18623RAPIER_API int8_t
RAPIER_CALL r3RigidBody_DominanceGroup(
struct R3RigidBodyHandle handle);
18629RAPIER_API
size_t RAPIER_CALL r3RigidBody_AdditionalSolverIterations(
struct R3RigidBodyHandle handle);
18635RAPIER_API
size_t RAPIER_CALL r3RigidBody_AdditionalPgsIterations(
struct R3RigidBodyHandle handle);
18641RAPIER_API R3Bool
RAPIER_CALL r3RigidBody_IsFastRotationAllowed(
struct R3RigidBodyHandle handle);
18649R3Status
RAPIER_CALL r3Collider_SetRotation(
struct R3ColliderHandle handle,
18650 struct R3Rotation value);
18658R3Status
RAPIER_CALL r3RigidBody_SetAllowFastRotation(
struct R3RigidBodyHandle handle,
18668R3Status
RAPIER_CALL r3ShapeDesc_SetTrimesh(
struct R3ShapeDesc *desc,
18669 struct R3VectorView vertices,
18670 struct R3TriangleView indices,
18680R3Status
RAPIER_CALL r3ShapeDesc_SetPolyline(
struct R3ShapeDesc *desc,
18681 struct R3VectorView vertices,
18682 struct R3EdgeView indices,
18690R3Status
RAPIER_CALL r3ShapeDesc_SetConvexHull(
struct R3ShapeDesc *desc,
18691 struct R3VectorView vertices);
18698R3Status
RAPIER_CALL r3SoftBodyDesc_SetParticles(
struct R3SoftBodyDesc *desc,
18699 struct R3VectorView positions);
18706R3Status
RAPIER_CALL r3SoftBodyDesc_SetSurfaceMesh(
struct R3SoftBodyDesc *desc,
18707 struct R3VectorView vertices,
18708 R3SurfaceElementView elements);
18710#if defined(RAPIER_DIM2)
18718R3Status
RAPIER_CALL r3SoftBodyDesc_SetTrimesh(
struct R3SoftBodyDesc *desc,
18719 struct R3VectorView vertices,
18720 struct R3TriangleView triangles);
18730R3Status
RAPIER_CALL r3SoftBodyDesc_SetAppended(
struct R3SoftBodyDesc *desc,
18731 struct R3SoftBodyDescView view);
18740R3Status
RAPIER_CALL r3SoftBodyDesc_SetAddedEdges(
struct R3SoftBodyDesc *desc,
18741 struct R3EdgeView view);
18748R3Status
RAPIER_CALL r3SoftBodyDesc_SetSkin(
struct R3SoftBodyDesc *desc,
18749 struct R3VectorView vertices,
18750 R3SurfaceElementView elements);
18760R3Status
RAPIER_CALL r3SoftBodyDesc_SetMasses(
struct R3SoftBodyDesc *desc,
18761 struct R3RealView view);
18771R3Status
RAPIER_CALL r3SoftBodyDesc_SetPinnedParticles(
struct R3SoftBodyDesc *desc,
18772 struct R3IndexView view);
18782R3Status
RAPIER_CALL r3SoftBodyDesc_SetEdges(
struct R3SoftBodyDesc *desc,
18783 struct R3EdgeView view);
18793R3Status
RAPIER_CALL r3SoftBodyDesc_SetBendEdges(
struct R3SoftBodyDesc *desc,
18794 struct R3EdgeView view);
18803RAPIER_API R3Status
RAPIER_CALL r3SoftBodyDesc_SetCells(
struct R3SoftBodyDesc *desc, R3CellView view);
18813R3Status
RAPIER_CALL r3SoftBodyDesc_SetSurface(
struct R3SoftBodyDesc *desc,
18814 R3SurfaceElementView view);
18824R3Status
RAPIER_CALL r3SoftBodyDesc_SetTensionOnlyEdges(
struct R3SoftBodyDesc *desc,
18825 struct R3IndexView view);
18827#if defined(RAPIER_DIM3)
18836R3Status
RAPIER_CALL r3SoftBodyDesc_SetDihedrals(
struct R3SoftBodyDesc *desc,
18837 struct R3DihedralView view);
18840#if defined(RAPIER_DIM3)
18849R3Status
RAPIER_CALL r3SoftBodyDesc_SetWire(
struct R3SoftBodyDesc *desc,
18850 struct R3EdgeView view);
18859struct R3ColliderDesc
RAPIER_CALL r3RoundCuboidColliderDesc(struct R3Vector half_extents,
18860 R3Real border_radius);
18868struct R3ColliderDesc
RAPIER_CALL r3CapsuleColliderDesc(struct R3Vector a,
18877RAPIER_API
struct R3ColliderDesc
RAPIER_CALL r3SegmentColliderDesc(struct R3Vector a, struct R3Vector b);
18885struct R3ColliderDesc
RAPIER_CALL r3TriangleColliderDesc(struct R3Vector a,
18887 struct R3Vector c);
18894RAPIER_API
struct R3ColliderDesc
RAPIER_CALL r3HalfspaceColliderDesc(struct R3Vector normal);
18896#if defined(RAPIER_DIM3)
18902RAPIER_API
struct R3ColliderDesc
RAPIER_CALL r3CylinderColliderDesc(R3Real half_height, R3Real radius);
18905#if defined(RAPIER_DIM3)
18911RAPIER_API
struct R3ColliderDesc
RAPIER_CALL r3ConeColliderDesc(R3Real half_height, R3Real radius);
18914#if defined(RAPIER_DIM3)
18921struct R3ColliderDesc
RAPIER_CALL r3RoundCylinderColliderDesc(R3Real half_height,
18923 R3Real border_radius);
18926#if defined(RAPIER_DIM3)
18933struct R3ColliderDesc
RAPIER_CALL r3RoundConeColliderDesc(R3Real half_height,
18935 R3Real border_radius);
18943RAPIER_API
struct R3ColliderDesc
RAPIER_CALL r3CapsuleXColliderDesc(R3Real half_height, R3Real radius);
18950RAPIER_API
struct R3ColliderDesc
RAPIER_CALL r3CapsuleYColliderDesc(R3Real half_height, R3Real radius);
18952#if defined(RAPIER_DIM3)
18958RAPIER_API
struct R3ColliderDesc
RAPIER_CALL r3CapsuleZColliderDesc(R3Real half_height, R3Real radius);
18967struct R3SoftBodyDesc
RAPIER_CALL r3RopeSoftBodyDesc(struct R3Vector a,
18971#if defined(RAPIER_DIM2)
18978struct R3SoftBodyDesc
RAPIER_CALL r3GridSoftBodyDesc(struct R3Vector center,
18979 struct R3Vector half_extents,
18984#if defined(RAPIER_DIM3)
18991struct R3SoftBodyDesc
RAPIER_CALL r3CuboidSoftBodyDesc(struct R3Vector center,
18992 struct R3Vector half_extents,
18998#if defined(RAPIER_DIM3)
19005struct R3SoftBodyDesc
RAPIER_CALL r3ClothSoftBodyDesc(struct R3Vector origin,
19006 struct R3Vector du,
19007 struct R3Vector dv,
19012#if defined(RAPIER_DIM3)
19021struct R3SoftBodyDesc
RAPIER_CALL r3ClothAnisotropicSoftBodyDesc(struct R3Vector origin,
19022 struct R3Vector du,
19023 struct R3Vector dv,
19026 struct R3SpringCoefficients warp,
19027 struct R3SpringCoefficients weft,
19028 struct R3SpringCoefficients shear);
19031#if defined(RAPIER_DIM2)
19039RAPIER_API
struct R3SoftBodyDesc
RAPIER_CALL r3PolygonSoftBodyDesc(struct R3VectorView points);
19042#if defined(RAPIER_DIM2)
19050struct R3SoftBodyDesc
RAPIER_CALL r3DiskSoftBodyDesc(struct R3Vector center,
19055#if defined(RAPIER_DIM3)
19062struct R3SoftBodyDesc
RAPIER_CALL r3SphereSoftBodyDesc(struct R3Vector center,
19064 uint32_t subdivisions);
19067#if defined(RAPIER_DIM3)
19075struct R3SoftBodyDesc
RAPIER_CALL r3ClothTubeSoftBodyDesc(struct R3Vector origin,
19076 struct R3Vector axis,
19077 R3Real radius_start,
19088struct R3SoftBodyDesc
RAPIER_CALL r3VolumetricSoftBodyDesc(struct R3VectorView vertices,
19089 R3SurfaceElementView surface,
19090 struct R3VolumeMeshParameters parameters);
19097struct R3SoftBodyMaterial
RAPIER_CALL r3UniformSoftBodyMaterial(struct R3SpringCoefficients value);
19105size_t RAPIER_CALL r3SoftBodyDesc_ParticlePositions(
const struct R3SoftBodyDesc *desc,
19106 struct R3Vector *buffer,
19115size_t RAPIER_CALL r3SoftBodyDesc_CellIndices(
const struct R3SoftBodyDesc *desc,
19124struct R3Vector
RAPIER_CALL r3SoftBody_ParticleVelocity(struct R3SoftBodyHandle handle,
19132RAPIER_API uint32_t
RAPIER_CALL r3SoftBody_Solver(
struct R3SoftBodyHandle handle);
19140R3Status
RAPIER_CALL r3SoftBody_SetClusterEdgeSoftness(
struct R3SoftBodyHandle handle,
19142 const struct R3SpringCoefficients *softness);
19153R3Status
RAPIER_CALL r3SoftBody_ApplyImpulseAtPoint(
struct R3SoftBodyHandle handle,
19154 struct R3Vector impulse,
19155 struct R3Vector point,
19156 R3Real falloff_radius,
19169R3Status
RAPIER_CALL r3SoftBody_ApplyRadialImpulse(
struct R3SoftBodyHandle handle,
19170 struct R3Vector center,
19172 R3Real falloff_radius,
19181RAPIER_API R3Status
RAPIER_CALL r3SoftBody_ResetPlasticity(
struct R3SoftBodyHandle handle);
19188RAPIER_API R3Status
RAPIER_CALL r3SoftBody_TearEdge(
struct R3SoftBodyHandle handle,
size_t index);
19196RAPIER_API R3Status
RAPIER_CALL r3SoftBody_TearCell(
struct R3SoftBodyHandle handle,
size_t index);
19203RAPIER_API
struct R3SoftBodyHandle
RAPIER_CALL r3Collider_SoftBody(struct R3ColliderHandle handle);
19211struct R3SoftBodyHandle
RAPIER_CALL r3ReadCollider_SoftBody(const struct R3ReadContext *context,
19212 struct R3ColliderHandle handle);
19220RAPIER_API
size_t RAPIER_CALL r3SoftBodyTearEvent_PieceCount(
const struct R3SoftBodyTearEvent *event);
19226RAPIER_API R3Bool
RAPIER_CALL r3RecoveryAuthoredVelocityMargin(
const struct R3World *world);
19232RAPIER_API R3Bool
RAPIER_CALL r3RecoveryEdgeSpeculation(
const struct R3World *world);
19238RAPIER_API R3Bool
RAPIER_CALL r3RecoveryInvertedCellDetection(
const struct R3World *world);
19244RAPIER_API R3Bool
RAPIER_CALL r3RecoverySelfCrossingDetection(
const struct R3World *world);
19250RAPIER_API R3Bool
RAPIER_CALL r3RecoveryDetectionMotionGating(
const struct R3World *world);
19256RAPIER_API R3Bool
RAPIER_CALL r3RecoveryCrossBodyDetection(
const struct R3World *world);
19262RAPIER_API R3Bool
RAPIER_CALL r3RecoverySelfStandDown(
const struct R3World *world);
19268RAPIER_API R3Bool
RAPIER_CALL r3RecoveryCrossBodyExpelGate(
const struct R3World *world);
19274RAPIER_API R3Bool
RAPIER_CALL r3RecoveryEdgeStandDown(
const struct R3World *world);
19280RAPIER_API R3Bool
RAPIER_CALL r3RecoveryCrossingRepulsion(
const struct R3World *world);
19286RAPIER_API R3Bool
RAPIER_CALL r3RecoveryCrossingRepulsionGuide(
const struct R3World *world);
19292RAPIER_API R3Bool
RAPIER_CALL r3RecoveryCrossingRepulsionSelfGuide(
const struct R3World *world);
19298RAPIER_API R3Real
RAPIER_CALL r3RecoveryRecoveryPace(
const struct R3World *world);
19304RAPIER_API R3Bool
RAPIER_CALL r3RecoveryOverlapConstraints(
const struct R3World *world);
19310RAPIER_API R3Bool
RAPIER_CALL r3RecoveryOverlapRigid(
const struct R3World *world);
19316RAPIER_API R3Bool
RAPIER_CALL r3RecoveryOverlapSkipSelfTangled(
const struct R3World *world);
19322RAPIER_API R3Bool
RAPIER_CALL r3RecoveryOverlapEdgeStandDown(
const struct R3World *world);
19328RAPIER_API R3Real
RAPIER_CALL r3RecoveryOverlapConstraintPace(
const struct R3World *world);
19334RAPIER_API uint32_t
RAPIER_CALL r3RecoveryOverlapPatchConstraints(
const struct R3World *world);
19341R3Status
RAPIER_CALL r3RecoverySetOverlapPatchConstraints(
struct R3World *world,
19348RAPIER_API R3Bool
RAPIER_CALL r3RecoveryOverlapSkinVolume(
const struct R3World *world);
19354RAPIER_API R3Real
RAPIER_CALL r3RecoveryOverlapKeptDepth(
const struct R3World *world);
19360RAPIER_API R3Bool
RAPIER_CALL r3RecoveryOverlapSelfRegions(
const struct R3World *world);
19366RAPIER_API R3Bool
RAPIER_CALL r3RecoveryOverlapNormalPush(
const struct R3World *world);
19372RAPIER_API R3Bool
RAPIER_CALL r3RecoveryOverlapMultiVolume(
const struct R3World *world);
19378RAPIER_API uint32_t
RAPIER_CALL r3RecoveryOverlapSplit(
const struct R3World *world);
19384RAPIER_API R3Status
RAPIER_CALL r3RecoverySetOverlapSplit(
struct R3World *world, uint32_t value);
19390RAPIER_API uint32_t
RAPIER_CALL r3RecoveryOverlapPatience(
const struct R3World *world);
19396RAPIER_API R3Status
RAPIER_CALL r3RecoverySetOverlapPatience(
struct R3World *world, uint32_t value);
19402RAPIER_API R3Real
RAPIER_CALL r3RecoveryOverlapProgressMargin(
const struct R3World *world);
19404#if defined(RAPIER_FEM)
19409RAPIER_API R3Real
RAPIER_CALL r3FemLinearTolerance(
const struct R3World *world);
19412#if defined(RAPIER_FEM)
19417RAPIER_API
size_t RAPIER_CALL r3FemMaxLinearIterations(
const struct R3World *world);
19420#if defined(RAPIER_FEM)
19425RAPIER_API
size_t RAPIER_CALL r3FemMaxDenseDofs(
const struct R3World *world);
19433RAPIER_API
size_t RAPIER_CALL r3Collider_ShapeIdentity(
struct R3ColliderHandle handle);
19439RAPIER_API
size_t RAPIER_CALL r3SoftBody_NumParticles(
struct R3SoftBodyHandle handle);
19446RAPIER_API uint32_t
RAPIER_CALL r3SoftBody_TopologyVersion(
struct R3SoftBodyHandle handle);
19452RAPIER_API R3Real
RAPIER_CALL r3SoftBody_Mass(
struct R3SoftBodyHandle handle);
19458RAPIER_API R3Real
RAPIER_CALL r3SoftBody_Volume(
struct R3SoftBodyHandle handle);
19464RAPIER_API R3Real
RAPIER_CALL r3SoftBody_RestVolume(
struct R3SoftBodyHandle handle);
19470RAPIER_API R3Real
RAPIER_CALL r3SoftBody_VolumeFactor(
struct R3SoftBodyHandle handle);
19476RAPIER_API
struct R3Vector
RAPIER_CALL r3SoftBody_CenterOfMass(struct R3SoftBodyHandle handle);
19482RAPIER_API
struct R3RigidBodyHandle
RAPIER_CALL r3SoftBody_RootBody(struct R3SoftBodyHandle handle);
19488RAPIER_API R3Bool
RAPIER_CALL r3SoftBody_IsEnabled(
struct R3SoftBodyHandle handle);
19494RAPIER_API R3Bool
RAPIER_CALL r3SoftBody_IsSleeping(
struct R3SoftBodyHandle handle);
19502size_t RAPIER_CALL r3SoftBody_ParticleVelocities(
struct R3SoftBodyHandle handle,
19503 struct R3Vector *buffer,
19512size_t RAPIER_CALL r3SoftBody_Edges(
struct R3SoftBodyHandle handle,
19522size_t RAPIER_CALL r3SoftBody_Cells(
struct R3SoftBodyHandle handle,
19532size_t RAPIER_CALL r3SoftBody_Boundary(
struct R3SoftBodyHandle handle,
19542size_t RAPIER_CALL r3SoftBody_Pieces(
struct R3SoftBodyHandle handle,
19543 struct R3SoftBodyHandle *buffer,
19551R3Status
RAPIER_CALL r3SoftBody_SetParticleVelocity(
struct R3SoftBodyHandle handle,
19553 struct R3Vector value);
19560R3Status
RAPIER_CALL r3SoftBody_SetParticleKinematicTarget(
struct R3SoftBodyHandle handle,
19562 struct R3Vector value);
19569R3Status
RAPIER_CALL r3SoftBody_SetParticlePinned(
struct R3SoftBodyHandle handle,
19579R3Status
RAPIER_CALL r3SoftBody_ApplyParticleImpulse(
struct R3SoftBodyHandle handle,
19581 struct R3Vector value,
19590R3Status
RAPIER_CALL r3SoftBody_AddForce(
struct R3SoftBodyHandle handle,
19591 struct R3Vector value,
19602R3Status
RAPIER_CALL r3SoftBody_ApplyImpulse(
struct R3SoftBodyHandle handle,
19603 struct R3Vector value,
19611RAPIER_API R3Status
RAPIER_CALL r3SoftBody_ResetForces(
struct R3SoftBodyHandle handle, R3Bool wake_up);
19617RAPIER_API R3Status
RAPIER_CALL r3SoftBody_SetEnabled(
struct R3SoftBodyHandle handle, R3Bool value);
19624R3Status
RAPIER_CALL r3SoftBody_SetVolumeFactor(
struct R3SoftBodyHandle handle,
19634R3Status
RAPIER_CALL r3SoftBody_AttachParticle(
struct R3SoftBodyHandle handle,
19636 struct R3RigidBodyHandle rigid_body);
19643RAPIER_API R3Bool
RAPIER_CALL r3SoftBody_DetachParticle(
struct R3SoftBodyHandle handle,
size_t index);
19651size_t RAPIER_CALL r3SoftBody_Clusters(
struct R3SoftBodyHandle handle,
19660struct R3RigidBodyHandle
RAPIER_CALL r3SoftBody_ClusterProxy(struct R3SoftBodyHandle handle,
19669size_t RAPIER_CALL r3SoftBody_ClusterParticles(
struct R3SoftBodyHandle handle,
19679R3Status
RAPIER_CALL r3SoftBody_SetClusterPinned(
struct R3SoftBodyHandle handle,
19688R3Status
RAPIER_CALL r3SoftBody_SetClusterKinematicTarget(
struct R3SoftBodyHandle handle,
19690 struct R3Pose value);
19697R3Status
RAPIER_CALL r3SoftBody_SetClusterShapeMatchingEnabled(
struct R3SoftBodyHandle handle,
19708R3Status
RAPIER_CALL r3SoftBody_SetClusterStiffnessScale(
struct R3SoftBodyHandle handle,
19717R3Status
RAPIER_CALL r3SoftBody_SetClusterTearResistance(
struct R3SoftBodyHandle handle,
19727size_t RAPIER_CALL r3SoftBody_Meshes(
struct R3SoftBodyHandle handle,
19728 struct R3SoftMeshInfo *buffer,
19737size_t RAPIER_CALL r3SoftBody_MeshVerticesById(
struct R3SoftBodyHandle handle,
19738 struct R3SoftMeshId
id,
19739 struct R3Vector *buffer,
19748size_t RAPIER_CALL r3SoftBody_MeshIndicesById(
struct R3SoftBodyHandle handle,
19749 struct R3SoftMeshId
id,
19759size_t RAPIER_CALL r3SoftBody_MeshColliders(
struct R3SoftBodyHandle handle,
19760 struct R3ColliderHandle *buffer,
19769size_t RAPIER_CALL r3SoftBody_MeshVertices(
struct R3SoftBodyHandle handle,
19770 struct R3ColliderHandle collider,
19771 struct R3Vector *buffer,
19780size_t RAPIER_CALL r3SoftBody_MeshIndices(
struct R3SoftBodyHandle handle,
19781 struct R3ColliderHandle collider,
19790size_t RAPIER_CALL r3SoftBody_MeshArity(
struct R3SoftBodyHandle handle,
19791 struct R3ColliderHandle collider);
19798uint32_t
RAPIER_CALL r3SoftBody_MeshTopologyVersion(
struct R3SoftBodyHandle handle,
19799 struct R3ColliderHandle collider);
19801#if defined(RAPIER_FEM)
19806RAPIER_API R3Status
RAPIER_CALL r3SoftBody_SetSolver(
struct R3SoftBodyHandle handle, uint32_t solver);
19814R3Status
RAPIER_CALL r3SoftBody_SetClusterShapeMatchingTarget(
struct R3SoftBodyHandle handle,
19816 const struct R3Pose *target);
19823R3Status
RAPIER_CALL r3SoftBody_SetEdgeTearResistance(
struct R3SoftBodyHandle handle,
19825 R3Real resistance);
19832R3Bool
RAPIER_CALL r3SoftBody_MeshIsClosed(
struct R3SoftBodyHandle handle,
19833 struct R3ColliderHandle collider);
19841R3Status
RAPIER_CALL r3RigidBody_SetAdditionalMassProperties(
struct R3RigidBodyHandle handle,
19842 struct R3MassProperties properties,
19850R3Status
RAPIER_CALL r3RigidBody_RecomputeMassPropertiesFromColliders(
struct R3RigidBodyHandle handle);
19857R3Status
RAPIER_CALL r3Collider_SetMassProperties(
struct R3ColliderHandle handle,
19858 struct R3MassProperties properties);
19864RAPIER_API
struct R3MassProperties
RAPIER_CALL r3Collider_MassProperties(struct R3ColliderHandle handle);
19872R3Status
RAPIER_CALL r3RigidBody_SetLockedAxes(
struct R3RigidBodyHandle handle,
19880RAPIER_API uint8_t
RAPIER_CALL r3RigidBody_LockedAxes(
struct R3RigidBodyHandle handle);
19886RAPIER_API R3Bool
RAPIER_CALL r3Collider_IsVoxels(
struct R3ColliderHandle handle);
19893struct R3VoxelQuery
RAPIER_CALL r3Collider_VoxelAtFlatId(struct R3ColliderHandle handle,
19901R3Status
RAPIER_CALL r3Collider_SetVoxel(
struct R3ColliderHandle handle,
19902 struct R3VoxelKey key,
19909RAPIER_API
struct R3Pose
RAPIER_CALL r3RigidBody_NextPosition(struct R3RigidBodyHandle handle);
19915RAPIER_API
struct R3Rotation
RAPIER_CALL r3RigidBody_Rotation(struct R3RigidBodyHandle handle);
19921RAPIER_API
struct R3Vector
RAPIER_CALL r3RigidBody_CenterOfMass(struct R3RigidBodyHandle handle);
19927RAPIER_API
struct R3Vector
RAPIER_CALL r3RigidBody_LocalCenterOfMass(struct R3RigidBodyHandle handle);
19933RAPIER_API
struct R3Vector
RAPIER_CALL r3RigidBody_UserForce(struct R3RigidBodyHandle handle);
19939RAPIER_API R3AngVector
RAPIER_CALL r3RigidBody_UserTorque(
struct R3RigidBodyHandle handle);
19945RAPIER_API uint32_t
RAPIER_CALL r3RigidBody_BodyType(
struct R3RigidBodyHandle handle);
19951RAPIER_API R3Real
RAPIER_CALL r3RigidBody_Mass(
struct R3RigidBodyHandle handle);
19957RAPIER_API R3Real
RAPIER_CALL r3RigidBody_GravityScale(
struct R3RigidBodyHandle handle);
19963RAPIER_API R3Real
RAPIER_CALL r3RigidBody_LinearDamping(
struct R3RigidBodyHandle handle);
19969RAPIER_API R3Real
RAPIER_CALL r3RigidBody_AngularDamping(
struct R3RigidBodyHandle handle);
19975RAPIER_API R3Real
RAPIER_CALL r3RigidBody_KineticEnergy(
struct R3RigidBodyHandle handle);
19981RAPIER_API R3Real
RAPIER_CALL r3RigidBody_SoftCcdPrediction(
struct R3RigidBodyHandle handle);
19987RAPIER_API R3Bool
RAPIER_CALL r3RigidBody_IsCcdEnabled(
struct R3RigidBodyHandle handle);
19993RAPIER_API R3Bool
RAPIER_CALL r3RigidBody_IsDynamic(
struct R3RigidBodyHandle handle);
19999RAPIER_API
struct R3SoftBodyHandle
RAPIER_CALL r3RigidBody_SoftBody(struct R3RigidBodyHandle handle);
20005RAPIER_API R3Bool
RAPIER_CALL r3RigidBody_IsSoftFrame(
struct R3RigidBodyHandle handle);
20011RAPIER_API R3Bool
RAPIER_CALL r3RigidBody_IsFixed(
struct R3RigidBodyHandle handle);
20017RAPIER_API R3Bool
RAPIER_CALL r3RigidBody_IsKinematic(
struct R3RigidBodyHandle handle);
20023RAPIER_API R3Bool
RAPIER_CALL r3RigidBody_IsMoving(
struct R3RigidBodyHandle handle);
20029RAPIER_API R3Bool
RAPIER_CALL r3RigidBody_IsCcdActive(
struct R3RigidBodyHandle handle);
20037R3Status
RAPIER_CALL r3RigidBody_SetRotation(
struct R3RigidBodyHandle handle,
20038 struct R3Rotation value,
20047R3Status
RAPIER_CALL r3RigidBody_SetBodyType(
struct R3RigidBodyHandle handle,
20056R3Status
RAPIER_CALL r3RigidBody_SetNextKinematicRotation(
struct R3RigidBodyHandle handle,
20057 struct R3Rotation value);
20065R3Status
RAPIER_CALL r3RigidBody_SetAdditionalMass(
struct R3RigidBodyHandle handle,
20074R3Status
RAPIER_CALL r3RigidBody_SetSoftCcdPrediction(
struct R3RigidBodyHandle handle,
20082R3Status
RAPIER_CALL r3RigidBody_SetCcdEnabled(
struct R3RigidBodyHandle handle,
20091R3Status
RAPIER_CALL r3RigidBody_SetTranslationsLocked(
struct R3RigidBodyHandle handle,
20101R3Status
RAPIER_CALL r3RigidBody_SetRotationsLocked(
struct R3RigidBodyHandle handle,
20110R3Status
RAPIER_CALL r3RigidBody_SetDominanceGroup(
struct R3RigidBodyHandle handle,
20118R3Status
RAPIER_CALL r3RigidBody_SetAdditionalSolverIterations(
struct R3RigidBodyHandle handle,
20126R3Status
RAPIER_CALL r3RigidBody_SetAdditionalPgsIterations(
struct R3RigidBodyHandle handle,
20135R3Status
RAPIER_CALL r3RigidBody_AddTorque(
struct R3RigidBodyHandle handle,
20145R3Status
RAPIER_CALL r3RigidBody_ApplyTorqueImpulse(
struct R3RigidBodyHandle handle,
20155R3Status
RAPIER_CALL r3RigidBody_AddForceAtPoint(
struct R3RigidBodyHandle handle,
20156 struct R3Vector value,
20157 struct R3Vector point,
20166R3Status
RAPIER_CALL r3RigidBody_ResetTorques(
struct R3RigidBodyHandle handle,
20174struct R3Vector
RAPIER_CALL r3RigidBody_VelocityAtPoint(struct R3RigidBodyHandle handle,
20175 struct R3Vector point);
20183size_t RAPIER_CALL r3RigidBody_Colliders(
struct R3RigidBodyHandle handle,
20184 struct R3ColliderHandle *buffer,
20187#if defined(RAPIER_DIM3)
20192RAPIER_API R3Bool
RAPIER_CALL r3RigidBody_GyroscopicForcesEnabled(
struct R3RigidBodyHandle handle);
20195#if defined(RAPIER_DIM3)
20201R3Status
RAPIER_CALL r3RigidBody_SetGyroscopicForcesEnabled(
struct R3RigidBodyHandle handle,
20209RAPIER_API R3Status
RAPIER_CALL r3Collider_SetDensity(
struct R3ColliderHandle handle, R3Real value);
20215RAPIER_API R3Status
RAPIER_CALL r3Collider_SetMass(
struct R3ColliderHandle handle, R3Real value);
20221RAPIER_API R3Status
RAPIER_CALL r3Collider_SetEnabled(
struct R3ColliderHandle handle, R3Bool value);
20228R3Status
RAPIER_CALL r3Collider_SetSolverGroups(
struct R3ColliderHandle handle,
20229 struct R3InteractionGroups value);
20236R3Status
RAPIER_CALL r3Collider_SetFrictionCombineRule(
struct R3ColliderHandle handle,
20244R3Status
RAPIER_CALL r3Collider_SetRestitutionCombineRule(
struct R3ColliderHandle handle,
20251RAPIER_API R3Status
RAPIER_CALL r3Collider_SetContactSkin(
struct R3ColliderHandle handle, R3Real value);
20258R3Status
RAPIER_CALL r3Collider_SetContactForceEventThreshold(
struct R3ColliderHandle handle,
20266R3Status
RAPIER_CALL r3Collider_SetActiveEvents(
struct R3ColliderHandle handle,
20273RAPIER_API R3Status
RAPIER_CALL r3Collider_SetActiveHooks(
struct R3ColliderHandle handle, uint32_t value);
20280R3Status
RAPIER_CALL r3Collider_SetActiveCollisionTypes(
struct R3ColliderHandle handle,
20287RAPIER_API
struct R3Rotation
RAPIER_CALL r3Collider_Rotation(struct R3ColliderHandle handle);
20294struct R3InteractionGroups
RAPIER_CALL r3Collider_CollisionGroups(struct R3ColliderHandle handle);
20300RAPIER_API
struct R3InteractionGroups
RAPIER_CALL r3Collider_SolverGroups(struct R3ColliderHandle handle);
20306RAPIER_API
struct R3UserData
RAPIER_CALL r3Collider_UserData(struct R3ColliderHandle handle);
20313RAPIER_API uint32_t
RAPIER_CALL r3Collider_ActiveEvents(
struct R3ColliderHandle handle);
20319RAPIER_API R3Real
RAPIER_CALL r3Collider_Mass(
struct R3ColliderHandle handle);
20325RAPIER_API R3Real
RAPIER_CALL r3Collider_Density(
struct R3ColliderHandle handle);
20331RAPIER_API R3Real
RAPIER_CALL r3Collider_Volume(
struct R3ColliderHandle handle);
20337RAPIER_API R3Real
RAPIER_CALL r3Collider_ContactSkin(
struct R3ColliderHandle handle);
20343RAPIER_API R3Real
RAPIER_CALL r3Collider_ContactForceEventThreshold(
struct R3ColliderHandle handle);
20349RAPIER_API R3Bool
RAPIER_CALL r3Collider_IsEnabled(
struct R3ColliderHandle handle);
20355RAPIER_API
struct R3Aabb
RAPIER_CALL r3Collider_ComputeAabb(struct R3ColliderHandle handle);
20361RAPIER_API R3SharedShape *
RAPIER_CALL r3Collider_CloneShape(
struct R3ColliderHandle handle);
20368R3Status
RAPIER_CALL r3Collider_SetShape(
struct R3ColliderHandle handle,
20369 const R3SharedShape *shape);
20376R3Status
RAPIER_CALL r3Collider_SetPositionWrtParent(
struct R3ColliderHandle handle,
20377 struct R3Pose value);
20384RAPIER_API R3Status
RAPIER_CALL r3RigidBody_ValidateHandle(
struct R3RigidBodyHandle handle);
20391RAPIER_API R3Status
RAPIER_CALL r3Collider_ValidateHandle(
struct R3ColliderHandle handle);
20398RAPIER_API R3Status
RAPIER_CALL r3SoftBody_ValidateHandle(
struct R3SoftBodyHandle handle);
20405R3Status
RAPIER_CALL r3JointDesc_SetLocalFrame1(
struct R3JointDesc *desc,
20406 struct R3Pose value);
20414R3Status
RAPIER_CALL r3ImpulseJoint_SetLocalFrame1(
struct R3ImpulseJointHandle handle,
20415 struct R3Pose value,
20423R3Status
RAPIER_CALL r3JointDesc_SetLocalFrame2(
struct R3JointDesc *desc,
20424 struct R3Pose value);
20432R3Status
RAPIER_CALL r3ImpulseJoint_SetLocalFrame2(
struct R3ImpulseJointHandle handle,
20433 struct R3Pose value,
20441R3Status
RAPIER_CALL r3JointDesc_SetLocalAnchor1(
struct R3JointDesc *desc,
20442 struct R3Vector value);
20450R3Status
RAPIER_CALL r3ImpulseJoint_SetLocalAnchor1(
struct R3ImpulseJointHandle handle,
20451 struct R3Vector value,
20459R3Status
RAPIER_CALL r3JointDesc_SetLocalAnchor2(
struct R3JointDesc *desc,
20460 struct R3Vector value);
20468R3Status
RAPIER_CALL r3ImpulseJoint_SetLocalAnchor2(
struct R3ImpulseJointHandle handle,
20469 struct R3Vector value,
20476RAPIER_API R3Status
RAPIER_CALL r3JointDesc_SetContactsEnabled(
struct R3JointDesc *desc, R3Bool value);
20484R3Status
RAPIER_CALL r3ImpulseJoint_SetContactsEnabled(
struct R3ImpulseJointHandle handle,
20492RAPIER_API R3Status
RAPIER_CALL r3JointDesc_SetEnabled(
struct R3JointDesc *desc, R3Bool value);
20500R3Status
RAPIER_CALL r3ImpulseJoint_SetEnabled(
struct R3ImpulseJointHandle handle,
20509R3Status
RAPIER_CALL r3JointDesc_SetSoftness(
struct R3JointDesc *desc,
20510 struct R3SpringCoefficients value);
20518R3Status
RAPIER_CALL r3ImpulseJoint_SetSoftness(
struct R3ImpulseJointHandle handle,
20519 struct R3SpringCoefficients value,
20526RAPIER_API R3Status
RAPIER_CALL r3JointDesc_SetLockedAxes(
struct R3JointDesc *desc, uint8_t value);
20534R3Status
RAPIER_CALL r3ImpulseJoint_SetLockedAxes(
struct R3ImpulseJointHandle handle,
20542RAPIER_API R3Status
RAPIER_CALL r3JointDesc_SetLimitAxes(
struct R3JointDesc *desc, uint8_t value);
20550R3Status
RAPIER_CALL r3ImpulseJoint_SetLimitAxes(
struct R3ImpulseJointHandle handle,
20558RAPIER_API R3Status
RAPIER_CALL r3JointDesc_SetMotorAxes(
struct R3JointDesc *desc, uint8_t value);
20566R3Status
RAPIER_CALL r3ImpulseJoint_SetMotorAxes(
struct R3ImpulseJointHandle handle,
20574RAPIER_API R3Status
RAPIER_CALL r3JointDesc_SetCoupledAxes(
struct R3JointDesc *desc, uint8_t value);
20582R3Status
RAPIER_CALL r3ImpulseJoint_SetCoupledAxes(
struct R3ImpulseJointHandle handle,
20591R3Status
RAPIER_CALL r3JointDesc_SetLocalAxis1(
struct R3JointDesc *desc,
20592 struct R3Vector value);
20600R3Status
RAPIER_CALL r3ImpulseJoint_SetLocalAxis1(
struct R3ImpulseJointHandle handle,
20601 struct R3Vector value,
20609R3Status
RAPIER_CALL r3JointDesc_SetLocalAxis2(
struct R3JointDesc *desc,
20610 struct R3Vector value);
20618R3Status
RAPIER_CALL r3ImpulseJoint_SetLocalAxis2(
struct R3ImpulseJointHandle handle,
20619 struct R3Vector value,
20627R3Status
RAPIER_CALL r3JointDesc_SetLimits(
struct R3JointDesc *desc,
20628 uint32_t joint_axis,
20639R3Status
RAPIER_CALL r3ImpulseJoint_SetLimits(
struct R3ImpulseJointHandle handle,
20640 uint32_t joint_axis,
20650R3Status
RAPIER_CALL r3JointDesc_SetMotor(
struct R3JointDesc *desc,
20651 uint32_t joint_axis,
20652 R3Real target_position,
20653 R3Real target_velocity,
20663R3Status
RAPIER_CALL r3ImpulseJoint_SetMotor(
struct R3ImpulseJointHandle handle,
20664 uint32_t joint_axis,
20665 R3Real target_position,
20666 R3Real target_velocity,
20676R3Status
RAPIER_CALL r3JointDesc_SetMotorMaxForce(
struct R3JointDesc *desc,
20677 uint32_t joint_axis,
20686R3Status
RAPIER_CALL r3ImpulseJoint_SetMotorMaxForce(
struct R3ImpulseJointHandle handle,
20687 uint32_t joint_axis,
20696R3Status
RAPIER_CALL r3JointDesc_SetMotorModel(
struct R3JointDesc *desc,
20697 uint32_t joint_axis,
20706R3Status
RAPIER_CALL r3ImpulseJoint_SetMotorModel(
struct R3ImpulseJointHandle handle,
20707 uint32_t joint_axis,
20716R3Status
RAPIER_CALL r3JointDesc_SetUserData(
struct R3JointDesc *desc,
20717 struct R3UserData value);
20725R3Status
RAPIER_CALL r3ImpulseJoint_SetUserData(
struct R3ImpulseJointHandle handle,
20726 struct R3UserData value,
20734R3Status
RAPIER_CALL r3JointDesc_SetMotorPosition(
struct R3JointDesc *desc,
20735 uint32_t joint_axis,
20736 R3Real target_position,
20746R3Status
RAPIER_CALL r3ImpulseJoint_SetMotorPosition(
struct R3ImpulseJointHandle handle,
20747 uint32_t joint_axis,
20748 R3Real target_position,
20758R3Status
RAPIER_CALL r3JointDesc_SetMotorVelocity(
struct R3JointDesc *desc,
20759 uint32_t joint_axis,
20760 R3Real target_velocity,
20769R3Status
RAPIER_CALL r3ImpulseJoint_SetMotorVelocity(
struct R3ImpulseJointHandle handle,
20770 uint32_t joint_axis,
20771 R3Real target_velocity,
20780RAPIER_API
struct R3JointImpulses
RAPIER_CALL r3ImpulseJoint_Impulses(struct R3ImpulseJointHandle handle);
20786RAPIER_API
struct R3UserData
RAPIER_CALL r3ImpulseJoint_UserData(struct R3ImpulseJointHandle handle);
20792RAPIER_API
size_t RAPIER_CALL r3ImpulseJointCount(
const struct R3World *world);
20799RAPIER_API
size_t RAPIER_CALL r3MultibodyJointCount(
const struct R3World *world);
20805RAPIER_API
struct R3JointDesc
RAPIER_CALL r3MultibodyJoint_Desc(struct R3MultibodyJointHandle handle);
20814R3Status
RAPIER_CALL r3MultibodyJoint_SetDesc(
struct R3MultibodyJointHandle handle,
20815 const struct R3JointDesc *desc,
20822RAPIER_API
struct R3JointBodies
RAPIER_CALL r3MultibodyJoint_Bodies(struct R3MultibodyJointHandle handle);
20831R3SharedShape *
RAPIER_CALL r3ConvexDecompositionSharedShape(
struct R3VectorView vertices,
20832 R3SurfaceElementView indices);
20841R3SharedShape *
RAPIER_CALL r3VoxelsSharedShapeFromPoints(
struct R3Vector voxel_size,
20842 struct R3VectorView points);
20851R3SharedShape *
RAPIER_CALL r3VoxelizedMeshSharedShape(
struct R3VectorView vertices,
20852 R3SurfaceElementView indices,
20853 R3Real voxel_size);
20860RAPIER_API R3SharedShape *
RAPIER_CALL r3ConvexHullSharedShape(
struct R3VectorView vertices);
20862#if defined(RAPIER_DIM3)
20870R3SharedShape *
RAPIER_CALL r3ConvexMeshSharedShape(
struct R3VectorView vertices,
20871 struct R3TriangleView indices);
20881R3SharedShape *
RAPIER_CALL r3TrimeshSharedShape(
struct R3VectorView vertices,
20882 struct R3TriangleView indices);
20891R3SharedShape *
RAPIER_CALL r3PolylineSharedShape(
struct R3VectorView vertices,
20892 struct R3EdgeView indices);
20894#if defined(RAPIER_DIM2)
20902R3SharedShape *
RAPIER_CALL r3OrientedPolylineSharedShape(
struct R3VectorView vertices,
20903 struct R3EdgeView indices);
20906#if defined(RAPIER_DIM2)
20913RAPIER_API R3SharedShape *
RAPIER_CALL r3ConvexPolylineSharedShape(
struct R3VectorView vertices);
20922R3SharedShape *
RAPIER_CALL r3RoundConvexHullSharedShape(
struct R3VectorView vertices,
20923 R3Real border_radius);
20932R3SharedShape *
RAPIER_CALL r3TrimeshSharedShapeWithFlags(
struct R3VectorView vertices,
20933 struct R3TriangleView indices,
20940RAPIER_API
struct R3World *
RAPIER_CALL r3NewWorld(
void);
20947RAPIER_API R3Status
RAPIER_CALL r3FreeWorld(
struct R3World *world);
20955struct R3VelocityCorrection
RAPIER_CALL r3ReadPidController_RigidBodyCorrection(const struct R3ReadContext *context,
20956 struct R3PidController *controller,
20958 struct R3RigidBodyHandle body,
20959 struct R3Pose target_pose,
20960 struct R3Vector target_linvel,
20961 R3AngVector target_angvel);
20969struct R3VelocityCorrection
RAPIER_CALL r3ReadPdController_RigidBodyCorrection(const struct R3ReadContext *context,
20970 const struct R3PdController *controller,
20971 struct R3RigidBodyHandle body,
20972 struct R3Pose target_pose,
20973 struct R3Vector target_linvel,
20974 R3AngVector target_angvel);
20981RAPIER_API
size_t RAPIER_CALL r3ReadRigidBodyCount(
const struct R3ReadContext *context);
20989size_t RAPIER_CALL r3ReadRigidBodyHandles(
const struct R3ReadContext *context,
20990 struct R3RigidBodyHandle *buffer,
20999R3Bool
RAPIER_CALL r3ReadRigidBody_Contains(
const struct R3ReadContext *context,
21000 struct R3RigidBodyHandle handle);
21007RAPIER_API
size_t RAPIER_CALL r3ReadColliderCount(
const struct R3ReadContext *context);
21015size_t RAPIER_CALL r3ReadColliderHandles(
const struct R3ReadContext *context,
21016 struct R3ColliderHandle *buffer,
21025R3Bool
RAPIER_CALL r3ReadCollider_Contains(
const struct R3ReadContext *context,
21026 struct R3ColliderHandle handle);
21035size_t RAPIER_CALL r3ReadCollider_ShapeIdentity(
const struct R3ReadContext *context,
21036 struct R3ColliderHandle handle);
21044struct R3MassProperties
RAPIER_CALL r3ReadCollider_MassProperties(const struct R3ReadContext *context,
21045 struct R3ColliderHandle handle);
21053uint8_t
RAPIER_CALL r3ReadRigidBody_LockedAxes(
const struct R3ReadContext *context,
21054 struct R3RigidBodyHandle handle);
21062R3Bool
RAPIER_CALL r3ReadCollider_IsVoxels(
const struct R3ReadContext *context,
21063 struct R3ColliderHandle handle);
21071struct R3VoxelQuery
RAPIER_CALL r3ReadCollider_VoxelAtFlatId(const struct R3ReadContext *context,
21072 struct R3ColliderHandle handle,
21081struct R3Pose
RAPIER_CALL r3ReadRigidBody_NextPosition(const struct R3ReadContext *context,
21082 struct R3RigidBodyHandle handle);
21090struct R3Rotation
RAPIER_CALL r3ReadRigidBody_Rotation(const struct R3ReadContext *context,
21091 struct R3RigidBodyHandle handle);
21099struct R3Vector
RAPIER_CALL r3ReadRigidBody_CenterOfMass(const struct R3ReadContext *context,
21100 struct R3RigidBodyHandle handle);
21108struct R3Vector
RAPIER_CALL r3ReadRigidBody_LocalCenterOfMass(const struct R3ReadContext *context,
21109 struct R3RigidBodyHandle handle);
21117struct R3Vector
RAPIER_CALL r3ReadRigidBody_UserForce(const struct R3ReadContext *context,
21118 struct R3RigidBodyHandle handle);
21126R3AngVector
RAPIER_CALL r3ReadRigidBody_UserTorque(
const struct R3ReadContext *context,
21127 struct R3RigidBodyHandle handle);
21135uint32_t
RAPIER_CALL r3ReadRigidBody_BodyType(
const struct R3ReadContext *context,
21136 struct R3RigidBodyHandle handle);
21144R3Real
RAPIER_CALL r3ReadRigidBody_Mass(
const struct R3ReadContext *context,
21145 struct R3RigidBodyHandle handle);
21153R3Real
RAPIER_CALL r3ReadRigidBody_GravityScale(
const struct R3ReadContext *context,
21154 struct R3RigidBodyHandle handle);
21162R3Real
RAPIER_CALL r3ReadRigidBody_LinearDamping(
const struct R3ReadContext *context,
21163 struct R3RigidBodyHandle handle);
21171R3Real
RAPIER_CALL r3ReadRigidBody_AngularDamping(
const struct R3ReadContext *context,
21172 struct R3RigidBodyHandle handle);
21180R3Real
RAPIER_CALL r3ReadRigidBody_KineticEnergy(
const struct R3ReadContext *context,
21181 struct R3RigidBodyHandle handle);
21189R3Real
RAPIER_CALL r3ReadRigidBody_SoftCcdPrediction(
const struct R3ReadContext *context,
21190 struct R3RigidBodyHandle handle);
21198R3Bool
RAPIER_CALL r3ReadRigidBody_IsCcdEnabled(
const struct R3ReadContext *context,
21199 struct R3RigidBodyHandle handle);
21207R3Bool
RAPIER_CALL r3ReadRigidBody_IsDynamic(
const struct R3ReadContext *context,
21208 struct R3RigidBodyHandle handle);
21216struct R3SoftBodyHandle
RAPIER_CALL r3ReadRigidBody_SoftBody(const struct R3ReadContext *context,
21217 struct R3RigidBodyHandle handle);
21225R3Bool
RAPIER_CALL r3ReadRigidBody_IsSoftFrame(
const struct R3ReadContext *context,
21226 struct R3RigidBodyHandle handle);
21234R3Bool
RAPIER_CALL r3ReadRigidBody_IsFixed(
const struct R3ReadContext *context,
21235 struct R3RigidBodyHandle handle);
21243R3Bool
RAPIER_CALL r3ReadRigidBody_IsKinematic(
const struct R3ReadContext *context,
21244 struct R3RigidBodyHandle handle);
21252R3Bool
RAPIER_CALL r3ReadRigidBody_IsMoving(
const struct R3ReadContext *context,
21253 struct R3RigidBodyHandle handle);
21261R3Bool
RAPIER_CALL r3ReadRigidBody_IsCcdActive(
const struct R3ReadContext *context,
21262 struct R3RigidBodyHandle handle);
21270struct R3Vector
RAPIER_CALL r3ReadRigidBody_VelocityAtPoint(const struct R3ReadContext *context,
21271 struct R3RigidBodyHandle handle,
21272 struct R3Vector point);
21281size_t RAPIER_CALL r3ReadRigidBody_Colliders(
const struct R3ReadContext *context,
21282 struct R3RigidBodyHandle handle,
21283 struct R3ColliderHandle *buffer,
21286#if defined(RAPIER_DIM3)
21293R3Bool
RAPIER_CALL r3ReadRigidBody_GyroscopicForcesEnabled(
const struct R3ReadContext *context,
21294 struct R3RigidBodyHandle handle);
21303struct R3Rotation
RAPIER_CALL r3ReadCollider_Rotation(const struct R3ReadContext *context,
21304 struct R3ColliderHandle handle);
21312struct R3InteractionGroups
RAPIER_CALL r3ReadCollider_CollisionGroups(const struct R3ReadContext *context,
21313 struct R3ColliderHandle handle);
21321struct R3InteractionGroups
RAPIER_CALL r3ReadCollider_SolverGroups(const struct R3ReadContext *context,
21322 struct R3ColliderHandle handle);
21330struct R3UserData
RAPIER_CALL r3ReadCollider_UserData(const struct R3ReadContext *context,
21331 struct R3ColliderHandle handle);
21339uint32_t
RAPIER_CALL r3ReadCollider_ActiveEvents(
const struct R3ReadContext *context,
21340 struct R3ColliderHandle handle);
21347R3Real
RAPIER_CALL r3ReadCollider_Mass(
const struct R3ReadContext *context,
21348 struct R3ColliderHandle handle);
21356R3Real
RAPIER_CALL r3ReadCollider_Density(
const struct R3ReadContext *context,
21357 struct R3ColliderHandle handle);
21365R3Real
RAPIER_CALL r3ReadCollider_Volume(
const struct R3ReadContext *context,
21366 struct R3ColliderHandle handle);
21374R3Real
RAPIER_CALL r3ReadCollider_ContactSkin(
const struct R3ReadContext *context,
21375 struct R3ColliderHandle handle);
21383R3Real
RAPIER_CALL r3ReadCollider_ContactForceEventThreshold(
const struct R3ReadContext *context,
21384 struct R3ColliderHandle handle);
21392R3Bool
RAPIER_CALL r3ReadCollider_IsEnabled(
const struct R3ReadContext *context,
21393 struct R3ColliderHandle handle);
21401struct R3Aabb
RAPIER_CALL r3ReadCollider_ComputeAabb(const struct R3ReadContext *context,
21402 struct R3ColliderHandle handle);
21411R3SharedShape *
RAPIER_CALL r3ReadCollider_CloneShape(
const struct R3ReadContext *context,
21412 struct R3ColliderHandle handle);
21420R3Status
RAPIER_CALL r3ReadRigidBody_ValidateHandle(
const struct R3ReadContext *context,
21421 struct R3RigidBodyHandle handle);
21429R3Status
RAPIER_CALL r3ReadCollider_ValidateHandle(
const struct R3ReadContext *context,
21430 struct R3ColliderHandle handle);
21438struct R3Pose
RAPIER_CALL r3ReadRigidBody_Position(const struct R3ReadContext *context,
21439 struct R3RigidBodyHandle handle);
21447struct R3Vector
RAPIER_CALL r3ReadRigidBody_Translation(const struct R3ReadContext *context,
21448 struct R3RigidBodyHandle handle);
21456struct R3Vector
RAPIER_CALL r3ReadRigidBody_Linvel(const struct R3ReadContext *context,
21457 struct R3RigidBodyHandle handle);
21465R3AngVector
RAPIER_CALL r3ReadRigidBody_Angvel(
const struct R3ReadContext *context,
21466 struct R3RigidBodyHandle handle);
21474R3Bool
RAPIER_CALL r3ReadRigidBody_IsSleeping(
const struct R3ReadContext *context,
21475 struct R3RigidBodyHandle handle);
21483R3Bool
RAPIER_CALL r3ReadRigidBody_IsEnabled(
const struct R3ReadContext *context,
21484 struct R3RigidBodyHandle handle);
21492struct R3UserData
RAPIER_CALL r3ReadRigidBody_UserData(const struct R3ReadContext *context,
21493 struct R3RigidBodyHandle handle);
21501struct R3Pose
RAPIER_CALL r3ReadCollider_Position(const struct R3ReadContext *context,
21502 struct R3ColliderHandle handle);
21510struct R3Vector
RAPIER_CALL r3ReadCollider_Translation(const struct R3ReadContext *context,
21511 struct R3ColliderHandle handle);
21519R3Real
RAPIER_CALL r3ReadCollider_Friction(
const struct R3ReadContext *context,
21520 struct R3ColliderHandle handle);
21528R3Real
RAPIER_CALL r3ReadCollider_Restitution(
const struct R3ReadContext *context,
21529 struct R3ColliderHandle handle);
21537R3Bool
RAPIER_CALL r3ReadCollider_IsSensor(
const struct R3ReadContext *context,
21538 struct R3ColliderHandle handle);
21546struct R3RigidBodyHandle
RAPIER_CALL r3ReadCollider_Parent(const struct R3ReadContext *context,
21547 struct R3ColliderHandle handle);
21556size_t RAPIER_CALL r3ReadRigidBodyReadStates(
const struct R3ReadContext *context,
21557 const struct R3RigidBodyHandle *handles,
21558 size_t handle_count,
21559 struct R3RigidBodyState *states,
21568uint16_t
RAPIER_CALL r3ReadCollider_ActiveCollisionTypes(
const struct R3ReadContext *context,
21569 struct R3ColliderHandle handle);
21577uint32_t
RAPIER_CALL r3ReadCollider_ActiveHooks(
const struct R3ReadContext *context,
21578 struct R3ColliderHandle handle);
21586uint32_t
RAPIER_CALL r3ReadCollider_FrictionCombineRule(
const struct R3ReadContext *context,
21587 struct R3ColliderHandle handle);
21595uint32_t
RAPIER_CALL r3ReadCollider_RestitutionCombineRule(
const struct R3ReadContext *context,
21596 struct R3ColliderHandle handle);
21605struct R3Pose
RAPIER_CALL r3ReadCollider_PositionWrtParent(const struct R3ReadContext *context,
21606 struct R3ColliderHandle handle);
21614int8_t
RAPIER_CALL r3ReadRigidBody_DominanceGroup(
const struct R3ReadContext *context,
21615 struct R3RigidBodyHandle handle);
21623size_t RAPIER_CALL r3ReadRigidBody_AdditionalSolverIterations(
const struct R3ReadContext *context,
21624 struct R3RigidBodyHandle handle);
21632size_t RAPIER_CALL r3ReadRigidBody_AdditionalPgsIterations(
const struct R3ReadContext *context,
21633 struct R3RigidBodyHandle handle);
21641R3Bool
RAPIER_CALL r3ReadRigidBody_IsFastRotationAllowed(
const struct R3ReadContext *context,
21642 struct R3RigidBodyHandle handle);
21654size_t RAPIER_CALL r3IntersectRay(
const struct R3World *world,
21655 const struct R3QueryOptions *query_options,
21656 struct R3Vector origin,
21657 struct R3Vector direction,
21660 struct R3RayHit *buffer,
21671struct R3OptionalShapeCastHit
RAPIER_CALL r3TryCastShape(const struct R3World *world,
21672 const struct R3QueryOptions *query_options,
21673 struct R3Pose pose,
21674 struct R3Vector velocity,
21675 const R3SharedShape *shape,
21676 struct R3ShapeCastOptions options);
21686struct R3OptionalPointProjection
RAPIER_CALL r3TryProjectPoint(const struct R3World *world,
21687 const struct R3QueryOptions *query_options,
21688 struct R3Vector point,
21689 R3Real max_distance,
21697struct R3Pose
RAPIER_CALL r3NonlinearRigidMotion_PositionAtTime(const struct R3NonlinearRigidMotion *motion,
21711struct R3OptionalShapeCastHit
RAPIER_CALL r3TryCastShapeNonlinear(const struct R3World *world,
21712 const struct R3QueryOptions *query_options,
21713 const struct R3NonlinearRigidMotion *motion,
21714 const R3SharedShape *shape,
21717 R3Bool stop_at_penetration);
21726struct R3OptionalContactPair
RAPIER_CALL r3TryContactPair(struct R3ColliderHandle collider1,
21727 struct R3ColliderHandle collider2);
21735struct R3IntersectionPair
RAPIER_CALL r3IntersectionPair(struct R3ColliderHandle collider1,
21736 struct R3ColliderHandle collider2);
21744struct R3OptionalIntersectionPair
RAPIER_CALL r3TryIntersectionPair(struct R3ColliderHandle collider1,
21745 struct R3ColliderHandle collider2);
21754size_t RAPIER_CALL r3Collider_ContactPairs(
struct R3ColliderHandle handle,
21755 struct R3ContactPair *buffer,
21765size_t RAPIER_CALL r3Collider_IntersectionPairs(
struct R3ColliderHandle handle,
21766 struct R3IntersectionPair *buffer,
21777size_t RAPIER_CALL r3ContactManifolds(
struct R3ColliderHandle collider1,
21778 struct R3ColliderHandle collider2,
21779 struct R3ContactManifold *buffer,
21790size_t RAPIER_CALL r3SolverContacts(
struct R3ColliderHandle collider1,
21791 struct R3ColliderHandle collider2,
21792 size_t manifold_index,
21793 struct R3SolverContact *buffer,
21802R3Bool
RAPIER_CALL r3ContactModificationContext_IsSoft(
const struct R3ContactModificationContext *context);
21809size_t RAPIER_CALL r3ContactModificationContext_SolverContactCount(
const struct R3ContactModificationContext *context);
21816struct R3SolverContact
RAPIER_CALL r3ContactModificationContext_SolverContact(const struct R3ContactModificationContext *context,
21825R3Status
RAPIER_CALL r3ContactModificationContext_SetSolverContact(
struct R3ContactModificationContext *context,
21827 const struct R3SolverContact *contact);
21834R3Status
RAPIER_CALL r3ContactModificationContext_RemoveSolverContact(
struct R3ContactModificationContext *context,
21843R3Status
RAPIER_CALL r3EventCollector_SetCallbacks(
struct R3EventCollector *events,
21844 const struct R3EventCallbacks *callbacks);
21850RAPIER_API
struct R3DebugRenderStyle
RAPIER_CALL r3DefaultDebugRenderStyle(void);
21859size_t RAPIER_CALL r3DebugRenderWithStyle(
const struct R3World *world,
21861 const struct R3DebugRenderStyle *style,
21862 struct R3DebugLine *buffer,
R2Real r2ReadRigidBody_SoftCcdPrediction(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body soft-CCD prediction distance.
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.
size_t r2ContactModificationContext_SolverContactCount(const struct R2ContactModificationContext *context)
Return the number of solver contacts of the manifold; zero for a soft context.
struct R2Pose r2ReadCollider_Position(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider world-space pose.
struct R2Rotation r2ReadCollider_Rotation(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider world-space rotation.
R2Bool r2ReadRigidBody_IsCcdEnabled(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return whether the rigid body is using continuous collision detection.
struct R2SolverContact r2ContactModificationContext_SolverContact(const struct R2ContactModificationContext *context, size_t index)
Return a solver contact of the manifold.
struct R2InteractionGroups r2ReadCollider_CollisionGroups(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider collision filtering groups.
struct R2MassProperties r2ReadCollider_MassProperties(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider local mass properties.
R2Real r2ReadCollider_Mass(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider mass.
R2Bool r2ReadRigidBody_IsCcdActive(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return whether the rigid body is currently using CCD for its motion.
size_t r2ReadRigidBodyCount(const struct R2ReadContext *context)
Return the number of rigid body objects in the world.
struct R2UserData r2ReadCollider_UserData(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider application-owned 128-bit user value.
R2Real r2ReadCollider_Volume(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider current volume.
R2Bool r2ReadRigidBody_IsDynamic(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return whether the rigid body is dynamic.
size_t r2ReadRigidBodyHandles(const struct R2ReadContext *context, struct R2RigidBodyHandle *buffer, size_t capacity)
Copy entity handles.
R2Status r2ContactModificationContext_RemoveSolverContact(struct R2ContactModificationContext *context, size_t index)
Remove a solver contact of the manifold.
R2Real r2ReadCollider_ContactForceEventThreshold(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider force threshold for contact-force events.
uint32_t r2ReadCollider_RestitutionCombineRule(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider restitution combination rule (R2_COMBINE_*).
R2Real r2ReadRigidBody_KineticEnergy(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body kinetic energy.
struct R2Vector r2ReadRigidBody_UserForce(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body accumulated user-applied world-space force.
struct R2ContactModificationContext R2ContactModificationContext
Borrowed native contact context.
Definition rapier.h:1127
uint32_t r2ReadCollider_ActiveHooks(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider physics-hook activation bitmask.
size_t r2ReadRigidBody_Colliders(const struct R2ReadContext *context, struct R2RigidBodyHandle handle, struct R2ColliderHandle *buffer, size_t capacity)
Copy attached collider handles.
R2Bool r2ReadRigidBody_IsFastRotationAllowed(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return whether the rigid body may exceed the angular-velocity limit of its CCD.
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.
R2Bool r2ReadCollider_Contains(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Test whether the live world contains this collider handle.
uint8_t r2ReadRigidBody_LockedAxes(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body translation/rotation lock bitmask.
R2Real r2ReadRigidBody_AngularDamping(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body angular damping coefficient.
struct R2Vector r2ReadRigidBody_CenterOfMass(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body world-space center of mass.
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.
R2AngVector r2ReadRigidBody_UserTorque(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body accumulated user-applied world-space torque.
R2Bool r2ReadRigidBody_IsMoving(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return whether the rigid body is moving.
struct R2ReadContext R2ReadContext
Callback-scoped read access to bodies and colliders.
Definition rapier.h:1200
R2Status r2ReadRigidBody_ValidateHandle(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Validate the index and generation in the live owning world.
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.
Definition rapier.h:3681
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.
struct R2Vector r2ReadRigidBody_Linvel(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body world-space linear velocity.
struct R2InteractionGroups r2ReadCollider_SolverGroups(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider contact-force filtering groups.
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.
R2Real r2ReadRigidBody_LinearDamping(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body linear damping coefficient.
struct R2Rotation r2ReadRigidBody_Rotation(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body world-space rotation.
R2Real r2ReadCollider_Density(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider mass per unit volume.
size_t r2ReadColliderHandles(const struct R2ReadContext *context, struct R2ColliderHandle *buffer, size_t capacity)
Copy entity handles.
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.
Definition rapier.h:3671
R2Bool r2ReadRigidBody_IsSoftFrame(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return whether the rigid body is a soft-body proxy.
struct R2Aabb r2ReadCollider_ComputeAabb(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the current world-space axis-aligned bounds.
struct R2Vector r2ReadRigidBody_Translation(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body world-space translation.
R2Bool r2ReadCollider_IsEnabled(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return whether the collider is enabled.
size_t r2ReadRigidBody_AdditionalPgsIterations(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body additional PGS iterations for connected bodies.
R2Real r2ReadCollider_Restitution(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider restitution coefficient.
R2Bool r2ContactModificationContext_IsSoft(const struct R2ContactModificationContext *context)
Return whether the context holds the contact candidates of two soft surfaces rather than a manifold.
R2Bool r2ReadCollider_IsSensor(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return whether the collider is a sensor (detects overlaps without contact forces).
R2Bool r2ReadRigidBody_IsFixed(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return whether the rigid body is fixed.
R2SharedShape * r2ReadCollider_CloneShape(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return an owned wrapper sharing the collider geometry.
struct R2Pose r2ReadRigidBody_NextPosition(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body next kinematic world-space pose.
uint32_t r2ReadCollider_FrictionCombineRule(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider friction 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 pare...
int8_t r2ReadRigidBody_DominanceGroup(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body signed dominance group.
R2Bool r2ReadRigidBody_IsKinematic(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return whether the rigid body is kinematic.
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_ActiveEvents(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider event-generation bitmask (R2_COLLISION_EVENTS and R2_CONTACT_FORCE_EVENTS).
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.
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.
R2Status r2ContactModificationContext_SetTangentVelocity(struct R2ContactModificationContext *context, struct R2Vector velocity)
Sets the tangent velocity of every rigid solver contact in this manifold.
R2Real r2ReadRigidBody_Mass(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body mass.
size_t r2ReadCollider_ShapeIdentity(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return a process-local geometry identity for caching, not a serializable ID.
R2Bool r2ReadRigidBody_IsSleeping(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return whether the rigid body is sleeping.
struct R2Pose r2ReadRigidBody_Position(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body world-space pose.
R2Status r2ReadCollider_ValidateHandle(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Validate the index and generation in the live owning world.
R2AngVector r2ReadRigidBody_Angvel(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body world-space angular velocity (radians per second).
R2Bool r2ReadRigidBody_Contains(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Test whether the live world contains this rigid body handle.
R2Bool r2ReadRigidBody_IsEnabled(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return whether the rigid body is enabled.
struct R2Vector r2ReadCollider_Translation(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider world-space translation.
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.
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.
Definition rapier.h:3633
R2Real r2ReadCollider_Friction(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider friction coefficient.
struct R2UserData r2ReadRigidBody_UserData(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body application-owned 128-bit user value.
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).
struct R2Vector r2ReadRigidBody_LocalCenterOfMass(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body body-local center of mass.
R2Real r2ReadRigidBody_GravityScale(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body gravity multiplier.
R2Real r2ReadCollider_ContactSkin(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return the collider extra separation skin around the shape.
size_t r2ReadRigidBody_AdditionalSolverIterations(const struct R2ReadContext *context, struct R2RigidBodyHandle handle)
Return the rigid body additional solver iterations for connected bodies.
size_t r2ReadColliderCount(const struct R2ReadContext *context)
Return the number of collider objects in the world.
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.
R2Bool r2ReadCollider_IsVoxels(const struct R2ReadContext *context, struct R2ColliderHandle handle)
Return whether the collider is a voxel shape.
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 O...
R2Status r2Collider_SetSensor(struct R2ColliderHandle handle, R2Bool value)
Enable or disable a sensor (detects overlaps without contact forces) for the collider.
R2Status r2Collider_SetFriction(struct R2ColliderHandle handle, R2Real value)
Set the collider friction coefficient.
R2Status r2Collider_SetMassProperties(struct R2ColliderHandle handle, struct R2MassProperties properties)
Set the collider local mass properties.
R2Status r2Collider_SetRotation(struct R2ColliderHandle handle, struct R2Rotation value)
Set the collider world-space rotation.
R2Status r2Collider_SetActiveEvents(struct R2ColliderHandle handle, uint32_t value)
Set the collider event-generation bitmask (R2_COLLISION_EVENTS and R2_CONTACT_FORCE_EVENTS).
R2Status r2RemoveCollider(struct R2ColliderHandle handle, R2Bool wake_up)
Remove the collider and update its parent body mass properties.
R2Status r2Collider_SetRestitutionCombineRule(struct R2ColliderHandle handle, uint32_t value)
Set the collider restitution combination rule (R2_COMBINE_*).
struct R2ColliderDesc r2CuboidColliderDesc(struct R2Vector half_extents)
Return an axis-aligned box description with the supplied half-extents.
struct R2UserData r2Collider_UserData(struct R2ColliderHandle handle)
Return the collider application-owned 128-bit user value.
R2Bool r2Collider_IsVoxels(struct R2ColliderHandle handle)
Return whether the collider is a voxel shape.
R2Status r2Collider_SetMass(struct R2ColliderHandle handle, R2Real value)
Set the collider mass.
struct R2VoxelQuery r2Collider_VoxelAtFlatId(struct R2ColliderHandle handle, uint32_t id)
Return voxel information at a flat index; found = 0 if absent.
struct R2MassProperties r2Collider_MassProperties(struct R2ColliderHandle handle)
Return the collider local mass properties.
R2Status r2Collider_SetPositionWrtParent(struct R2ColliderHandle handle, struct R2Pose value)
Set the collider pose relative to the parent rigid body.
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 R2SoftBodyHandle r2Collider_SoftBody(struct R2ColliderHandle handle)
Return the soft body owning this deformable collider (a soft-body collision mesh),...
struct R2ColliderDesc r2HalfspaceColliderDesc(struct R2Vector normal)
Return a half-space description bounded by a plane through the origin; normal points outward.
R2Bool r2Collider_Contains(struct R2ColliderHandle handle)
Test whether the live world contains this collider handle.
struct R2ColliderDesc r2BallColliderDesc(R2Real radius)
Return a ball description with the supplied radius.
struct R2InteractionGroups r2Collider_SolverGroups(struct R2ColliderHandle handle)
Return the collider contact-force filtering groups.
struct R2ColliderDesc r2SegmentColliderDesc(struct R2Vector a, struct R2Vector b)
Return a segment description with endpoints a and b.
R2Status r2Collider_SetCollisionGroups(struct R2ColliderHandle handle, struct R2InteractionGroups value)
Set the collider collision filtering groups.
R2Status r2Collider_SetSolverGroups(struct R2ColliderHandle handle, struct R2InteractionGroups value)
Set the collider contact-force filtering groups.
struct R2ColliderDesc r2RoundCuboidColliderDesc(struct R2Vector half_extents, R2Real border_radius)
Return a rounded box description; half_extents exclude the added border_radius.
struct R2Pose r2Collider_Position(struct R2ColliderHandle handle)
Return the collider world-space pose.
R2Status r2Collider_SetTranslation(struct R2ColliderHandle handle, struct R2Vector value)
Set the collider world-space translation.
struct R2ColliderHandle r2InsertColliderWithoutParent(struct R2World *world, const struct R2ColliderDesc *desc)
Insert a collider without a rigid-body parent.
R2Status r2Collider_SetRestitution(struct R2ColliderHandle handle, R2Real value)
Set the collider restitution coefficient.
struct R2ColliderHandle r2InsertDeformableCollider(const struct R2ColliderDesc *collider, const struct R2SoftMeshBindingDesc *binding, struct R2RigidBodyHandle parent)
Create a deformable collider bound to a soft-body cluster.
R2Status r2Collider_SetDensity(struct R2ColliderHandle handle, R2Real value)
Set the collider mass per unit volume.
R2Status r2Collider_ValidateHandle(struct R2ColliderHandle handle)
Validate the index and generation in the live owning world.
struct R2ColliderDesc r2CapsuleColliderDesc(struct R2Vector a, struct R2Vector b, R2Real radius)
Return a capsule description with segment endpoints a/b and the supplied radius.
R2Status r2Collider_SetContactForceEventThreshold(struct R2ColliderHandle handle, R2Real value)
Set the collider force threshold for contact-force events.
R2Status r2Collider_SetUserData(struct R2ColliderHandle handle, struct R2UserData value)
Set the collider application-owned 128-bit user value.
R2Status r2Collider_SetActiveCollisionTypes(struct R2ColliderHandle handle, uint16_t value)
Set the collider body-type collision activation bitmask.
R2Status r2Collider_SetFrictionCombineRule(struct R2ColliderHandle handle, uint32_t value)
Set the collider friction combination rule (R2_COMBINE_*).
R2Real r2Collider_ContactForceEventThreshold(struct R2ColliderHandle handle)
Return the collider force threshold for contact-force events.
uint16_t r2Collider_ActiveCollisionTypes(struct R2ColliderHandle handle)
Return the collider body-type collision activation bitmask (R2_COLLISION_TYPES_* bits).
struct R2Aabb r2Collider_ComputeAabb(struct R2ColliderHandle handle)
Return the current world-space axis-aligned bounds.
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 pare...
size_t r2ColliderCount(const struct R2World *world)
Return the number of collider objects in the world.
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 R2ColliderDesc r2DefaultColliderDesc(void)
Return native default collider desc.
R2Real r2Collider_ContactSkin(struct R2ColliderHandle handle)
Return the collider extra separation skin around the shape.
size_t r2ColliderHandles(const struct R2World *world, struct R2ColliderHandle *buffer, size_t capacity)
Copy entity handles.
R2Status r2Collider_SetPosition(struct R2ColliderHandle handle, struct R2Pose value)
Set the collider world-space pose.
R2Status r2Collider_SetEnabled(struct R2ColliderHandle handle, R2Bool value)
Enable or disable the collider.
struct R2ColliderDesc R2ColliderDesc
Copyable collider construction data.
struct R2ColliderDesc r2CapsuleXColliderDesc(R2Real half_height, R2Real radius)
Return a X-aligned capsule description; half_height is half the segment length, excluding caps.
uint32_t r2Collider_RestitutionCombineRule(struct R2ColliderHandle handle)
Return the collider restitution combination rule (R2_COMBINE_*).
R2Real r2Collider_Volume(struct R2ColliderHandle handle)
Return the collider current volume.
struct R2ColliderDesc r2CapsuleYColliderDesc(R2Real half_height, R2Real radius)
Return a Y-aligned capsule description; half_height is half the segment length, excluding caps.
R2Status r2Collider_SetActiveHooks(struct R2ColliderHandle handle, uint32_t value)
Set the collider physics-hook activation bitmask.
R2Status r2Collider_SetContactSkin(struct R2ColliderHandle handle, R2Real value)
Set the collider extra separation skin around the shape.
R2Real r2Collider_Friction(struct R2ColliderHandle handle)
Return the collider friction coefficient.
R2Bool r2Collider_IsEnabled(struct R2ColliderHandle handle)
Return whether the collider is enabled.
uint32_t r2Collider_FrictionCombineRule(struct R2ColliderHandle handle)
Return the collider friction combination rule (R2_COMBINE_*).
R2Real r2Collider_Restitution(struct R2ColliderHandle handle)
Return the collider restitution coefficient.
struct R2Rotation r2Collider_Rotation(struct R2ColliderHandle handle)
Return the collider world-space rotation.
struct R2ColliderHandle R2ColliderHandle
Copyable non-owning handle: world pointer plus entity index and generation.
R2Real r2Collider_Mass(struct R2ColliderHandle handle)
Return the collider mass.
uint32_t r2Collider_ActiveEvents(struct R2ColliderHandle handle)
Return the collider event-generation bitmask (R2_COLLISION_EVENTS and R2_CONTACT_FORCE_EVENTS).
struct R2Vector r2Collider_Translation(struct R2ColliderHandle handle)
Return the collider world-space translation.
struct R2ColliderDesc r2TriangleColliderDesc(struct R2Vector a, struct R2Vector b, struct R2Vector c)
Return a triangle description with vertices a, b, and c.
struct R2InteractionGroups r2Collider_CollisionGroups(struct R2ColliderHandle handle)
Return the collider collision filtering groups.
struct R2RigidBodyHandle r2Collider_Parent(struct R2ColliderHandle handle)
Return the parent body handle, or an invalid handle with OK status for a standalone collider.
uint32_t r2Collider_ActiveHooks(struct R2ColliderHandle handle)
Return the collider physics-hook activation bitmask.
R2Bool r2Collider_IsSensor(struct R2ColliderHandle handle)
Return whether the collider is a sensor (detects overlaps without contact forces).
R2Real r2Collider_Density(struct R2ColliderHandle handle)
Return the collider mass per unit volume.
R2Status r2KinematicCharacterController_SetUp(struct R2KinematicCharacterController *controller, struct R2Vector up)
Set the up direction; it must be finite and nonzero and is normalized on input.
struct R2KinematicCharacterController R2KinematicCharacterController
Controller plus reusable collision output from the last move_shape call.
Definition rapier.h:1151
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.
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_SetSlide(struct R2KinematicCharacterController *controller, R2Bool enabled)
Enable or disable sliding along obstacles.
struct R2Vector r2KinematicCharacterController_Up(const struct R2KinematicCharacterController *controller)
Return the normalized up direction.
R2Status r2PidController_SetGains(struct R2PidController *controller, struct R2PidGains gains)
Replace the proportional, integral, and derivative gains.
R2Status r2FreeKinematicCharacterController(struct R2KinematicCharacterController *controller)
Release an owned kinematic character controller.
struct R2PdController r2DefaultPdController(void)
Return Rapier's default PD controller: kp = 60 and kd = 0.8 on every axis, all axes controlled.
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 r2PidController_ResetIntegrals(struct R2PidController *controller)
Reset to zero the linear and angular errors accumulated by the integral term.
R2Status r2KinematicCharacterController_SetOffset(struct R2KinematicCharacterController *controller, struct R2CharacterLength offset)
Set the collision separation margin; use a positive absolute or relative character length.
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.
R2Status r2KinematicCharacterController_SetSnapToGround(struct R2KinematicCharacterController *controller, R2Bool enabled, struct R2CharacterLength distance)
Configure downward ground snapping.
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.
R2Status r2FreePidController(struct R2PidController *controller)
Release an owned pid controller.
R2Real r2KinematicCharacterController_NormalNudgeFactor(const struct R2KinematicCharacterController *controller)
Return the normal nudge factor set by SetNormalNudgeFactor.
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.
struct R2PidController * r2NewPidController(void)
Allocate a PID controller with Rapier's defaults: kp = 60, ki = 1 and kd = 0.8 on every axis,...
struct R2CharacterControllerSettings r2KinematicCharacterController_Settings(const struct R2KinematicCharacterController *controller)
Return a copy of slide, slope, and ground-snap settings.
struct R2CharacterAutostep r2KinematicCharacterController_Autostep(const struct R2KinematicCharacterController *controller)
Return the automatic stepping settings.
size_t r2KinematicCharacterController_Collisions(const struct R2KinematicCharacterController *controller, struct R2CharacterCollision *buffer, size_t capacity)
Copy collisions recorded by the most recent MoveShape call.
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 R2CharacterLength r2KinematicCharacterController_Offset(const struct R2KinematicCharacterController *controller)
Return the collision separation margin.
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...
struct R2PidGains r2PidController_Gains(const struct R2PidController *controller)
Return a copy of the proportional, integral, and derivative gains.
struct R2KinematicCharacterController * r2NewKinematicCharacterController(void)
Allocate a character controller with native defaults; release it with r2FreeKinematicCharacterControl...
struct R2PidController R2PidController
PID controller with persistent integral state.
Definition rapier.h:1193
const char * r2BuildProfile(void)
Cargo profile of the loaded physics library: "debug" or "release".
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 ...
R2Status r2LastStatus(void)
Status of the most recent fallible operation on this thread.
struct R2BuildInfo r2BuildInfo(void)
Return ABI version, dimension, scalar size, and pointer size of the linked library.
const char * r2LastError(void)
Thread-local UTF-8 diagnostic, valid until the next fallible call on this thread.
struct R2BuildFeatures r2BuildFeatures(void)
Return profiling, SIMD width, parallelism, and determinism of the linked library.
const char * r2Version(void)
Release version of the loaded C bindings, e.g.
uint32_t R2Status
Status-returning operations use these integer codes.
Definition rapier.h:1671
struct R2PodLayout r2PodLayout(void)
Return POD structure sizes for checking foreign-language layouts against this library.
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.
void(*) R2ErrorCallback(R2Status, const char *, void *)
Called synchronously on the calling thread when an operation reports an error.
Definition rapier.h:3502
size_t r2IntersectionPairs(const struct R2World *world, struct R2IntersectionPair *buffer, size_t capacity)
Copy current sensor intersection pairs from the narrow phase.
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 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.
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 r2EventCollector_TearEventCount(const struct R2EventCollector *events)
Return the number of soft-body tear events collected since the last clear.
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 po...
R2Status r2FreeEventCollector(struct R2EventCollector *events)
Release an owned event collector.
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 broa...
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.
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.
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.
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 ...
R2Status r2EventCollector_SetCallbacks(struct R2EventCollector *events, const struct R2EventCallbacks *callbacks)
Replace the callbacks invoked while stepping with this collector; NULL removes them.
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.
Definition rapier.h:4455
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.
struct R2EventCollector R2EventCollector
Events accumulate across steps until r2EventCollector_Clear: reading them never drains the collector,...
Definition rapier.h:1143
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.
Definition rapier.h:4465
struct R2SoftBodyTearEvent * r2EventCollector_TearEvent(const struct R2EventCollector *events, size_t index)
Return an owned copy of a queued tear event; release with r2FreeSoftBodyTearEvent.
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.
struct R2EventCollector * r2NewEventCollector(void)
Allocate an empty event collector; release it with r2FreeEventCollector.
struct R2SoftBodyTearEvent R2SoftBodyTearEvent
Owned copy of a tear event.
Definition rapier.h:1214
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 con...
struct R2DebugRenderStyle r2DefaultDebugRenderStyle(void)
Return native default debug-render style.
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.
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.
R2Status r2RemoveImpulseJoint(struct R2ImpulseJointHandle handle, R2Bool wake_up)
Remove an impulse joint.
R2Status r2JointDesc_SetLocalAxis1(struct R2JointDesc *desc, struct R2Vector value)
Set the joint desc joint principal axis in body 1 local coordinates.
R2Status r2ImpulseJoint_SetSoftness(struct R2ImpulseJointHandle handle, struct R2SpringCoefficients value, R2Bool wake_up)
Set the impulse joint joint spring coefficients.
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 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_SetLocalAnchor1(struct R2ImpulseJointHandle handle, struct R2Vector value, R2Bool wake_up)
Set the impulse joint joint anchor relative to body 1.
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 r2ImpulseJoint_SetCoupledAxes(struct R2ImpulseJointHandle handle, uint8_t value, R2Bool wake_up)
Set the impulse joint coupled joint axis mask.
struct R2JointDesc r2ImpulseJoint_Desc(struct R2ImpulseJointHandle handle)
Copies joint configuration without returning a borrowed joint pointer.
R2Status r2JointDesc_SetUserData(struct R2JointDesc *desc, struct R2UserData value)
Set the joint desc application-owned 128-bit user value.
struct R2InverseKinematicsOptions r2DefaultInverseKinematicsOptions(void)
Return native default inverse kinematics options.
R2Status r2JointDesc_SetLocalAxis2(struct R2JointDesc *desc, struct R2Vector value)
Set the joint desc joint principal axis in body 2 local coordinates.
R2Status r2ImpulseJoint_SetLocalAnchor2(struct R2ImpulseJointHandle handle, struct R2Vector value, R2Bool wake_up)
Set the impulse joint joint anchor relative to body 2.
struct R2JointDesc r2PinSlotJointDesc(struct R2Vector axis_vector)
Returns a joint description.
R2Status r2MultibodyJoint_SetDesc(struct R2MultibodyJointHandle handle, const struct R2JointDesc *desc, R2Bool wake_up)
Replaces the multibody joint configuration after validation.
R2Status r2JointDesc_SetContactsEnabled(struct R2JointDesc *desc, R2Bool value)
Enable or disable allowing contacts between connected bodies for the joint desc.
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 r2JointDesc_SetLocalAnchor1(struct R2JointDesc *desc, struct R2Vector value)
Set the joint desc joint anchor relative to body 1.
struct R2UserData r2ImpulseJoint_UserData(struct R2ImpulseJointHandle handle)
Return the impulse joint application-owned 128-bit user value.
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.
struct R2JointImpulses r2ImpulseJoint_Impulses(struct R2ImpulseJointHandle handle)
Return the impulses applied by the impulse joint during the last step.
struct R2MultibodyJointHandle r2InsertMultibodyJoint(struct R2RigidBodyHandle body1, struct R2RigidBodyHandle body2, const struct R2JointDesc *joint)
Create an articulation joint between bodies in the same world.
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).
struct R2JointDesc r2SpringJointDesc(R2Real length, R2Real stiffness, R2Real damping)
Return a spring joint description with native defaults; no allocation.
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 r2ImpulseJoint_SetLocalFrame2(struct R2ImpulseJointHandle handle, struct R2Pose value, R2Bool wake_up)
Set the impulse joint joint frame relative to body 2.
R2Status r2RemoveMultibodyJoint(struct R2MultibodyJointHandle handle, R2Bool wake_up)
Remove an articulation joint.
R2Status r2ImpulseJoint_SetEnabled(struct R2ImpulseJointHandle handle, R2Bool value, R2Bool wake_up)
Enable or disable the impulse joint.
R2Status r2ImpulseJoint_SetUserData(struct R2ImpulseJointHandle handle, struct R2UserData value, R2Bool wake_up)
Set 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.
R2Status r2ImpulseJoint_SetContactsEnabled(struct R2ImpulseJointHandle handle, R2Bool value, R2Bool wake_up)
Enable or disable allowing contacts between connected bodies for the impulse joint.
struct R2JointBodies r2ImpulseJoint_Bodies(struct R2ImpulseJointHandle handle)
Return the two bodies connected by an impulse joint.
struct R2JointDesc r2RopeJointDesc(R2Real length)
Return a rope joint description with native defaults; no allocation.
R2Status r2ImpulseJoint_SetLocalFrame1(struct R2ImpulseJointHandle handle, struct R2Pose value, R2Bool wake_up)
Set the impulse joint joint frame relative to body 1.
R2Status r2JointDesc_SetLocalAnchor2(struct R2JointDesc *desc, struct R2Vector value)
Set the joint desc joint anchor relative to body 2.
size_t r2MultibodyJoint_Ndofs(struct R2MultibodyJointHandle handle)
Return the degrees of freedom of the whole multibody containing the joint (not of the joint alone),...
struct R2JointDesc r2FixedJointDesc(void)
Return a fixed joint description with native defaults; no allocation.
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 r2MultibodyJoint_ApplyDisplacements(struct R2MultibodyJointHandle handle, const R2Real *displacements, size_t count)
Apply generalized articulation displacements in native degree-of-freedom order.
size_t r2MultibodyJointCount(const struct R2World *world)
Return the number of multibody joints in the world, which is the number of handles copied by r2Multib...
#define R2_JOINT_DOF_COUNT
Number of translational and angular joint axes in this dimension.
Definition rapier.h:89
R2Status r2JointDesc_SetLockedAxes(struct R2JointDesc *desc, uint8_t value)
Set the joint desc translation/rotation lock bitmask.
struct R2JointDesc r2DefaultJointDesc(void)
Return native default joint desc.
R2Status r2ImpulseJoint_SetLocalAxis1(struct R2ImpulseJointHandle handle, struct R2Vector value, R2Bool wake_up)
Set the impulse joint joint principal axis in body 1 local coordinates.
struct R2JointDesc r2MultibodyJoint_Desc(struct R2MultibodyJointHandle handle)
Copies the multibody joint configuration without returning a borrowed joint pointer.
R2Status r2JointDesc_SetCoupledAxes(struct R2JointDesc *desc, uint8_t value)
Set the joint desc coupled joint axis mask.
R2Status r2JointDesc_SetLocalFrame2(struct R2JointDesc *desc, struct R2Pose value)
Set the joint desc joint frame relative to body 2.
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_SetEnabled(struct R2JointDesc *desc, R2Bool value)
Enable or disable the joint desc.
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 r2JointDesc_SetMotorAxes(struct R2JointDesc *desc, uint8_t value)
Set the joint desc joint axis mask with motors enabled.
size_t r2MultibodyJointHandles(const struct R2World *world, struct R2MultibodyJointHandle *buffer, size_t capacity)
Copy entity handles.
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_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.
size_t r2MultibodyJoint_GeneralizedVelocity(struct R2MultibodyJointHandle handle, R2Real *buffer, size_t capacity)
Copy the articulation generalized velocities in native degree-of-freedom order.
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).
struct R2JointBodies r2MultibodyJoint_Bodies(struct R2MultibodyJointHandle handle)
Return the two bodies connected by a multibody joint: its parent link, then its own link.
size_t r2ImpulseJointHandles(const struct R2World *world, struct R2ImpulseJointHandle *buffer, size_t capacity)
Copy entity handles.
struct R2ImpulseJointHandle r2InsertImpulseJoint(struct R2RigidBodyHandle body1, struct R2RigidBodyHandle body2, const struct R2JointDesc *joint)
Create an impulse joint connecting two bodies in the same world.
R2Status r2ImpulseJoint_SetDesc(struct R2ImpulseJointHandle handle, const struct R2JointDesc *desc, R2Bool wake_up)
Replaces configuration after validation, resetting cached limit/motor impulses.
struct R2JointDesc r2PrismaticJointDesc(struct R2Vector axis_vector)
Returns a joint description.
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 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 r2ImpulseJoint_SetLimitAxes(struct R2ImpulseJointHandle handle, uint8_t value, R2Bool wake_up)
Set the impulse joint joint axis mask with limits enabled.
R2Status r2JointDesc_SetSoftness(struct R2JointDesc *desc, struct R2SpringCoefficients value)
Set the joint desc joint spring coefficients.
R2Bool(*) R2IkJointCanMove(void *, struct R2RigidBodyHandle)
Optional per-link filter, called synchronously.
Definition rapier.h:3566
R2Status r2ImpulseJoint_SetMotorAxes(struct R2ImpulseJointHandle handle, uint8_t value, R2Bool wake_up)
Set the impulse joint joint axis mask with motors enabled.
R2Status r2JointDesc_SetLocalFrame1(struct R2JointDesc *desc, struct R2Pose value)
Set the joint desc joint frame relative to body 1.
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.
struct R2JointDesc r2RevoluteJointDesc(void)
Return a revolute joint description with native defaults; no allocation.
struct R2Vector R2Vector
Cartesian vector with two or three components.
R2Real r2Sin(R2Real x)
Sine of an angle in radians, computed by Rapier's math backend.
struct R2TriangleView R2CellView
Borrowed cell array: triangles in 2D, tetrahedra in 3D.
Definition rapier.h:2198
R2Real r2Exp(R2Real x)
Exponential e^x, computed by Rapier's math backend.
R2Real r2Acos(R2Real x)
Arccosine in radians, computed by Rapier's math backend.
struct R2Pose R2Pose
Rigid transform combining translation and rotation.
uint32_t R2Bool
ABI booleans are uint32_t: zero is false, one is true.
Definition rapier.h:1285
R2Real r2Asin(R2Real x)
Arcsine in radians, computed by Rapier's math backend.
R2Real r2Powf(R2Real base, R2Real exponent)
base raised to the power exponent, computed by Rapier's math backend.
R2Real R2AngVector
Angular scalar in 2D or vector in 3D, in radians for angular displacement.
Definition rapier.h:2420
R2Real r2Cos(R2Real x)
Cosine of an angle in radians, computed by Rapier's math backend.
R2Real r2Ln(R2Real x)
Natural logarithm, computed by Rapier's math backend.
int64_t R2VoxelCoord
Signed voxel coordinate integer.
Definition rapier.h:4232
struct R2EdgeView R2SurfaceElementView
Borrowed surface array: edges in 2D, triangles in 3D.
Definition rapier.h:2214
R2Real r2Tan(R2Real x)
Tangent of an angle in radians, computed by Rapier's math backend.
double R2Real
Floating-point scalar: float for f32, double for f64.
Definition rapier.h:1263
R2Real r2Atan2(R2Real y, R2Real x)
Angle in radians of the point (x, y), in [-pi, pi], computed by Rapier's math backend.
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 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 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 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,...
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).
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 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 R2QueryOptions r2DefaultQueryOptions(void)
Return native default query options.
struct R2ShapeCastOptions r2DefaultShapeCastOptions(void)
Return native default shape cast options.
struct R2QueryFilter r2DefaultQueryFilter(void)
Return native default query filter.
R2Bool(*) R2QueryPredicate(void *user_data, const struct R2ReadContext *read, struct R2ColliderHandle handle)
Called with scoped read access and a collider handle.
Definition rapier.h:2896
struct R2Pose r2NonlinearRigidMotion_PositionAtTime(const struct R2NonlinearRigidMotion *motion, R2Real time)
Return the world-space pose of the motion at the given time.
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.
R2Status r2RigidBody_ApplyImpulse(struct R2RigidBodyHandle handle, struct R2Vector value, R2Bool wake_up)
Apply a world-space linear impulse.
R2Status r2RigidBody_AddForce(struct R2RigidBodyHandle handle, struct R2Vector value, R2Bool wake_up)
Accumulate a world-space force; it persists until reset.
R2Status r2RigidBodyPropagateModifiedBodyPositionsToColliders(struct R2World *world)
Propagate all modified body poses to attached colliders.
struct R2Rotation r2RigidBody_Rotation(struct R2RigidBodyHandle handle)
Return the rigid body world-space rotation.
R2Status r2RigidBody_SetSoftCcdPrediction(struct R2RigidBodyHandle handle, R2Real value)
Set the rigid body soft-CCD prediction distance.
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).
struct R2UserData r2RigidBody_UserData(struct R2RigidBodyHandle handle)
Return the rigid body application-owned 128-bit user value.
struct R2RigidBodyDesc r2KinematicVelocityBasedRigidBodyDesc(void)
Return a kinematic velocity based rigid-body description with native defaults; no allocation.
R2Status r2RigidBody_SetAdditionalPgsIterations(struct R2RigidBodyHandle handle, size_t value)
Set the rigid body additional PGS iterations.
R2Bool r2RigidBody_IsKinematic(struct R2RigidBodyHandle handle)
Return whether the rigid body is kinematic.
R2Status r2RigidBody_SetLinearDamping(struct R2RigidBodyHandle handle, R2Real value)
Set the rigid body linear damping coefficient.
R2Status r2RigidBody_SetUserData(struct R2RigidBodyHandle handle, struct R2UserData value)
Set the rigid body application-owned 128-bit user value.
struct R2Pose r2RigidBody_Position(struct R2RigidBodyHandle handle)
Return the rigid body world-space pose.
R2Status r2RigidBody_WakeUp(struct R2RigidBodyHandle handle, R2Bool strong)
Wake a body by handle, including a soft-body cluster proxy.
struct R2RigidBodyDesc r2FixedRigidBodyDesc(void)
Return a fixed rigid-body description with native defaults; no allocation.
R2Status r2RigidBody_ValidateHandle(struct R2RigidBodyHandle handle)
Validate the index and generation in the live owning world.
R2Status r2RigidBody_SetRotationsLocked(struct R2RigidBodyHandle handle, R2Bool value, R2Bool wake_up)
Enable or disable locking rotation for the rigid body.
struct R2RigidBodyDesc R2RigidBodyDesc
Stack-allocated rigid-body construction data.
R2Status r2RigidBody_SetNextKinematicPosition(struct R2RigidBodyHandle handle, struct R2Pose value)
Set the rigid body next kinematic world-space pose.
R2Status r2RigidBody_SetLinvel(struct R2RigidBodyHandle handle, struct R2Vector value, R2Bool wake_up)
Set the rigid body world-space linear velocity.
size_t r2RigidBodyCount(const struct R2World *world)
Return the number of rigid body objects in the world.
struct R2Vector r2RigidBody_CenterOfMass(struct R2RigidBodyHandle handle)
Return the rigid body world-space center of mass.
uint32_t r2RigidBody_BodyType(struct R2RigidBodyHandle handle)
Return the rigid body body type (R2_DYNAMIC, R2_FIXED, or a kinematic kind).
struct R2Vector r2RigidBody_VelocityAtPoint(struct R2RigidBodyHandle handle, struct R2Vector point)
Return world-space velocity at a world-space point, including angular motion.
R2Status r2RigidBody_SetPosition(struct R2RigidBodyHandle handle, struct R2Pose value, R2Bool wake_up)
Set the rigid body world-space pose.
R2AngVector r2RigidBody_Angvel(struct R2RigidBodyHandle handle)
Return the rigid body world-space angular velocity (radians per second).
struct R2Pose r2RigidBody_NextPosition(struct R2RigidBodyHandle handle)
Return the rigid body next kinematic world-space pose.
R2Status r2RigidBody_SetTranslationsLocked(struct R2RigidBodyHandle handle, R2Bool value, R2Bool wake_up)
Enable or disable locking translation for the rigid body.
R2Status r2RigidBody_ApplyTorqueImpulse(struct R2RigidBodyHandle handle, R2AngVector value, R2Bool wake_up)
Apply a world-space angular impulse.
R2Bool r2RigidBody_IsMoving(struct R2RigidBodyHandle handle)
Return whether the rigid body is moving.
R2Status r2RigidBody_SetCcdEnabled(struct R2RigidBodyHandle handle, R2Bool value)
Enable or disable using continuous collision detection for the rigid body.
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.
uint8_t r2RigidBody_LockedAxes(struct R2RigidBodyHandle handle)
Return the rigid body translation/rotation lock bitmask.
R2Bool r2RigidBody_Contains(struct R2RigidBodyHandle handle)
Test whether the live world contains this rigid body handle.
int8_t r2RigidBody_DominanceGroup(struct R2RigidBodyHandle handle)
Return the rigid body signed dominance group.
R2Status r2RigidBody_SetNextKinematicTranslation(struct R2RigidBodyHandle handle, struct R2Vector value)
Set the rigid body next kinematic world-space translation.
R2Bool r2RigidBody_IsCcdActive(struct R2RigidBodyHandle handle)
Return whether the rigid body is currently using CCD for its motion.
size_t r2RigidBody_AdditionalPgsIterations(struct R2RigidBodyHandle handle)
Return the rigid body additional PGS iterations for connected bodies.
R2Status r2RigidBody_Sleep(struct R2RigidBodyHandle handle)
Put the body to sleep.
R2Status r2RigidBody_SetDominanceGroup(struct R2RigidBodyHandle handle, int8_t value)
Set the rigid body signed dominance group.
R2Status r2RigidBody_SetAngularDamping(struct R2RigidBodyHandle handle, R2Real value)
Set the rigid body angular damping coefficient.
R2Bool r2RigidBody_IsDynamic(struct R2RigidBodyHandle handle)
Return whether the rigid body is dynamic.
R2Status r2RigidBody_ResetForces(struct R2RigidBodyHandle handle, R2Bool wake_up)
Clear accumulated user forces.
R2AngVector r2RigidBody_UserTorque(struct R2RigidBodyHandle handle)
Return the rigid body accumulated user-applied world-space torque.
struct R2Vector r2RigidBody_Translation(struct R2RigidBodyHandle handle)
Return the rigid body world-space translation.
R2Real r2RigidBody_Mass(struct R2RigidBodyHandle handle)
Return the rigid body mass.
R2Real r2RigidBody_KineticEnergy(struct R2RigidBodyHandle handle)
Return the rigid body kinetic energy.
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.
R2Status r2RigidBody_AddTorque(struct R2RigidBodyHandle handle, R2AngVector value, R2Bool wake_up)
Accumulate a world-space torque; it persists until reset.
struct R2Vector r2RigidBody_UserForce(struct R2RigidBodyHandle handle)
Return the rigid body accumulated user-applied world-space force.
R2Status r2RigidBody_SetGravityScale(struct R2RigidBodyHandle handle, R2Real value, R2Bool wake_up)
Set the rigid body gravity multiplier.
R2Status r2RigidBody_SetRotation(struct R2RigidBodyHandle handle, struct R2Rotation value, R2Bool wake_up)
Set the rigid body world-space rotation.
struct R2RigidBodyDesc r2KinematicPositionBasedRigidBodyDesc(void)
Return a kinematic position based rigid-body description with native defaults; no allocation.
R2Status r2RigidBody_SetLockedAxes(struct R2RigidBodyHandle handle, uint8_t axes, R2Bool wake_up)
Set the rigid body translation/rotation lock bitmask.
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_RecomputeMassPropertiesFromColliders(struct R2RigidBodyHandle handle)
Recompute body mass and inertia from attached colliders and additional mass properties.
size_t r2RigidBody_Colliders(struct R2RigidBodyHandle handle, struct R2ColliderHandle *buffer, size_t capacity)
Copy attached collider handles.
R2Status r2RigidBody_SetNextKinematicRotation(struct R2RigidBodyHandle handle, struct R2Rotation value)
Set the rigid body next kinematic world-space rotation.
R2Bool r2RigidBody_IsCcdEnabled(struct R2RigidBodyHandle handle)
Return whether the rigid body is using continuous collision detection.
R2Status r2RemoveRigidBody(struct R2RigidBodyHandle handle, R2Bool remove_attached_colliders)
Remove a body and its joints, optionally keeping colliders as standalone objects.
R2Real r2RigidBody_GravityScale(struct R2RigidBodyHandle handle)
Return the rigid body gravity multiplier.
R2Status r2RigidBody_SetAllowFastRotation(struct R2RigidBodyHandle handle, R2Bool value)
Allow or disallow the rigid body to exceed the angular-velocity limit of its CCD (e....
struct R2RigidBodyDesc r2DynamicRigidBodyDesc(void)
Return a dynamic rigid-body description with native defaults; no allocation.
R2Status r2RigidBody_SetEnabled(struct R2RigidBodyHandle handle, R2Bool value)
Enable or disable the rigid body.
R2Status r2RigidBody_SetTranslation(struct R2RigidBodyHandle handle, struct R2Vector value, R2Bool wake_up)
Set the rigid body world-space translation.
struct R2Vector r2RigidBody_Linvel(struct R2RigidBodyHandle handle)
Return the rigid body world-space linear velocity.
R2Bool r2RigidBody_IsFastRotationAllowed(struct R2RigidBodyHandle handle)
Return whether the rigid body may exceed the angular-velocity limit of its CCD.
size_t r2RigidBodyHandles(const struct R2World *world, struct R2RigidBodyHandle *buffer, size_t capacity)
Copy entity handles.
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_ResetTorques(struct R2RigidBodyHandle handle, R2Bool wake_up)
Clear accumulated user torques.
struct R2RigidBodyHandle r2InsertRigidBody(struct R2World *world, const struct R2RigidBodyDesc *desc)
Create a body from the description and return its world-bound handle.
R2Real r2RigidBody_LinearDamping(struct R2RigidBodyHandle handle)
Return the rigid body linear damping coefficient.
struct R2Vector r2RigidBody_LocalCenterOfMass(struct R2RigidBodyHandle handle)
Return the rigid body body-local center of mass.
R2Real r2RigidBody_AngularDamping(struct R2RigidBodyHandle handle)
Return the rigid body angular damping coefficient.
R2Bool r2RigidBody_IsEnabled(struct R2RigidBodyHandle handle)
Return whether the rigid body is enabled.
R2Status r2RigidBody_SetAngvel(struct R2RigidBodyHandle handle, R2AngVector value, R2Bool wake_up)
Set the rigid body world-space angular velocity (radians per second).
size_t r2RigidBody_AdditionalSolverIterations(struct R2RigidBodyHandle handle)
Return the rigid body additional solver iterations for connected bodies.
R2Status r2RigidBody_SetAdditionalSolverIterations(struct R2RigidBodyHandle handle, size_t value)
Set the rigid body additional solver iterations for connected bodies.
R2Status r2RigidBody_SetAdditionalMass(struct R2RigidBodyHandle handle, R2Real value, R2Bool wake_up)
Set the rigid body mass added to collider contributions.
R2Real r2RigidBody_SoftCcdPrediction(struct R2RigidBodyHandle handle)
Return the rigid body soft-CCD prediction distance.
R2Bool r2RigidBody_IsSleeping(struct R2RigidBodyHandle handle)
Return whether the rigid body is sleeping.
R2Bool r2RigidBody_IsFixed(struct R2RigidBodyHandle handle)
Return whether the rigid body is fixed.
R2SharedShape * r2CompoundSharedShape(struct R2CompoundShapeView children)
Create an owned compound shape; each child pose is relative to the compound.
struct R2ShapeDesc r2DefaultShapeDesc(void)
Return native default shape desc.
R2Status r2Collider_SetShape(struct R2ColliderHandle handle, const R2SharedShape *shape)
Replace collider geometry by sharing shape; the supplied wrapper is not consumed.
struct R2ShapeMesh R2ShapeMesh
Owned tessellated shape: flat triangle vertices and independent line segments, in local space.
Definition rapier.h:1208
R2SharedShape * r2BallSharedShape(R2Real radius)
Create an owned ball shape.
struct R2MassProperties r2SharedShape_MassProperties(const R2SharedShape *shape, R2Real density)
Compute local mass properties for the supplied nonnegative density.
R2SharedShape * r2RoundCuboidSharedShape(struct R2Vector half_extents, R2Real border_radius)
Create an owned round cuboid shape.
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.
R2SharedShape * r2TrimeshSharedShapeWithFlags(struct R2VectorView vertices, struct R2TriangleView indices, uint32_t flags)
Create an owned triangle mesh with the supplied TRIMESH_* processing flags.
R2Status r2FreeShapeMesh(struct R2ShapeMesh *mesh)
Release an owned shape mesh.
R2SharedShape * r2ConvexHullSharedShape(struct R2VectorView vertices)
Create an owned convex hull of the supplied vertices.
R2Status r2ShapeDesc_SetTrimesh(struct R2ShapeDesc *desc, struct R2VectorView vertices, struct R2TriangleView indices, uint32_t flags)
Replace the shape geometry with a borrowed tri mesh.
R2SharedShape * r2SegmentSharedShape(struct R2Vector a, struct R2Vector b)
Create an owned segment shape.
R2SharedShape * r2Collider_CloneShape(struct R2ColliderHandle handle)
Return an owned wrapper sharing the collider geometry.
R2SharedShape * r2PolylineSharedShape(struct R2VectorView vertices, struct R2EdgeView indices)
Create an owned polyline from vertices and edge indices.
R2SharedShape * r2HalfspaceSharedShape(struct R2Vector normal)
Create an owned halfspace shape.
size_t r2Collider_ShapeIdentity(struct R2ColliderHandle handle)
Return a process-local geometry identity for caching, not a serializable ID.
struct R2Aabb r2SharedShape_ComputeAabb(const R2SharedShape *shape, struct R2Pose pose)
Compute the shape axis-aligned bounds at the supplied world-space pose.
R2SharedShape * r2CapsuleSharedShape(struct R2Vector a, struct R2Vector b, R2Real radius)
Create an owned capsule shape.
R2SharedShape * r2ShapeDesc_Build(const struct R2ShapeDesc *desc)
Build an owned shared shape from a description; release it with r2FreeSharedShape.
R2SharedShape * r2VoxelsSharedShapeFromPoints(struct R2Vector voxel_size, struct R2VectorView points)
Create an owned voxel shape by quantizing points with the supplied per-axis voxel size.
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 r2ShapeMesh_Triangles(const struct R2ShapeMesh *mesh, struct R2Vector *buffer, size_t capacity)
Flat groups of three vertices.
R2SharedShape * r2SharedShape_Clone(const R2SharedShape *object)
Create an owned wrapper sharing the same immutable geometry.
R2SharedShape * r2RoundConvexHullSharedShape(struct R2VectorView vertices, R2Real border_radius)
Create an owned round convex hull shape.
R2SharedShape * r2HeightfieldSharedShape(struct R2RealView heights, size_t rows, size_t columns, struct R2Vector scale)
Create an owned heightfield shape from copied samples.
R2SharedShape * r2CuboidSharedShape(struct R2Vector half_extents)
Create an owned cuboid shape.
size_t r2ShapeMesh_Lines(const struct R2ShapeMesh *mesh, struct R2Vector *buffer, size_t capacity)
Flat groups of two vertices.
R2Status r2ShapeDesc_SetPolyline(struct R2ShapeDesc *desc, struct R2VectorView vertices, struct R2EdgeView indices, uint32_t flags)
Replace the shape geometry with a borrowed polyline.
R2SharedShape * r2TrimeshSharedShape(struct R2VectorView vertices, struct R2TriangleView indices)
Create an owned triangle mesh from vertices and triangle indices.
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 * r2ConvexDecompositionSharedShape(struct R2VectorView vertices, R2SurfaceElementView indices)
Create an owned compound shape by convex decomposition of the input surface.
struct R2SharedShape R2SharedShape
Opaque SharedShape.
Definition rapier.h:2302
R2Bool r2SharedShape_ContainsPoint(const R2SharedShape *shape, struct R2Pose pose, struct R2Vector point)
Test whether the world-space point lies inside the shape at pose.
R2SharedShape * r2ConvexPolylineSharedShape(struct R2VectorView vertices)
Create an owned convex polygon from vertices already ordered along its boundary.
R2SharedShape * r2TriangleSharedShape(struct R2Vector a, struct R2Vector b, struct R2Vector c)
Create an owned triangle shape.
struct R2ShapeMesh * r2SharedShape_Tessellate(const R2SharedShape *shape, uint32_t subdivisions)
Return owned local-space rendering geometry; release it with r2FreeShapeMesh.
R2SharedShape * r2OrientedPolylineSharedShape(struct R2VectorView vertices, struct R2EdgeView indices)
Create an owned oriented 2D polyline from vertices and edge indices.
R2Status r2ShapeDesc_SetConvexHull(struct R2ShapeDesc *desc, struct R2VectorView vertices)
Replace the shape geometry with a borrowed convex hull point cloud.
R2Status r2FreeSharedShape(R2SharedShape *object)
Frees an owned object; NULL is allowed.
uint32_t r2RecoveryOverlapPatience(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::overlapPatience.
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 b...
R2Bool r2RecoveryOverlapRigid(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::overlapRigid.
struct R2SoftBodyHandle r2InsertSoftBody(struct R2World *world, const struct R2SoftBodyDesc *desc)
Consumes no caller-owned resources.
R2Bool r2RecoveryCrossBodyExpelGate(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::crossBodyExpelGate.
size_t r2SoftBody_Edges(struct R2SoftBodyHandle handle, uint32_t *buffer, size_t capacity)
Copy flattened edge vertex indices.
R2Status r2FemSetMaxLinearIterations(struct R2World *world, size_t value)
Set the world setting documented by R2SoftFemParameters::maxLinearIterations.
R2Status r2SoftBody_AddForce(struct R2SoftBodyHandle handle, struct R2Vector value, R2Bool wake_up)
Accumulate a world-space force; it persists until reset.
R2Status r2RecoverySetOverlapProgressMargin(struct R2World *world, R2Real value)
Set the world setting documented by R2SoftRecoverySettings::overlapProgressMargin.
R2Status r2SoftBody_SetParticleVelocity(struct R2SoftBodyHandle handle, size_t index, struct R2Vector value)
Set the soft body particle world-space velocity.
R2Status r2RecoverySetOverlapPatience(struct R2World *world, uint32_t value)
Set the world setting documented by R2SoftRecoverySettings::overlapPatience.
R2Status r2SoftBodyDesc_SetTensionOnlyEdges(struct R2SoftBodyDesc *desc, struct R2IndexView view)
Borrow tension only edges; preserve all other fields.
R2Status r2SoftBody_SetClusterKinematicTarget(struct R2SoftBodyHandle handle, uint32_t cluster, struct R2Pose value)
Set the next world-space target pose of a pinned cluster.
struct R2SoftBodyMaterial r2DefaultSoftBodyMaterial(void)
Return native default soft body material.
R2Bool r2SoftBody_DetachParticle(struct R2SoftBodyHandle handle, size_t index)
Detach a particle from every rigid body it was attached to with r2SoftBody_AttachParticle.
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 r2RecoverySetOverlapConstraints(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::overlapConstraints.
R2Real r2SoftBody_VolumeFactor(struct R2SoftBodyHandle handle)
Return 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_MeshIsClosed(struct R2SoftBodyHandle handle, struct R2ColliderHandle collider)
Return whether the selected collision mesh is closed.
R2Bool r2RecoveryCrossBodyDetection(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::crossBodyDetection.
R2Real r2SoftBody_Volume(struct R2SoftBodyHandle handle)
Return the soft body current volume.
struct R2Vector r2SoftBody_ParticleVelocity(struct R2SoftBodyHandle handle, size_t index)
Return the world-space velocity of the indexed particle.
R2Status r2SoftBody_ResetForces(struct R2SoftBodyHandle handle, R2Bool wake_up)
Clear accumulated user forces.
R2Status r2RecoverySetSelfCrossingDetection(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::selfCrossingDetection.
R2Status r2SoftBodiesSetResweepStrain(struct R2World *world, R2Real value)
Set the world setting documented by R2SoftBodiesSettings::resweepStrain.
struct R2RigidBodyHandle r2SoftBody_ClusterProxy(struct R2SoftBodyHandle handle, uint32_t cluster)
Return the rigid proxy for the selected cluster.
uint32_t r2SoftBody_Solver(struct R2SoftBodyHandle handle)
Return the solver simulating the soft body's elasticity (R2_SOFT_SOLVER_*).
R2Status r2SoftBodyDesc_SetSurfaceMesh(struct R2SoftBodyDesc *desc, struct R2VectorView vertices, R2SurfaceElementView elements)
Select a surface recipe and borrow its vertices and elements.
R2Status r2RecoverySetOverlapSplit(struct R2World *world, uint32_t value)
Set the world setting documented by R2SoftRecoverySettings::overlapSplit.
R2Status r2SoftBody_RemoveCluster(struct R2SoftBodyHandle handle, uint32_t cluster)
Remove the selected cluster and its rigid proxy.
R2Bool r2RecoveryDetectionMotionGating(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::detectionMotionGating.
R2Status r2RecoverySetSelfStandDown(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::selfStandDown.
size_t r2SoftBodyTearEvent_MovedJoints(const struct R2SoftBodyTearEvent *event, struct R2SoftJointMove *buffer, size_t capacity)
Copy impulse-joint remapping records produced by the tear.
R2Bool r2RecoveryOverlapSkipSelfTangled(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::overlapSkipSelfTangled.
R2Status r2SoftBodyDesc_SetAddedEdges(struct R2SoftBodyDesc *desc, struct R2EdgeView view)
Borrow structural edges added after appending (see R2SoftBodyDesc::addedEdges); preserve all other fi...
R2Bool r2RecoveryCrossingRepulsionGuide(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::crossingRepulsionGuide.
R2Status r2SoftBodyDesc_SetSurface(struct R2SoftBodyDesc *desc, R2SurfaceElementView view)
Borrow surface; preserve all other fields.
R2Status r2SoftBody_SetClusterShapeMatchingEnabled(struct R2SoftBodyHandle handle, uint32_t cluster, R2Bool value)
Enable or disable using cluster shape matching for the soft body.
size_t r2SoftBodyTearEvent_SplitParticles(const struct R2SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity)
Flat indices; element arity follows the corresponding Rust event field.
R2Status r2SoftBodiesSetMaxExtraSubsteps(struct R2World *world, size_t value)
Set the world setting documented by R2SoftBodiesSettings::maxExtraSubsteps.
R2Real r2SoftBodiesResweepStrain(const struct R2World *world)
Return the world setting documented by R2SoftBodiesSettings::resweepStrain.
size_t r2SoftBody_MeshArity(struct R2SoftBodyHandle handle, struct R2ColliderHandle collider)
Return indices per collision-mesh element (2 for segments, 3 for triangles).
struct R2SoftBodyDesc r2DefaultSoftBodyDesc(void)
Return native default soft body desc.
size_t r2FemMaxDenseDofs(const struct R2World *world)
Return the world setting documented by R2SoftFemParameters::maxDenseDofs.
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...
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.
R2Status r2SoftBodiesSetContactStiffening(struct R2World *world, R2Real value)
Set the world setting documented by R2SoftBodiesSettings::contactStiffening.
R2Bool r2RigidBody_IsSoftFrame(struct R2RigidBodyHandle handle)
Return whether the rigid body is a soft-body proxy.
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 preservati...
R2Status r2SoftBodyDesc_SetParticles(struct R2SoftBodyDesc *desc, struct R2VectorView positions)
Select an explicit particle recipe and borrow its positions.
R2Status r2RemoveSoftBody(struct R2SoftBodyHandle handle)
Remove a soft body and its associated simulation objects.
R2Status r2SoftBody_ResetPlasticity(struct R2SoftBodyHandle handle)
Undo every permanent (plastic) deformation: edge rest lengths, dihedral rest angles,...
R2Status r2RecoverySetOverlapEdgeStandDown(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::overlapEdgeStandDown.
R2Status r2SoftBodyDesc_SetBendEdges(struct R2SoftBodyDesc *desc, struct R2EdgeView view)
Borrow bend edges; preserve all other fields.
R2Bool r2SoftBody_IsSleeping(struct R2SoftBodyHandle handle)
Return whether the soft body is sleeping.
R2Status r2RecoverySetOverlapSkinVolume(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::overlapSkinVolume.
R2Status r2RecoverySetOverlapNormalPush(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::overlapNormalPush.
size_t r2SoftBody_ParticlePositions(struct R2SoftBodyHandle handle, struct R2Vector *buffer, size_t capacity)
Copy world-space particle positions.
R2Real r2RecoveryOverlapKeptDepth(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::overlapKeptDepth.
R2Status r2RecoverySetCrossBodyDetection(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::crossBodyDetection.
struct R2RigidBodyHandle r2SoftBody_RootBody(struct R2SoftBodyHandle handle)
Return the soft body root rigid-proxy handle.
R2Status r2RecoverySetDetectionMotionGating(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::detectionMotionGating.
size_t r2SoftBodyDesc_CellIndices(const struct R2SoftBodyDesc *desc, uint32_t *buffer, size_t capacity)
Copies generated cell indices into caller-owned storage.
struct R2SoftBodyHandle r2SoftBodyTearEvent_SoftBody(const struct R2SoftBodyTearEvent *event)
Return the source soft-body handle for this tear event.
struct R2SoftBodyTearEvent * r2CutSoftBody(struct R2SoftBodyHandle handle, const struct R2Vector *blade)
Cut using DIM points (a segment in 2D, triangle in 3D).
R2Status r2RecoverySetEdgeSpeculation(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::edgeSpeculation.
uint32_t r2RecoveryOverlapPatchConstraints(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::overlapPatchConstraints.
struct R2ParticleDestination r2SoftBodyTearEvent_ParticleDestination(const struct R2SoftBodyTearEvent *event, uint32_t particle)
Return the destination body and particle index for an original particle.
R2Bool r2RecoveryInvertedCellDetection(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::invertedCellDetection.
R2Status r2RecoverySetCrossBodyExpelGate(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::crossBodyExpelGate.
struct R2SoftBodyMaterial r2UniformSoftBodyMaterial(struct R2SpringCoefficients value)
Returns a material with the same softness for each constraint family.
size_t r2SoftBody_Meshes(struct R2SoftBodyHandle handle, struct R2SoftMeshInfo *buffer, size_t capacity)
Copy collision mesh metadata.
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 r2SoftBody_ClusterParticles(struct R2SoftBodyHandle handle, uint32_t cluster, uint32_t *buffer, size_t capacity)
Copy particle indices for a cluster.
size_t r2SoftBodyTearEvent_RemovedEdges(const struct R2SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity)
Flat indices; element arity follows the corresponding Rust event field.
R2Bool r2SoftBody_IsEnabled(struct R2SoftBodyHandle handle)
Return whether the soft body is enabled.
R2Status r2FemSetLinearTolerance(struct R2World *world, R2Real value)
Set the world setting documented by R2SoftFemParameters::linearTolerance.
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...
R2Status r2SoftBody_TearCell(struct R2SoftBodyHandle handle, size_t index)
Mark the indexed cell as torn.
R2Status r2RecoverySetOverlapPatchConstraints(struct R2World *world, uint32_t value)
Set the world setting documented by R2SoftRecoverySettings::overlapPatchConstraints.
size_t r2SoftBody_Cells(struct R2SoftBodyHandle handle, uint32_t *buffer, size_t capacity)
Copy flattened cell vertex indices.
R2Status r2RecoverySetCrossingRepulsionSelfGuide(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::crossingRepulsionSelfGuide.
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...
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.
R2Bool r2RecoverySelfStandDown(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::selfStandDown.
R2Bool r2RecoveryOverlapNormalPush(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::overlapNormalPush.
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.
struct R2SoftBodyHandle r2RigidBody_SoftBody(struct R2RigidBodyHandle handle)
Return the associated soft-body handle, or an invalid handle if this is not a soft proxy.
struct R2SoftRecoverySettings r2DefaultSoftRecoverySettings(void)
Return native default soft recovery settings.
R2Status r2SoftBodyDesc_SetEdges(struct R2SoftBodyDesc *desc, struct R2EdgeView view)
Borrow edges; preserve all other fields.
uint32_t r2SoftBody_TopologyVersion(struct R2SoftBodyHandle handle)
Return a counter that changes when particle connectivity changes; use it to invalidate mesh caches.
R2Status r2RecoverySetEdgeStandDown(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::edgeStandDown.
R2Status r2SoftBody_SetClusterShapeMatchingTarget(struct R2SoftBodyHandle handle, uint32_t cluster, const struct R2Pose *target)
Set the soft body cluster shape-matching target pose.
R2Status r2RecoverySetOverlapRigid(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::overlapRigid.
R2Status r2FreeSoftBodyTearEvent(struct R2SoftBodyTearEvent *event)
Release an owned soft body tear event.
struct R2SoftBodiesSettings r2DefaultSoftBodiesSettings(void)
Return native default soft bodies settings.
R2Status r2RecoverySetRecoveryPace(struct R2World *world, R2Real value)
Set the world setting documented by R2SoftRecoverySettings::recoveryPace.
R2Status r2RecoverySetOverlapMultiVolume(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::overlapMultiVolume.
size_t r2SoftBody_NumParticles(struct R2SoftBodyHandle handle)
Return the soft body particle count.
size_t r2SoftBodiesMaxExtraSubsteps(const struct R2World *world)
Return the world setting documented by R2SoftBodiesSettings::maxExtraSubsteps.
struct R2SoftBodyDesc r2PolygonSoftBodyDesc(struct R2VectorView points)
Return a closed polygon recipe from at least 3 counter-clockwise points: structural edges along the b...
struct R2Vector r2SoftBody_CenterOfMass(struct R2SoftBodyHandle handle)
Return the soft body world-space center of mass.
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 r2SoftBody_Boundary(struct R2SoftBodyHandle handle, uint32_t *buffer, size_t capacity)
Copy flattened boundary element indices.
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 r2SoftBodyTearEvent_TornEdges(const struct R2SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity)
Flat indices; element arity follows the corresponding Rust event field.
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 r2SoftBodyCount(const struct R2World *world)
Return the number of soft body objects in the world.
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 parti...
R2Bool r2SoftBody_Contains(struct R2SoftBodyHandle handle)
Test whether the live world contains this soft body handle.
size_t r2FemMaxLinearIterations(const struct R2World *world)
Return the world setting documented by R2SoftFemParameters::maxLinearIterations.
size_t r2SoftBody_MeshIndices(struct R2SoftBodyHandle handle, struct R2ColliderHandle collider, uint32_t *buffer, size_t capacity)
Copy flattened collision mesh indices.
R2Status r2SoftBody_ApplyParticleImpulse(struct R2SoftBodyHandle handle, size_t index, struct R2Vector value, R2Bool wake_up)
Apply a world-space impulse to one particle.
R2Status r2RecoverySetOverlapSkipSelfTangled(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::overlapSkipSelfTangled.
R2Status r2SoftBody_SetMaterial(struct R2SoftBodyHandle handle, const struct R2SoftBodyMaterial *data)
Copy material parameters into the soft body.
size_t r2SoftBody_ParticleVelocities(struct R2SoftBodyHandle handle, struct R2Vector *buffer, size_t capacity)
Copy world-space particle velocities.
struct R2SoftBodyDesc r2VolumetricSoftBodyDesc(struct R2VectorView vertices, R2SurfaceElementView surface, struct R2VolumeMeshParameters parameters)
Initializes a borrowed meshing recipe.
R2Bool r2RecoveryCrossingRepulsionSelfGuide(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::crossingRepulsionSelfGuide.
R2Status r2FemSetMaxDenseDofs(struct R2World *world, size_t value)
Set the world setting documented by R2SoftFemParameters::maxDenseDofs.
struct R2OptionalParticleDestination r2SoftBodyTearEvent_TryParticleDestination(const struct R2SoftBodyTearEvent *event, uint32_t particle)
Optional particle destination after a tear.
size_t r2SoftBodyTearEvent_InsertedParticles(const struct R2SoftBodyTearEvent *event, uint32_t *buffer, size_t capacity)
Flat indices; element arity follows the corresponding Rust event field.
struct R2SoftBodyMaterial r2SoftBody_Material(struct R2SoftBodyHandle handle)
Return a copy of the soft body material parameters.
R2Status r2SoftBodyDesc_SetPinnedParticles(struct R2SoftBodyDesc *desc, struct R2IndexView view)
Borrow pinned particles; preserve all other fields.
R2Status r2SoftBodyDesc_SetAppended(struct R2SoftBodyDesc *desc, struct R2SoftBodyDescView view)
Borrow descriptions to merge into this body (see R2SoftBodyDesc::appended); preserve all other fields...
size_t r2SoftBody_Pieces(struct R2SoftBodyHandle handle, struct R2SoftBodyHandle *buffer, size_t capacity)
Copy piece identifiers.
R2Bool r2RecoveryEdgeSpeculation(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::edgeSpeculation.
R2Status r2SoftBody_SetClusterTearResistance(struct R2SoftBodyHandle handle, uint32_t cluster, R2Real value)
Set the soft body cluster tear-resistance multiplier.
R2Bool r2RecoveryOverlapEdgeStandDown(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::overlapEdgeStandDown.
R2Status r2RecoverySetAuthoredVelocityMargin(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::authoredVelocityMargin.
R2Status r2RecoverySetCrossingRepulsion(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::crossingRepulsion.
size_t r2SoftBody_MeshColliders(struct R2SoftBodyHandle handle, struct R2ColliderHandle *buffer, size_t capacity)
Copy collision mesh collider handles.
R2Real r2RecoveryOverlapProgressMargin(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::overlapProgressMargin.
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: regiona...
size_t r2SoftBody_MeshVertices(struct R2SoftBodyHandle handle, struct R2ColliderHandle collider, struct R2Vector *buffer, size_t capacity)
Copy world-space collision mesh vertices.
R2Status r2SoftBody_SetSolver(struct R2SoftBodyHandle handle, uint32_t solver)
Set the soft body soft solver kind (R2_SOFT_SOLVER_*).
R2Status r2SoftBodyDesc_SetCells(struct R2SoftBodyDesc *desc, R2CellView view)
Borrow cells; preserve all other fields.
R2Bool r2RecoverySelfCrossingDetection(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::selfCrossingDetection.
R2Real r2SoftBody_Mass(struct R2SoftBodyHandle handle)
Return the soft body mass.
R2Status r2SoftBody_SetParticlePosition(struct R2SoftBodyHandle handle, size_t index, struct R2Vector value)
Set the world-space position of the indexed particle.
R2Status r2SoftBody_SetClusterPinned(struct R2SoftBodyHandle handle, uint32_t cluster, R2Bool value)
Enable or disable pinning the cluster for the soft body.
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.
R2Status r2SoftBody_TearEdge(struct R2SoftBodyHandle handle, size_t index)
Mark the indexed edge as torn.
R2Bool r2RecoveryOverlapConstraints(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::overlapConstraints.
R2Status r2SoftBodyDesc_SetMasses(struct R2SoftBodyDesc *desc, struct R2RealView view)
Borrow masses; preserve all other fields.
R2Status r2SoftBody_ValidateHandle(struct R2SoftBodyHandle handle)
Validate the index and generation in the live owning world.
struct R2SoftMeshBindingDesc r2DefaultSoftMeshBindingDesc(void)
Return native default soft mesh binding desc.
R2Bool r2RecoveryCrossingRepulsion(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::crossingRepulsion.
R2Bool r2RecoveryOverlapSkinVolume(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::overlapSkinVolume.
R2Bool r2RecoveryEdgeStandDown(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::edgeStandDown.
R2Real r2RecoveryOverlapConstraintPace(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::overlapConstraintPace.
R2Status r2RecoverySetOverlapKeptDepth(struct R2World *world, R2Real value)
Set the world setting documented by R2SoftRecoverySettings::overlapKeptDepth.
R2Status r2SoftBody_SetParticleKinematicTarget(struct R2SoftBodyHandle handle, size_t index, struct R2Vector value)
Set the next world-space target position of a pinned particle.
R2Status r2RecoverySetInvertedCellDetection(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::invertedCellDetection.
R2Status r2SoftBody_WakeUp(struct R2SoftBodyHandle handle)
Wake the soft body and its rigid proxies.
R2Bool r2RecoveryOverlapSelfRegions(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::overlapSelfRegions.
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 b...
R2Bool r2RecoveryOverlapMultiVolume(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::overlapMultiVolume.
R2Status r2SoftBody_SetEnabled(struct R2SoftBodyHandle handle, R2Bool value)
Enable or disable the soft body.
R2Status r2RecoverySetOverlapSelfRegions(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::overlapSelfRegions.
R2Status r2SoftBody_SetVolumeFactor(struct R2SoftBodyHandle handle, R2Real value)
Set the soft body target volume multiplier.
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 r2SoftBody_Clusters(struct R2SoftBodyHandle handle, uint32_t *buffer, size_t capacity)
Copy cluster indices.
R2Real r2FemLinearTolerance(const struct R2World *world)
Return the world setting documented by R2SoftFemParameters::linearTolerance.
R2Bool r2RecoveryAuthoredVelocityMargin(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::authoredVelocityMargin.
struct R2SoftFemParameters r2DefaultSoftFemParameters(void)
Return native default soft fem parameters.
R2Status r2RecoverySetOverlapConstraintPace(struct R2World *world, R2Real value)
Set the world setting documented by R2SoftRecoverySettings::overlapConstraintPace.
R2Status r2SoftBodyDesc_SetSkin(struct R2SoftBodyDesc *desc, struct R2VectorView vertices, R2SurfaceElementView elements)
Borrow skin geometry.
R2Status r2SoftBody_SetEdgeTearResistance(struct R2SoftBodyHandle handle, size_t index, R2Real resistance)
Set the soft body edge tear-resistance multiplier.
size_t r2SoftBodyHandles(const struct R2World *world, struct R2SoftBodyHandle *buffer, size_t capacity)
Copy entity handles.
uint32_t r2RecoveryOverlapSplit(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::overlapSplit.
R2Status r2RecoverySetCrossingRepulsionGuide(struct R2World *world, R2Bool value)
Set the world setting documented by R2SoftRecoverySettings::crossingRepulsionGuide.
R2Real r2SoftBody_RestVolume(struct R2SoftBodyHandle handle)
Return the soft body undeformed volume.
uint32_t r2SoftBody_MeshTopologyVersion(struct R2SoftBodyHandle handle, struct R2ColliderHandle collider)
Return the selected collision mesh topology revision for cache invalidation.
R2Status r2SoftBody_SetParticlePinned(struct R2SoftBodyHandle handle, size_t index, R2Bool value)
Enable or disable pinning the particle for the soft body.
struct R2Vector r2SoftBody_ParticlePosition(struct R2SoftBodyHandle handle, size_t index)
Return the world-space position of the indexed particle.
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,...
R2Real r2SoftBodiesContactStiffening(const struct R2World *world)
Return the world setting documented by R2SoftBodiesSettings::contactStiffening.
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 r2SoftBodyTearEven...
R2Real r2RecoveryRecoveryPace(const struct R2World *world)
Return the world setting documented by R2SoftRecoverySettings::recoveryPace.
R2Status r2ClearThreadPool(struct R2World *world)
Removes the world's dedicated pool.
struct R2Bytes R2Bytes
Immutable owned byte buffer.
Definition rapier.h:1121
R2Status r2SetNumSolverIterations(struct R2World *world, size_t value)
Set the world setting documented by R2IntegrationParameters::numSolverIterations.
R2Real r2MinCcdDt(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::minCcdDt.
R2Status r2SetLengthUnit(struct R2World *world, R2Real value)
Set the world setting documented by R2IntegrationParameters::lengthUnit.
struct R2World * r2DeserializeWorld(const uint8_t *data, size_t count)
Restore ONLY trusted snapshots produced by the identical Rapier build.
R2Real r2LengthUnit(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::lengthUnit.
R2Real r2NormalizedContactRecycleDistance(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::normalizedContactRecycleDistance.
struct R2VolumeMeshParameters r2NewVolumeMeshParameters(R2Real cell_size)
Return volume-meshing settings for the supplied cell size; this POD value requires no destructor.
R2Real r2WarmstartCoefficient(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::warmstartCoefficient.
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 beca...
R2Status r2SetContactSoftness(struct R2World *world, struct R2SpringCoefficients value)
Set the world setting documented by R2IntegrationParameters::contactSoftness.
R2Real r2NormalizedMaxCorrectiveVelocity(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::normalizedMaxCorrectiveVelocity.
double r2StepTimeMs(const struct R2World *world)
Native engine time of the most recent step, in milliseconds, as in the Rust testbed.
R2Bool r2FrictionInBiasPass(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::frictionInBiasPass.
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.
size_t r2MaxCcdSubsteps(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::maxCcdSubsteps.
R2Status r2SetNormalizedMaxLinearVelocity(struct R2World *world, R2Real value)
Set the world setting documented by R2IntegrationParameters::normalizedMaxLinearVelocity.
R2Status r2DetectCollisions(struct R2World *world, const struct R2PhysicsHooks *hooks, const struct R2EventCollector *events)
Refresh collision detection without advancing simulation.
R2Status r2SetCountersEnabled(struct R2World *world, R2Bool enabled)
Enable or disable the native pipeline profiling counters.
R2Status r2SetNormalizedPredictionDistance(struct R2World *world, R2Real value)
Set the world setting documented by R2IntegrationParameters::normalizedPredictionDistance.
R2Status r2SetNormalizedMaxCorrectiveVelocity(struct R2World *world, R2Real value)
Set the world setting documented by R2IntegrationParameters::normalizedMaxCorrectiveVelocity.
R2Real r2NormalizedAllowedLinearError(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::normalizedAllowedLinearError.
R2Bool r2WarmstartJoints(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::warmstartJoints.
R2Status r2FreeWorld(struct R2World *world)
Free a world.
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-f...
R2Status r2SetWarmstartJoints(struct R2World *world, R2Bool value)
Set the world setting documented by R2IntegrationParameters::warmstartJoints.
R2Status r2SetMaxCcdSubsteps(struct R2World *world, size_t value)
Set the world setting documented by R2IntegrationParameters::maxCcdSubsteps.
R2Status r2SetNumInternalStabilizationIterations(struct R2World *world, size_t value)
Set the world setting documented by R2IntegrationParameters::numInternalStabilizationIterations.
R2Status r2SetMinCcdDt(struct R2World *world, R2Real value)
Set the world setting documented by R2IntegrationParameters::minCcdDt.
R2Bool r2ContactClustering(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::contactClustering.
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 ...
R2Bool r2ContactRecycling(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::contactRecycling.
R2Status r2SetNormalizedAllowedLinearError(struct R2World *world, R2Real value)
Set the world setting documented by R2IntegrationParameters::normalizedAllowedLinearError.
struct R2World * r2NewWorld(void)
Create an owned world.
size_t r2NumSolverIterations(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::numSolverIterations.
R2Status r2SetTimeStep(struct R2World *world, R2Real value)
Set the world setting documented by R2IntegrationParameters::dt.
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 r2SetWarmstartCoefficient(struct R2World *world, R2Real value)
Set the world setting documented by R2IntegrationParameters::warmstartCoefficient.
R2Status r2SetFrictionInBiasPass(struct R2World *world, R2Bool value)
Set the world setting documented by R2IntegrationParameters::frictionInBiasPass.
R2Status r2SetStaticContactSoftness(struct R2World *world, struct R2SpringCoefficients value)
Set the world setting documented by R2IntegrationParameters::staticContactSoftness.
struct R2IntegrationParameters r2DefaultIntegrationParameters(void)
Return native default integration parameters.
size_t r2NumInternalPgsIterations(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::numInternalPgsIterations.
struct R2Vector r2Gravity(const struct R2World *world)
Return the world-space gravitational acceleration.
struct R2World R2World
Sole owner of simulation state.
Definition rapier.h:1248
R2Status r2SetIntegrationParameters(struct R2World *world, const struct R2IntegrationParameters *data)
Copies validated values; does not expose a writable alias to Rust memory.
size_t r2NumInternalStabilizationIterations(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::numInternalStabilizationIterations.
R2Real r2TimeStep(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::dt.
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-fin...
struct R2SpringCoefficients r2ContactSoftness(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::contactSoftness.
R2Status r2SetContactRecycling(struct R2World *world, R2Bool value)
Set the world setting documented by R2IntegrationParameters::contactRecycling.
size_t r2ActiveRigidBodies(const struct R2World *world, struct R2RigidBodyHandle *buffer, size_t capacity)
Copies the island manager's active body handles.
struct R2Bytes * r2SerializeWorld(const struct R2World *world)
Return owned snapshot bytes; release them with r2FreeBytes.
R2Status r2SetContactClustering(struct R2World *world, R2Bool value)
Set the world setting documented by R2IntegrationParameters::contactClustering.
R2Status r2SetNormalizedContactRecycleDistance(struct R2World *world, R2Real value)
Set the world setting documented by R2IntegrationParameters::normalizedContactRecycleDistance.
struct R2IntegrationParameters r2IntegrationParameters(const struct R2World *world)
Return a copy of all world integration settings.
R2Status r2SetNumThreads(struct R2World *world, size_t num_threads)
Configures a dedicated pool for this world's parallel work.
struct R2SpringCoefficients r2StaticContactSoftness(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::staticContactSoftness.
R2Status r2FreeBytes(struct R2Bytes *bytes)
Release an owned snapshot byte buffer.
R2Status r2SetNumInternalPgsIterations(struct R2World *world, size_t value)
Set the world setting documented by R2IntegrationParameters::numInternalPgsIterations.
R2Real r2NormalizedPredictionDistance(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::normalizedPredictionDistance.
R2Real r2NormalizedMaxLinearVelocity(const struct R2World *world)
Return the world setting documented by R2IntegrationParameters::normalizedMaxLinearVelocity.
struct R2ByteView r2Bytes_Data(const struct R2Bytes *bytes)
Borrow snapshot bytes without copying; valid until r2FreeBytes.
R2QueryOptions queryOptions()
Return query defaults with no callback or exclusions.
Definition rapier.hpp:100
R2JointDesc joint(uint8_t locked_axes=0)
Return a joint description with the selected locked-axis mask.
Definition rapier.hpp:93
R2SoftBodyDesc soft_body()
Return native soft-body description defaults.
Definition rapier.hpp:88
#define RAPIER_CALL
C ABI calling convention.
Definition rapier.h:41
Axis-aligned bounding box.
Definition rapier.h:3029
struct R2Vector mins
Minimum corner in each coordinate.
Definition rapier.h:3033
struct R2Vector maxs
Maximum corner in each coordinate.
Definition rapier.h:3037
Features available through the loaded C library, independent of consumer defines.
Definition rapier.h:3859
R2Bool profiling
Whether native profiling timers were compiled in.
Definition rapier.h:3863
R2Bool parallel
Whether this library exposes Rapier's parallel execution and thread-pool APIs.
Definition rapier.h:3871
uint32_t simd_lanes
Solver SIMD lane count.
Definition rapier.h:3867
R2Bool enhanced_determinism
Whether the library is built with enhanced-determinism: the simulation, and the math functions such a...
Definition rapier.h:3876
Runtime ABI identity and fundamental type sizes.
Definition rapier.h:3836
uint32_t pointer_size
Pointer size in bytes.
Definition rapier.h:3852
uint32_t dimension
Spatial dimension, 2 or 3.
Definition rapier.h:3844
uint32_t abi_version
Binary ABI revision; compare with the header ABI_VERSION.
Definition rapier.h:3840
uint32_t real_size
Size of Real in bytes, 4 or 8.
Definition rapier.h:3848
Borrowed bytes.
Definition rapier.h:3722
size_t count
Number of elements, not bytes unless the element type is a byte.
Definition rapier.h:3730
const uint8_t * data
Borrowed pointer to contiguous elements; NULL is allowed when count is zero.
Definition rapier.h:3726
Copy of the automatic stepping settings.
Definition rapier.h:3243
struct R2CharacterLength max_height
Maximum height of the steps climbed automatically.
Definition rapier.h:3251
struct R2CharacterLength min_width
Minimum free width required on top of a step.
Definition rapier.h:3255
R2Bool enabled
Whether automatic stepping is enabled.
Definition rapier.h:3247
R2Bool include_dynamic_bodies
Whether the character can also step over dynamic bodies.
Definition rapier.h:3259
Collision recorded during character movement.
Definition rapier.h:3285
struct R2Vector translation_applied
World-space translation already applied before collision.
Definition rapier.h:3297
struct R2Vector translation_remaining
World-space translation remaining at collision.
Definition rapier.h:3301
struct R2ColliderHandle collider
World-bound collider handle.
Definition rapier.h:3289
struct R2Pose character_pos
World-space character pose at collision.
Definition rapier.h:3293
struct R2ShapeCastHit hit
Shape/ray impact details.
Definition rapier.h:3305
Copy of character sliding, slope, and snapping settings.
Definition rapier.h:3386
struct R2CharacterLength snap_distance
Maximum downward snapping distance.
Definition rapier.h:3406
R2Bool snap_to_ground
Whether downward ground snapping is enabled.
Definition rapier.h:3402
R2Real max_slope_climb_angle
Maximum climbable slope angle in radians.
Definition rapier.h:3394
R2Real min_slope_slide_angle
Minimum slope angle for sliding, in radians.
Definition rapier.h:3398
R2Bool slide
Whether obstacle sliding is enabled.
Definition rapier.h:3390
CharacterLength counterpart: relative=1 scales with character height, relative=0 uses world units.
Definition rapier.h:3227
R2Real value
Nonnegative length: a fraction of the character shape height when relative is 1, a world-space length...
Definition rapier.h:3232
R2Bool relative
1 scales value by the character shape size; 0 uses an absolute length.
Definition rapier.h:3236
Allowed character motion and ground-contact state.
Definition rapier.h:3266
struct R2Vector translation
Allowed world-space displacement; not applied automatically.
Definition rapier.h:3270
R2Bool grounded
Whether the character touches the ground after movement.
Definition rapier.h:3274
R2Bool is_sliding_down_slope
Whether motion includes sliding down a non-climbable slope.
Definition rapier.h:3278
Copyable collider construction data.
Definition rapier.h:2480
uint32_t activeEvents
R2_COLLISION_EVENTS and/or R2_CONTACT_FORCE_EVENTS.
Definition rapier.h:2548
uint32_t frictionCombineRule
R2_COMBINE_AVERAGE, MIN, MULTIPLY, MAX, CLAMPED_SUM, or GEOMETRIC_MEAN.
Definition rapier.h:2516
R2Bool enabled
Whether this setting/object is enabled (0 or 1).
Definition rapier.h:2528
struct R2UserData userData
Application data; Rapier does not own pointers encoded in it.
Definition rapier.h:2560
R2Real contactSkin
Nonnegative extra separation distance around the collider.
Definition rapier.h:2556
struct R2InteractionGroups collisionGroups
Groups controlling collision detection.
Definition rapier.h:2532
struct R2MassProperties massProperties
Explicit local mass and inertia when massMode selects them.
Definition rapier.h:2504
struct R2ShapeDesc shape
Non-owning shape description; build/insert consumes its views synchronously.
Definition rapier.h:2484
struct R2Pose position
Pose relative to the parent body; world-space for a collider without a parent.
Definition rapier.h:2488
R2Real density
Nonnegative mass per unit volume.
Definition rapier.h:2496
R2Real friction
Nonnegative friction coefficient.
Definition rapier.h:2508
uint32_t restitutionCombineRule
R2_COMBINE_AVERAGE, MIN, MULTIPLY, MAX, CLAMPED_SUM, or GEOMETRIC_MEAN.
Definition rapier.h:2520
uint32_t activeHooks
Hook flags enabling pair filtering/contact modification.
Definition rapier.h:2544
uint16_t activeCollisionTypes
Bitmask of body-type pairs allowed to collide.
Definition rapier.h:2540
R2Real contactForceEventThreshold
Nonnegative force threshold for force events.
Definition rapier.h:2552
R2Real mass
Mass; nonnegative when supplied as input.
Definition rapier.h:2500
R2Real restitution
Nonnegative restitution coefficient.
Definition rapier.h:2512
struct R2InteractionGroups solverGroups
Groups controlling contact-force solving.
Definition rapier.h:2536
uint32_t massMode
R2_MASS_DENSITY, R2_MASS_TOTAL, or R2_MASS_PROPERTIES.
Definition rapier.h:2492
R2Bool isSensor
1 detects intersections without generating contact forces.
Definition rapier.h:2524
Copyable non-owning handle: world pointer plus entity index and generation.
Definition rapier.h:2849
struct R2World * world
Borrowed owning world.
Definition rapier.h:2853
uint32_t generation
Slot generation used to reject stale handles.
Definition rapier.h:2861
uint32_t index
Slot index; UINT32_MAX denotes the explicit invalid handle.
Definition rapier.h:2857
Collision start/stop flags match Rapier CollisionEventFlags.
Definition rapier.h:3572
struct R2ColliderHandle collider2
Second collider in the pair.
Definition rapier.h:3580
uint32_t flags
Bitmask of R2_COLLISION_EVENT_SENSOR and R2_COLLISION_EVENT_REMOVED.
Definition rapier.h:3588
struct R2ColliderHandle collider1
First collider in the pair.
Definition rapier.h:3576
R2Bool started
1 for a starting event, 0 for a stopping event.
Definition rapier.h:3584
One compound child with a local pose and borrowed geometry description.
Definition rapier.h:2403
struct R2Pose pose
Pose relative to the compound parent.
Definition rapier.h:2407
struct R2ShapeDesc shape
Non-owning shape description; build/insert consumes its views synchronously.
Definition rapier.h:2411
Borrowed elements; count counts elements.
Definition rapier.h:2309
const struct R2CompoundShapeDesc * data
Borrowed pointer to contiguous elements; NULL is allowed when count is zero.
Definition rapier.h:2313
size_t count
Number of elements, not bytes unless the element type is a byte.
Definition rapier.h:2317
World-space line segment produced by physics debug rendering.
Definition rapier.h:3737
float color[4]
HSLA color: hue in degrees, then saturation, lightness and alpha in [0, 1].
Definition rapier.h:3749
struct R2Vector b
World-space end point.
Definition rapier.h:3745
struct R2Vector a
World-space start point.
Definition rapier.h:3741
Debug-render colors and sizes.
Definition rapier.h:4497
float volume_contact_normal_color[4]
Color of the normals of soft-body volume contacts.
Definition rapier.h:4601
float impulse_joint_anchor_color[4]
Color of the lines from a body's center of mass to its impulse-joint anchors.
Definition rapier.h:4525
float collider_fixed_color[4]
Color of colliders attached to fixed bodies.
Definition rapier.h:4513
float soft_body_element_color[4]
Color of soft-body elements.
Definition rapier.h:4569
float contact_normal_color[4]
Color of the contact normals.
Definition rapier.h:4561
float multibody_joint_anchor_color[4]
Color of the lines from a body's center of mass to its multibody-joint anchors.
Definition rapier.h:4533
R2Real rigid_body_axes_length
Nonnegative length of the rendered body axes.
Definition rapier.h:4553
float collider_aabb_color[4]
Color of the collider bounding boxes.
Definition rapier.h:4585
float sleep_color_multiplier[4]
Color multiplier for entities of sleeping bodies.
Definition rapier.h:4541
uint32_t border_subdivisions
Positive number of subdivisions approximating the borders of round shapes.
Definition rapier.h:4505
float collider_kinematic_color[4]
Color of colliders attached to kinematic bodies.
Definition rapier.h:4517
float collider_dynamic_color[4]
Color of colliders attached to dynamic bodies.
Definition rapier.h:4509
float volume_gradient_color[4]
Color of the volume gradients drawn at the particles of a volume constraint.
Definition rapier.h:4605
float soft_body_frame_color[4]
Color of the soft-body cluster frames.
Definition rapier.h:4581
float edge_pseudo_normal_color[4]
Color of the edge pseudo-normals of triangle meshes (3D only).
Definition rapier.h:4593
float collider_parentless_color[4]
Color of colliders without a parent body.
Definition rapier.h:4521
float impulse_joint_separation_color[4]
Color of the line between the two anchors of an impulse joint.
Definition rapier.h:4529
float contact_depth_color[4]
Color of the segments joining the two points of a contact.
Definition rapier.h:4557
R2Real pseudo_normal_length
Nonnegative length of the pseudo-normals.
Definition rapier.h:4597
float multibody_joint_separation_color[4]
Color of the line between the two anchors of a multibody joint.
Definition rapier.h:4537
float vertex_pseudo_normal_color[4]
Color of the vertex pseudo-normals of triangle meshes and polylines.
Definition rapier.h:4589
float soft_body_loaded_color[4]
Color of soft-body elements at their tear threshold when coloring them by load.
Definition rapier.h:4577
uint32_t subdivisions
Positive number of subdivisions approximating curved shapes.
Definition rapier.h:4501
R2Real contact_normal_length
Nonnegative length of the contact normals.
Definition rapier.h:4565
float disabled_color_multiplier[4]
Color multiplier for entities of disabled bodies.
Definition rapier.h:4549
float sleep_eligible_color_multiplier[4]
Color multiplier for entities of awake bodies eligible for sleep.
Definition rapier.h:4545
float soft_body_slack_color[4]
Color of unloaded soft-body elements when coloring them by load.
Definition rapier.h:4573
Vertex indices for one dihedral; contiguous u32 fields with no padding.
Definition rapier.h:2229
uint32_t a
First vertex index.
Definition rapier.h:2233
uint32_t b
Second vertex index.
Definition rapier.h:2237
uint32_t c
Third vertex index.
Definition rapier.h:2241
uint32_t d
Fourth vertex index.
Definition rapier.h:2245
Borrowed array of dihedral elements.
Definition rapier.h:2255
size_t count
Number of elements, not bytes unless the element type is a byte.
Definition rapier.h:2263
const struct R2Dihedral * data
Borrowed pointer to contiguous elements; NULL is allowed when count is zero.
Definition rapier.h:2259
Vertex indices for one edge; contiguous u32 fields with no padding.
Definition rapier.h:2026
uint32_t a
First vertex index.
Definition rapier.h:2030
uint32_t b
Second vertex index.
Definition rapier.h:2034
Borrowed array of edge elements.
Definition rapier.h:2044
const struct R2Edge * data
Borrowed pointer to contiguous elements; NULL is allowed when count is zero.
Definition rapier.h:2048
size_t count
Number of elements, not bytes unless the element type is a byte.
Definition rapier.h:2052
An optional thread-local error handler.
Definition rapier.h:3509
void * user_data
Application data; Rapier does not own pointers encoded in it.
Definition rapier.h:3517
R2ErrorCallback callback
Optional error callback; NULL disables notifications.
Definition rapier.h:3513
Callbacks invoked while stepping, in addition to collecting the events.
Definition rapier.h:4476
void * user_data
Application data; Rapier does not own pointers encoded in it.
Definition rapier.h:4480
R2ContactForceEventCallback contact_force_event
Optional contact-force callback.
Definition rapier.h:4488
R2CollisionEventCallback collision_event
Optional collision start/stop callback.
Definition rapier.h:4484
Copyable non-owning handle: world pointer plus entity index and generation.
Definition rapier.h:1870
struct R2World * world
Borrowed owning world.
Definition rapier.h:1874
uint32_t generation
Slot generation used to reject stale handles.
Definition rapier.h:1882
uint32_t index
Zero-based element index.
Definition rapier.h:1878
Borrowed array of index elements.
Definition rapier.h:2011
size_t count
Number of elements, not bytes unless the element type is a byte.
Definition rapier.h:2019
const uint32_t * data
Borrowed pointer to contiguous elements; NULL is allowed when count is zero.
Definition rapier.h:2015
Plain configuration data; initialize defaults, edit, then apply.
Definition rapier.h:1578
R2Real dt
Simulation step duration in seconds.
Definition rapier.h:1582
struct R2SoftBodiesSettings softBodies
Soft-body integration and recovery settings.
Definition rapier.h:1606
R2Bool contactClustering
Whether to cluster contacts for solving.
Definition rapier.h:1642
R2Real normalizedMaxCorrectiveVelocity
Maximum penetration-correction speed divided by lengthUnit.
Definition rapier.h:1614
R2Real normalizedPredictionDistance
Speculative-contact distance divided by lengthUnit.
Definition rapier.h:1618
struct R2SpringCoefficients contactSoftness
Spring coefficients for dynamic contact constraints.
Definition rapier.h:1590
R2Real normalizedContactRecycleDistance
Contact recycling distance divided by lengthUnit.
Definition rapier.h:1650
size_t numSolverIterations
Number of solver substeps/iterations; must be positive.
Definition rapier.h:1626
R2Bool frictionInBiasPass
Whether to solve friction in the bias pass.
Definition rapier.h:1654
R2Bool warmstartJoints
Whether to warmstart joint constraints.
Definition rapier.h:1658
R2Real normalizedMaxLinearVelocity
Maximum linear speed divided by lengthUnit.
Definition rapier.h:1622
R2Bool contactRecycling
Whether to reuse nearby contacts between steps.
Definition rapier.h:1646
size_t maxCcdSubsteps
Maximum CCD substeps; 0 disables all CCD for the world.
Definition rapier.h:1638
size_t numInternalPgsIterations
PGS iterations per solver substep; must be positive.
Definition rapier.h:1630
R2Real lengthUnit
Typical world-space length of one meter; scales solver tolerances, not geometry.
Definition rapier.h:1602
R2Real minCcdDt
Minimum CCD substep duration in seconds.
Definition rapier.h:1586
struct R2SpringCoefficients staticContactSoftness
Spring coefficients for contacts against fixed bodies.
Definition rapier.h:1594
R2Real normalizedAllowedLinearError
Allowed penetration divided by lengthUnit.
Definition rapier.h:1610
R2Real warmstartCoefficient
Scale applied to cached impulses when warmstarting.
Definition rapier.h:1598
size_t numInternalStabilizationIterations
Stabilization iterations after velocity solving.
Definition rapier.h:1634
Collision membership/filter masks and their pairwise combination rule.
Definition rapier.h:2461
uint32_t memberships
Groups this object belongs to, as a 32-bit mask.
Definition rapier.h:2465
uint32_t filter
Membership groups accepted by this object, as a 32-bit mask.
Definition rapier.h:2469
uint32_t test_mode
0 requires both membership/filter tests; 1 accepts either test.
Definition rapier.h:2473
Sensor intersection state for a collider pair.
Definition rapier.h:3918
struct R2ColliderHandle collider2
Second collider in the pair.
Definition rapier.h:3926
R2Bool intersecting
Whether the two sensor/collider shapes intersect.
Definition rapier.h:3930
struct R2ColliderHandle collider1
First collider in the pair.
Definition rapier.h:3922
Damped least-squares inverse-kinematics parameters.
Definition rapier.h:3539
uint8_t constrained_axes
Controlled-axis bitmask; translations precede rotations.
Definition rapier.h:3551
R2Real epsilon_linear
Linear convergence tolerance.
Definition rapier.h:3555
R2Real damping
Nonnegative motor damping.
Definition rapier.h:3543
size_t max_iters
Maximum inverse-kinematics iterations.
Definition rapier.h:3547
R2Real epsilon_angular
Angular convergence tolerance in radians.
Definition rapier.h:3559
World-bound handles of the two connected bodies.
Definition rapier.h:3524
struct R2RigidBodyHandle body1
First connected body.
Definition rapier.h:3528
struct R2RigidBodyHandle body2
Second connected body.
Definition rapier.h:3532
Copyable joint configuration.
Definition rapier.h:1813
struct R2JointLimits limits[R2_JOINT_DOF_COUNT]
Axis limits in translation-then-rotation order.
Definition rapier.h:1841
struct R2Pose localFrame2
Joint frame in body 2 local coordinates.
Definition rapier.h:1821
uint8_t motorAxes
Axis mask enabling corresponding motors entries.
Definition rapier.h:1833
uint8_t lockedAxes
Locked joint degrees of freedom; translations precede rotations.
Definition rapier.h:1825
uint8_t limitAxes
Axis mask enabling corresponding limits entries.
Definition rapier.h:1829
struct R2JointMotor motors[R2_JOINT_DOF_COUNT]
Axis motors in translation-then-rotation order.
Definition rapier.h:1845
struct R2Pose localFrame1
Joint frame in body 1 local coordinates.
Definition rapier.h:1817
R2Bool enabled
Whether this setting/object is enabled (0 or 1).
Definition rapier.h:1857
R2Bool contactsEnabled
Whether connected bodies may collide.
Definition rapier.h:1853
uint8_t coupledAxes
Axis mask sharing a coupled constraint.
Definition rapier.h:1837
struct R2UserData userData
Application data; Rapier does not own pointers encoded in it.
Definition rapier.h:1861
struct R2SpringCoefficients softness
Spring coefficients for constraint correction.
Definition rapier.h:1849
Impulses applied by an impulse joint during the last step, along the axes of its joint frame.
Definition rapier.h:4283
struct R2Vector linear
Impulse applied along the locked translational axes.
Definition rapier.h:4287
R2Real limits[R2_JOINT_DOF_COUNT]
Impulse applied by the limit of each axis, in translation-then-rotation order.
Definition rapier.h:4295
R2AngVector angular
Angular impulse applied along the locked rotational axes (a scalar in 2D).
Definition rapier.h:4291
R2Real motors[R2_JOINT_DOF_COUNT]
Impulse applied by the motor of each axis, in translation-then-rotation order.
Definition rapier.h:4299
Lower and upper axis limits in length units or radians.
Definition rapier.h:1751
R2Real max
Maximum allowed axis displacement (length or radians).
Definition rapier.h:1759
R2Real min
Minimum allowed axis displacement (length or radians).
Definition rapier.h:1755
Position/velocity motor settings for one joint axis.
Definition rapier.h:1766
R2Real maxForce
Nonnegative maximum force or torque.
Definition rapier.h:1786
R2Real damping
Nonnegative motor damping.
Definition rapier.h:1782
R2Real targetVel
Motor target velocity (length per second or radians per second).
Definition rapier.h:1770
uint32_t model
Motor model: 0 acceleration-based, 1 force-based.
Definition rapier.h:1790
R2Real targetPos
Motor target position (length or radians).
Definition rapier.h:1774
R2Real stiffness
Nonnegative motor spring stiffness.
Definition rapier.h:1778
Explicit mass and principal inertia, matching MassProperties constructors.
Definition rapier.h:2436
R2AngVector principal_inertia
Principal angular inertia; scalar in 2D, three diagonal entries in 3D.
Definition rapier.h:2448
R2Real mass
Mass; nonnegative when supplied as input.
Definition rapier.h:2444
struct R2Vector local_com
Center of mass in local coordinates.
Definition rapier.h:2440
Copyable non-owning handle: world pointer plus entity index and generation.
Definition rapier.h:1912
struct R2World * world
Borrowed owning world.
Definition rapier.h:1916
uint32_t generation
Slot generation used to reject stale handles.
Definition rapier.h:1924
uint32_t index
Zero-based element index.
Definition rapier.h:1920
Rigid motion with constant linear and angular velocities.
Definition rapier.h:4337
struct R2Vector linvel
World-space linear velocity.
Definition rapier.h:4349
R2AngVector angvel
World-space angular velocity, in radians per second.
Definition rapier.h:4353
struct R2Vector local_center
Rotation center, in the local coordinates of the moving shape.
Definition rapier.h:4345
struct R2Pose start
World-space pose at time zero.
Definition rapier.h:4341
Optional boolean override.
Definition rapier.h:2287
R2Bool enabled
Whether this setting/object is enabled (0 or 1).
Definition rapier.h:2291
R2Bool value
Value used when enabled is 1.
Definition rapier.h:2295
Optional intersection pair; check found before reading the pair.
Definition rapier.h:4375
R2Bool found
Whether a result exists; other result fields are meaningful only when this is 1.
Definition rapier.h:4383
struct R2IntersectionPair pair
Intersection pair state.
Definition rapier.h:4379
Optional particle remapping; check found before reading the destination.
Definition rapier.h:3817
uint32_t index
Zero-based element index.
Definition rapier.h:3825
struct R2SoftBodyHandle body
World-bound rigid/soft-body handle, as selected by the field type.
Definition rapier.h:3821
R2Bool found
Whether a result exists; other result fields are meaningful only when this is 1.
Definition rapier.h:3829
Optional point projection.
Definition rapier.h:4321
R2Bool found
Whether a result exists; other result fields are meaningful only when this is 1.
Definition rapier.h:4329
struct R2PointProjection projection
Closest projection details.
Definition rapier.h:4325
Optional full ray result.
Definition rapier.h:3063
R2Bool found
Whether a result exists; other result fields are meaningful only when this is 1.
Definition rapier.h:3071
struct R2RayHit hit
Shape/ray impact details.
Definition rapier.h:3067
Optional scalar override; enabled = 0 selects no override.
Definition rapier.h:1291
R2Real value
Value used when enabled is 1.
Definition rapier.h:1299
R2Bool enabled
Whether this setting/object is enabled (0 or 1).
Definition rapier.h:1295
Optional shape-cast result.
Definition rapier.h:4306
R2Bool found
Whether a result exists; other result fields are meaningful only when this is 1.
Definition rapier.h:4314
struct R2ShapeCastHit hit
Shape-cast impact details.
Definition rapier.h:4310
Optional unsigned integer override; enabled = 0 selects no override.
Definition rapier.h:1306
uint32_t value
Value used when enabled is 1.
Definition rapier.h:1314
R2Bool enabled
Whether this setting/object is enabled (0 or 1).
Definition rapier.h:1310
Particle remapping after tearing.
Definition rapier.h:3756
struct R2SoftBodyHandle body
World-bound rigid/soft-body handle, as selected by the field type.
Definition rapier.h:3760
uint32_t index
Zero-based element index.
Definition rapier.h:3764
Stateless proportional-derivative controller: a PID controller without integral term,...
Definition rapier.h:3344
uint32_t axes
Controlled axes, a combination of R2_AXES_MASK_* bits.
Definition rapier.h:3364
struct R2Vector lin_kp
Linear proportional gain per axis.
Definition rapier.h:3348
struct R2Vector lin_kd
Linear derivative gain per axis.
Definition rapier.h:3352
R2AngVector ang_kp
Angular proportional gain per axis.
Definition rapier.h:3356
R2AngVector ang_kd
Angular derivative gain per axis.
Definition rapier.h:3360
Callbacks must not unwind or retain arguments.
Definition rapier.h:3695
R2PairFilter filter_intersection_pair
Optional sensor-pair filter, called only for colliders enabling the hook.
Definition rapier.h:3707
void * user_data
Application data; Rapier does not own pointers encoded in it.
Definition rapier.h:3699
R2ModifyContacts modify_solver_contacts
Optional legacy aggregate contact-edit callback.
Definition rapier.h:3711
R2ModifyContactContext modify_solver_contacts_context
Runs after the legacy property callback.
Definition rapier.h:3715
R2PairFilter filter_contact_pair
Optional contact-pair filter, called only for colliders enabling the hook.
Definition rapier.h:3703
Per-axis proportional, integral, and derivative controller gains.
Definition rapier.h:3312
R2AngVector ang_ki
Angular integral gain per axis.
Definition rapier.h:3332
struct R2Vector lin_kp
Linear proportional gain per axis.
Definition rapier.h:3316
R2AngVector ang_kp
Angular proportional gain per axis.
Definition rapier.h:3328
R2AngVector ang_kd
Angular derivative gain per axis.
Definition rapier.h:3336
struct R2Vector lin_kd
Linear derivative gain per axis.
Definition rapier.h:3324
struct R2Vector lin_ki
Linear integral gain per axis.
Definition rapier.h:3320
Sizes of the POD types in this library build, for foreign-language layout checks.
Definition rapier.h:3175
size_t mjcfLoaderOptions
Zero unless 3D f32 robotics is enabled.
Definition rapier.h:3219
size_t queryOptions
Size in bytes of the queryOptions structure; zero when unavailable.
Definition rapier.h:3211
size_t softBodyDesc
Size in bytes of the softBodyDesc structure; zero when unavailable.
Definition rapier.h:3203
size_t urdfLoaderOptions
Zero unless 3D f32 robotics is enabled.
Definition rapier.h:3215
size_t integrationParameters
Size in bytes of the integrationParameters structure; zero when unavailable.
Definition rapier.h:3199
size_t colliderDesc
Size in bytes of the colliderDesc structure; zero when unavailable.
Definition rapier.h:3183
size_t jointDesc
Size in bytes of the jointDesc structure; zero when unavailable.
Definition rapier.h:3191
size_t softMeshBindingDesc
Size in bytes of the softMeshBindingDesc structure; zero when unavailable.
Definition rapier.h:3207
size_t shapeDesc
Size in bytes of the shapeDesc structure; zero when unavailable.
Definition rapier.h:3187
size_t softBodyMaterial
Size in bytes of the softBodyMaterial structure; zero when unavailable.
Definition rapier.h:3195
size_t rigidBodyDesc
Size in bytes of the rigidBodyDesc structure; zero when unavailable.
Definition rapier.h:3179
Closest projected world-space point and its collider.
Definition rapier.h:2951
struct R2ColliderHandle collider
World-bound collider handle.
Definition rapier.h:2955
struct R2Vector point
Projected world-space point.
Definition rapier.h:2959
R2Bool is_inside
Whether the original point was inside the collider.
Definition rapier.h:2963
Rigid transform combining translation and rotation.
Definition rapier.h:1736
struct R2Vector translation
Translation vector.
Definition rapier.h:1740
struct R2Rotation rotation
Rotation value.
Definition rapier.h:1744
Scene-query flags, groups, and excluded handles.
Definition rapier.h:2868
uint32_t flags
R2_QUERY_EXCLUDE_* bitmask selecting body types and sensors/solids.
Definition rapier.h:2872
R2Bool use_groups
Whether to apply the groups filter.
Definition rapier.h:2876
struct R2RigidBodyHandle exclude_rigid_body
Body whose colliders are excluded; use the explicit invalid handle for none.
Definition rapier.h:2888
struct R2ColliderHandle exclude_collider
Collider to exclude; use the explicit invalid handle to exclude none.
Definition rapier.h:2884
struct R2InteractionGroups groups
Groups to test when use_groups is 1.
Definition rapier.h:2880
Copyable query settings.
Definition rapier.h:2904
void * userData
Application data; Rapier does not own pointers encoded in it.
Definition rapier.h:2916
struct R2QueryFilter filter
Query selection settings.
Definition rapier.h:2908
R2QueryPredicate predicate
Optional additional query filter; nonzero accepts a collider.
Definition rapier.h:2912
Closest ray intersection, with a world-space normal.
Definition rapier.h:2923
R2Real time_of_impact
Ray/sweep parameter at first impact, bounded by the query options.
Definition rapier.h:2931
struct R2ColliderHandle collider
World-bound collider handle.
Definition rapier.h:2927
uint32_t feature_id
Index within the feature kind; zero for unknown.
Definition rapier.h:2944
uint32_t feature_type
Shape feature kind: R2_FEATURE_UNKNOWN, R2_FEATURE_VERTEX, R2_FEATURE_EDGE, or R2_FEATURE_FACE.
Definition rapier.h:2940
struct R2Vector normal
World-space contact or surface normal.
Definition rapier.h:2935
Optional ray collider/time result.
Definition rapier.h:3044
R2Bool found
Whether a result exists; other result fields are meaningful only when this is 1.
Definition rapier.h:3056
struct R2ColliderHandle collider
World-bound collider handle.
Definition rapier.h:3048
R2Real toi
Ray parameter t at impact: origin + direction * t.
Definition rapier.h:3052
Borrowed array of real elements.
Definition rapier.h:1993
size_t count
Number of elements, not bytes unless the element type is a byte.
Definition rapier.h:2001
const R2Real * data
Borrowed pointer to contiguous elements; NULL is allowed when count is zero.
Definition rapier.h:1997
Stack-allocated rigid-body construction data.
Definition rapier.h:3080
R2Bool gyroscopicForcesEnabled
Whether to include gyroscopic forces (3D).
Definition rapier.h:3164
uint32_t bodyType
R2_DYNAMIC, R2_FIXED, R2_KINEMATIC_POSITION_BASED, or R2_KINEMATIC_VELOCITY_BASED.
Definition rapier.h:3096
R2Bool canSleep
Whether automatic sleeping is allowed.
Definition rapier.h:3128
struct R2UserData userData
Application data; Rapier does not own pointers encoded in it.
Definition rapier.h:3168
R2Real additionalMass
Nonnegative mass added to attached collider contributions.
Definition rapier.h:3112
size_t additionalSolverIterations
Extra solver iterations for this body and connected bodies.
Definition rapier.h:3156
R2Real softCcdPrediction
Nonnegative prediction distance for soft CCD.
Definition rapier.h:3140
R2Bool enabled
Whether this setting/object is enabled (0 or 1).
Definition rapier.h:3148
size_t additionalPgsIterations
Extra PGS iterations for this body.
Definition rapier.h:3160
struct R2Pose position
World-space pose.
Definition rapier.h:3084
int8_t dominanceGroup
Signed dominance group; larger groups dominate smaller groups.
Definition rapier.h:3152
R2AngVector angvel
World-space angular velocity in radians per second.
Definition rapier.h:3092
struct R2Vector linvel
World-space linear velocity.
Definition rapier.h:3088
struct R2MassProperties additionalMassProperties
Additional body-local mass and inertia when enabled.
Definition rapier.h:3120
R2Bool ccdEnabled
Whether continuous collision detection is enabled.
Definition rapier.h:3136
R2Real angularDamping
Nonnegative angular damping coefficient.
Definition rapier.h:3108
R2Real linearDamping
Nonnegative linear damping coefficient.
Definition rapier.h:3104
uint8_t lockedAxes
Locked-axis bitmask; translations precede rotations.
Definition rapier.h:3124
R2Real gravityScale
Multiplier applied to world gravity.
Definition rapier.h:3100
R2Bool allowFastRotation
Whether to allow fast rotations without the native angular-motion clamp.
Definition rapier.h:3144
R2Bool useAdditionalMassProperties
1 uses additionalMassProperties; 0 uses additionalMass.
Definition rapier.h:3116
R2Bool sleeping
Whether the body starts/is asleep.
Definition rapier.h:3132
Copyable non-owning handle: world pointer plus entity index and generation.
Definition rapier.h:1891
uint32_t generation
Slot generation used to reject stale handles.
Definition rapier.h:1903
struct R2World * world
Borrowed owning world.
Definition rapier.h:1895
uint32_t index
Slot index; UINT32_MAX denotes the explicit invalid handle.
Definition rapier.h:1899
A copied state snapshot, with no pointers or ownership obligations.
Definition rapier.h:4150
struct R2Vector linvel
World-space linear velocity.
Definition rapier.h:4158
R2Bool sleeping
Whether the body starts/is asleep.
Definition rapier.h:4166
struct R2UserData userData
Application data; Rapier does not own pointers encoded in it.
Definition rapier.h:4174
struct R2Pose position
World-space pose.
Definition rapier.h:4154
R2Bool enabled
Whether this setting/object is enabled (0 or 1).
Definition rapier.h:4170
R2AngVector angvel
World-space angular velocity in radians per second.
Definition rapier.h:4162
2D: angle in radians.
Definition rapier.h:1698
R2Real angle
Rotation angle in radians.
Definition rapier.h:1703
Shape-cast impact geometry; collider-side data is world-space, moving-shape data is local.
Definition rapier.h:2970
R2Real time_of_impact
Ray/sweep parameter at first impact, bounded by the query options.
Definition rapier.h:2978
uint32_t status
Native result: 0 out of iterations, 1 converged, 2 failed, 3 penetrating or within target distance.
Definition rapier.h:2999
struct R2Vector normal1
Impact normal on the collider, in world coordinates.
Definition rapier.h:2990
struct R2ColliderHandle collider
World-bound collider handle.
Definition rapier.h:2974
struct R2Vector normal2
Impact normal on the moving shape, in its local coordinates.
Definition rapier.h:2994
struct R2Vector witness2
Impact witness on the moving shape, in its local coordinates.
Definition rapier.h:2986
struct R2Vector witness1
Impact witness on the collider, in world coordinates.
Definition rapier.h:2982
Sweep termination settings.
Definition rapier.h:3006
R2Bool stop_at_penetration
Whether to stop at t = 0 for an initial overlap.
Definition rapier.h:3018
R2Real target_distance
Nonnegative separation at which a shape cast counts as a hit.
Definition rapier.h:3014
R2Bool compute_impact_geometry_on_penetration
Whether to compute witness points/normals for an initial overlap.
Definition rapier.h:3022
R2Real max_time_of_impact
Maximum sweep parameter; movement is velocity multiplied by this time.
Definition rapier.h:3010
Non-owning shape description.
Definition rapier.h:2328
size_t rows
Number of heightfield rows.
Definition rapier.h:2380
struct R2Vector a
Half extents, endpoint/vertex, or halfspace normal, selected by kind.
Definition rapier.h:2336
uint32_t kind
Discriminant selecting which description fields are read.
Definition rapier.h:2332
R2Real halfHeight
Half the height of a cylinder or cone.
Definition rapier.h:2352
struct R2CompoundShapeView children
Borrowed compound children and their nested geometry views.
Definition rapier.h:2396
struct R2RealView heights
Borrowed height samples; 3D uses column-major rows * columns samples.
Definition rapier.h:2376
size_t columns
Number of heightfield columns.
Definition rapier.h:2384
R2Real borderRadius
Rounding radius of a round cylinder or round cone (the round cuboid reads radius instead).
Definition rapier.h:2356
struct R2EdgeView edges
Borrowed edge topology; count is edges.
Definition rapier.h:2368
R2Real radius
Radius for the selected primitive or recipe.
Definition rapier.h:2348
const R2SharedShape * sharedShape
Borrowed shared geometry; keep its wrapper alive through build/insert.
Definition rapier.h:2392
struct R2Vector scale
Shape scale along each axis.
Definition rapier.h:2388
struct R2VectorView vertices
Borrowed vertex positions.
Definition rapier.h:2360
struct R2Vector b
Second endpoint or triangle vertex, selected by kind.
Definition rapier.h:2340
uint32_t flags
TRIMESH_*, POLYLINE_*, or HEIGHTFIELD_* bitmask selected by kind.
Definition rapier.h:2372
struct R2TriangleView triangles
Borrowed triangle topology; count is triangles.
Definition rapier.h:2364
struct R2Vector c
Third triangle vertex.
Definition rapier.h:2344
Plain configuration data; initialize defaults, edit, then apply.
Definition rapier.h:1549
R2Real resweepStrain
Strain threshold for re-solving soft constraints after contacts within a substep.
Definition rapier.h:1557
struct R2SoftFemParameters fem
FEM linear-solver settings, present only when RAPIER_FEM is enabled.
Definition rapier.h:1570
size_t maxExtraSubsteps
Maximum additional substeps requested by soft-body motion.
Definition rapier.h:1561
R2Real contactStiffening
Multiplier on contact natural frequency for soft-body contacts.
Definition rapier.h:1565
struct R2SoftRecoverySettings recovery
Soft-body crossing detection and recovery settings.
Definition rapier.h:1553
Copyable recipe, not an owned procedural builder.
Definition rapier.h:2573
struct R2EdgeView addedEdges
Borrowed structural edges added after appending (seams); indices count this body's particles then the...
Definition rapier.h:2715
R2SurfaceElementView skinIndices
Borrowed skin topology.
Definition rapier.h:2703
struct R2SoftBodyDescView appended
Borrowed descriptions merged into this body, their particles numbered after this one's in order.
Definition rapier.h:2710
uint32_t kind
Discriminant selecting which description fields are read.
Definition rapier.h:2577
R2Bool volumePreservation
Whether to preserve volume.
Definition rapier.h:2739
R2Real radius
Radius for the selected primitive or recipe.
Definition rapier.h:2627
R2Bool canSleep
Whether automatic sleeping is allowed.
Definition rapier.h:2788
R2Real particleMass
Default nonnegative particle mass.
Definition rapier.h:2731
struct R2EdgeView edges
Borrowed edge topology; count is edges.
Definition rapier.h:2659
struct R2OptionalReal totalMass
Optional total mass override for generated particles.
Definition rapier.h:2639
struct R2Vector translation
Translation vector.
Definition rapier.h:2635
int8_t dominanceGroup
Signed dominance group; larger groups dominate smaller groups.
Definition rapier.h:2792
R2Real volumeFactor
Target volume multiplier.
Definition rapier.h:2743
struct R2UserData userData
Application data; Rapier does not own pointers encoded in it.
Definition rapier.h:2796
struct R2IndexView tensionOnlyEdges
Borrowed indices of edges that resist tension only.
Definition rapier.h:2667
R2Real radiusEnd
Radius at the second end of a tapered cloth tube.
Definition rapier.h:2631
struct R2OptionalBool oriented
Optional override of the ORIENTED flag of the generated collision surface (when disabled,...
Definition rapier.h:2752
struct R2EdgeView bendEdges
Borrowed bending edge constraints.
Definition rapier.h:2663
struct R2Vector b
Recipe half extents, second rope endpoint, or tube axis; use a recipe constructor.
Definition rapier.h:2585
R2CellView cells
Borrowed triangles in 2D or tetrahedra in 3D.
Definition rapier.h:2679
R2Real gravityScale
Multiplier applied to world gravity.
Definition rapier.h:2776
struct R2IndexView pinned
Borrowed indices of pinned particles.
Definition rapier.h:2655
R2Bool skinCollision
Whether skin elements participate in collision detection.
Definition rapier.h:2760
struct R2OptionalBool shapeMatching
Optional shape-matching override; disabled retains recipe defaults.
Definition rapier.h:2747
struct R2VolumeMeshParameters meshing
Volume-meshing parameters for a volumetric recipe.
Definition rapier.h:2643
size_t nz
Third recipe resolution; interpretation depends on kind.
Definition rapier.h:2623
size_t additionalSolverIterations
Extra solver iterations for this body and connected bodies.
Definition rapier.h:2780
struct R2SoftEdgeSoftnessView edgeSoftness
Borrowed per-edge softness overrides.
Definition rapier.h:2671
struct R2SoftEdgeTearView edgeTearResistance
Borrowed per-edge tear-resistance overrides.
Definition rapier.h:2675
R2Real linearDamping
Nonnegative linear damping coefficient.
Definition rapier.h:2772
struct R2SoftBodyMaterial material
Soft-body material coefficients.
Definition rapier.h:2719
struct R2RealView masses
Borrowed per-particle masses; when empty, particleMass is used.
Definition rapier.h:2651
R2Bool selfContacts
Whether self-collision is enabled.
Definition rapier.h:2756
struct R2VectorView skinVertices
Borrowed skin vertex positions.
Definition rapier.h:2699
struct R2Vector du
Cloth basis step along its first parameter axis.
Definition rapier.h:2589
struct R2VectorView positions
Borrowed initial particle positions.
Definition rapier.h:2647
size_t nx
First recipe resolution; interpretation depends on kind.
Definition rapier.h:2615
struct R2OptionalReal particleRadius
Disabled by default: retain the radius computed by the generator.
Definition rapier.h:2735
R2SurfaceElementView surface
Borrowed boundary edges in 2D or triangles in 3D.
Definition rapier.h:2683
struct R2Vector dv
Cloth basis step along its second parameter axis.
Definition rapier.h:2593
struct R2ColliderDesc collider
Collider configuration used by the recipe; shape comes from the generated geometry.
Definition rapier.h:2768
uint32_t cellModel
R2_SOFT_CELL_VOLUME, R2_SOFT_CELL_COROTATIONAL, or R2_SOFT_CELL_NEO_HOOKEAN.
Definition rapier.h:2723
struct R2Vector a
Recipe origin/center or first rope endpoint; use a recipe constructor.
Definition rapier.h:2581
size_t additionalPgsIterations
Extra PGS iterations for this body.
Definition rapier.h:2784
R2Bool collisionEnabled
Whether the generated collision geometry is enabled.
Definition rapier.h:2764
uint32_t solver
0 = constraints, 1 = FEM (requires a library built with FEM).
Definition rapier.h:2727
size_t ny
Second recipe resolution; interpretation depends on kind.
Definition rapier.h:2619
Borrowed array of soft-body descriptions.
Definition rapier.h:2272
const struct R2SoftBodyDesc * data
Borrowed pointer to contiguous elements; NULL is allowed when count is zero.
Definition rapier.h:2276
size_t count
Number of elements, not bytes unless the element type is a byte.
Definition rapier.h:2280
Copyable non-owning handle: world pointer plus entity index and generation.
Definition rapier.h:2805
uint32_t index
Zero-based element index.
Definition rapier.h:2813
struct R2World * world
Borrowed owning world.
Definition rapier.h:2809
uint32_t generation
Slot generation used to reject stale handles.
Definition rapier.h:2817
Plain configuration data; initialize defaults, edit, then apply.
Definition rapier.h:1321
struct R2SpringCoefficients volumeSoftness
Spring coefficients for cell and global volume constraints.
Definition rapier.h:1333
uint32_t edgePlasticFlow
Plastic flow direction: R2_SOFT_EDGE_PLASTIC_FLOW_BOTH, _COMPRESSION or _TENSION.
Definition rapier.h:1381
R2Real youngModulus
Elastic modulus: force per area in 3D, force per length in 2D; nonnegative.
Definition rapier.h:1341
struct R2OptionalReal tearStrain
Optional strain threshold for tearing; disabled means no strain-based tearing.
Definition rapier.h:1385
R2Real plasticYield
Cell strain threshold for plastic flow; zero disables plasticity.
Definition rapier.h:1353
R2Real plasticCreep
Nonnegative rate per second at which excess cell strain becomes permanent.
Definition rapier.h:1357
R2Real plasticMax
Maximum accumulated cell plastic stretch, measured by the norm of P - I.
Definition rapier.h:1361
R2Real edgePlasticYield
Edge strain threshold for plastic flow; zero disables plasticity.
Definition rapier.h:1369
struct R2OptionalU32 minPiece
Optional minimum particle count of tear pieces.
Definition rapier.h:1405
struct R2OptionalReal tearForce
Optional tensile edge-force threshold for tearing.
Definition rapier.h:1389
uint32_t maxTearsPerStep
Maximum ordinary edge tears per step; edges above twice their threshold bypass the limit.
Definition rapier.h:1401
struct R2SpringCoefficients bendSoftness
Spring coefficients for bending edges and dihedrals.
Definition rapier.h:1329
struct R2SpringCoefficients edgeSoftness
Spring coefficients for structural edge constraints.
Definition rapier.h:1325
R2Real edgePlasticCreep
Nonnegative rate per second at which excess edge strain becomes permanent.
Definition rapier.h:1373
R2Real deformationDamping
Rate per second pulling particle velocities toward best-fit rigid motion; zero disables it.
Definition rapier.h:1365
R2Real poissonRatio
Poisson ratio for elastic cells, in [0, 0.5).
Definition rapier.h:1345
R2Real tearSmoothing
Exponential load-smoothing time constant in seconds; zero disables smoothing.
Definition rapier.h:1393
R2Real interiorStrength
Tear-threshold multiplier for undamaged interior elements.
Definition rapier.h:1397
struct R2SpringCoefficients shapeMatchingSoftness
Spring coefficients for shape-matching constraints.
Definition rapier.h:1337
R2Real elasticDampingRatio
Nonnegative damping ratio of elastic cells.
Definition rapier.h:1349
R2Real edgePlasticMax
Maximum permanent edge-length change as a fraction of its initial length.
Definition rapier.h:1377
Cluster and proxy remapping after a soft-body split.
Definition rapier.h:3771
struct R2SoftBodyHandle soft_body
Resulting soft-body handle.
Definition rapier.h:3779
uint32_t source_cluster
Original cluster index before splitting.
Definition rapier.h:3775
R2Bool keeps_proxy
Whether this split retains the original proxy.
Definition rapier.h:3791
uint32_t cluster
Cluster index within its soft body.
Definition rapier.h:3783
struct R2RigidBodyHandle proxy
Cluster rigid-proxy body handle.
Definition rapier.h:3787
Spring-coefficient override for one soft-body edge.
Definition rapier.h:2059
struct R2SpringCoefficients softness
Spring coefficients for constraint correction.
Definition rapier.h:2067
uint32_t edge
Zero-based edge index.
Definition rapier.h:2063
Borrowed elements; count counts elements.
Definition rapier.h:2074
const struct R2SoftEdgeSoftness * data
Borrowed pointer to contiguous elements; NULL is allowed when count is zero.
Definition rapier.h:2078
size_t count
Number of elements, not bytes unless the element type is a byte.
Definition rapier.h:2082
Tear-resistance override for one soft-body edge.
Definition rapier.h:2089
uint32_t edge
Zero-based edge index.
Definition rapier.h:2093
R2Real resistance
Nonnegative edge tear-resistance multiplier.
Definition rapier.h:2097
Borrowed elements; count counts elements.
Definition rapier.h:2104
size_t count
Number of elements, not bytes unless the element type is a byte.
Definition rapier.h:2112
const struct R2SoftEdgeTear * data
Borrowed pointer to contiguous elements; NULL is allowed when count is zero.
Definition rapier.h:2108
Plain configuration data; initialize defaults, edit, then apply.
Definition rapier.h:1529
size_t maxDenseDofs
Maximum degrees of freedom solved by the dense FEM solver.
Definition rapier.h:1541
size_t maxLinearIterations
Maximum FEM linear-solver iterations.
Definition rapier.h:1537
R2Real linearTolerance
FEM iterative linear-solver tolerance.
Definition rapier.h:1533
Impulse-joint movement between rigid proxies after tearing.
Definition rapier.h:3798
struct R2RigidBodyHandle to
Destination rigid-proxy body.
Definition rapier.h:3810
struct R2ImpulseJointHandle joint
Impulse joint that moved between proxies.
Definition rapier.h:3802
struct R2RigidBodyHandle from
Original rigid-proxy body.
Definition rapier.h:3806
Non-owning deformable binding description.
Definition rapier.h:2824
R2Bool selfContacts
Whether self-collision is enabled.
Definition rapier.h:2840
uint32_t kind
Discriminant selecting which description fields are read.
Definition rapier.h:2828
struct R2IndexView particles
Borrowed particle indices used for a direct mesh binding.
Definition rapier.h:2832
R2Real epsilon
Nonnegative positional tolerance for direct-by-position binding.
Definition rapier.h:2836
Stable identity of a live mesh within one soft body; matches Rapier's SoftMeshId.
Definition rapier.h:4181
uint32_t cluster
Cluster index within its soft body.
Definition rapier.h:4185
uint32_t mesh
Mesh index within the cluster.
Definition rapier.h:4189
Mesh identity and rendering metadata.
Definition rapier.h:4196
R2Bool collision_enabled
Whether collision detection is enabled for this mesh.
Definition rapier.h:4216
R2Bool is_skinned
Whether vertex positions are obtained by skinning.
Definition rapier.h:4212
struct R2SoftMeshId id
Cluster/mesh pair identifying this collision mesh.
Definition rapier.h:4200
struct R2ColliderHandle collider
World-bound collider handle.
Definition rapier.h:4204
size_t arity
Indices per mesh element: 2 for an edge or 3 for a triangle.
Definition rapier.h:4208
Plain configuration data; initialize defaults, edit, then apply.
Definition rapier.h:1412
R2Bool overlapRigid
Enable intersection-volume constraints against rigid colliders.
Definition rapier.h:1472
R2Bool detectionMotionGating
Skip self-crossing detection when accumulated motion cannot have created a crossing.
Definition rapier.h:1432
R2Bool overlapSelfRegions
Enable recovery of self-intersection regions.
Definition rapier.h:1501
R2Bool edgeSpeculation
Enable speculative edge-edge collision constraints.
Definition rapier.h:1420
R2Bool crossingRepulsion
Repel crossing features toward their neighborhood's side of the surface.
Definition rapier.h:1452
R2Bool crossingRepulsionGuide
Guide cross-body repulsion by overlap-volume normals; closed meshes only.
Definition rapier.h:1456
uint32_t overlapPatchConstraints
Per-point constraints inside overlap patches: R2_SOFT_PATCH_CONSTRAINTS_KEEP, _STAND_DOWN or _ALONG_N...
Definition rapier.h:1489
R2Real overlapKeptDepth
Overlap depth retained by recovery, as a fraction of the pair's contact skins.
Definition rapier.h:1497
R2Real overlapConstraintPace
Velocity-change limit per step, as a multiple of recoveryPace.
Definition rapier.h:1484
uint32_t overlapSplit
Cells per tangent axis of the multi-volume grid.
Definition rapier.h:1513
R2Bool overlapSkinVolume
Measure overlap on contact-skin surfaces rather than bare geometry.
Definition rapier.h:1493
R2Bool overlapConstraints
Enable intersection-volume constraints for overlapping closed surfaces.
Definition rapier.h:1468
R2Bool overlapSkipSelfTangled
Skip pair overlap constraints for self-crossed meshes.
Definition rapier.h:1476
R2Bool invertedCellDetection
Detect inverted cells to support self-contact recovery.
Definition rapier.h:1424
R2Bool overlapNormalPush
Use the overlap normal for recovery pushes.
Definition rapier.h:1505
R2Real recoveryPace
Maximum recovery rate in length units per second, scaled by lengthUnit.
Definition rapier.h:1464
R2Bool overlapMultiVolume
Use spatially split overlap-volume constraints.
Definition rapier.h:1509
R2Bool selfStandDown
Disable contacts on tangled features so elasticity can untangle them.
Definition rapier.h:1440
R2Bool crossBodyExpelGate
Allow contacts at cross-body crossings to expel, but not hold, the intruder.
Definition rapier.h:1444
R2Bool crossBodyDetection
Detect boundary crossings between soft bodies.
Definition rapier.h:1436
R2Bool crossingRepulsionSelfGuide
Guide self-crossing repulsion by self-intersection-volume normals; closed meshes only.
Definition rapier.h:1460
R2Bool authoredVelocityMargin
Expand speculative contact margins to cover particle velocities set between steps.
Definition rapier.h:1416
R2Bool edgeStandDown
Disable edge constraints touching cross-body crossings.
Definition rapier.h:1448
R2Bool selfCrossingDetection
Detect surface self-crossings each step.
Definition rapier.h:1428
R2Bool overlapEdgeStandDown
Disable 3D closed-surface edge constraints where overlap constraints take over.
Definition rapier.h:1480
R2Real overlapProgressMargin
Relative overlap-volume decrease that counts as recovery progress.
Definition rapier.h:1521
uint32_t overlapPatience
Recovery progress patience in steps.
Definition rapier.h:1517
Spring softness expressed as natural frequency and damping ratio.
Definition rapier.h:1270
R2Real natural_frequency
Nonnegative spring natural frequency in Hz.
Definition rapier.h:1274
R2Real damping_ratio
Nonnegative damping ratio; 1 is critical damping.
Definition rapier.h:1278
Vertex indices for one tetrahedron; contiguous u32 fields with no padding.
Definition rapier.h:2156
uint32_t a
First vertex index.
Definition rapier.h:2160
uint32_t d
Fourth vertex index.
Definition rapier.h:2172
uint32_t b
Second vertex index.
Definition rapier.h:2164
uint32_t c
Third vertex index.
Definition rapier.h:2168
Borrowed array of tetrahedron elements.
Definition rapier.h:2182
size_t count
Number of elements, not bytes unless the element type is a byte.
Definition rapier.h:2190
const struct R2Tetrahedron * data
Borrowed pointer to contiguous elements; NULL is allowed when count is zero.
Definition rapier.h:2186
Vertex indices for one triangle; contiguous u32 fields with no padding.
Definition rapier.h:2119
uint32_t b
Second vertex index.
Definition rapier.h:2127
uint32_t a
First vertex index.
Definition rapier.h:2123
uint32_t c
Third vertex index.
Definition rapier.h:2131
Borrowed array of triangle elements.
Definition rapier.h:2141
size_t count
Number of elements, not bytes unless the element type is a byte.
Definition rapier.h:2149
const struct R2Triangle * data
Borrowed pointer to contiguous elements; NULL is allowed when count is zero.
Definition rapier.h:2145
Application-defined 128-bit value.
Definition rapier.h:1797
uint64_t low
Low 64 bits of the application value.
Definition rapier.h:1801
uint64_t high
High 64 bits of the application value.
Definition rapier.h:1805
Cartesian vector with two or three components.
Definition rapier.h:1677
R2Real y
Y component.
Definition rapier.h:1685
R2Real x
X component.
Definition rapier.h:1681
Borrowed array of vector elements.
Definition rapier.h:1975
const struct R2Vector * data
Borrowed pointer to contiguous elements; NULL is allowed when count is zero.
Definition rapier.h:1979
size_t count
Number of elements, not bytes unless the element type is a byte.
Definition rapier.h:1983
Linear and angular velocity correction computed by a controller.
Definition rapier.h:3371
struct R2Vector linear
World-space linear velocity correction.
Definition rapier.h:3375
R2AngVector angularVelocity
World-space angular velocity correction, in radians per second.
Definition rapier.h:3379
Parameters for the native volumetric mesher.
Definition rapier.h:1931
R2Real cell_size
Positive target cell size for volume meshing.
Definition rapier.h:1935
R2Real min_angle
Minimum target element angle in radians; above pi/6, refinement may stop early.
Definition rapier.h:1940
Integer coordinates of a voxel cell.
Definition rapier.h:4239
R2VoxelCoord y
Y component.
Definition rapier.h:4247
R2VoxelCoord x
X component.
Definition rapier.h:4243
Optional voxel lookup result; check found before reading voxel data.
Definition rapier.h:4260
struct R2Vector center
World-space wheel center.
Definition rapier.h:4268
R2Bool found
Whether a result exists; other result fields are meaningful only when this is 1.
Definition rapier.h:4276
struct R2VoxelKey key
Integer voxel coordinates.
Definition rapier.h:4264
struct R2Vector size
Voxel dimensions along each axis.
Definition rapier.h:4272