Rapier C — 2D / f32 0.36.0+c.0
Loading...
Searching...
No Matches
rapier.h
Go to the documentation of this file.
1
5#if !defined(RAPIER_DIM2) && !defined(RAPIER_DIM3)
6#define RAPIER_DIM3
7#endif
8#if defined(RAPIER_DIM2) && defined(RAPIER_DIM3)
9#error Select exactly one Rapier dimension
10#endif
11#if !defined(RAPIER_F32) && !defined(RAPIER_F64)
12#define RAPIER_F32
13#endif
14#if defined(RAPIER_F32) && defined(RAPIER_F64)
15#error Select exactly one Rapier precision
16#endif
17#if defined(RAPIER_DIM2)
19#define R2_DIMENSION 2
21#define RAPIER_TYPE(name) R2##name
23#define RAPIER_CONST(name) R2_##name
25#define RAPIER_FN(name) r2##name
26#else
28#define R3_DIMENSION 3
30#define RAPIER_TYPE(name) R3##name
32#define RAPIER_CONST(name) R3_##name
34#define RAPIER_FN(name) r3##name
35#endif
36#if defined(_WIN32)
38#define RAPIER_CALL __cdecl
39#else
41#define RAPIER_CALL
42#endif
43#ifndef RAPIER_API
44#if defined(_WIN32) && !defined(RAPIER_STATIC)
46#define RAPIER_API __declspec(dllimport)
47#else
49#define RAPIER_API
50#endif
51#endif
52
53
54#ifndef RAPIER_H
55#define RAPIER_H
56
57/* Generated by cbindgen. Regenerate with bindings/c/tools/generate-header.sh. */
58
59#include <stdarg.h>
60#include <stdbool.h>
61#include <stddef.h>
62#include <stdint.h>
63#include <stdlib.h>
64
65#if defined(RAPIER_DIM2)
66
67#if defined(RAPIER_DIM3)
73#define R2_FRICTION_MODEL_SIMPLIFIED 0
74#endif
75
76#if defined(RAPIER_DIM3)
81#define R2_FRICTION_MODEL_COULOMB 1
82#endif
83
84#if defined(RAPIER_DIM2)
89#define R2_JOINT_DOF_COUNT 3
90#endif
91
92#if defined(RAPIER_DIM3)
97#define R2_JOINT_DOF_COUNT 6
98#endif
99
104#define R2_SOFT_DESC_PARTICLES 0
105
110#define R2_SOFT_DESC_ROPE 1
111
116#define R2_SOFT_DESC_GRID 2
117
122#define R2_SOFT_DESC_CLOTH 3
123
128#define R2_SOFT_DESC_CUBOID 4
129
134#define R2_SOFT_DESC_SURFACE 5
135
140#define R2_SOFT_DESC_DISK 6
141
146#define R2_SOFT_DESC_SPHERE 7
147
152#define R2_SOFT_DESC_CLOTH_TUBE 8
153
158#define R2_SOFT_DESC_VOLUMETRIC 9
159
160#if defined(RAPIER_DIM2)
165#define R2_SOFT_DESC_POLYGON 10
166#endif
167
168#if defined(RAPIER_DIM2)
173#define R2_SOFT_DESC_TRIMESH 11
174#endif
175
176#if defined(RAPIER_DIM3)
181#define R2_SOFT_DESC_CLOTH_ANISOTROPIC 12
182#endif
183
188#define R2_SOFT_BINDING_SKINNED 0
189
194#define R2_SOFT_BINDING_DIRECT 1
195
200#define R2_SOFT_BINDING_DIRECT_BY_POSITION 2
201
202#if defined(RAPIER_DIM2)
207#define R2_POLYLINE_ORIENTED 1
208#endif
209
214#define R2_POLYLINE_DEFORMABLE 2
215
220#define R2_SHAPE_DESC_BALL 0
221
226#define R2_SHAPE_DESC_CUBOID 1
227
232#define R2_SHAPE_DESC_ROUND_CUBOID 2
233
238#define R2_SHAPE_DESC_CAPSULE 3
239
244#define R2_SHAPE_DESC_SEGMENT 4
245
250#define R2_SHAPE_DESC_TRIANGLE 5
251
256#define R2_SHAPE_DESC_HALFSPACE 6
257
262#define R2_SHAPE_DESC_CONVEX_HULL 7
263
268#define R2_SHAPE_DESC_TRIMESH 8
269
274#define R2_SHAPE_DESC_POLYLINE 9
275
280#define R2_SHAPE_DESC_SHARED 10
281
286#define R2_SHAPE_DESC_HEIGHTFIELD 11
287
292#define R2_SHAPE_DESC_CYLINDER 12
293
298#define R2_SHAPE_DESC_CONE 13
299
304#define R2_SHAPE_DESC_COMPOUND 14
305
310#define R2_SHAPE_DESC_ROUND_CYLINDER 15
311
316#define R2_SHAPE_DESC_ROUND_CONE 16
317
322#define R2_MASS_DENSITY 0
323
328#define R2_MASS_TOTAL 1
329
334#define R2_MASS_PROPERTIES 2
335
340#define R2_ABI_VERSION 1
341
346#define R2_DYNAMIC 0
347
352#define R2_FIXED 1
353
358#define R2_KINEMATIC_POSITION_BASED 2
359
364#define R2_KINEMATIC_VELOCITY_BASED 3
365
370#define R2_COLLISION_EVENTS 1
371
376#define R2_CONTACT_FORCE_EVENTS 2
377
382#define R2_COMBINE_AVERAGE 0
383
388#define R2_COMBINE_MIN 1
389
394#define R2_COMBINE_MULTIPLY 2
395
400#define R2_COMBINE_MAX 3
401
406#define R2_COMBINE_CLAMPED_SUM 4
407
412#define R2_COMBINE_GEOMETRIC_MEAN 5
413
418#define R2_COLLISION_TYPES_DYNAMIC_DYNAMIC 1
419
424#define R2_COLLISION_TYPES_DYNAMIC_KINEMATIC 12
425
430#define R2_COLLISION_TYPES_DYNAMIC_FIXED 2
431
436#define R2_COLLISION_TYPES_KINEMATIC_KINEMATIC 52224
437
442#define R2_COLLISION_TYPES_KINEMATIC_FIXED 8704
443
448#define R2_COLLISION_TYPES_FIXED_FIXED 32
449
454#define R2_COLLISION_TYPES_DEFAULT 15
455
460#define R2_FILTER_CONTACT_PAIRS 1
461
466#define R2_FILTER_INTERSECTION_PAIR 2
467
472#define R2_MODIFY_SOLVER_CONTACTS 4
473
478#define R2_QUERY_EXCLUDE_FIXED 1
479
484#define R2_QUERY_EXCLUDE_KINEMATIC 2
485
490#define R2_QUERY_EXCLUDE_DYNAMIC 4
491
496#define R2_QUERY_EXCLUDE_SENSORS 8
497
502#define R2_QUERY_EXCLUDE_SOLIDS 16
503
508#define R2_QUERY_ONLY_DYNAMIC 3
509
514#define R2_QUERY_ONLY_KINEMATIC 5
515
520#define R2_QUERY_ONLY_FIXED 6
521
526#define R2_DEBUG_COLLIDER_SHAPES 1
527
532#define R2_DEBUG_RIGID_BODY_AXES 2
533
538#define R2_DEBUG_MULTIBODY_JOINTS 4
539
544#define R2_DEBUG_IMPULSE_JOINTS 8
545
550#define R2_DEBUG_SOLVER_CONTACTS 16
551
556#define R2_DEBUG_CONTACTS 32
557
562#define R2_DEBUG_COLLIDER_AABBS 64
563
568#define R2_DEBUG_SOFT_BODIES 128
569
574#define R2_DEBUG_PSEUDO_NORMALS 256
575
580#define R2_DEBUG_SOFT_VOLUME_CONTACTS 512
581
586#define R2_DEBUG_SOFT_BODY_STRESS 1024
587
592#define R2_GROUPS_AND 0
593
598#define R2_GROUPS_OR 1
599
604#define R2_MOTOR_ACCELERATION_BASED 0
605
610#define R2_MOTOR_FORCE_BASED 1
611
616#define R2_SOFT_CELL_VOLUME 0
617
622#define R2_SOFT_CELL_COROTATIONAL 1
623
628#define R2_SOFT_CELL_NEO_HOOKEAN 2
629
634#define R2_SOFT_SOLVER_CONSTRAINTS 0
635
640#define R2_SOFT_SOLVER_FEM 1
641
646#define R2_SOFT_EDGE_PLASTIC_FLOW_BOTH 0
647
652#define R2_SOFT_EDGE_PLASTIC_FLOW_COMPRESSION 1
653
658#define R2_SOFT_EDGE_PLASTIC_FLOW_TENSION 2
659
664#define R2_SOFT_PATCH_CONSTRAINTS_KEEP 0
665
670#define R2_SOFT_PATCH_CONSTRAINTS_STAND_DOWN 1
671
676#define R2_SOFT_PATCH_CONSTRAINTS_ALONG_NORMAL 2
677
682#define R2_AXIS_LIN_X 0
683
688#define R2_AXIS_LIN_Y 1
689
694#define R2_LOCK_TRANSLATION_X 1
695
700#define R2_LOCK_TRANSLATION_Y 2
701
706#define R2_LOCK_TRANSLATION_Z 4
707
712#define R2_LOCK_ROTATION_X 8
713
718#define R2_LOCK_ROTATION_Y 16
719
724#define R2_LOCK_ROTATION_Z 32
725
726#if defined(RAPIER_DIM2)
731#define R2_AXIS_ANG_X 2
732#endif
733
734#if defined(RAPIER_DIM3)
739#define R2_AXIS_ANG_X 3
740#endif
741
742#if defined(RAPIER_DIM2)
747#define R2_JOINT_FIXED_AXES 7
748#endif
749
750#if defined(RAPIER_DIM3)
755#define R2_JOINT_FIXED_AXES 63
756#endif
757
758#if defined(RAPIER_DIM2)
763#define R2_JOINT_REVOLUTE_AXES 3
764#endif
765
766#if defined(RAPIER_DIM3)
771#define R2_JOINT_REVOLUTE_AXES 55
772#endif
773
774#if defined(RAPIER_DIM2)
779#define R2_JOINT_PRISMATIC_AXES 6
780#endif
781
782#if defined(RAPIER_DIM3)
787#define R2_JOINT_PRISMATIC_AXES 62
788#endif
789
790#if defined(RAPIER_DIM3)
795#define R2_AXIS_LIN_Z 2
796#endif
797
798#if defined(RAPIER_DIM3)
803#define R2_AXIS_ANG_Y 4
804#endif
805
806#if defined(RAPIER_DIM3)
811#define R2_AXIS_ANG_Z 5
812#endif
813
814#if defined(RAPIER_DIM3)
819#define R2_JOINT_SPHERICAL_AXES 7
820#endif
821
826#define R2_SOFT_FRAME 4
827
832#define R2_SHAPE_CAST_OUT_OF_ITERATIONS 0
833
838#define R2_SHAPE_CAST_CONVERGED 1
839
844#define R2_SHAPE_CAST_FAILED 2
845
850#define R2_SHAPE_CAST_PENETRATING 3
851
856#define R2_FEATURE_UNKNOWN 0
857
862#define R2_FEATURE_VERTEX 1
863
868#define R2_FEATURE_EDGE 2
869
874#define R2_FEATURE_FACE 3
875
880#define R2_MULTIBODY_JOINTS_ARE_KINEMATIC 1
881
886#define R2_MULTIBODY_DISABLE_SELF_CONTACTS 2
887
893#define R2_MULTIBODY_SKIP_LOOP_CLOSURES 4
894
899#define R2_MULTIBODY_SKIP_JOINT_MOTORS 8
900
905#define R2_MULTIBODY_SKIP_JOINT_LIMITS 16
906
911#define R2_MULTIBODY_SKIP_JOINT_SPRINGS 32
912
917#define R2_TRIMESH_HALF_EDGE_TOPOLOGY 1
918
923#define R2_TRIMESH_CONNECTED_COMPONENTS 2
924
929#define R2_TRIMESH_DELETE_BAD_TOPOLOGY_TRIANGLES 4
930
935#define R2_TRIMESH_ORIENTED 8
936
941#define R2_TRIMESH_MERGE_DUPLICATE_VERTICES 16
942
947#define R2_TRIMESH_DELETE_DEGENERATE_TRIANGLES 32
948
953#define R2_TRIMESH_DELETE_DUPLICATE_TRIANGLES 64
954
959#define R2_TRIMESH_FIX_INTERNAL_EDGES 144
960
965#define R2_TRIMESH_DEFORMABLE 256
966
971#define R2_TRIMESH_FIX_INTERNAL_EDGES_TWO_SIDED 656
972
977#define R2_HEIGHTFIELD_FIX_INTERNAL_EDGES 1
978
983#define R2_AXES_MASK_LIN_X 1
984
989#define R2_AXES_MASK_LIN_Y 2
990
991#if defined(RAPIER_DIM3)
996#define R2_AXES_MASK_LIN_Z 4
997#endif
998
999#if defined(RAPIER_DIM3)
1004#define R2_AXES_MASK_ANG_X 8
1005#endif
1006
1007#if defined(RAPIER_DIM3)
1012#define R2_AXES_MASK_ANG_Y 16
1013#endif
1014
1019#define R2_AXES_MASK_ANG_Z 32
1020
1025#define R2_ABI_FEATURE_FEM 1
1026
1031#define R2_ABI_FEATURE_ROBOTICS 2
1032
1033#if (defined(RAPIER_FEM) && defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1038#define R2_ABI_FEATURES 3
1039#endif
1040
1041#if (defined(RAPIER_FEM) && !(defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32)))
1046#define R2_ABI_FEATURES 1
1047#endif
1048
1049#if (!defined(RAPIER_FEM) && defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1054#define R2_ABI_FEATURES 2
1055#endif
1056
1057#if (!defined(RAPIER_FEM) && !(defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32)))
1062#define R2_ABI_FEATURES 0
1063#endif
1064
1065#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1070#define R2_MESH_CONVERTER_TRIMESH 0
1071#endif
1072
1073#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1078#define R2_MESH_CONVERTER_OBB 1
1079#endif
1080
1081#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1086#define R2_MESH_CONVERTER_AABB 2
1087#endif
1088
1089#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1094#define R2_MESH_CONVERTER_CONVEX_HULL 3
1095#endif
1096
1097#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1102#define R2_MESH_CONVERTER_CONVEX_DECOMPOSITION 4
1103#endif
1104
1109#define R2_COLLISION_EVENT_SENSOR 1
1110
1115#define R2_COLLISION_EVENT_REMOVED 2
1116
1121typedef struct R2Bytes R2Bytes;
1122
1128
1129#if defined(RAPIER_DIM3)
1134typedef struct R2DynamicRayCastVehicleController R2DynamicRayCastVehicleController;
1135#endif
1136
1144
1152
1153#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1159typedef struct R2LoadedMeshes R2LoadedMeshes;
1160#endif
1161
1162#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1168typedef struct R2MjcfContactHooks R2MjcfContactHooks;
1169#endif
1170
1171#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1176typedef struct R2MjcfRobot R2MjcfRobot;
1177#endif
1178
1179#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1185typedef struct R2MjcfRobotHandles R2MjcfRobotHandles;
1186#endif
1187
1194
1201
1209
1215
1216#if defined(RAPIER_DIM3)
1221typedef struct R2TriMeshData R2TriMeshData;
1222#endif
1223
1224#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1230typedef struct R2UrdfRobot R2UrdfRobot;
1231#endif
1232
1233#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
1239typedef struct R2UrdfRobotHandles R2UrdfRobotHandles;
1240#endif
1241
1248typedef struct R2World R2World;
1249
1250#if defined(RAPIER_F32)
1255typedef float R2Real;
1256#endif
1257
1258#if defined(RAPIER_F64)
1263typedef double R2Real;
1264#endif
1265
1280
1285typedef uint32_t R2Bool;
1286
1301
1316
1407
1523
1524#if defined(RAPIER_FEM)
1543#endif
1544
1573
1666
1671typedef uint32_t R2Status;
1672
1677typedef struct R2Vector {
1686#if defined(RAPIER_DIM3)
1690 R2Real z;
1691#endif
1693
1698typedef struct R2Rotation {
1699#if defined(RAPIER_DIM2)
1704#endif
1705#if defined(RAPIER_DIM3)
1709 R2Real x;
1710#endif
1711#if defined(RAPIER_DIM3)
1715 R2Real y;
1716#endif
1717#if defined(RAPIER_DIM3)
1721 R2Real z;
1722#endif
1723#if defined(RAPIER_DIM3)
1727 R2Real w;
1728#endif
1730
1746
1761
1792
1797typedef struct R2UserData {
1801 uint64_t low;
1805 uint64_t high;
1807
1863
1884
1905
1926
1936#if defined(RAPIER_DIM2)
1941#endif
1942#if defined(RAPIER_DIM3)
1946 uint32_t enclosure;
1947#endif
1948#if defined(RAPIER_DIM3)
1952 uint32_t cover_smoothing;
1953#endif
1954#if defined(RAPIER_DIM3)
1958 R2Real cover_guard;
1959#endif
1960#if defined(RAPIER_DIM3)
1964 uint32_t cover_subdivisions;
1965#endif
1967
1975typedef struct R2VectorView {
1979 const struct R2Vector *data;
1983 size_t count;
1985
1993typedef struct R2RealView {
1997 const R2Real *data;
2001 size_t count;
2003
2011typedef struct R2IndexView {
2015 const uint32_t *data;
2019 size_t count;
2021
2026typedef struct R2Edge {
2030 uint32_t a;
2034 uint32_t b;
2036
2044typedef struct R2EdgeView {
2048 const struct R2Edge *data;
2052 size_t count;
2054
2069
2084
2099
2114
2119typedef struct R2Triangle {
2123 uint32_t a;
2127 uint32_t b;
2131 uint32_t c;
2133
2141typedef struct R2TriangleView {
2145 const struct R2Triangle *data;
2149 size_t count;
2151
2156typedef struct R2Tetrahedron {
2160 uint32_t a;
2164 uint32_t b;
2168 uint32_t c;
2172 uint32_t d;
2174
2192
2193#if defined(RAPIER_DIM2)
2199#endif
2200
2201#if defined(RAPIER_DIM3)
2206typedef struct R2TetrahedronView R2CellView;
2207#endif
2208
2209#if defined(RAPIER_DIM2)
2215#endif
2216
2217#if defined(RAPIER_DIM3)
2223#endif
2224
2229typedef struct R2Dihedral {
2233 uint32_t a;
2237 uint32_t b;
2241 uint32_t c;
2245 uint32_t d;
2247
2255typedef struct R2DihedralView {
2259 const struct R2Dihedral *data;
2263 size_t count;
2265
2282
2297
2303
2304
2319
2398
2413
2414
2415#if defined(RAPIER_DIM2)
2421#endif
2422
2423#if defined(RAPIER_DIM3)
2428typedef struct R2Vector R2AngVector;
2429#endif
2430
2436typedef struct R2MassProperties {
2449#if defined(RAPIER_DIM3)
2453 struct R2Rotation principal_inertia_local_frame;
2454#endif
2456
2475
2562
2573typedef struct R2SoftBodyDesc {
2577 uint32_t kind;
2581 struct R2Vector a;
2585 struct R2Vector b;
2589 struct R2Vector du;
2593 struct R2Vector dv;
2594#if defined(RAPIER_DIM3)
2598 struct R2SpringCoefficients warpSoftness;
2599#endif
2600#if defined(RAPIER_DIM3)
2604 struct R2SpringCoefficients weftSoftness;
2605#endif
2606#if defined(RAPIER_DIM3)
2610 struct R2SpringCoefficients shearSoftness;
2611#endif
2615 size_t nx;
2619 size_t ny;
2623 size_t nz;
2684#if defined(RAPIER_DIM3)
2688 struct R2DihedralView dihedrals;
2689#endif
2690#if defined(RAPIER_DIM3)
2694 struct R2EdgeView wire;
2695#endif
2723 uint32_t cellModel;
2727 uint32_t solver;
2798
2819
2842
2863
2890
2896typedef R2Bool (RAPIER_CALL *R2QueryPredicate)(void *user_data,
2897 const struct R2ReadContext *read,
2898 struct R2ColliderHandle handle);
2899
2918
2946
2965
3001
3024
3029typedef struct R2Aabb {
3039
3058
3073
3170
3221
3238
3261
3280
3307
3338
3366
3381
3408
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;
3434 R2Real friction_slip;
3438 R2Real max_suspension_force;
3442 R2Real side_friction_stiffness;
3443} R2WheelTuning;
3444#endif
3445
3446#if defined(RAPIER_DIM3)
3451typedef struct R2WheelState {
3455 struct R2Vector center;
3459 struct R2Vector suspension;
3463 struct R2Vector axle;
3467 R2Real rotation;
3471 R2Real suspension_force;
3475 R2Real suspension_length;
3479 R2Bool is_in_contact;
3483 struct R2ColliderHandle ground_object;
3487 struct R2Vector contact_point;
3491 struct R2Vector contact_normal;
3492} R2WheelState;
3493#endif
3494
3502typedef void (RAPIER_CALL *R2ErrorCallback)(R2Status, const char*, void*);
3503
3519
3534
3561
3567
3590
3626
3633typedef int32_t (RAPIER_CALL *R2PairFilter)(void *user_data,
3634 const struct R2ReadContext *read,
3635 struct R2ColliderHandle collider1,
3636 struct R2ColliderHandle collider2,
3637 struct R2RigidBodyHandle body1,
3638 struct R2RigidBodyHandle body2);
3639
3666
3671typedef void (RAPIER_CALL *R2ModifyContacts)(void *user_data,
3672 const struct R2ReadContext *read,
3673 struct R2ColliderHandle collider1,
3674 struct R2ColliderHandle collider2,
3675 struct R2ContactModification *contact);
3676
3681typedef void (RAPIER_CALL *R2ModifyContactContext)(void *user_data,
3682 const struct R2ReadContext *read,
3683 struct R2ColliderHandle collider1,
3684 struct R2ColliderHandle collider2,
3685 struct R2ContactModificationContext *context);
3686
3717
3722typedef struct R2ByteView {
3726 const uint8_t *data;
3730 size_t count;
3732
3737typedef struct R2DebugLine {
3741 struct R2Vector a;
3745 struct R2Vector b;
3749 float color[4];
3751
3766
3793
3812
3831
3836typedef struct R2BuildInfo {
3840 uint32_t abi_version;
3844 uint32_t dimension;
3848 uint32_t real_size;
3854
3878
3913
3932
3937typedef struct R2ContactPoint {
3962#if defined(RAPIER_DIM2)
3967#endif
3968#if defined(RAPIER_DIM3)
3973#endif
3975
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;
4002 R2Bool makeRootsFixed;
4006 R2Bool squeezeEmptyFixedLinks;
4010 struct R2Pose shift;
4014 R2Real scale;
4018 struct R2ColliderDesc colliderBlueprint;
4022 struct R2RigidBodyDesc rigidBodyBlueprint;
4023} R2UrdfLoaderOptions;
4024#endif
4025
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;
4052 R2Bool makeRootsFixed;
4056 R2Bool skipPlaneGeoms;
4060 R2Bool disableJointMotors;
4064 struct R2Pose shift;
4068 R2Real scale;
4072 struct R2ColliderDesc colliderBlueprint;
4076 struct R2RigidBodyDesc rigidBodyBlueprint;
4077} R2MjcfLoaderOptions;
4078#endif
4079
4080#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
4085typedef struct R2MjcfVisualMesh R2MjcfVisualMesh;
4086#endif
4087
4088#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
4093typedef struct R2RenderMaterial {
4097 float metallic;
4101 float roughness;
4105 float reflectance;
4109 float emissive[3];
4110} R2RenderMaterial;
4111#endif
4112
4113#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
4118typedef struct R2MjcfVisualMeshInfo {
4122 struct R2Pose local_pose;
4126 float rgba[4];
4130 struct R2RenderMaterial material;
4134 R2Bool has_color;
4138 R2Bool has_material;
4142 R2Bool is_trimesh;
4143} R2MjcfVisualMeshInfo;
4144#endif
4145
4176
4181typedef struct R2SoftMeshId {
4185 uint32_t cluster;
4189 uint32_t mesh;
4191
4218
4219#if defined(RAPIER_F32)
4224typedef int32_t R2VoxelCoord;
4225#endif
4226
4227#if defined(RAPIER_F64)
4232typedef int64_t R2VoxelCoord;
4233#endif
4234
4239typedef struct R2VoxelKey {
4248#if defined(RAPIER_DIM3)
4252 R2VoxelCoord z;
4253#endif
4255
4278
4301
4316
4331
4355
4370
4385
4425
4448
4455typedef void (RAPIER_CALL *R2CollisionEventCallback)(void *user_data,
4456 const struct R2ReadContext *read,
4457 const struct R2CollisionEvent *event,
4458 const struct R2ContactPoint *contacts,
4459 size_t contact_count);
4460
4465typedef void (RAPIER_CALL *R2ContactForceEventCallback)(void *user_data,
4466 const struct R2ReadContext *read,
4467 const struct R2ContactForceEvent *event);
4468
4490
4607
4612#define R2_OK 0
4613
4618#define R2_NULL_POINTER 1
4619
4624#define R2_INVALID_ARGUMENT 2
4625
4630#define R2_INVALID_HANDLE 3
4631
4636#define R2_BUFFER_TOO_SMALL 4
4637
4642#define R2_UNSUPPORTED 5
4643
4648#define R2_PANIC 6
4649
4654#define R2_NOT_FOUND 7
4655
4660#define R2_WORLD_BUSY 8
4661
4662#ifdef __cplusplus
4663extern "C" {
4664#endif // __cplusplus
4665
4671
4677
4678#if defined(RAPIER_FEM)
4684#endif
4685
4691
4697
4703
4708RAPIER_API
4710 const struct R2IntegrationParameters *data);
4711
4717
4723
4724#if defined(RAPIER_DIM2)
4730#endif
4731
4732#if defined(RAPIER_DIM3)
4737RAPIER_API struct R2JointDesc RAPIER_CALL r2RevoluteJointDesc(struct R2Vector axis_vector);
4738#endif
4739
4744RAPIER_API struct R2JointDesc RAPIER_CALL r2PrismaticJointDesc(struct R2Vector axis_vector);
4745
4751
4756RAPIER_API
4758 R2Real stiffness,
4759 R2Real damping);
4760
4761#if defined(RAPIER_DIM3)
4766RAPIER_API struct R2JointDesc RAPIER_CALL r2SphericalJointDesc(void);
4767#endif
4768
4769#if defined(RAPIER_DIM2)
4774RAPIER_API struct R2JointDesc RAPIER_CALL r2PinSlotJointDesc(struct R2Vector axis_vector);
4775#endif
4776
4782RAPIER_API
4784 struct R2RigidBodyHandle body2,
4785 const struct R2JointDesc *joint);
4786
4792RAPIER_API
4794 struct R2RigidBodyHandle body2,
4795 const struct R2JointDesc *joint);
4796
4802
4807RAPIER_API
4809 const struct R2SoftBodyDesc *desc);
4810
4816
4822RAPIER_API
4824 const struct R2SoftMeshBindingDesc *binding,
4825 struct R2RigidBodyHandle parent);
4826
4832
4841RAPIER_API
4842struct R2RayHit RAPIER_CALL r2CastRay(const struct R2World *world,
4843 const struct R2QueryOptions *query_options,
4844 struct R2Vector origin,
4845 struct R2Vector direction,
4846 R2Real max_toi,
4847 R2Bool solid);
4848
4856RAPIER_API
4858 const struct R2QueryOptions *query_options,
4859 struct R2Vector point,
4860 R2Real max_distance,
4861 R2Bool solid);
4862
4870RAPIER_API
4872 const struct R2QueryOptions *query_options,
4873 struct R2Pose pose,
4874 struct R2Vector velocity,
4875 const R2SharedShape *shape,
4876 struct R2ShapeCastOptions options);
4877
4885RAPIER_API
4886size_t RAPIER_CALL r2IntersectPoint(const struct R2World *world,
4887 const struct R2QueryOptions *query_options,
4888 struct R2Vector point,
4889 struct R2ColliderHandle *buffer,
4890 size_t capacity);
4891
4900RAPIER_API
4901size_t RAPIER_CALL r2IntersectShape(const struct R2World *world,
4902 const struct R2QueryOptions *query_options,
4903 struct R2Pose pose,
4904 const R2SharedShape *shape,
4905 struct R2ColliderHandle *buffer,
4906 size_t capacity);
4907
4916RAPIER_API
4918 const struct R2QueryOptions *query_options,
4919 struct R2Aabb aabb,
4920 struct R2ColliderHandle *buffer,
4921 size_t capacity);
4922
4930RAPIER_API
4931struct R2RayToi RAPIER_CALL r2CastRayToi(const struct R2World *world,
4932 const struct R2QueryOptions *query_options,
4933 struct R2Vector origin,
4934 struct R2Vector direction,
4935 R2Real max_toi,
4936 R2Bool solid);
4937
4945RAPIER_API
4947 const struct R2QueryOptions *query_options,
4948 struct R2Vector origin,
4949 struct R2Vector direction,
4950 R2Real max_toi,
4951 R2Bool solid);
4952
4958
4964
4970
4976
4982
4989
4995
5002
5008RAPIER_API struct R2ColliderDesc RAPIER_CALL r2CuboidColliderDesc(struct R2Vector half_extents);
5009
5014RAPIER_API
5016 const struct R2RigidBodyDesc *desc);
5017
5024RAPIER_API
5026 const struct R2ColliderDesc *desc);
5027
5033RAPIER_API
5035 const struct R2ColliderDesc *desc);
5036
5041RAPIER_API struct R2PodLayout RAPIER_CALL r2PodLayout(void);
5042
5049
5055RAPIER_API
5057
5062RAPIER_API
5064 struct R2Vector up);
5065
5070RAPIER_API
5072 struct R2CharacterLength offset);
5073
5078RAPIER_API
5080 R2Bool enabled);
5081
5086RAPIER_API
5088 R2Real max_climb_angle,
5089 R2Real min_slide_angle);
5090
5095RAPIER_API
5097 R2Bool enabled,
5098 struct R2CharacterLength max_height,
5099 struct R2CharacterLength min_width,
5100 R2Bool include_dynamic_bodies);
5101
5106RAPIER_API
5108 R2Bool enabled,
5109 struct R2CharacterLength distance);
5110
5115RAPIER_API
5117
5122RAPIER_API
5124
5130RAPIER_API
5132
5138RAPIER_API
5140 R2Real value);
5141
5146RAPIER_API
5148
5156RAPIER_API
5158 const struct R2QueryOptions *options,
5159 struct R2KinematicCharacterController *controller,
5160 R2Real dt,
5161 const R2SharedShape *shape,
5162 struct R2Pose pose,
5163 struct R2Vector desired_translation);
5164
5170RAPIER_API
5172 struct R2CharacterCollision *buffer,
5173 size_t capacity);
5174
5182RAPIER_API
5184 const R2SharedShape *shape,
5185 R2Real dt,
5186 R2Real mass,
5187 const struct R2QueryOptions *options);
5188
5195
5202
5207RAPIER_API struct R2PidGains RAPIER_CALL r2PidController_Gains(const struct R2PidController *controller);
5208
5213RAPIER_API
5215 struct R2PidGains gains);
5216
5222RAPIER_API
5224 uint32_t axes);
5225
5230RAPIER_API uint32_t RAPIER_CALL r2PidController_Axes(const struct R2PidController *controller);
5231
5237
5244
5250RAPIER_API
5252 struct R2RigidBodyHandle body,
5253 struct R2Pose target_pose,
5254 struct R2Vector target_linvel,
5255 R2AngVector target_angvel);
5256
5261RAPIER_API
5263 R2Real dt,
5264 struct R2RigidBodyHandle body,
5265 struct R2Pose target_pose,
5266 struct R2Vector target_linvel,
5267 R2AngVector target_angvel);
5268
5273RAPIER_API
5275
5276#if defined(RAPIER_DIM3)
5281RAPIER_API struct R2WheelTuning RAPIER_CALL r2DefaultWheelTuning(void);
5282#endif
5283
5284#if defined(RAPIER_DIM3)
5290RAPIER_API
5291struct R2DynamicRayCastVehicleController *RAPIER_CALL r2NewDynamicRayCastVehicleController(struct R2RigidBodyHandle chassis);
5292#endif
5293
5294#if defined(RAPIER_DIM3)
5300RAPIER_API
5301R2Status RAPIER_CALL r2FreeDynamicRayCastVehicleController(struct R2DynamicRayCastVehicleController *controller);
5302#endif
5303
5304#if defined(RAPIER_DIM3)
5310RAPIER_API
5311size_t RAPIER_CALL r2DynamicRayCastVehicleController_AddWheel(struct R2DynamicRayCastVehicleController *controller,
5312 struct R2Vector connection,
5313 struct R2Vector direction,
5314 struct R2Vector axle,
5315 R2Real rest_length,
5316 R2Real radius,
5317 const struct R2WheelTuning *tuning);
5318#endif
5319
5320#if defined(RAPIER_DIM3)
5325RAPIER_API
5326R2Status RAPIER_CALL r2DynamicRayCastVehicleController_SetAxes(struct R2DynamicRayCastVehicleController *controller,
5327 size_t up,
5328 size_t forward);
5329#endif
5330
5331#if defined(RAPIER_DIM3)
5336RAPIER_API
5337R2Status RAPIER_CALL r2DynamicRayCastVehicleController_SetWheelControls(struct R2DynamicRayCastVehicleController *controller,
5338 size_t index,
5339 R2Real steering,
5340 R2Real engine_force,
5341 R2Real brake);
5342#endif
5343
5344#if defined(RAPIER_DIM3)
5353RAPIER_API
5354R2Status RAPIER_CALL r2DynamicRayCastVehicleController_UpdateVehicle(struct R2DynamicRayCastVehicleController *controller,
5355 R2Real dt,
5356 const struct R2QueryOptions *options);
5357#endif
5358
5359#if defined(RAPIER_DIM3)
5364RAPIER_API
5365R2Real RAPIER_CALL r2DynamicRayCastVehicleController_CurrentVehicleSpeed(const struct R2DynamicRayCastVehicleController *controller);
5366#endif
5367
5368#if defined(RAPIER_DIM3)
5374RAPIER_API
5375size_t RAPIER_CALL r2DynamicRayCastVehicleController_Wheels(const struct R2DynamicRayCastVehicleController *controller,
5376 struct R2WheelState *buffer,
5377 size_t capacity);
5378#endif
5379
5385RAPIER_API
5387
5393RAPIER_API
5394size_t RAPIER_CALL r2ActiveRigidBodies(const struct R2World *world,
5395 struct R2RigidBodyHandle *buffer,
5396 size_t capacity);
5397
5403
5412
5421
5426RAPIER_API const char *RAPIER_CALL r2LastError(void);
5427
5433
5439
5444RAPIER_API
5446 R2Real border_radius);
5447
5452RAPIER_API
5454 struct R2Vector b,
5455 R2Real radius);
5456
5462
5467RAPIER_API
5469 struct R2Vector b,
5470 struct R2Vector c);
5471
5477
5478#if defined(RAPIER_DIM3)
5483RAPIER_API R2SharedShape *RAPIER_CALL r2CylinderSharedShape(R2Real half_height, R2Real radius);
5484#endif
5485
5486#if defined(RAPIER_DIM3)
5491RAPIER_API R2SharedShape *RAPIER_CALL r2ConeSharedShape(R2Real half_height, R2Real radius);
5492#endif
5493
5500
5506
5512
5518RAPIER_API
5519size_t RAPIER_CALL r2ImpulseJointHandles(const struct R2World *world,
5520 struct R2ImpulseJointHandle *buffer,
5521 size_t capacity);
5522
5527RAPIER_API
5529 R2Bool wake_up);
5530
5536RAPIER_API
5538 struct R2MultibodyJointHandle *buffer,
5539 size_t capacity);
5540
5546
5552
5560
5565RAPIER_API
5567 const struct R2InverseKinematicsOptions *options,
5568 struct R2Pose target,
5569 R2IkJointCanMove can_move,
5570 void *user_data,
5571 R2Real *displacements,
5572 size_t count);
5573
5578RAPIER_API
5580 const R2Real *displacements,
5581 size_t count);
5582
5588
5595
5600RAPIER_API size_t RAPIER_CALL r2RigidBodyCount(const struct R2World *world);
5601
5607RAPIER_API
5608size_t RAPIER_CALL r2RigidBodyHandles(const struct R2World *world,
5609 struct R2RigidBodyHandle *buffer,
5610 size_t capacity);
5611
5618
5623RAPIER_API size_t RAPIER_CALL r2ColliderCount(const struct R2World *world);
5624
5630RAPIER_API
5631size_t RAPIER_CALL r2ColliderHandles(const struct R2World *world,
5632 struct R2ColliderHandle *buffer,
5633 size_t capacity);
5634
5640
5645RAPIER_API size_t RAPIER_CALL r2SoftBodyCount(const struct R2World *world);
5646
5652RAPIER_API
5653size_t RAPIER_CALL r2SoftBodyHandles(const struct R2World *world,
5654 struct R2SoftBodyHandle *buffer,
5655 size_t capacity);
5656
5663
5671RAPIER_API
5673 R2Bool remove_attached_colliders);
5674
5679RAPIER_API R2Real RAPIER_CALL r2TimeStep(const struct R2World *world);
5680
5685RAPIER_API R2Status RAPIER_CALL r2SetTimeStep(struct R2World *world, R2Real value);
5686
5691RAPIER_API R2Real RAPIER_CALL r2MinCcdDt(const struct R2World *world);
5692
5697RAPIER_API R2Status RAPIER_CALL r2SetMinCcdDt(struct R2World *world, R2Real value);
5698
5703RAPIER_API R2Real RAPIER_CALL r2LengthUnit(const struct R2World *world);
5704
5709RAPIER_API R2Status RAPIER_CALL r2SetLengthUnit(struct R2World *world, R2Real value);
5710
5715RAPIER_API R2Real RAPIER_CALL r2WarmstartCoefficient(const struct R2World *world);
5716
5722
5728
5734
5741
5746RAPIER_API
5748 R2Real value);
5749
5755
5761
5767
5773
5780
5785RAPIER_API
5787 R2Real value);
5788
5793RAPIER_API size_t RAPIER_CALL r2NumSolverIterations(const struct R2World *world);
5794
5799RAPIER_API R2Status RAPIER_CALL r2SetNumSolverIterations(struct R2World *world, size_t value);
5800
5805RAPIER_API size_t RAPIER_CALL r2NumInternalPgsIterations(const struct R2World *world);
5806
5811RAPIER_API R2Status RAPIER_CALL r2SetNumInternalPgsIterations(struct R2World *world, size_t value);
5812
5818RAPIER_API size_t RAPIER_CALL r2NumInternalStabilizationIterations(const struct R2World *world);
5819
5825RAPIER_API
5827 size_t value);
5828
5833RAPIER_API size_t RAPIER_CALL r2MaxCcdSubsteps(const struct R2World *world);
5834
5839RAPIER_API R2Status RAPIER_CALL r2SetMaxCcdSubsteps(struct R2World *world, size_t value);
5840
5845RAPIER_API R2Bool RAPIER_CALL r2ContactClustering(const struct R2World *world);
5846
5852
5857RAPIER_API R2Bool RAPIER_CALL r2ContactRecycling(const struct R2World *world);
5858
5864
5869RAPIER_API R2Bool RAPIER_CALL r2FrictionInBiasPass(const struct R2World *world);
5870
5876
5881RAPIER_API R2Bool RAPIER_CALL r2WarmstartJoints(const struct R2World *world);
5882
5887RAPIER_API R2Status RAPIER_CALL r2SetWarmstartJoints(struct R2World *world, R2Bool value);
5888
5893RAPIER_API struct R2SpringCoefficients RAPIER_CALL r2ContactSoftness(const struct R2World *world);
5894
5899RAPIER_API
5901 struct R2SpringCoefficients value);
5902
5908
5913RAPIER_API
5915 struct R2SpringCoefficients value);
5916
5921RAPIER_API
5923 struct R2Vector allowed_local_n1,
5924 R2Real allowed_angle);
5925
5930RAPIER_API
5932 struct R2Vector velocity);
5933
5939
5946
5952
5958RAPIER_API
5960 struct R2CollisionEvent *buffer,
5961 size_t capacity);
5962
5968RAPIER_API
5970 struct R2ContactForceEvent *buffer,
5971 size_t capacity);
5972
5977RAPIER_API size_t RAPIER_CALL r2EventCollector_TearEventCount(const struct R2EventCollector *events);
5978
5984RAPIER_API
5986 size_t index);
5987
5992RAPIER_API struct R2Vector RAPIER_CALL r2Gravity(const struct R2World *world);
5993
5998RAPIER_API R2Status RAPIER_CALL r2SetGravity(struct R2World *world, struct R2Vector value);
5999
6006RAPIER_API
6008 const struct R2PhysicsHooks *hooks,
6009 const struct R2EventCollector *events);
6010
6016RAPIER_API
6018 const struct R2PhysicsHooks *hooks,
6019 const struct R2EventCollector *events);
6020
6026RAPIER_API struct R2ByteView RAPIER_CALL r2Bytes_Data(const struct R2Bytes *bytes);
6027
6033RAPIER_API R2Status RAPIER_CALL r2FreeBytes(struct R2Bytes *bytes);
6034
6040RAPIER_API struct R2Bytes *RAPIER_CALL r2SerializeWorld(const struct R2World *world);
6041
6047RAPIER_API struct R2World *RAPIER_CALL r2DeserializeWorld(const uint8_t *data, size_t count);
6048
6055RAPIER_API
6056size_t RAPIER_CALL r2DebugRender(const struct R2World *world,
6057 uint32_t mode,
6058 struct R2DebugLine *buffer,
6059 size_t capacity);
6060
6066
6071RAPIER_API R2Real RAPIER_CALL r2SoftBodiesResweepStrain(const struct R2World *world);
6072
6078
6084
6089RAPIER_API R2Status RAPIER_CALL r2SoftBodiesSetMaxExtraSubsteps(struct R2World *world, size_t value);
6090
6095RAPIER_API size_t RAPIER_CALL r2SoftBodiesMaxExtraSubsteps(const struct R2World *world);
6096
6101RAPIER_API
6103 R2Bool value);
6104
6110
6115RAPIER_API
6117 R2Bool value);
6118
6123RAPIER_API
6125 R2Bool value);
6126
6131RAPIER_API
6133 R2Bool value);
6134
6140
6146
6152
6158
6164
6169RAPIER_API
6171 R2Bool value);
6172
6177RAPIER_API
6179 R2Bool value);
6180
6186
6192
6198
6203RAPIER_API
6205 R2Bool value);
6206
6211RAPIER_API
6213 R2Bool value);
6214
6219RAPIER_API
6221 R2Real value);
6222
6228
6234
6240
6246
6252
6257RAPIER_API
6259 R2Real value);
6260
6261#if defined(RAPIER_FEM)
6267#endif
6268
6269#if defined(RAPIER_FEM)
6274RAPIER_API R2Status RAPIER_CALL r2FemSetMaxLinearIterations(struct R2World *world, size_t value);
6275#endif
6276
6277#if defined(RAPIER_FEM)
6282RAPIER_API R2Status RAPIER_CALL r2FemSetMaxDenseDofs(struct R2World *world, size_t value);
6283#endif
6284
6292RAPIER_API R2Status RAPIER_CALL r2SetNumThreads(struct R2World *world, size_t num_threads);
6293
6301
6307RAPIER_API size_t RAPIER_CALL r2NumThreads(const struct R2World *world);
6308
6314RAPIER_API R2Status RAPIER_CALL r2SetCountersEnabled(struct R2World *world, R2Bool enabled);
6315
6322RAPIER_API double RAPIER_CALL r2StepTimeMs(const struct R2World *world);
6323
6332RAPIER_API struct R2World *RAPIER_CALL r2DeserializeRigidState(const uint8_t *data, size_t count);
6333
6339
6345
6351
6357
6364
6369RAPIER_API
6371
6379RAPIER_API
6381 struct R2SoftBodyHandle *buffer,
6382 size_t capacity);
6383
6388RAPIER_API
6390 uint32_t particle);
6391
6397RAPIER_API
6399 uint32_t *buffer,
6400 size_t capacity);
6401
6407RAPIER_API
6409 uint32_t *buffer,
6410 size_t capacity);
6411
6417RAPIER_API
6419 uint32_t *buffer,
6420 size_t capacity);
6421
6427RAPIER_API
6429 uint32_t *buffer,
6430 size_t capacity);
6431
6437RAPIER_API
6439 uint32_t *buffer,
6440 size_t capacity);
6441
6449RAPIER_API
6451 size_t piece_index,
6452 uint32_t *buffer,
6453 size_t capacity);
6454
6460RAPIER_API
6462 struct R2SoftClusterSplit *buffer,
6463 size_t capacity);
6464
6470RAPIER_API
6472 struct R2SoftJointMove *buffer,
6473 size_t capacity);
6474
6480RAPIER_API
6482 const uint32_t *edges,
6483 size_t edge_count,
6484 const uint32_t *cells,
6485 size_t cell_count);
6486
6491RAPIER_API
6493 const uint32_t *particles,
6494 size_t count);
6495
6500RAPIER_API
6502 uint32_t cluster);
6503
6509RAPIER_API
6511 uint32_t particle);
6512
6518RAPIER_API
6520 const struct R2Vector *blade);
6521
6528
6533RAPIER_API struct R2BuildInfo RAPIER_CALL r2BuildInfo(void);
6534
6542RAPIER_API const char *RAPIER_CALL r2Version(void);
6543
6551RAPIER_API const char *RAPIER_CALL r2BuildProfile(void);
6552
6558
6564RAPIER_API
6566 size_t rows,
6567 size_t columns,
6568 struct R2Vector scale);
6569
6574RAPIER_API
6576 struct R2Pose pose);
6577
6582RAPIER_API
6584 R2Real density);
6585
6590RAPIER_API
6592 struct R2Pose pose,
6593 struct R2Vector point);
6594
6600RAPIER_API
6601size_t RAPIER_CALL r2ContactPairs(const struct R2World *world,
6602 struct R2ContactPair *buffer,
6603 size_t capacity);
6604
6610RAPIER_API
6613
6619RAPIER_API
6620size_t RAPIER_CALL r2IntersectionPairs(const struct R2World *world,
6621 struct R2IntersectionPair *buffer,
6622 size_t capacity);
6623
6633RAPIER_API
6636 struct R2ContactPoint *buffer,
6637 size_t capacity);
6638
6644RAPIER_API
6646 R2Real *buffer,
6647 size_t capacity);
6648
6653RAPIER_API
6655 const R2Real *values,
6656 size_t count);
6657
6666RAPIER_API
6668 uint32_t dimension,
6669 size_t real_size,
6670 size_t vector_size,
6671 size_t pose_size,
6672 uint32_t features);
6673
6682RAPIER_API
6684 struct R2RigidBodyHandle *buffer,
6685 size_t capacity);
6686
6695RAPIER_API
6696size_t RAPIER_CALL r2QuarantinedColliders(const struct R2World *world,
6697 struct R2ColliderHandle *buffer,
6698 size_t capacity);
6699
6708RAPIER_API
6710 struct R2SoftBodyHandle *buffer,
6711 size_t capacity);
6712
6713#if defined(RAPIER_DIM3)
6718RAPIER_API uint32_t RAPIER_CALL r2FrictionModel(const struct R2World *world);
6719#endif
6720
6721#if defined(RAPIER_DIM3)
6726RAPIER_API R2Status RAPIER_CALL r2SetFrictionModel(struct R2World *world, uint32_t value);
6727#endif
6728
6735
6741
6747
6753
6759
6766
6772
6778
6783RAPIER_API R2Real RAPIER_CALL r2Powf(R2Real base, R2Real exponent);
6784
6790RAPIER_API
6792 uint32_t subdivisions);
6793
6799RAPIER_API
6801 struct R2Vector *buffer,
6802 size_t capacity);
6803
6809RAPIER_API
6811 struct R2Vector *buffer,
6812 size_t capacity);
6813
6820
6821#if defined(RAPIER_DIM3)
6826RAPIER_API
6827R2SharedShape *RAPIER_CALL r2RoundCylinderSharedShape(R2Real half_height,
6828 R2Real radius,
6829 R2Real border_radius);
6830#endif
6831
6832#if defined(RAPIER_DIM3)
6837RAPIER_API
6838R2SharedShape *RAPIER_CALL r2RoundConeSharedShape(R2Real half_height,
6839 R2Real radius,
6840 R2Real border_radius);
6841#endif
6842
6843#if defined(RAPIER_DIM3)
6851RAPIER_API
6852struct R2TriMeshData *RAPIER_CALL r2SharedShape_ToTrimesh(const R2SharedShape *shape,
6853 uint32_t ntheta,
6854 uint32_t nphi);
6855#endif
6856
6857#if defined(RAPIER_DIM3)
6863RAPIER_API
6864size_t RAPIER_CALL r2TriMeshData_Vertices(const struct R2TriMeshData *mesh,
6865 struct R2Vector *buffer,
6866 size_t capacity);
6867#endif
6868
6869#if defined(RAPIER_DIM3)
6875RAPIER_API
6876size_t RAPIER_CALL r2TriMeshData_Indices(const struct R2TriMeshData *mesh,
6877 uint32_t *buffer,
6878 size_t capacity);
6879#endif
6880
6881#if defined(RAPIER_DIM3)
6887RAPIER_API R2Status RAPIER_CALL r2FreeTriMeshData(struct R2TriMeshData *mesh);
6888#endif
6889
6890#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6895RAPIER_API struct R2UrdfLoaderOptions RAPIER_CALL r2DefaultUrdfLoaderOptions(void);
6896#endif
6897
6898#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6904RAPIER_API R2Status RAPIER_CALL r2FreeUrdfRobot(struct R2UrdfRobot *object);
6905#endif
6906
6907#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6913RAPIER_API
6914struct R2UrdfRobot *RAPIER_CALL r2UrdfRobotFromFile(const char *path,
6915 const struct R2UrdfLoaderOptions *options);
6916#endif
6917
6918#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6923RAPIER_API
6924R2Status RAPIER_CALL r2UrdfRobot_AppendTransform(struct R2UrdfRobot *robot,
6925 struct R2Pose transform);
6926#endif
6927
6928#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6934RAPIER_API R2Status RAPIER_CALL r2FreeUrdfRobotHandles(struct R2UrdfRobotHandles *handles);
6935#endif
6936
6937#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6942RAPIER_API
6943struct R2UrdfRobotHandles *RAPIER_CALL r2UrdfRobot_InsertUsingImpulseJoints(struct R2World *world,
6944 const struct R2UrdfRobot *robot);
6945#endif
6946
6947#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6952RAPIER_API
6953struct R2UrdfRobotHandles *RAPIER_CALL r2UrdfRobot_InsertUsingMultibodyJoints(struct R2World *world,
6954 const struct R2UrdfRobot *robot,
6955 uint8_t options);
6956#endif
6957
6958#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6965RAPIER_API
6966size_t RAPIER_CALL r2UrdfRobotHandles_Bodies(const struct R2UrdfRobotHandles *handles,
6967 struct R2RigidBodyHandle *buffer,
6968 size_t capacity);
6969#endif
6970
6971#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6976RAPIER_API struct R2MjcfLoaderOptions RAPIER_CALL r2DefaultMjcfLoaderOptions(void);
6977#endif
6978
6979#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6985RAPIER_API R2Status RAPIER_CALL r2FreeMjcfRobot(struct R2MjcfRobot *object);
6986#endif
6987
6988#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
6994RAPIER_API
6995struct R2MjcfRobot *RAPIER_CALL r2MjcfRobotFromFile(const char *path,
6996 const struct R2MjcfLoaderOptions *options);
6997#endif
6998
6999#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7004RAPIER_API
7005R2Status RAPIER_CALL r2MjcfRobot_AppendTransform(struct R2MjcfRobot *robot,
7006 struct R2Pose transform);
7007#endif
7008
7009#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7015RAPIER_API R2Status RAPIER_CALL r2FreeMjcfRobotHandles(struct R2MjcfRobotHandles *handles);
7016#endif
7017
7018#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7023RAPIER_API
7024struct R2MjcfRobotHandles *RAPIER_CALL r2MjcfRobot_InsertUsingImpulseJoints(struct R2World *world,
7025 const struct R2MjcfRobot *robot);
7026#endif
7027
7028#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7033RAPIER_API
7034struct R2MjcfRobotHandles *RAPIER_CALL r2MjcfRobot_InsertUsingMultibodyJoints(struct R2World *world,
7035 const struct R2MjcfRobot *robot,
7036 uint8_t options);
7037#endif
7038
7039#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7045RAPIER_API
7046size_t RAPIER_CALL r2MjcfRobotHandles_Bodies(const struct R2MjcfRobotHandles *handles,
7047 struct R2RigidBodyHandle *buffer,
7048 size_t capacity);
7049#endif
7050
7051#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7056RAPIER_API struct R2Vector RAPIER_CALL r2MjcfRobot_Gravity(const struct R2MjcfRobot *robot);
7057#endif
7058
7059#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7064RAPIER_API size_t RAPIER_CALL r2MjcfRobot_BodyCount(const struct R2MjcfRobot *robot);
7065#endif
7066
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);
7073#endif
7074
7075#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7080RAPIER_API
7081R2Status RAPIER_CALL r2MjcfRobot_SetBodyColliderCollisionGroups(struct R2MjcfRobot *robot,
7082 size_t body,
7083 size_t collider,
7084 struct R2InteractionGroups groups);
7085#endif
7086
7087#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7092RAPIER_API size_t RAPIER_CALL r2MjcfRobot_KeyframeCount(const struct R2MjcfRobot *robot);
7093#endif
7094
7095#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7101RAPIER_API
7102size_t RAPIER_CALL r2MjcfRobot_KeyframeName(const struct R2MjcfRobot *robot,
7103 size_t key,
7104 char *buffer,
7105 size_t capacity);
7106#endif
7107
7108#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7113RAPIER_API
7114R2Status RAPIER_CALL r2MjcfRobot_AppendKeyframe(struct R2MjcfRobot *robot,
7115 const struct R2MjcfRobot *source,
7116 size_t key);
7117#endif
7118
7119#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7125RAPIER_API
7126size_t RAPIER_CALL r2MjcfRobot_KeyframeControls(const struct R2MjcfRobot *robot,
7127 size_t key,
7128 R2Real *buffer,
7129 size_t capacity);
7130#endif
7131
7132#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7137RAPIER_API size_t RAPIER_CALL r2MjcfRobotHandles_ActuatorCount(const struct R2MjcfRobotHandles *handles);
7138#endif
7139
7140#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7145RAPIER_API
7146R2Status RAPIER_CALL r2MjcfRobotHandles_ApplyKeyframe(const struct R2MjcfRobotHandles *handles,
7147 const struct R2MjcfRobot *robot,
7148 size_t key);
7149#endif
7150
7151#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7156RAPIER_API
7157R2Status RAPIER_CALL r2MjcfRobotHandles_ApplyControlsScaled(const struct R2MjcfRobotHandles *handles,
7158 const R2Real *controls,
7159 size_t count,
7160 R2Real gain);
7161#endif
7162
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);
7169#endif
7170
7171#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7177RAPIER_API
7178const R2MjcfVisualMesh *RAPIER_CALL r2MjcfRobot_BodyVisual(const struct R2MjcfRobot *robot,
7179 size_t body,
7180 size_t visual);
7181#endif
7182
7183#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7188RAPIER_API struct R2MjcfVisualMeshInfo RAPIER_CALL r2MjcfVisualMesh_Info(const R2MjcfVisualMesh *visual);
7189#endif
7190
7191#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7197RAPIER_API R2SharedShape *RAPIER_CALL r2MjcfVisualMesh_CloneShape(const R2MjcfVisualMesh *visual);
7198#endif
7199
7200#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7206RAPIER_API
7207size_t RAPIER_CALL r2MjcfVisualMesh_Uvs(const R2MjcfVisualMesh *visual,
7208 float *buffer,
7209 size_t capacity);
7210#endif
7211
7212#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7218RAPIER_API
7219size_t RAPIER_CALL r2MjcfVisualMesh_Normals(const R2MjcfVisualMesh *visual,
7220 float *buffer,
7221 size_t capacity);
7222#endif
7223
7224#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7230RAPIER_API
7231size_t RAPIER_CALL r2MjcfVisualMesh_Texture(const R2MjcfVisualMesh *visual,
7232 char *buffer,
7233 size_t capacity);
7234#endif
7235
7236#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7243RAPIER_API
7244struct R2UrdfRobot *RAPIER_CALL r2UrdfRobotFromString(const char *urdf,
7245 const char *mesh_dir,
7246 const struct R2UrdfLoaderOptions *options);
7247#endif
7248
7249#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7255RAPIER_API R2Status RAPIER_CALL r2FreeMjcfContactHooks(struct R2MjcfContactHooks *hooks);
7256#endif
7257
7258#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7264RAPIER_API
7265struct R2MjcfContactHooks *RAPIER_CALL r2MjcfRobotHandles_ContactHooks(const struct R2MjcfRobotHandles *handles,
7266 const struct R2MjcfRobot *robot);
7267#endif
7268
7269#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7276RAPIER_API
7277struct R2PhysicsHooks RAPIER_CALL r2MjcfContactHooks_PhysicsHooks(const struct R2MjcfContactHooks *hooks);
7278#endif
7279
7280#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7286RAPIER_API R2Status RAPIER_CALL r2FreeLoadedMeshes(struct R2LoadedMeshes *meshes);
7287#endif
7288
7289#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7297RAPIER_API
7298struct R2LoadedMeshes *RAPIER_CALL r2LoadedMeshesFromFile(const char *path,
7299 uint32_t converter,
7300 uint32_t trimesh_flags,
7301 struct R2Vector scale);
7302#endif
7303
7304#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7309RAPIER_API size_t RAPIER_CALL r2LoadedMeshes_Count(const struct R2LoadedMeshes *meshes);
7310#endif
7311
7312#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7319RAPIER_API
7320R2SharedShape *RAPIER_CALL r2LoadedMeshes_CloneShape(const struct R2LoadedMeshes *meshes,
7321 size_t index);
7322#endif
7323
7324#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
7330RAPIER_API
7331struct R2Pose RAPIER_CALL r2LoadedMeshes_Pose(const struct R2LoadedMeshes *meshes,
7332 size_t index);
7333#endif
7334
7340
7346
7352
7358
7364
7370
7376
7382RAPIER_API
7384 struct R2Pose value,
7385 R2Bool wake_up);
7386
7392RAPIER_API
7394 struct R2Vector value,
7395 R2Bool wake_up);
7396
7402RAPIER_API
7404 struct R2Vector value,
7405 R2Bool wake_up);
7406
7412RAPIER_API
7414 R2AngVector value,
7415 R2Bool wake_up);
7416
7421RAPIER_API
7423 struct R2Pose value);
7424
7429RAPIER_API
7431 struct R2Vector value);
7432
7438RAPIER_API
7440 R2Real value,
7441 R2Bool wake_up);
7442
7447RAPIER_API
7449 R2Real value);
7450
7455RAPIER_API
7457 R2Real value);
7458
7464
7469RAPIER_API
7471 struct R2UserData value);
7472
7478RAPIER_API
7480 struct R2Vector value,
7481 R2Bool wake_up);
7482
7488RAPIER_API
7490 struct R2Vector value,
7491 struct R2Vector point,
7492 R2Bool wake_up);
7493
7499RAPIER_API
7501 struct R2Vector value,
7502 R2Bool wake_up);
7503
7510
7516
7522
7528
7534
7540
7546
7552
7558RAPIER_API
7560 struct R2Pose value);
7561
7567RAPIER_API
7569 struct R2Vector value);
7570
7576
7582
7588
7593RAPIER_API
7595 struct R2InteractionGroups value);
7596
7601RAPIER_API
7603 struct R2UserData value);
7604
7609RAPIER_API
7611 size_t index);
7612
7618RAPIER_API
7620 struct R2Vector *buffer,
7621 size_t capacity);
7622
7628
7633RAPIER_API
7635 size_t index,
7636 struct R2Vector value);
7637
7642RAPIER_API
7644 const struct R2SoftBodyMaterial *data);
7645
7651RAPIER_API
7653 size_t index,
7654 struct R2Vector value,
7655 R2Bool wake_up);
7656
7663RAPIER_API
7664size_t RAPIER_CALL r2RigidBodyReadStates(const struct R2World *world,
7665 const struct R2RigidBodyHandle *handles,
7666 size_t handle_count,
7667 struct R2RigidBodyState *states,
7668 size_t capacity);
7669
7675
7681RAPIER_API
7683 const struct R2JointDesc *desc,
7684 R2Bool wake_up);
7685
7691
7696RAPIER_API uint32_t RAPIER_CALL r2Collider_ActiveHooks(struct R2ColliderHandle handle);
7697
7703
7709
7716
7722
7728
7734
7740
7746RAPIER_API
7748 struct R2Rotation value);
7749
7755RAPIER_API
7757 R2Bool value);
7758
7765RAPIER_API
7767 struct R2VectorView vertices,
7768 struct R2TriangleView indices,
7769 uint32_t flags);
7770
7777RAPIER_API
7779 struct R2VectorView vertices,
7780 struct R2EdgeView indices,
7781 uint32_t flags);
7782
7787RAPIER_API
7789 struct R2VectorView vertices);
7790
7795RAPIER_API
7797 struct R2VectorView positions);
7798
7803RAPIER_API
7805 struct R2VectorView vertices,
7806 R2SurfaceElementView elements);
7807
7808#if defined(RAPIER_DIM2)
7815RAPIER_API
7817 struct R2VectorView vertices,
7818 struct R2TriangleView triangles);
7819#endif
7820
7827RAPIER_API
7829 struct R2SoftBodyDescView view);
7830
7837RAPIER_API
7839 struct R2EdgeView view);
7840
7845RAPIER_API
7847 struct R2VectorView vertices,
7848 R2SurfaceElementView elements);
7849
7857RAPIER_API
7859 struct R2RealView view);
7860
7868RAPIER_API
7870 struct R2IndexView view);
7871
7879RAPIER_API
7881 struct R2EdgeView view);
7882
7890RAPIER_API
7892 struct R2EdgeView view);
7893
7902
7910RAPIER_API
7913
7921RAPIER_API
7923 struct R2IndexView view);
7924
7925#if defined(RAPIER_DIM3)
7933RAPIER_API
7934R2Status RAPIER_CALL r2SoftBodyDesc_SetDihedrals(struct R2SoftBodyDesc *desc,
7935 struct R2DihedralView view);
7936#endif
7937
7938#if defined(RAPIER_DIM3)
7946RAPIER_API
7947R2Status RAPIER_CALL r2SoftBodyDesc_SetWire(struct R2SoftBodyDesc *desc,
7948 struct R2EdgeView view);
7949#endif
7950
7956RAPIER_API
7958 R2Real border_radius);
7959
7965RAPIER_API
7967 struct R2Vector b,
7968 R2Real radius);
7969
7976
7982RAPIER_API
7984 struct R2Vector b,
7985 struct R2Vector c);
7986
7993
7994#if defined(RAPIER_DIM3)
8000RAPIER_API struct R2ColliderDesc RAPIER_CALL r2CylinderColliderDesc(R2Real half_height, R2Real radius);
8001#endif
8002
8003#if defined(RAPIER_DIM3)
8009RAPIER_API struct R2ColliderDesc RAPIER_CALL r2ConeColliderDesc(R2Real half_height, R2Real radius);
8010#endif
8011
8012#if defined(RAPIER_DIM3)
8018RAPIER_API
8019struct R2ColliderDesc RAPIER_CALL r2RoundCylinderColliderDesc(R2Real half_height,
8020 R2Real radius,
8021 R2Real border_radius);
8022#endif
8023
8024#if defined(RAPIER_DIM3)
8030RAPIER_API
8031struct R2ColliderDesc RAPIER_CALL r2RoundConeColliderDesc(R2Real half_height,
8032 R2Real radius,
8033 R2Real border_radius);
8034#endif
8035
8041RAPIER_API struct R2ColliderDesc RAPIER_CALL r2CapsuleXColliderDesc(R2Real half_height, R2Real radius);
8042
8048RAPIER_API struct R2ColliderDesc RAPIER_CALL r2CapsuleYColliderDesc(R2Real half_height, R2Real radius);
8049
8050#if defined(RAPIER_DIM3)
8056RAPIER_API struct R2ColliderDesc RAPIER_CALL r2CapsuleZColliderDesc(R2Real half_height, R2Real radius);
8057#endif
8058
8064RAPIER_API
8066 struct R2Vector b,
8067 size_t particles);
8068
8069#if defined(RAPIER_DIM2)
8075RAPIER_API
8077 struct R2Vector half_extents,
8078 size_t nx,
8079 size_t ny);
8080#endif
8081
8082#if defined(RAPIER_DIM3)
8088RAPIER_API
8089struct R2SoftBodyDesc RAPIER_CALL r2CuboidSoftBodyDesc(struct R2Vector center,
8090 struct R2Vector half_extents,
8091 size_t nx,
8092 size_t ny,
8093 size_t nz);
8094#endif
8095
8096#if defined(RAPIER_DIM3)
8102RAPIER_API
8103struct R2SoftBodyDesc RAPIER_CALL r2ClothSoftBodyDesc(struct R2Vector origin,
8104 struct R2Vector du,
8105 struct R2Vector dv,
8106 size_t nu,
8107 size_t nv);
8108#endif
8109
8110#if defined(RAPIER_DIM3)
8118RAPIER_API
8119struct R2SoftBodyDesc RAPIER_CALL r2ClothAnisotropicSoftBodyDesc(struct R2Vector origin,
8120 struct R2Vector du,
8121 struct R2Vector dv,
8122 size_t nu,
8123 size_t nv,
8124 struct R2SpringCoefficients warp,
8125 struct R2SpringCoefficients weft,
8126 struct R2SpringCoefficients shear);
8127#endif
8128
8129#if defined(RAPIER_DIM2)
8138#endif
8139
8140#if defined(RAPIER_DIM2)
8147RAPIER_API
8149 R2Real radius,
8150 size_t particles);
8151#endif
8152
8153#if defined(RAPIER_DIM3)
8159RAPIER_API
8160struct R2SoftBodyDesc RAPIER_CALL r2SphereSoftBodyDesc(struct R2Vector center,
8161 R2Real radius,
8162 uint32_t subdivisions);
8163#endif
8164
8165#if defined(RAPIER_DIM3)
8172RAPIER_API
8173struct R2SoftBodyDesc RAPIER_CALL r2ClothTubeSoftBodyDesc(struct R2Vector origin,
8174 struct R2Vector axis,
8175 R2Real radius_start,
8176 R2Real radius_end,
8177 size_t num_around,
8178 size_t num_along);
8179#endif
8180
8185RAPIER_API
8188 struct R2VolumeMeshParameters parameters);
8189
8194RAPIER_API
8196
8202RAPIER_API
8204 struct R2Vector *buffer,
8205 size_t capacity);
8206
8212RAPIER_API
8214 uint32_t *buffer,
8215 size_t capacity);
8216
8221RAPIER_API
8223 size_t index);
8224
8230RAPIER_API uint32_t RAPIER_CALL r2SoftBody_Solver(struct R2SoftBodyHandle handle);
8231
8237RAPIER_API
8239 uint32_t cluster,
8240 const struct R2SpringCoefficients *softness);
8241
8250RAPIER_API
8252 struct R2Vector impulse,
8253 struct R2Vector point,
8254 R2Real falloff_radius,
8255 R2Bool wake_up);
8256
8266RAPIER_API
8268 struct R2Vector center,
8269 R2Real magnitude,
8270 R2Real falloff_radius,
8271 R2Bool wake_up);
8272
8280
8286RAPIER_API R2Status RAPIER_CALL r2SoftBody_TearEdge(struct R2SoftBodyHandle handle, size_t index);
8287
8294RAPIER_API R2Status RAPIER_CALL r2SoftBody_TearCell(struct R2SoftBodyHandle handle, size_t index);
8295
8302
8308RAPIER_API
8310 struct R2ColliderHandle handle);
8311
8319
8325
8331
8337
8343
8349
8355
8361
8367
8373
8379
8385
8391
8397
8403
8409
8415
8421
8427
8433
8438RAPIER_API
8440 uint32_t value);
8441
8447
8453
8459
8465
8471
8476RAPIER_API uint32_t RAPIER_CALL r2RecoveryOverlapSplit(const struct R2World *world);
8477
8482RAPIER_API R2Status RAPIER_CALL r2RecoverySetOverlapSplit(struct R2World *world, uint32_t value);
8483
8488RAPIER_API uint32_t RAPIER_CALL r2RecoveryOverlapPatience(const struct R2World *world);
8489
8495
8501
8502#if defined(RAPIER_FEM)
8508#endif
8509
8510#if defined(RAPIER_FEM)
8515RAPIER_API size_t RAPIER_CALL r2FemMaxLinearIterations(const struct R2World *world);
8516#endif
8517
8518#if defined(RAPIER_FEM)
8523RAPIER_API size_t RAPIER_CALL r2FemMaxDenseDofs(const struct R2World *world);
8524#endif
8525
8532
8538
8545
8551
8557
8563
8569
8575
8581
8587
8593
8599RAPIER_API
8601 struct R2Vector *buffer,
8602 size_t capacity);
8603
8609RAPIER_API
8611 uint32_t *buffer,
8612 size_t capacity);
8613
8619RAPIER_API
8621 uint32_t *buffer,
8622 size_t capacity);
8623
8629RAPIER_API
8631 uint32_t *buffer,
8632 size_t capacity);
8633
8639RAPIER_API
8641 struct R2SoftBodyHandle *buffer,
8642 size_t capacity);
8643
8648RAPIER_API
8650 size_t index,
8651 struct R2Vector value);
8652
8657RAPIER_API
8659 size_t index,
8660 struct R2Vector value);
8661
8666RAPIER_API
8668 size_t index,
8669 R2Bool value);
8670
8676RAPIER_API
8678 size_t index,
8679 struct R2Vector value,
8680 R2Bool wake_up);
8681
8687RAPIER_API
8689 struct R2Vector value,
8690 R2Bool wake_up);
8691
8699RAPIER_API
8701 struct R2Vector value,
8702 R2Bool wake_up);
8703
8710
8716
8721RAPIER_API
8723 R2Real value);
8724
8731RAPIER_API
8733 size_t index,
8734 struct R2RigidBodyHandle rigid_body);
8735
8742
8748RAPIER_API
8750 uint32_t *buffer,
8751 size_t capacity);
8752
8757RAPIER_API
8759 uint32_t cluster);
8760
8766RAPIER_API
8768 uint32_t cluster,
8769 uint32_t *buffer,
8770 size_t capacity);
8771
8776RAPIER_API
8778 uint32_t cluster,
8779 R2Bool value);
8780
8785RAPIER_API
8787 uint32_t cluster,
8788 struct R2Pose value);
8789
8794RAPIER_API
8796 uint32_t cluster,
8797 R2Bool value);
8798
8805RAPIER_API
8807 uint32_t cluster,
8808 R2Real value);
8809
8814RAPIER_API
8816 uint32_t cluster,
8817 R2Real value);
8818
8824RAPIER_API
8826 struct R2SoftMeshInfo *buffer,
8827 size_t capacity);
8828
8834RAPIER_API
8836 struct R2SoftMeshId id,
8837 struct R2Vector *buffer,
8838 size_t capacity);
8839
8845RAPIER_API
8847 struct R2SoftMeshId id,
8848 uint32_t *buffer,
8849 size_t capacity);
8850
8856RAPIER_API
8858 struct R2ColliderHandle *buffer,
8859 size_t capacity);
8860
8866RAPIER_API
8868 struct R2ColliderHandle collider,
8869 struct R2Vector *buffer,
8870 size_t capacity);
8871
8877RAPIER_API
8879 struct R2ColliderHandle collider,
8880 uint32_t *buffer,
8881 size_t capacity);
8882
8887RAPIER_API
8889 struct R2ColliderHandle collider);
8890
8895RAPIER_API
8897 struct R2ColliderHandle collider);
8898
8899#if defined(RAPIER_FEM)
8904RAPIER_API R2Status RAPIER_CALL r2SoftBody_SetSolver(struct R2SoftBodyHandle handle, uint32_t solver);
8905#endif
8906
8911RAPIER_API
8913 uint32_t cluster,
8914 const struct R2Pose *target);
8915
8920RAPIER_API
8922 size_t index,
8923 R2Real resistance);
8924
8929RAPIER_API
8931 struct R2ColliderHandle collider);
8932
8938RAPIER_API
8940 struct R2MassProperties properties,
8941 R2Bool wake_up);
8942
8947RAPIER_API
8949
8954RAPIER_API
8956 struct R2MassProperties properties);
8957
8963
8969RAPIER_API
8971 uint8_t axes,
8972 R2Bool wake_up);
8973
8978RAPIER_API uint8_t RAPIER_CALL r2RigidBody_LockedAxes(struct R2RigidBodyHandle handle);
8979
8985
8990RAPIER_API
8992 uint32_t id);
8993
8998RAPIER_API
9000 struct R2VoxelKey key,
9001 R2Bool filled);
9002
9008
9014
9020
9026
9032
9038
9043RAPIER_API uint32_t RAPIER_CALL r2RigidBody_BodyType(struct R2RigidBodyHandle handle);
9044
9050
9056
9062
9068
9074
9080
9086
9092
9098
9104
9110
9116
9122
9128
9134RAPIER_API
9136 struct R2Rotation value,
9137 R2Bool wake_up);
9138
9144RAPIER_API
9146 uint32_t value,
9147 R2Bool wake_up);
9148
9153RAPIER_API
9155 struct R2Rotation value);
9156
9162RAPIER_API
9164 R2Real value,
9165 R2Bool wake_up);
9166
9171RAPIER_API
9173 R2Real value);
9174
9179RAPIER_API
9181 R2Bool value);
9182
9188RAPIER_API
9190 R2Bool value,
9191 R2Bool wake_up);
9192
9198RAPIER_API
9200 R2Bool value,
9201 R2Bool wake_up);
9202
9207RAPIER_API
9209 int8_t value);
9210
9215RAPIER_API
9217 size_t value);
9218
9223RAPIER_API
9225 size_t value);
9226
9232RAPIER_API
9234 R2AngVector value,
9235 R2Bool wake_up);
9236
9242RAPIER_API
9244 R2AngVector value,
9245 R2Bool wake_up);
9246
9252RAPIER_API
9254 struct R2Vector value,
9255 struct R2Vector point,
9256 R2Bool wake_up);
9257
9263RAPIER_API
9265 R2Bool wake_up);
9266
9271RAPIER_API
9273 struct R2Vector point);
9274
9280RAPIER_API
9282 struct R2ColliderHandle *buffer,
9283 size_t capacity);
9284
9285#if defined(RAPIER_DIM3)
9290RAPIER_API R2Bool RAPIER_CALL r2RigidBody_GyroscopicForcesEnabled(struct R2RigidBodyHandle handle);
9291#endif
9292
9293#if defined(RAPIER_DIM3)
9298RAPIER_API
9299R2Status RAPIER_CALL r2RigidBody_SetGyroscopicForcesEnabled(struct R2RigidBodyHandle handle,
9300 R2Bool enabled);
9301#endif
9302
9308
9314
9320
9325RAPIER_API
9327 struct R2InteractionGroups value);
9328
9333RAPIER_API
9335 uint32_t value);
9336
9341RAPIER_API
9343 uint32_t value);
9344
9350
9355RAPIER_API
9357 R2Real value);
9358
9363RAPIER_API
9365 uint32_t value);
9366
9371RAPIER_API R2Status RAPIER_CALL r2Collider_SetActiveHooks(struct R2ColliderHandle handle, uint32_t value);
9372
9377RAPIER_API
9379 uint16_t value);
9380
9386
9391RAPIER_API
9393
9399
9405
9411RAPIER_API uint32_t RAPIER_CALL r2Collider_ActiveEvents(struct R2ColliderHandle handle);
9412
9418
9424
9430
9436
9442
9448
9454
9460
9465RAPIER_API
9467 const R2SharedShape *shape);
9468
9473RAPIER_API
9475 struct R2Pose value);
9476
9483
9490
9497
9502RAPIER_API
9504 struct R2Pose value);
9505
9511RAPIER_API
9513 struct R2Pose value,
9514 R2Bool wake_up);
9515
9520RAPIER_API
9522 struct R2Pose value);
9523
9529RAPIER_API
9531 struct R2Pose value,
9532 R2Bool wake_up);
9533
9538RAPIER_API
9540 struct R2Vector value);
9541
9547RAPIER_API
9549 struct R2Vector value,
9550 R2Bool wake_up);
9551
9556RAPIER_API
9558 struct R2Vector value);
9559
9565RAPIER_API
9567 struct R2Vector value,
9568 R2Bool wake_up);
9569
9575
9581RAPIER_API
9583 R2Bool value,
9584 R2Bool wake_up);
9585
9591
9597RAPIER_API
9599 R2Bool value,
9600 R2Bool wake_up);
9601
9606RAPIER_API
9608 struct R2SpringCoefficients value);
9609
9615RAPIER_API
9617 struct R2SpringCoefficients value,
9618 R2Bool wake_up);
9619
9624RAPIER_API R2Status RAPIER_CALL r2JointDesc_SetLockedAxes(struct R2JointDesc *desc, uint8_t value);
9625
9631RAPIER_API
9633 uint8_t value,
9634 R2Bool wake_up);
9635
9640RAPIER_API R2Status RAPIER_CALL r2JointDesc_SetLimitAxes(struct R2JointDesc *desc, uint8_t value);
9641
9647RAPIER_API
9649 uint8_t value,
9650 R2Bool wake_up);
9651
9656RAPIER_API R2Status RAPIER_CALL r2JointDesc_SetMotorAxes(struct R2JointDesc *desc, uint8_t value);
9657
9663RAPIER_API
9665 uint8_t value,
9666 R2Bool wake_up);
9667
9672RAPIER_API R2Status RAPIER_CALL r2JointDesc_SetCoupledAxes(struct R2JointDesc *desc, uint8_t value);
9673
9679RAPIER_API
9681 uint8_t value,
9682 R2Bool wake_up);
9683
9688RAPIER_API
9690 struct R2Vector value);
9691
9697RAPIER_API
9699 struct R2Vector value,
9700 R2Bool wake_up);
9701
9706RAPIER_API
9708 struct R2Vector value);
9709
9715RAPIER_API
9717 struct R2Vector value,
9718 R2Bool wake_up);
9719
9724RAPIER_API
9726 uint32_t joint_axis,
9727 R2Real min,
9728 R2Real max);
9729
9736RAPIER_API
9738 uint32_t joint_axis,
9739 R2Real min,
9740 R2Real max,
9741 R2Bool wake_up);
9742
9747RAPIER_API
9749 uint32_t joint_axis,
9750 R2Real target_position,
9751 R2Real target_velocity,
9752 R2Real stiffness,
9753 R2Real damping);
9754
9760RAPIER_API
9762 uint32_t joint_axis,
9763 R2Real target_position,
9764 R2Real target_velocity,
9765 R2Real stiffness,
9766 R2Real damping,
9767 R2Bool wake_up);
9768
9773RAPIER_API
9775 uint32_t joint_axis,
9776 R2Real max_force);
9777
9783RAPIER_API
9785 uint32_t joint_axis,
9786 R2Real max_force,
9787 R2Bool wake_up);
9788
9793RAPIER_API
9795 uint32_t joint_axis,
9796 uint32_t model);
9797
9803RAPIER_API
9805 uint32_t joint_axis,
9806 uint32_t model,
9807 R2Bool wake_up);
9808
9813RAPIER_API
9815 struct R2UserData value);
9816
9822RAPIER_API
9824 struct R2UserData value,
9825 R2Bool wake_up);
9826
9831RAPIER_API
9833 uint32_t joint_axis,
9834 R2Real target_position,
9835 R2Real stiffness,
9836 R2Real damping);
9837
9843RAPIER_API
9845 uint32_t joint_axis,
9846 R2Real target_position,
9847 R2Real stiffness,
9848 R2Real damping,
9849 R2Bool wake_up);
9850
9855RAPIER_API
9857 uint32_t joint_axis,
9858 R2Real target_velocity,
9859 R2Real factor);
9860
9866RAPIER_API
9868 uint32_t joint_axis,
9869 R2Real target_velocity,
9870 R2Real factor,
9871 R2Bool wake_up);
9872
9879
9885
9890RAPIER_API size_t RAPIER_CALL r2ImpulseJointCount(const struct R2World *world);
9891
9897RAPIER_API size_t RAPIER_CALL r2MultibodyJointCount(const struct R2World *world);
9898
9904
9911RAPIER_API
9913 const struct R2JointDesc *desc,
9914 R2Bool wake_up);
9915
9921
9928RAPIER_API
9930 R2SurfaceElementView indices);
9931
9938RAPIER_API
9940 struct R2VectorView points);
9941
9948RAPIER_API
9950 R2SurfaceElementView indices,
9951 R2Real voxel_size);
9952
9959
9960#if defined(RAPIER_DIM3)
9967RAPIER_API
9968R2SharedShape *RAPIER_CALL r2ConvexMeshSharedShape(struct R2VectorView vertices,
9969 struct R2TriangleView indices);
9970#endif
9971
9978RAPIER_API
9980 struct R2TriangleView indices);
9981
9988RAPIER_API
9990 struct R2EdgeView indices);
9991
9992#if defined(RAPIER_DIM2)
9999RAPIER_API
10001 struct R2EdgeView indices);
10002#endif
10003
10004#if defined(RAPIER_DIM2)
10012#endif
10013
10019RAPIER_API
10021 R2Real border_radius);
10022
10029RAPIER_API
10031 struct R2TriangleView indices,
10032 uint32_t flags);
10033
10038RAPIER_API struct R2World *RAPIER_CALL r2NewWorld(void);
10039
10045RAPIER_API R2Status RAPIER_CALL r2FreeWorld(struct R2World *world);
10046
10052RAPIER_API
10054 struct R2PidController *controller,
10055 R2Real dt,
10056 struct R2RigidBodyHandle body,
10057 struct R2Pose target_pose,
10058 struct R2Vector target_linvel,
10059 R2AngVector target_angvel);
10060
10066RAPIER_API
10068 const struct R2PdController *controller,
10069 struct R2RigidBodyHandle body,
10070 struct R2Pose target_pose,
10071 struct R2Vector target_linvel,
10072 R2AngVector target_angvel);
10073
10079RAPIER_API size_t RAPIER_CALL r2ReadRigidBodyCount(const struct R2ReadContext *context);
10080
10086RAPIER_API
10088 struct R2RigidBodyHandle *buffer,
10089 size_t capacity);
10090
10096RAPIER_API
10098 struct R2RigidBodyHandle handle);
10099
10105RAPIER_API size_t RAPIER_CALL r2ReadColliderCount(const struct R2ReadContext *context);
10106
10112RAPIER_API
10114 struct R2ColliderHandle *buffer,
10115 size_t capacity);
10116
10122RAPIER_API
10124 struct R2ColliderHandle handle);
10125
10132RAPIER_API
10134 struct R2ColliderHandle handle);
10135
10141RAPIER_API
10143 struct R2ColliderHandle handle);
10144
10150RAPIER_API
10152 struct R2RigidBodyHandle handle);
10153
10159RAPIER_API
10161 struct R2ColliderHandle handle);
10162
10168RAPIER_API
10170 struct R2ColliderHandle handle,
10171 uint32_t id);
10172
10178RAPIER_API
10180 struct R2RigidBodyHandle handle);
10181
10187RAPIER_API
10189 struct R2RigidBodyHandle handle);
10190
10196RAPIER_API
10198 struct R2RigidBodyHandle handle);
10199
10205RAPIER_API
10207 struct R2RigidBodyHandle handle);
10208
10214RAPIER_API
10216 struct R2RigidBodyHandle handle);
10217
10223RAPIER_API
10225 struct R2RigidBodyHandle handle);
10226
10232RAPIER_API
10234 struct R2RigidBodyHandle handle);
10235
10241RAPIER_API
10243 struct R2RigidBodyHandle handle);
10244
10250RAPIER_API
10252 struct R2RigidBodyHandle handle);
10253
10259RAPIER_API
10261 struct R2RigidBodyHandle handle);
10262
10268RAPIER_API
10270 struct R2RigidBodyHandle handle);
10271
10277RAPIER_API
10279 struct R2RigidBodyHandle handle);
10280
10286RAPIER_API
10288 struct R2RigidBodyHandle handle);
10289
10295RAPIER_API
10297 struct R2RigidBodyHandle handle);
10298
10304RAPIER_API
10306 struct R2RigidBodyHandle handle);
10307
10313RAPIER_API
10315 struct R2RigidBodyHandle handle);
10316
10322RAPIER_API
10324 struct R2RigidBodyHandle handle);
10325
10331RAPIER_API
10333 struct R2RigidBodyHandle handle);
10334
10340RAPIER_API
10342 struct R2RigidBodyHandle handle);
10343
10349RAPIER_API
10351 struct R2RigidBodyHandle handle);
10352
10358RAPIER_API
10360 struct R2RigidBodyHandle handle);
10361
10367RAPIER_API
10369 struct R2RigidBodyHandle handle,
10370 struct R2Vector point);
10371
10378RAPIER_API
10380 struct R2RigidBodyHandle handle,
10381 struct R2ColliderHandle *buffer,
10382 size_t capacity);
10383
10384#if defined(RAPIER_DIM3)
10390RAPIER_API
10391R2Bool RAPIER_CALL r2ReadRigidBody_GyroscopicForcesEnabled(const struct R2ReadContext *context,
10392 struct R2RigidBodyHandle handle);
10393#endif
10394
10400RAPIER_API
10402 struct R2ColliderHandle handle);
10403
10409RAPIER_API
10411 struct R2ColliderHandle handle);
10412
10418RAPIER_API
10420 struct R2ColliderHandle handle);
10421
10427RAPIER_API
10429 struct R2ColliderHandle handle);
10430
10436RAPIER_API
10438 struct R2ColliderHandle handle);
10439
10444RAPIER_API
10446 struct R2ColliderHandle handle);
10447
10453RAPIER_API
10455 struct R2ColliderHandle handle);
10456
10462RAPIER_API
10464 struct R2ColliderHandle handle);
10465
10471RAPIER_API
10473 struct R2ColliderHandle handle);
10474
10480RAPIER_API
10482 struct R2ColliderHandle handle);
10483
10489RAPIER_API
10491 struct R2ColliderHandle handle);
10492
10498RAPIER_API
10500 struct R2ColliderHandle handle);
10501
10508RAPIER_API
10510 struct R2ColliderHandle handle);
10511
10517RAPIER_API
10519 struct R2RigidBodyHandle handle);
10520
10526RAPIER_API
10528 struct R2ColliderHandle handle);
10529
10535RAPIER_API
10537 struct R2RigidBodyHandle handle);
10538
10544RAPIER_API
10546 struct R2RigidBodyHandle handle);
10547
10553RAPIER_API
10555 struct R2RigidBodyHandle handle);
10556
10562RAPIER_API
10564 struct R2RigidBodyHandle handle);
10565
10571RAPIER_API
10573 struct R2RigidBodyHandle handle);
10574
10580RAPIER_API
10582 struct R2RigidBodyHandle handle);
10583
10589RAPIER_API
10591 struct R2RigidBodyHandle handle);
10592
10598RAPIER_API
10600 struct R2ColliderHandle handle);
10601
10607RAPIER_API
10609 struct R2ColliderHandle handle);
10610
10616RAPIER_API
10618 struct R2ColliderHandle handle);
10619
10625RAPIER_API
10627 struct R2ColliderHandle handle);
10628
10634RAPIER_API
10636 struct R2ColliderHandle handle);
10637
10643RAPIER_API
10645 struct R2ColliderHandle handle);
10646
10653RAPIER_API
10655 const struct R2RigidBodyHandle *handles,
10656 size_t handle_count,
10657 struct R2RigidBodyState *states,
10658 size_t capacity);
10659
10665RAPIER_API
10667 struct R2ColliderHandle handle);
10668
10674RAPIER_API
10676 struct R2ColliderHandle handle);
10677
10683RAPIER_API
10685 struct R2ColliderHandle handle);
10686
10692RAPIER_API
10694 struct R2ColliderHandle handle);
10695
10702RAPIER_API
10704 struct R2ColliderHandle handle);
10705
10711RAPIER_API
10713 struct R2RigidBodyHandle handle);
10714
10720RAPIER_API
10722 struct R2RigidBodyHandle handle);
10723
10729RAPIER_API
10731 struct R2RigidBodyHandle handle);
10732
10738RAPIER_API
10740 struct R2RigidBodyHandle handle);
10741
10751RAPIER_API
10753 const struct R2QueryOptions *query_options,
10754 struct R2Vector origin,
10755 struct R2Vector direction,
10756 R2Real max_toi,
10757 R2Bool solid,
10758 struct R2RayHit *buffer,
10759 size_t capacity);
10760
10768RAPIER_API
10770 const struct R2QueryOptions *query_options,
10771 struct R2Pose pose,
10772 struct R2Vector velocity,
10773 const R2SharedShape *shape,
10774 struct R2ShapeCastOptions options);
10775
10783RAPIER_API
10785 const struct R2QueryOptions *query_options,
10786 struct R2Vector point,
10787 R2Real max_distance,
10788 R2Bool solid);
10789
10794RAPIER_API
10796 R2Real time);
10797
10808RAPIER_API
10810 const struct R2QueryOptions *query_options,
10811 const struct R2NonlinearRigidMotion *motion,
10812 const R2SharedShape *shape,
10813 R2Real start_time,
10814 R2Real end_time,
10815 R2Bool stop_at_penetration);
10816
10823RAPIER_API
10825 struct R2ColliderHandle collider2);
10826
10832RAPIER_API
10835
10841RAPIER_API
10843 struct R2ColliderHandle collider2);
10844
10851RAPIER_API
10853 struct R2ContactPair *buffer,
10854 size_t capacity);
10855
10862RAPIER_API
10864 struct R2IntersectionPair *buffer,
10865 size_t capacity);
10866
10874RAPIER_API
10876 struct R2ColliderHandle collider2,
10877 struct R2ContactManifold *buffer,
10878 size_t capacity);
10879
10887RAPIER_API
10889 struct R2ColliderHandle collider2,
10890 size_t manifold_index,
10891 struct R2SolverContact *buffer,
10892 size_t capacity);
10893
10899RAPIER_API
10901
10906RAPIER_API
10908
10913RAPIER_API
10915 size_t index);
10916
10922RAPIER_API
10924 size_t index,
10925 const struct R2SolverContact *contact);
10926
10931RAPIER_API
10933 size_t index);
10934
10940RAPIER_API
10942 const struct R2EventCallbacks *callbacks);
10943
10949
10956RAPIER_API
10957size_t RAPIER_CALL r2DebugRenderWithStyle(const struct R2World *world,
10958 uint32_t mode,
10959 const struct R2DebugRenderStyle *style,
10960 struct R2DebugLine *buffer,
10961 size_t capacity);
10962
10963#ifdef __cplusplus
10964} // extern "C"
10965#endif // __cplusplus
10966
10967#else /* RAPIER_DIM3 */
10968
10969#if defined(RAPIER_DIM3)
10975#define R3_FRICTION_MODEL_SIMPLIFIED 0
10976#endif
10977
10978#if defined(RAPIER_DIM3)
10983#define R3_FRICTION_MODEL_COULOMB 1
10984#endif
10985
10986#if defined(RAPIER_DIM2)
10991#define R3_JOINT_DOF_COUNT 3
10992#endif
10993
10994#if defined(RAPIER_DIM3)
10999#define R3_JOINT_DOF_COUNT 6
11000#endif
11001
11006#define R3_SOFT_DESC_PARTICLES 0
11007
11012#define R3_SOFT_DESC_ROPE 1
11013
11018#define R3_SOFT_DESC_GRID 2
11019
11024#define R3_SOFT_DESC_CLOTH 3
11025
11030#define R3_SOFT_DESC_CUBOID 4
11031
11036#define R3_SOFT_DESC_SURFACE 5
11037
11042#define R3_SOFT_DESC_DISK 6
11043
11048#define R3_SOFT_DESC_SPHERE 7
11049
11054#define R3_SOFT_DESC_CLOTH_TUBE 8
11055
11060#define R3_SOFT_DESC_VOLUMETRIC 9
11061
11062#if defined(RAPIER_DIM2)
11067#define R3_SOFT_DESC_POLYGON 10
11068#endif
11069
11070#if defined(RAPIER_DIM2)
11075#define R3_SOFT_DESC_TRIMESH 11
11076#endif
11077
11078#if defined(RAPIER_DIM3)
11083#define R3_SOFT_DESC_CLOTH_ANISOTROPIC 12
11084#endif
11085
11090#define R3_SOFT_BINDING_SKINNED 0
11091
11096#define R3_SOFT_BINDING_DIRECT 1
11097
11102#define R3_SOFT_BINDING_DIRECT_BY_POSITION 2
11103
11104#if defined(RAPIER_DIM2)
11109#define R3_POLYLINE_ORIENTED 1
11110#endif
11111
11116#define R3_POLYLINE_DEFORMABLE 2
11117
11122#define R3_SHAPE_DESC_BALL 0
11123
11128#define R3_SHAPE_DESC_CUBOID 1
11129
11134#define R3_SHAPE_DESC_ROUND_CUBOID 2
11135
11140#define R3_SHAPE_DESC_CAPSULE 3
11141
11146#define R3_SHAPE_DESC_SEGMENT 4
11147
11152#define R3_SHAPE_DESC_TRIANGLE 5
11153
11158#define R3_SHAPE_DESC_HALFSPACE 6
11159
11164#define R3_SHAPE_DESC_CONVEX_HULL 7
11165
11170#define R3_SHAPE_DESC_TRIMESH 8
11171
11176#define R3_SHAPE_DESC_POLYLINE 9
11177
11182#define R3_SHAPE_DESC_SHARED 10
11183
11188#define R3_SHAPE_DESC_HEIGHTFIELD 11
11189
11194#define R3_SHAPE_DESC_CYLINDER 12
11195
11200#define R3_SHAPE_DESC_CONE 13
11201
11206#define R3_SHAPE_DESC_COMPOUND 14
11207
11212#define R3_SHAPE_DESC_ROUND_CYLINDER 15
11213
11218#define R3_SHAPE_DESC_ROUND_CONE 16
11219
11224#define R3_MASS_DENSITY 0
11225
11230#define R3_MASS_TOTAL 1
11231
11236#define R3_MASS_PROPERTIES 2
11237
11242#define R3_ABI_VERSION 1
11243
11248#define R3_DYNAMIC 0
11249
11254#define R3_FIXED 1
11255
11260#define R3_KINEMATIC_POSITION_BASED 2
11261
11266#define R3_KINEMATIC_VELOCITY_BASED 3
11267
11272#define R3_COLLISION_EVENTS 1
11273
11278#define R3_CONTACT_FORCE_EVENTS 2
11279
11284#define R3_COMBINE_AVERAGE 0
11285
11290#define R3_COMBINE_MIN 1
11291
11296#define R3_COMBINE_MULTIPLY 2
11297
11302#define R3_COMBINE_MAX 3
11303
11308#define R3_COMBINE_CLAMPED_SUM 4
11309
11314#define R3_COMBINE_GEOMETRIC_MEAN 5
11315
11320#define R3_COLLISION_TYPES_DYNAMIC_DYNAMIC 1
11321
11326#define R3_COLLISION_TYPES_DYNAMIC_KINEMATIC 12
11327
11332#define R3_COLLISION_TYPES_DYNAMIC_FIXED 2
11333
11338#define R3_COLLISION_TYPES_KINEMATIC_KINEMATIC 52224
11339
11344#define R3_COLLISION_TYPES_KINEMATIC_FIXED 8704
11345
11350#define R3_COLLISION_TYPES_FIXED_FIXED 32
11351
11356#define R3_COLLISION_TYPES_DEFAULT 15
11357
11362#define R3_FILTER_CONTACT_PAIRS 1
11363
11368#define R3_FILTER_INTERSECTION_PAIR 2
11369
11374#define R3_MODIFY_SOLVER_CONTACTS 4
11375
11380#define R3_QUERY_EXCLUDE_FIXED 1
11381
11386#define R3_QUERY_EXCLUDE_KINEMATIC 2
11387
11392#define R3_QUERY_EXCLUDE_DYNAMIC 4
11393
11398#define R3_QUERY_EXCLUDE_SENSORS 8
11399
11404#define R3_QUERY_EXCLUDE_SOLIDS 16
11405
11410#define R3_QUERY_ONLY_DYNAMIC 3
11411
11416#define R3_QUERY_ONLY_KINEMATIC 5
11417
11422#define R3_QUERY_ONLY_FIXED 6
11423
11428#define R3_DEBUG_COLLIDER_SHAPES 1
11429
11434#define R3_DEBUG_RIGID_BODY_AXES 2
11435
11440#define R3_DEBUG_MULTIBODY_JOINTS 4
11441
11446#define R3_DEBUG_IMPULSE_JOINTS 8
11447
11452#define R3_DEBUG_SOLVER_CONTACTS 16
11453
11458#define R3_DEBUG_CONTACTS 32
11459
11464#define R3_DEBUG_COLLIDER_AABBS 64
11465
11470#define R3_DEBUG_SOFT_BODIES 128
11471
11476#define R3_DEBUG_PSEUDO_NORMALS 256
11477
11482#define R3_DEBUG_SOFT_VOLUME_CONTACTS 512
11483
11488#define R3_DEBUG_SOFT_BODY_STRESS 1024
11489
11494#define R3_GROUPS_AND 0
11495
11500#define R3_GROUPS_OR 1
11501
11506#define R3_MOTOR_ACCELERATION_BASED 0
11507
11512#define R3_MOTOR_FORCE_BASED 1
11513
11518#define R3_SOFT_CELL_VOLUME 0
11519
11524#define R3_SOFT_CELL_COROTATIONAL 1
11525
11530#define R3_SOFT_CELL_NEO_HOOKEAN 2
11531
11536#define R3_SOFT_SOLVER_CONSTRAINTS 0
11537
11542#define R3_SOFT_SOLVER_FEM 1
11543
11548#define R3_SOFT_EDGE_PLASTIC_FLOW_BOTH 0
11549
11554#define R3_SOFT_EDGE_PLASTIC_FLOW_COMPRESSION 1
11555
11560#define R3_SOFT_EDGE_PLASTIC_FLOW_TENSION 2
11561
11566#define R3_SOFT_PATCH_CONSTRAINTS_KEEP 0
11567
11572#define R3_SOFT_PATCH_CONSTRAINTS_STAND_DOWN 1
11573
11578#define R3_SOFT_PATCH_CONSTRAINTS_ALONG_NORMAL 2
11579
11584#define R3_AXIS_LIN_X 0
11585
11590#define R3_AXIS_LIN_Y 1
11591
11596#define R3_LOCK_TRANSLATION_X 1
11597
11602#define R3_LOCK_TRANSLATION_Y 2
11603
11608#define R3_LOCK_TRANSLATION_Z 4
11609
11614#define R3_LOCK_ROTATION_X 8
11615
11620#define R3_LOCK_ROTATION_Y 16
11621
11626#define R3_LOCK_ROTATION_Z 32
11627
11628#if defined(RAPIER_DIM2)
11633#define R3_AXIS_ANG_X 2
11634#endif
11635
11636#if defined(RAPIER_DIM3)
11641#define R3_AXIS_ANG_X 3
11642#endif
11643
11644#if defined(RAPIER_DIM2)
11649#define R3_JOINT_FIXED_AXES 7
11650#endif
11651
11652#if defined(RAPIER_DIM3)
11657#define R3_JOINT_FIXED_AXES 63
11658#endif
11659
11660#if defined(RAPIER_DIM2)
11665#define R3_JOINT_REVOLUTE_AXES 3
11666#endif
11667
11668#if defined(RAPIER_DIM3)
11673#define R3_JOINT_REVOLUTE_AXES 55
11674#endif
11675
11676#if defined(RAPIER_DIM2)
11681#define R3_JOINT_PRISMATIC_AXES 6
11682#endif
11683
11684#if defined(RAPIER_DIM3)
11689#define R3_JOINT_PRISMATIC_AXES 62
11690#endif
11691
11692#if defined(RAPIER_DIM3)
11697#define R3_AXIS_LIN_Z 2
11698#endif
11699
11700#if defined(RAPIER_DIM3)
11705#define R3_AXIS_ANG_Y 4
11706#endif
11707
11708#if defined(RAPIER_DIM3)
11713#define R3_AXIS_ANG_Z 5
11714#endif
11715
11716#if defined(RAPIER_DIM3)
11721#define R3_JOINT_SPHERICAL_AXES 7
11722#endif
11723
11728#define R3_SOFT_FRAME 4
11729
11734#define R3_SHAPE_CAST_OUT_OF_ITERATIONS 0
11735
11740#define R3_SHAPE_CAST_CONVERGED 1
11741
11746#define R3_SHAPE_CAST_FAILED 2
11747
11752#define R3_SHAPE_CAST_PENETRATING 3
11753
11758#define R3_FEATURE_UNKNOWN 0
11759
11764#define R3_FEATURE_VERTEX 1
11765
11770#define R3_FEATURE_EDGE 2
11771
11776#define R3_FEATURE_FACE 3
11777
11782#define R3_MULTIBODY_JOINTS_ARE_KINEMATIC 1
11783
11788#define R3_MULTIBODY_DISABLE_SELF_CONTACTS 2
11789
11795#define R3_MULTIBODY_SKIP_LOOP_CLOSURES 4
11796
11801#define R3_MULTIBODY_SKIP_JOINT_MOTORS 8
11802
11807#define R3_MULTIBODY_SKIP_JOINT_LIMITS 16
11808
11813#define R3_MULTIBODY_SKIP_JOINT_SPRINGS 32
11814
11819#define R3_TRIMESH_HALF_EDGE_TOPOLOGY 1
11820
11825#define R3_TRIMESH_CONNECTED_COMPONENTS 2
11826
11831#define R3_TRIMESH_DELETE_BAD_TOPOLOGY_TRIANGLES 4
11832
11837#define R3_TRIMESH_ORIENTED 8
11838
11843#define R3_TRIMESH_MERGE_DUPLICATE_VERTICES 16
11844
11849#define R3_TRIMESH_DELETE_DEGENERATE_TRIANGLES 32
11850
11855#define R3_TRIMESH_DELETE_DUPLICATE_TRIANGLES 64
11856
11861#define R3_TRIMESH_FIX_INTERNAL_EDGES 144
11862
11867#define R3_TRIMESH_DEFORMABLE 256
11868
11873#define R3_TRIMESH_FIX_INTERNAL_EDGES_TWO_SIDED 656
11874
11879#define R3_HEIGHTFIELD_FIX_INTERNAL_EDGES 1
11880
11885#define R3_AXES_MASK_LIN_X 1
11886
11891#define R3_AXES_MASK_LIN_Y 2
11892
11893#if defined(RAPIER_DIM3)
11898#define R3_AXES_MASK_LIN_Z 4
11899#endif
11900
11901#if defined(RAPIER_DIM3)
11906#define R3_AXES_MASK_ANG_X 8
11907#endif
11908
11909#if defined(RAPIER_DIM3)
11914#define R3_AXES_MASK_ANG_Y 16
11915#endif
11916
11921#define R3_AXES_MASK_ANG_Z 32
11922
11927#define R3_ABI_FEATURE_FEM 1
11928
11933#define R3_ABI_FEATURE_ROBOTICS 2
11934
11935#if (defined(RAPIER_FEM) && defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
11940#define R3_ABI_FEATURES 3
11941#endif
11942
11943#if (defined(RAPIER_FEM) && !(defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32)))
11948#define R3_ABI_FEATURES 1
11949#endif
11950
11951#if (!defined(RAPIER_FEM) && defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
11956#define R3_ABI_FEATURES 2
11957#endif
11958
11959#if (!defined(RAPIER_FEM) && !(defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32)))
11964#define R3_ABI_FEATURES 0
11965#endif
11966
11967#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
11972#define R3_MESH_CONVERTER_TRIMESH 0
11973#endif
11974
11975#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
11980#define R3_MESH_CONVERTER_OBB 1
11981#endif
11982
11983#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
11988#define R3_MESH_CONVERTER_AABB 2
11989#endif
11990
11991#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
11996#define R3_MESH_CONVERTER_CONVEX_HULL 3
11997#endif
11998
11999#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
12004#define R3_MESH_CONVERTER_CONVEX_DECOMPOSITION 4
12005#endif
12006
12011#define R3_COLLISION_EVENT_SENSOR 1
12012
12017#define R3_COLLISION_EVENT_REMOVED 2
12018
12023typedef struct R3Bytes R3Bytes;
12024
12029typedef struct R3ContactModificationContext R3ContactModificationContext;
12030
12031#if defined(RAPIER_DIM3)
12036typedef struct R3DynamicRayCastVehicleController R3DynamicRayCastVehicleController;
12037#endif
12038
12045typedef struct R3EventCollector R3EventCollector;
12046
12053typedef struct R3KinematicCharacterController R3KinematicCharacterController;
12054
12055#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
12061typedef struct R3LoadedMeshes R3LoadedMeshes;
12062#endif
12063
12064#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
12070typedef struct R3MjcfContactHooks R3MjcfContactHooks;
12071#endif
12072
12073#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
12078typedef struct R3MjcfRobot R3MjcfRobot;
12079#endif
12080
12081#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
12087typedef struct R3MjcfRobotHandles R3MjcfRobotHandles;
12088#endif
12089
12095typedef struct R3PidController R3PidController;
12096
12102typedef struct R3ReadContext R3ReadContext;
12103
12110typedef struct R3ShapeMesh R3ShapeMesh;
12111
12116typedef struct R3SoftBodyTearEvent R3SoftBodyTearEvent;
12117
12118#if defined(RAPIER_DIM3)
12123typedef struct R3TriMeshData R3TriMeshData;
12124#endif
12125
12126#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
12132typedef struct R3UrdfRobot R3UrdfRobot;
12133#endif
12134
12135#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
12141typedef struct R3UrdfRobotHandles R3UrdfRobotHandles;
12142#endif
12143
12150typedef struct R3World R3World;
12151
12152#if defined(RAPIER_F32)
12157typedef float R3Real;
12158#endif
12159
12160#if defined(RAPIER_F64)
12165typedef double R3Real;
12166#endif
12167
12172typedef struct R3SpringCoefficients {
12176 R3Real natural_frequency;
12180 R3Real damping_ratio;
12181} R3SpringCoefficients;
12182
12187typedef uint32_t R3Bool;
12188
12193typedef struct R3OptionalReal {
12197 R3Bool enabled;
12201 R3Real value;
12202} R3OptionalReal;
12203
12208typedef struct R3OptionalU32 {
12212 R3Bool enabled;
12216 uint32_t value;
12217} R3OptionalU32;
12218
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;
12263 R3Real plasticMax;
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;
12309
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;
12425
12426#if defined(RAPIER_FEM)
12431typedef struct R3SoftFemParameters {
12435 R3Real linearTolerance;
12439 size_t maxLinearIterations;
12443 size_t maxDenseDofs;
12444} R3SoftFemParameters;
12445#endif
12446
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;
12473#endif
12474} R3SoftBodiesSettings;
12475
12480typedef struct R3IntegrationParameters {
12484 R3Real dt;
12488 R3Real minCcdDt;
12492 struct R3SpringCoefficients contactSoftness;
12496 struct R3SpringCoefficients staticContactSoftness;
12500 R3Real warmstartCoefficient;
12504 R3Real lengthUnit;
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;
12566#endif
12567} R3IntegrationParameters;
12568
12573typedef uint32_t R3Status;
12574
12579typedef struct R3Vector {
12583 R3Real x;
12587 R3Real y;
12588#if defined(RAPIER_DIM3)
12592 R3Real z;
12593#endif
12594} R3Vector;
12595
12600typedef struct R3Rotation {
12601#if defined(RAPIER_DIM2)
12605 R3Real angle;
12606#endif
12607#if defined(RAPIER_DIM3)
12611 R3Real x;
12612#endif
12613#if defined(RAPIER_DIM3)
12617 R3Real y;
12618#endif
12619#if defined(RAPIER_DIM3)
12623 R3Real z;
12624#endif
12625#if defined(RAPIER_DIM3)
12629 R3Real w;
12630#endif
12631} R3Rotation;
12632
12638typedef struct R3Pose {
12642 struct R3Vector translation;
12646 struct R3Rotation rotation;
12647} R3Pose;
12648
12653typedef struct R3JointLimits {
12657 R3Real min;
12661 R3Real max;
12662} R3JointLimits;
12663
12668typedef struct R3JointMotor {
12672 R3Real targetVel;
12676 R3Real targetPos;
12680 R3Real stiffness;
12684 R3Real damping;
12688 R3Real maxForce;
12692 uint32_t model;
12693} R3JointMotor;
12694
12699typedef struct R3UserData {
12703 uint64_t low;
12707 uint64_t high;
12708} R3UserData;
12709
12715typedef struct R3JointDesc {
12719 struct R3Pose localFrame1;
12723 struct R3Pose localFrame2;
12727 uint8_t lockedAxes;
12731 uint8_t limitAxes;
12735 uint8_t motorAxes;
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;
12759 R3Bool enabled;
12763 struct R3UserData userData;
12764} R3JointDesc;
12765
12772typedef struct R3ImpulseJointHandle {
12776 struct R3World *world;
12780 uint32_t index;
12784 uint32_t generation;
12785} R3ImpulseJointHandle;
12786
12793typedef struct R3RigidBodyHandle {
12797 struct R3World *world;
12801 uint32_t index;
12805 uint32_t generation;
12806} R3RigidBodyHandle;
12807
12814typedef struct R3MultibodyJointHandle {
12818 struct R3World *world;
12822 uint32_t index;
12826 uint32_t generation;
12827} R3MultibodyJointHandle;
12828
12833typedef struct R3VolumeMeshParameters {
12837 R3Real cell_size;
12838#if defined(RAPIER_DIM2)
12842 R3Real min_angle;
12843#endif
12844#if defined(RAPIER_DIM3)
12848 uint32_t enclosure;
12849#endif
12850#if defined(RAPIER_DIM3)
12854 uint32_t cover_smoothing;
12855#endif
12856#if defined(RAPIER_DIM3)
12860 R3Real cover_guard;
12861#endif
12862#if defined(RAPIER_DIM3)
12866 uint32_t cover_subdivisions;
12867#endif
12868} R3VolumeMeshParameters;
12869
12877typedef struct R3VectorView {
12881 const struct R3Vector *data;
12885 size_t count;
12886} R3VectorView;
12887
12895typedef struct R3RealView {
12899 const R3Real *data;
12903 size_t count;
12904} R3RealView;
12905
12913typedef struct R3IndexView {
12917 const uint32_t *data;
12921 size_t count;
12922} R3IndexView;
12923
12928typedef struct R3Edge {
12932 uint32_t a;
12936 uint32_t b;
12937} R3Edge;
12938
12946typedef struct R3EdgeView {
12950 const struct R3Edge *data;
12954 size_t count;
12955} R3EdgeView;
12956
12961typedef struct R3SoftEdgeSoftness {
12965 uint32_t edge;
12969 struct R3SpringCoefficients softness;
12970} R3SoftEdgeSoftness;
12971
12976typedef struct R3SoftEdgeSoftnessView {
12980 const struct R3SoftEdgeSoftness *data;
12984 size_t count;
12985} R3SoftEdgeSoftnessView;
12986
12991typedef struct R3SoftEdgeTear {
12995 uint32_t edge;
12999 R3Real resistance;
13000} R3SoftEdgeTear;
13001
13006typedef struct R3SoftEdgeTearView {
13010 const struct R3SoftEdgeTear *data;
13014 size_t count;
13015} R3SoftEdgeTearView;
13016
13021typedef struct R3Triangle {
13025 uint32_t a;
13029 uint32_t b;
13033 uint32_t c;
13034} R3Triangle;
13035
13043typedef struct R3TriangleView {
13047 const struct R3Triangle *data;
13051 size_t count;
13052} R3TriangleView;
13053
13058typedef struct R3Tetrahedron {
13062 uint32_t a;
13066 uint32_t b;
13070 uint32_t c;
13074 uint32_t d;
13075} R3Tetrahedron;
13076
13084typedef struct R3TetrahedronView {
13088 const struct R3Tetrahedron *data;
13092 size_t count;
13093} R3TetrahedronView;
13094
13095#if defined(RAPIER_DIM2)
13100typedef struct R3TriangleView R3CellView;
13101#endif
13102
13103#if defined(RAPIER_DIM3)
13108typedef struct R3TetrahedronView R3CellView;
13109#endif
13110
13111#if defined(RAPIER_DIM2)
13116typedef struct R3EdgeView R3SurfaceElementView;
13117#endif
13118
13119#if defined(RAPIER_DIM3)
13124typedef struct R3TriangleView R3SurfaceElementView;
13125#endif
13126
13131typedef struct R3Dihedral {
13135 uint32_t a;
13139 uint32_t b;
13143 uint32_t c;
13147 uint32_t d;
13148} R3Dihedral;
13149
13157typedef struct R3DihedralView {
13161 const struct R3Dihedral *data;
13165 size_t count;
13166} R3DihedralView;
13167
13174typedef struct R3SoftBodyDescView {
13178 const struct R3SoftBodyDesc *data;
13182 size_t count;
13183} R3SoftBodyDescView;
13184
13189typedef struct R3OptionalBool {
13193 R3Bool enabled;
13197 R3Bool value;
13198} R3OptionalBool;
13199
13204typedef struct R3SharedShape R3SharedShape;
13205
13206
13211typedef struct R3CompoundShapeView {
13215 const struct R3CompoundShapeDesc *data;
13219 size_t count;
13220} R3CompoundShapeView;
13221
13230typedef struct R3ShapeDesc {
13234 uint32_t kind;
13238 struct R3Vector a;
13242 struct R3Vector b;
13246 struct R3Vector c;
13250 R3Real radius;
13254 R3Real halfHeight;
13258 R3Real borderRadius;
13262 struct R3VectorView vertices;
13266 struct R3TriangleView triangles;
13270 struct R3EdgeView edges;
13274 uint32_t flags;
13278 struct R3RealView heights;
13282 size_t rows;
13286 size_t columns;
13290 struct R3Vector scale;
13294 const R3SharedShape *sharedShape;
13298 struct R3CompoundShapeView children;
13299} R3ShapeDesc;
13300
13305typedef struct R3CompoundShapeDesc {
13309 struct R3Pose pose;
13313 struct R3ShapeDesc shape;
13314} R3CompoundShapeDesc;
13315
13316
13317#if defined(RAPIER_DIM2)
13322typedef R3Real R3AngVector;
13323#endif
13324
13325#if defined(RAPIER_DIM3)
13330typedef struct R3Vector R3AngVector;
13331#endif
13332
13338typedef struct R3MassProperties {
13342 struct R3Vector local_com;
13346 R3Real mass;
13350 R3AngVector principal_inertia;
13351#if defined(RAPIER_DIM3)
13355 struct R3Rotation principal_inertia_local_frame;
13356#endif
13357} R3MassProperties;
13358
13363typedef struct R3InteractionGroups {
13367 uint32_t memberships;
13371 uint32_t filter;
13375 uint32_t test_mode;
13376} R3InteractionGroups;
13377
13382typedef struct R3ColliderDesc {
13386 struct R3ShapeDesc shape;
13390 struct R3Pose position;
13394 uint32_t massMode;
13398 R3Real density;
13402 R3Real mass;
13406 struct R3MassProperties massProperties;
13410 R3Real friction;
13414 R3Real restitution;
13418 uint32_t frictionCombineRule;
13422 uint32_t restitutionCombineRule;
13426 R3Bool isSensor;
13430 R3Bool enabled;
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;
13463} R3ColliderDesc;
13464
13475typedef struct R3SoftBodyDesc {
13479 uint32_t kind;
13483 struct R3Vector a;
13487 struct R3Vector b;
13491 struct R3Vector du;
13495 struct R3Vector dv;
13496#if defined(RAPIER_DIM3)
13500 struct R3SpringCoefficients warpSoftness;
13501#endif
13502#if defined(RAPIER_DIM3)
13506 struct R3SpringCoefficients weftSoftness;
13507#endif
13508#if defined(RAPIER_DIM3)
13512 struct R3SpringCoefficients shearSoftness;
13513#endif
13517 size_t nx;
13521 size_t ny;
13525 size_t nz;
13529 R3Real radius;
13533 R3Real radiusEnd;
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;
13581 R3CellView cells;
13585 R3SurfaceElementView surface;
13586#if defined(RAPIER_DIM3)
13590 struct R3DihedralView dihedrals;
13591#endif
13592#if defined(RAPIER_DIM3)
13596 struct R3EdgeView wire;
13597#endif
13601 struct R3VectorView skinVertices;
13605 R3SurfaceElementView skinIndices;
13612 struct R3SoftBodyDescView appended;
13617 struct R3EdgeView addedEdges;
13621 struct R3SoftBodyMaterial material;
13625 uint32_t cellModel;
13629 uint32_t solver;
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;
13690 R3Bool canSleep;
13694 int8_t dominanceGroup;
13698 struct R3UserData userData;
13699} R3SoftBodyDesc;
13700
13707typedef struct R3SoftBodyHandle {
13711 struct R3World *world;
13715 uint32_t index;
13719 uint32_t generation;
13720} R3SoftBodyHandle;
13721
13726typedef struct R3SoftMeshBindingDesc {
13730 uint32_t kind;
13734 struct R3IndexView particles;
13738 R3Real epsilon;
13742 R3Bool selfContacts;
13743} R3SoftMeshBindingDesc;
13744
13751typedef struct R3ColliderHandle {
13755 struct R3World *world;
13759 uint32_t index;
13763 uint32_t generation;
13764} R3ColliderHandle;
13765
13770typedef struct R3QueryFilter {
13774 uint32_t flags;
13778 R3Bool use_groups;
13782 struct R3InteractionGroups groups;
13786 struct R3ColliderHandle exclude_collider;
13790 struct R3RigidBodyHandle exclude_rigid_body;
13791} R3QueryFilter;
13792
13798typedef R3Bool (RAPIER_CALL *R3QueryPredicate)(void *user_data,
13799 const struct R3ReadContext *read,
13800 struct R3ColliderHandle handle);
13801
13806typedef struct R3QueryOptions {
13810 struct R3QueryFilter filter;
13814 R3QueryPredicate predicate;
13818 void *userData;
13819} R3QueryOptions;
13820
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;
13847} R3RayHit;
13848
13853typedef struct R3PointProjection {
13857 struct R3ColliderHandle collider;
13861 struct R3Vector point;
13865 R3Bool is_inside;
13866} R3PointProjection;
13867
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;
13901 uint32_t status;
13902} R3ShapeCastHit;
13903
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;
13926
13931typedef struct R3Aabb {
13935 struct R3Vector mins;
13939 struct R3Vector maxs;
13940} R3Aabb;
13941
13946typedef struct R3RayToi {
13950 struct R3ColliderHandle collider;
13954 R3Real toi;
13958 R3Bool found;
13959} R3RayToi;
13960
13965typedef struct R3OptionalRayHit {
13969 struct R3RayHit hit;
13973 R3Bool found;
13974} R3OptionalRayHit;
13975
13982typedef struct R3RigidBodyDesc {
13986 struct R3Pose position;
13990 struct R3Vector linvel;
13994 R3AngVector angvel;
13998 uint32_t bodyType;
14002 R3Real gravityScale;
14006 R3Real linearDamping;
14010 R3Real angularDamping;
14014 R3Real additionalMass;
14018 R3Bool useAdditionalMassProperties;
14022 struct R3MassProperties additionalMassProperties;
14026 uint8_t lockedAxes;
14030 R3Bool canSleep;
14034 R3Bool sleeping;
14038 R3Bool ccdEnabled;
14042 R3Real softCcdPrediction;
14046 R3Bool allowFastRotation;
14050 R3Bool enabled;
14054 int8_t dominanceGroup;
14058 size_t additionalSolverIterations;
14062 size_t additionalPgsIterations;
14066 R3Bool gyroscopicForcesEnabled;
14070 struct R3UserData userData;
14071} R3RigidBodyDesc;
14072
14077typedef struct R3PodLayout {
14081 size_t rigidBodyDesc;
14085 size_t colliderDesc;
14089 size_t shapeDesc;
14093 size_t jointDesc;
14097 size_t softBodyMaterial;
14101 size_t integrationParameters;
14105 size_t softBodyDesc;
14109 size_t softMeshBindingDesc;
14113 size_t queryOptions;
14117 size_t urdfLoaderOptions;
14121 size_t mjcfLoaderOptions;
14122} R3PodLayout;
14123
14129typedef struct R3CharacterLength {
14134 R3Real value;
14138 R3Bool relative;
14139} R3CharacterLength;
14140
14145typedef struct R3CharacterAutostep {
14149 R3Bool enabled;
14153 struct R3CharacterLength max_height;
14157 struct R3CharacterLength min_width;
14161 R3Bool include_dynamic_bodies;
14162} R3CharacterAutostep;
14163
14168typedef struct R3CharacterMovement {
14172 struct R3Vector translation;
14176 R3Bool grounded;
14180 R3Bool is_sliding_down_slope;
14181} R3CharacterMovement;
14182
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;
14209
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;
14239} R3PidGains;
14240
14246typedef struct R3PdController {
14250 struct R3Vector lin_kp;
14254 struct R3Vector lin_kd;
14258 R3AngVector ang_kp;
14262 R3AngVector ang_kd;
14266 uint32_t axes;
14267} R3PdController;
14268
14273typedef struct R3VelocityCorrection {
14277 struct R3Vector linear;
14281 R3AngVector angularVelocity;
14282} R3VelocityCorrection;
14283
14288typedef struct R3CharacterControllerSettings {
14292 R3Bool slide;
14296 R3Real max_slope_climb_angle;
14300 R3Real min_slope_slide_angle;
14304 R3Bool snap_to_ground;
14308 struct R3CharacterLength snap_distance;
14309} R3CharacterControllerSettings;
14310
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;
14345} R3WheelTuning;
14346#endif
14347
14348#if defined(RAPIER_DIM3)
14353typedef struct R3WheelState {
14357 struct R3Vector center;
14361 struct R3Vector suspension;
14365 struct R3Vector axle;
14369 R3Real rotation;
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;
14394} R3WheelState;
14395#endif
14396
14404typedef void (RAPIER_CALL *R3ErrorCallback)(R3Status, const char*, void*);
14405
14411typedef struct R3ErrorHandler {
14415 R3ErrorCallback callback;
14419 void *user_data;
14420} R3ErrorHandler;
14421
14426typedef struct R3JointBodies {
14430 struct R3RigidBodyHandle body1;
14434 struct R3RigidBodyHandle body2;
14435} R3JointBodies;
14436
14441typedef struct R3InverseKinematicsOptions {
14445 R3Real damping;
14449 size_t max_iters;
14453 uint8_t constrained_axes;
14457 R3Real epsilon_linear;
14461 R3Real epsilon_angular;
14462} R3InverseKinematicsOptions;
14463
14468typedef R3Bool (RAPIER_CALL *R3IkJointCanMove)(void*, struct R3RigidBodyHandle);
14469
14474typedef struct R3CollisionEvent {
14478 struct R3ColliderHandle collider1;
14482 struct R3ColliderHandle collider2;
14486 R3Bool started;
14490 uint32_t flags;
14491} R3CollisionEvent;
14492
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;
14526 R3Bool started;
14527} R3ContactForceEvent;
14528
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);
14541
14546typedef struct R3ContactModification {
14550 struct R3Vector normal;
14554 R3Real friction;
14558 R3Real restitution;
14562 uint32_t user_data;
14566 R3Bool enabled;
14567} R3ContactModification;
14568
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);
14578
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);
14588
14597typedef struct R3PhysicsHooks {
14601 void *user_data;
14605 R3PairFilter filter_contact_pair;
14609 R3PairFilter filter_intersection_pair;
14613 R3ModifyContacts modify_solver_contacts;
14617 R3ModifyContactContext modify_solver_contacts_context;
14618} R3PhysicsHooks;
14619
14624typedef struct R3ByteView {
14628 const uint8_t *data;
14632 size_t count;
14633} R3ByteView;
14634
14639typedef struct R3DebugLine {
14643 struct R3Vector a;
14647 struct R3Vector b;
14651 float color[4];
14652} R3DebugLine;
14653
14658typedef struct R3ParticleDestination {
14662 struct R3SoftBodyHandle body;
14666 uint32_t index;
14667} R3ParticleDestination;
14668
14673typedef struct R3SoftClusterSplit {
14677 uint32_t source_cluster;
14681 struct R3SoftBodyHandle soft_body;
14685 uint32_t cluster;
14689 struct R3RigidBodyHandle proxy;
14693 R3Bool keeps_proxy;
14694} R3SoftClusterSplit;
14695
14700typedef struct R3SoftJointMove {
14704 struct R3ImpulseJointHandle joint;
14708 struct R3RigidBodyHandle from;
14712 struct R3RigidBodyHandle to;
14713} R3SoftJointMove;
14714
14719typedef struct R3OptionalParticleDestination {
14723 struct R3SoftBodyHandle body;
14727 uint32_t index;
14731 R3Bool found;
14732} R3OptionalParticleDestination;
14733
14738typedef struct R3BuildInfo {
14742 uint32_t abi_version;
14746 uint32_t dimension;
14750 uint32_t real_size;
14754 uint32_t pointer_size;
14755} R3BuildInfo;
14756
14761typedef struct R3BuildFeatures {
14765 R3Bool profiling;
14769 uint32_t simd_lanes;
14773 R3Bool parallel;
14778 R3Bool enhanced_determinism;
14779} R3BuildFeatures;
14780
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;
14814} R3ContactPair;
14815
14820typedef struct R3IntersectionPair {
14824 struct R3ColliderHandle collider1;
14828 struct R3ColliderHandle collider2;
14832 R3Bool intersecting;
14833} R3IntersectionPair;
14834
14839typedef struct R3ContactPoint {
14843 size_t manifold_index;
14847 struct R3Vector local_p1;
14851 struct R3Vector local_p2;
14855 struct R3Vector normal;
14859 R3Real distance;
14863 R3Real impulse;
14864#if defined(RAPIER_DIM2)
14868 R3Real tangent_impulse[1];
14869#endif
14870#if defined(RAPIER_DIM3)
14874 R3Real tangent_impulse[2];
14875#endif
14876} R3ContactPoint;
14877
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;
14916 R3Real scale;
14920 struct R3ColliderDesc colliderBlueprint;
14924 struct R3RigidBodyDesc rigidBodyBlueprint;
14925} R3UrdfLoaderOptions;
14926#endif
14927
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;
14970 R3Real scale;
14974 struct R3ColliderDesc colliderBlueprint;
14978 struct R3RigidBodyDesc rigidBodyBlueprint;
14979} R3MjcfLoaderOptions;
14980#endif
14981
14982#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
14987typedef struct R3MjcfVisualMesh R3MjcfVisualMesh;
14988#endif
14989
14990#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
14995typedef struct R3RenderMaterial {
14999 float metallic;
15003 float roughness;
15007 float reflectance;
15011 float emissive[3];
15012} R3RenderMaterial;
15013#endif
15014
15015#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
15020typedef struct R3MjcfVisualMeshInfo {
15024 struct R3Pose local_pose;
15028 float rgba[4];
15032 struct R3RenderMaterial material;
15036 R3Bool has_color;
15040 R3Bool has_material;
15044 R3Bool is_trimesh;
15045} R3MjcfVisualMeshInfo;
15046#endif
15047
15052typedef struct R3RigidBodyState {
15056 struct R3Pose position;
15060 struct R3Vector linvel;
15064 R3AngVector angvel;
15068 R3Bool sleeping;
15072 R3Bool enabled;
15076 struct R3UserData userData;
15077} R3RigidBodyState;
15078
15083typedef struct R3SoftMeshId {
15087 uint32_t cluster;
15091 uint32_t mesh;
15092} R3SoftMeshId;
15093
15098typedef struct R3SoftMeshInfo {
15102 struct R3SoftMeshId id;
15106 struct R3ColliderHandle collider;
15110 size_t arity;
15114 R3Bool is_skinned;
15118 R3Bool collision_enabled;
15119} R3SoftMeshInfo;
15120
15121#if defined(RAPIER_F32)
15126typedef int32_t R3VoxelCoord;
15127#endif
15128
15129#if defined(RAPIER_F64)
15134typedef int64_t R3VoxelCoord;
15135#endif
15136
15141typedef struct R3VoxelKey {
15145 R3VoxelCoord x;
15149 R3VoxelCoord y;
15150#if defined(RAPIER_DIM3)
15154 R3VoxelCoord z;
15155#endif
15156} R3VoxelKey;
15157
15162typedef struct R3VoxelQuery {
15166 struct R3VoxelKey key;
15170 struct R3Vector center;
15174 struct R3Vector size;
15178 R3Bool found;
15179} R3VoxelQuery;
15180
15185typedef struct R3JointImpulses {
15189 struct R3Vector linear;
15193 R3AngVector angular;
15197 R3Real limits[R3_JOINT_DOF_COUNT];
15201 R3Real motors[R3_JOINT_DOF_COUNT];
15202} R3JointImpulses;
15203
15208typedef struct R3OptionalShapeCastHit {
15212 struct R3ShapeCastHit hit;
15216 R3Bool found;
15217} R3OptionalShapeCastHit;
15218
15223typedef struct R3OptionalPointProjection {
15227 struct R3PointProjection projection;
15231 R3Bool found;
15232} R3OptionalPointProjection;
15233
15239typedef struct R3NonlinearRigidMotion {
15243 struct R3Pose start;
15247 struct R3Vector local_center;
15251 struct R3Vector linvel;
15255 R3AngVector angvel;
15256} R3NonlinearRigidMotion;
15257
15262typedef struct R3OptionalContactPair {
15266 struct R3ContactPair pair;
15270 R3Bool found;
15271} R3OptionalContactPair;
15272
15277typedef struct R3OptionalIntersectionPair {
15281 struct R3IntersectionPair pair;
15285 R3Bool found;
15286} R3OptionalIntersectionPair;
15287
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;
15317 size_t num_points;
15321 size_t num_solver_contacts;
15325 uint32_t user_data;
15326} R3ContactManifold;
15327
15332typedef struct R3SolverContact {
15336 struct R3Vector point1;
15340 struct R3Vector point2;
15344 R3Real distance;
15348 struct R3Vector tangent_velocity;
15349} R3SolverContact;
15350
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);
15362
15367typedef void (RAPIER_CALL *R3ContactForceEventCallback)(void *user_data,
15368 const struct R3ReadContext *read,
15369 const struct R3ContactForceEvent *event);
15370
15378typedef struct R3EventCallbacks {
15382 void *user_data;
15386 R3CollisionEventCallback collision_event;
15390 R3ContactForceEventCallback contact_force_event;
15391} R3EventCallbacks;
15392
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;
15509
15514#define R3_OK 0
15515
15520#define R3_NULL_POINTER 1
15521
15526#define R3_INVALID_ARGUMENT 2
15527
15532#define R3_INVALID_HANDLE 3
15533
15538#define R3_BUFFER_TOO_SMALL 4
15539
15544#define R3_UNSUPPORTED 5
15545
15550#define R3_PANIC 6
15551
15556#define R3_NOT_FOUND 7
15557
15562#define R3_WORLD_BUSY 8
15563
15564#ifdef __cplusplus
15565extern "C" {
15566#endif // __cplusplus
15567
15572RAPIER_API struct R3SoftBodyMaterial RAPIER_CALL r3DefaultSoftBodyMaterial(void);
15573
15578RAPIER_API struct R3SoftRecoverySettings RAPIER_CALL r3DefaultSoftRecoverySettings(void);
15579
15580#if defined(RAPIER_FEM)
15585RAPIER_API struct R3SoftFemParameters RAPIER_CALL r3DefaultSoftFemParameters(void);
15586#endif
15587
15592RAPIER_API struct R3SoftBodiesSettings RAPIER_CALL r3DefaultSoftBodiesSettings(void);
15593
15598RAPIER_API struct R3IntegrationParameters RAPIER_CALL r3DefaultIntegrationParameters(void);
15599
15604RAPIER_API struct R3IntegrationParameters RAPIER_CALL r3IntegrationParameters(const struct R3World *world);
15605
15610RAPIER_API
15611R3Status RAPIER_CALL r3SetIntegrationParameters(struct R3World *world,
15612 const struct R3IntegrationParameters *data);
15613
15618RAPIER_API struct R3JointDesc RAPIER_CALL r3DefaultJointDesc(void);
15619
15624RAPIER_API struct R3JointDesc RAPIER_CALL r3FixedJointDesc(void);
15625
15626#if defined(RAPIER_DIM2)
15631RAPIER_API struct R3JointDesc RAPIER_CALL r3RevoluteJointDesc(void);
15632#endif
15633
15634#if defined(RAPIER_DIM3)
15639RAPIER_API struct R3JointDesc RAPIER_CALL r3RevoluteJointDesc(struct R3Vector axis_vector);
15640#endif
15641
15646RAPIER_API struct R3JointDesc RAPIER_CALL r3PrismaticJointDesc(struct R3Vector axis_vector);
15647
15652RAPIER_API struct R3JointDesc RAPIER_CALL r3RopeJointDesc(R3Real length);
15653
15658RAPIER_API
15659struct R3JointDesc RAPIER_CALL r3SpringJointDesc(R3Real length,
15660 R3Real stiffness,
15661 R3Real damping);
15662
15663#if defined(RAPIER_DIM3)
15668RAPIER_API struct R3JointDesc RAPIER_CALL r3SphericalJointDesc(void);
15669#endif
15670
15671#if defined(RAPIER_DIM2)
15676RAPIER_API struct R3JointDesc RAPIER_CALL r3PinSlotJointDesc(struct R3Vector axis_vector);
15677#endif
15678
15684RAPIER_API
15685struct R3ImpulseJointHandle RAPIER_CALL r3InsertImpulseJoint(struct R3RigidBodyHandle body1,
15686 struct R3RigidBodyHandle body2,
15687 const struct R3JointDesc *joint);
15688
15694RAPIER_API
15695struct R3MultibodyJointHandle RAPIER_CALL r3InsertMultibodyJoint(struct R3RigidBodyHandle body1,
15696 struct R3RigidBodyHandle body2,
15697 const struct R3JointDesc *joint);
15698
15703RAPIER_API struct R3SoftBodyDesc RAPIER_CALL r3DefaultSoftBodyDesc(void);
15704
15709RAPIER_API
15710struct R3SoftBodyHandle RAPIER_CALL r3InsertSoftBody(struct R3World *world,
15711 const struct R3SoftBodyDesc *desc);
15712
15717RAPIER_API struct R3SoftMeshBindingDesc RAPIER_CALL r3DefaultSoftMeshBindingDesc(void);
15718
15724RAPIER_API
15725struct R3ColliderHandle RAPIER_CALL r3InsertDeformableCollider(const struct R3ColliderDesc *collider,
15726 const struct R3SoftMeshBindingDesc *binding,
15727 struct R3RigidBodyHandle parent);
15728
15733RAPIER_API struct R3QueryOptions RAPIER_CALL r3DefaultQueryOptions(void);
15734
15743RAPIER_API
15744struct R3RayHit RAPIER_CALL r3CastRay(const struct R3World *world,
15745 const struct R3QueryOptions *query_options,
15746 struct R3Vector origin,
15747 struct R3Vector direction,
15748 R3Real max_toi,
15749 R3Bool solid);
15750
15758RAPIER_API
15759struct R3PointProjection RAPIER_CALL r3ProjectPoint(const struct R3World *world,
15760 const struct R3QueryOptions *query_options,
15761 struct R3Vector point,
15762 R3Real max_distance,
15763 R3Bool solid);
15764
15772RAPIER_API
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);
15779
15787RAPIER_API
15788size_t RAPIER_CALL r3IntersectPoint(const struct R3World *world,
15789 const struct R3QueryOptions *query_options,
15790 struct R3Vector point,
15791 struct R3ColliderHandle *buffer,
15792 size_t capacity);
15793
15802RAPIER_API
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,
15808 size_t capacity);
15809
15818RAPIER_API
15819size_t RAPIER_CALL r3IntersectAabbConservative(const struct R3World *world,
15820 const struct R3QueryOptions *query_options,
15821 struct R3Aabb aabb,
15822 struct R3ColliderHandle *buffer,
15823 size_t capacity);
15824
15832RAPIER_API
15833struct R3RayToi RAPIER_CALL r3CastRayToi(const struct R3World *world,
15834 const struct R3QueryOptions *query_options,
15835 struct R3Vector origin,
15836 struct R3Vector direction,
15837 R3Real max_toi,
15838 R3Bool solid);
15839
15847RAPIER_API
15848struct R3OptionalRayHit RAPIER_CALL r3TryCastRay(const struct R3World *world,
15849 const struct R3QueryOptions *query_options,
15850 struct R3Vector origin,
15851 struct R3Vector direction,
15852 R3Real max_toi,
15853 R3Bool solid);
15854
15859RAPIER_API struct R3RigidBodyDesc RAPIER_CALL r3DynamicRigidBodyDesc(void);
15860
15865RAPIER_API struct R3RigidBodyDesc RAPIER_CALL r3FixedRigidBodyDesc(void);
15866
15871RAPIER_API struct R3RigidBodyDesc RAPIER_CALL r3KinematicPositionBasedRigidBodyDesc(void);
15872
15877RAPIER_API struct R3RigidBodyDesc RAPIER_CALL r3KinematicVelocityBasedRigidBodyDesc(void);
15878
15883RAPIER_API struct R3ShapeDesc RAPIER_CALL r3DefaultShapeDesc(void);
15884
15890RAPIER_API R3SharedShape *RAPIER_CALL r3ShapeDesc_Build(const struct R3ShapeDesc *desc);
15891
15896RAPIER_API struct R3ColliderDesc RAPIER_CALL r3DefaultColliderDesc(void);
15897
15903RAPIER_API struct R3ColliderDesc RAPIER_CALL r3BallColliderDesc(R3Real radius);
15904
15910RAPIER_API struct R3ColliderDesc RAPIER_CALL r3CuboidColliderDesc(struct R3Vector half_extents);
15911
15916RAPIER_API
15917struct R3RigidBodyHandle RAPIER_CALL r3InsertRigidBody(struct R3World *world,
15918 const struct R3RigidBodyDesc *desc);
15919
15926RAPIER_API
15927struct R3ColliderHandle RAPIER_CALL r3InsertCollider(struct R3RigidBodyHandle parent,
15928 const struct R3ColliderDesc *desc);
15929
15935RAPIER_API
15936struct R3ColliderHandle RAPIER_CALL r3InsertColliderWithoutParent(struct R3World *world,
15937 const struct R3ColliderDesc *desc);
15938
15943RAPIER_API struct R3PodLayout RAPIER_CALL r3PodLayout(void);
15944
15950RAPIER_API struct R3KinematicCharacterController *RAPIER_CALL r3NewKinematicCharacterController(void);
15951
15957RAPIER_API
15958R3Status RAPIER_CALL r3FreeKinematicCharacterController(struct R3KinematicCharacterController *controller);
15959
15964RAPIER_API
15965R3Status RAPIER_CALL r3KinematicCharacterController_SetUp(struct R3KinematicCharacterController *controller,
15966 struct R3Vector up);
15967
15972RAPIER_API
15973R3Status RAPIER_CALL r3KinematicCharacterController_SetOffset(struct R3KinematicCharacterController *controller,
15974 struct R3CharacterLength offset);
15975
15980RAPIER_API
15981R3Status RAPIER_CALL r3KinematicCharacterController_SetSlide(struct R3KinematicCharacterController *controller,
15982 R3Bool enabled);
15983
15988RAPIER_API
15989R3Status RAPIER_CALL r3KinematicCharacterController_SetSlopes(struct R3KinematicCharacterController *controller,
15990 R3Real max_climb_angle,
15991 R3Real min_slide_angle);
15992
15997RAPIER_API
15998R3Status RAPIER_CALL r3KinematicCharacterController_SetAutostep(struct R3KinematicCharacterController *controller,
15999 R3Bool enabled,
16000 struct R3CharacterLength max_height,
16001 struct R3CharacterLength min_width,
16002 R3Bool include_dynamic_bodies);
16003
16008RAPIER_API
16009R3Status RAPIER_CALL r3KinematicCharacterController_SetSnapToGround(struct R3KinematicCharacterController *controller,
16010 R3Bool enabled,
16011 struct R3CharacterLength distance);
16012
16017RAPIER_API
16018struct R3Vector RAPIER_CALL r3KinematicCharacterController_Up(const struct R3KinematicCharacterController *controller);
16019
16024RAPIER_API
16025struct R3CharacterLength RAPIER_CALL r3KinematicCharacterController_Offset(const struct R3KinematicCharacterController *controller);
16026
16032RAPIER_API
16033struct R3CharacterAutostep RAPIER_CALL r3KinematicCharacterController_Autostep(const struct R3KinematicCharacterController *controller);
16034
16040RAPIER_API
16041R3Status RAPIER_CALL r3KinematicCharacterController_SetNormalNudgeFactor(struct R3KinematicCharacterController *controller,
16042 R3Real value);
16043
16048RAPIER_API
16049R3Real RAPIER_CALL r3KinematicCharacterController_NormalNudgeFactor(const struct R3KinematicCharacterController *controller);
16050
16058RAPIER_API
16059struct R3CharacterMovement RAPIER_CALL r3KinematicCharacterController_MoveShape(const struct R3World *world,
16060 const struct R3QueryOptions *options,
16061 struct R3KinematicCharacterController *controller,
16062 R3Real dt,
16063 const R3SharedShape *shape,
16064 struct R3Pose pose,
16065 struct R3Vector desired_translation);
16066
16072RAPIER_API
16073size_t RAPIER_CALL r3KinematicCharacterController_Collisions(const struct R3KinematicCharacterController *controller,
16074 struct R3CharacterCollision *buffer,
16075 size_t capacity);
16076
16084RAPIER_API
16085R3Status RAPIER_CALL r3KinematicCharacterController_SolveCharacterCollisionImpulses(const struct R3KinematicCharacterController *controller,
16086 const R3SharedShape *shape,
16087 R3Real dt,
16088 R3Real mass,
16089 const struct R3QueryOptions *options);
16090
16096RAPIER_API struct R3PidController *RAPIER_CALL r3NewPidController(void);
16097
16103RAPIER_API R3Status RAPIER_CALL r3FreePidController(struct R3PidController *controller);
16104
16109RAPIER_API struct R3PidGains RAPIER_CALL r3PidController_Gains(const struct R3PidController *controller);
16110
16115RAPIER_API
16116R3Status RAPIER_CALL r3PidController_SetGains(struct R3PidController *controller,
16117 struct R3PidGains gains);
16118
16124RAPIER_API
16125R3Status RAPIER_CALL r3PidController_SetAxes(struct R3PidController *controller,
16126 uint32_t axes);
16127
16132RAPIER_API uint32_t RAPIER_CALL r3PidController_Axes(const struct R3PidController *controller);
16133
16138RAPIER_API R3Status RAPIER_CALL r3PidController_ResetIntegrals(struct R3PidController *controller);
16139
16145RAPIER_API struct R3PdController RAPIER_CALL r3DefaultPdController(void);
16146
16152RAPIER_API
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);
16158
16163RAPIER_API
16164struct R3VelocityCorrection RAPIER_CALL r3PidController_RigidBodyCorrection(struct R3PidController *controller,
16165 R3Real dt,
16166 struct R3RigidBodyHandle body,
16167 struct R3Pose target_pose,
16168 struct R3Vector target_linvel,
16169 R3AngVector target_angvel);
16170
16175RAPIER_API
16176struct R3CharacterControllerSettings RAPIER_CALL r3KinematicCharacterController_Settings(const struct R3KinematicCharacterController *controller);
16177
16178#if defined(RAPIER_DIM3)
16183RAPIER_API struct R3WheelTuning RAPIER_CALL r3DefaultWheelTuning(void);
16184#endif
16185
16186#if defined(RAPIER_DIM3)
16192RAPIER_API
16193struct R3DynamicRayCastVehicleController *RAPIER_CALL r3NewDynamicRayCastVehicleController(struct R3RigidBodyHandle chassis);
16194#endif
16195
16196#if defined(RAPIER_DIM3)
16202RAPIER_API
16203R3Status RAPIER_CALL r3FreeDynamicRayCastVehicleController(struct R3DynamicRayCastVehicleController *controller);
16204#endif
16205
16206#if defined(RAPIER_DIM3)
16212RAPIER_API
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,
16218 R3Real radius,
16219 const struct R3WheelTuning *tuning);
16220#endif
16221
16222#if defined(RAPIER_DIM3)
16227RAPIER_API
16228R3Status RAPIER_CALL r3DynamicRayCastVehicleController_SetAxes(struct R3DynamicRayCastVehicleController *controller,
16229 size_t up,
16230 size_t forward);
16231#endif
16232
16233#if defined(RAPIER_DIM3)
16238RAPIER_API
16239R3Status RAPIER_CALL r3DynamicRayCastVehicleController_SetWheelControls(struct R3DynamicRayCastVehicleController *controller,
16240 size_t index,
16241 R3Real steering,
16242 R3Real engine_force,
16243 R3Real brake);
16244#endif
16245
16246#if defined(RAPIER_DIM3)
16255RAPIER_API
16256R3Status RAPIER_CALL r3DynamicRayCastVehicleController_UpdateVehicle(struct R3DynamicRayCastVehicleController *controller,
16257 R3Real dt,
16258 const struct R3QueryOptions *options);
16259#endif
16260
16261#if defined(RAPIER_DIM3)
16266RAPIER_API
16267R3Real RAPIER_CALL r3DynamicRayCastVehicleController_CurrentVehicleSpeed(const struct R3DynamicRayCastVehicleController *controller);
16268#endif
16269
16270#if defined(RAPIER_DIM3)
16276RAPIER_API
16277size_t RAPIER_CALL r3DynamicRayCastVehicleController_Wheels(const struct R3DynamicRayCastVehicleController *controller,
16278 struct R3WheelState *buffer,
16279 size_t capacity);
16280#endif
16281
16287RAPIER_API
16288R3Status RAPIER_CALL r3RigidBodyPropagateModifiedBodyPositionsToColliders(struct R3World *world);
16289
16295RAPIER_API
16296size_t RAPIER_CALL r3ActiveRigidBodies(const struct R3World *world,
16297 struct R3RigidBodyHandle *buffer,
16298 size_t capacity);
16299
16304RAPIER_API R3Status RAPIER_CALL r3RigidBody_WakeUp(struct R3RigidBodyHandle handle, R3Bool strong);
16305
16313RAPIER_API struct R3ErrorHandler RAPIER_CALL r3SetErrorHandler(struct R3ErrorHandler handler);
16314
16322RAPIER_API R3Status RAPIER_CALL r3LastStatus(void);
16323
16328RAPIER_API const char *RAPIER_CALL r3LastError(void);
16329
16334RAPIER_API R3SharedShape *RAPIER_CALL r3BallSharedShape(R3Real radius);
16335
16340RAPIER_API R3SharedShape *RAPIER_CALL r3CuboidSharedShape(struct R3Vector half_extents);
16341
16346RAPIER_API
16347R3SharedShape *RAPIER_CALL r3RoundCuboidSharedShape(struct R3Vector half_extents,
16348 R3Real border_radius);
16349
16354RAPIER_API
16355R3SharedShape *RAPIER_CALL r3CapsuleSharedShape(struct R3Vector a,
16356 struct R3Vector b,
16357 R3Real radius);
16358
16363RAPIER_API R3SharedShape *RAPIER_CALL r3SegmentSharedShape(struct R3Vector a, struct R3Vector b);
16364
16369RAPIER_API
16370R3SharedShape *RAPIER_CALL r3TriangleSharedShape(struct R3Vector a,
16371 struct R3Vector b,
16372 struct R3Vector c);
16373
16378RAPIER_API R3SharedShape *RAPIER_CALL r3HalfspaceSharedShape(struct R3Vector normal);
16379
16380#if defined(RAPIER_DIM3)
16385RAPIER_API R3SharedShape *RAPIER_CALL r3CylinderSharedShape(R3Real half_height, R3Real radius);
16386#endif
16387
16388#if defined(RAPIER_DIM3)
16393RAPIER_API R3SharedShape *RAPIER_CALL r3ConeSharedShape(R3Real half_height, R3Real radius);
16394#endif
16395
16401RAPIER_API R3SharedShape *RAPIER_CALL r3CompoundSharedShape(struct R3CompoundShapeView children);
16402
16407RAPIER_API R3Status RAPIER_CALL r3RemoveCollider(struct R3ColliderHandle handle, R3Bool wake_up);
16408
16413RAPIER_API R3Status RAPIER_CALL r3RemoveImpulseJoint(struct R3ImpulseJointHandle handle, R3Bool wake_up);
16414
16420RAPIER_API
16421size_t RAPIER_CALL r3ImpulseJointHandles(const struct R3World *world,
16422 struct R3ImpulseJointHandle *buffer,
16423 size_t capacity);
16424
16429RAPIER_API
16430R3Status RAPIER_CALL r3RemoveMultibodyJoint(struct R3MultibodyJointHandle handle,
16431 R3Bool wake_up);
16432
16438RAPIER_API
16439size_t RAPIER_CALL r3MultibodyJointHandles(const struct R3World *world,
16440 struct R3MultibodyJointHandle *buffer,
16441 size_t capacity);
16442
16447RAPIER_API struct R3JointBodies RAPIER_CALL r3ImpulseJoint_Bodies(struct R3ImpulseJointHandle handle);
16448
16453RAPIER_API struct R3InverseKinematicsOptions RAPIER_CALL r3DefaultInverseKinematicsOptions(void);
16454
16461RAPIER_API size_t RAPIER_CALL r3MultibodyJoint_Ndofs(struct R3MultibodyJointHandle handle);
16462
16467RAPIER_API
16468R3Status RAPIER_CALL r3MultibodyJoint_InverseKinematics(struct R3MultibodyJointHandle handle,
16469 const struct R3InverseKinematicsOptions *options,
16470 struct R3Pose target,
16471 R3IkJointCanMove can_move,
16472 void *user_data,
16473 R3Real *displacements,
16474 size_t count);
16475
16480RAPIER_API
16481R3Status RAPIER_CALL r3MultibodyJoint_ApplyDisplacements(struct R3MultibodyJointHandle handle,
16482 const R3Real *displacements,
16483 size_t count);
16484
16489RAPIER_API R3Status RAPIER_CALL r3FreeSharedShape(R3SharedShape *object);
16490
16496RAPIER_API R3SharedShape *RAPIER_CALL r3SharedShape_Clone(const R3SharedShape *object);
16497
16502RAPIER_API size_t RAPIER_CALL r3RigidBodyCount(const struct R3World *world);
16503
16509RAPIER_API
16510size_t RAPIER_CALL r3RigidBodyHandles(const struct R3World *world,
16511 struct R3RigidBodyHandle *buffer,
16512 size_t capacity);
16513
16519RAPIER_API R3Bool RAPIER_CALL r3RigidBody_Contains(struct R3RigidBodyHandle handle);
16520
16525RAPIER_API size_t RAPIER_CALL r3ColliderCount(const struct R3World *world);
16526
16532RAPIER_API
16533size_t RAPIER_CALL r3ColliderHandles(const struct R3World *world,
16534 struct R3ColliderHandle *buffer,
16535 size_t capacity);
16536
16541RAPIER_API R3Bool RAPIER_CALL r3Collider_Contains(struct R3ColliderHandle handle);
16542
16547RAPIER_API size_t RAPIER_CALL r3SoftBodyCount(const struct R3World *world);
16548
16554RAPIER_API
16555size_t RAPIER_CALL r3SoftBodyHandles(const struct R3World *world,
16556 struct R3SoftBodyHandle *buffer,
16557 size_t capacity);
16558
16564RAPIER_API R3Bool RAPIER_CALL r3SoftBody_Contains(struct R3SoftBodyHandle handle);
16565
16573RAPIER_API
16574R3Status RAPIER_CALL r3RemoveRigidBody(struct R3RigidBodyHandle handle,
16575 R3Bool remove_attached_colliders);
16576
16581RAPIER_API R3Real RAPIER_CALL r3TimeStep(const struct R3World *world);
16582
16587RAPIER_API R3Status RAPIER_CALL r3SetTimeStep(struct R3World *world, R3Real value);
16588
16593RAPIER_API R3Real RAPIER_CALL r3MinCcdDt(const struct R3World *world);
16594
16599RAPIER_API R3Status RAPIER_CALL r3SetMinCcdDt(struct R3World *world, R3Real value);
16600
16605RAPIER_API R3Real RAPIER_CALL r3LengthUnit(const struct R3World *world);
16606
16611RAPIER_API R3Status RAPIER_CALL r3SetLengthUnit(struct R3World *world, R3Real value);
16612
16617RAPIER_API R3Real RAPIER_CALL r3WarmstartCoefficient(const struct R3World *world);
16618
16623RAPIER_API R3Status RAPIER_CALL r3SetWarmstartCoefficient(struct R3World *world, R3Real value);
16624
16629RAPIER_API R3Real RAPIER_CALL r3NormalizedAllowedLinearError(const struct R3World *world);
16630
16635RAPIER_API R3Status RAPIER_CALL r3SetNormalizedAllowedLinearError(struct R3World *world, R3Real value);
16636
16642RAPIER_API R3Real RAPIER_CALL r3NormalizedMaxCorrectiveVelocity(const struct R3World *world);
16643
16648RAPIER_API
16649R3Status RAPIER_CALL r3SetNormalizedMaxCorrectiveVelocity(struct R3World *world,
16650 R3Real value);
16651
16656RAPIER_API R3Real RAPIER_CALL r3NormalizedPredictionDistance(const struct R3World *world);
16657
16662RAPIER_API R3Status RAPIER_CALL r3SetNormalizedPredictionDistance(struct R3World *world, R3Real value);
16663
16668RAPIER_API R3Real RAPIER_CALL r3NormalizedMaxLinearVelocity(const struct R3World *world);
16669
16674RAPIER_API R3Status RAPIER_CALL r3SetNormalizedMaxLinearVelocity(struct R3World *world, R3Real value);
16675
16681RAPIER_API R3Real RAPIER_CALL r3NormalizedContactRecycleDistance(const struct R3World *world);
16682
16687RAPIER_API
16688R3Status RAPIER_CALL r3SetNormalizedContactRecycleDistance(struct R3World *world,
16689 R3Real value);
16690
16695RAPIER_API size_t RAPIER_CALL r3NumSolverIterations(const struct R3World *world);
16696
16701RAPIER_API R3Status RAPIER_CALL r3SetNumSolverIterations(struct R3World *world, size_t value);
16702
16707RAPIER_API size_t RAPIER_CALL r3NumInternalPgsIterations(const struct R3World *world);
16708
16713RAPIER_API R3Status RAPIER_CALL r3SetNumInternalPgsIterations(struct R3World *world, size_t value);
16714
16720RAPIER_API size_t RAPIER_CALL r3NumInternalStabilizationIterations(const struct R3World *world);
16721
16727RAPIER_API
16728R3Status RAPIER_CALL r3SetNumInternalStabilizationIterations(struct R3World *world,
16729 size_t value);
16730
16735RAPIER_API size_t RAPIER_CALL r3MaxCcdSubsteps(const struct R3World *world);
16736
16741RAPIER_API R3Status RAPIER_CALL r3SetMaxCcdSubsteps(struct R3World *world, size_t value);
16742
16747RAPIER_API R3Bool RAPIER_CALL r3ContactClustering(const struct R3World *world);
16748
16753RAPIER_API R3Status RAPIER_CALL r3SetContactClustering(struct R3World *world, R3Bool value);
16754
16759RAPIER_API R3Bool RAPIER_CALL r3ContactRecycling(const struct R3World *world);
16760
16765RAPIER_API R3Status RAPIER_CALL r3SetContactRecycling(struct R3World *world, R3Bool value);
16766
16771RAPIER_API R3Bool RAPIER_CALL r3FrictionInBiasPass(const struct R3World *world);
16772
16777RAPIER_API R3Status RAPIER_CALL r3SetFrictionInBiasPass(struct R3World *world, R3Bool value);
16778
16783RAPIER_API R3Bool RAPIER_CALL r3WarmstartJoints(const struct R3World *world);
16784
16789RAPIER_API R3Status RAPIER_CALL r3SetWarmstartJoints(struct R3World *world, R3Bool value);
16790
16795RAPIER_API struct R3SpringCoefficients RAPIER_CALL r3ContactSoftness(const struct R3World *world);
16796
16801RAPIER_API
16802R3Status RAPIER_CALL r3SetContactSoftness(struct R3World *world,
16803 struct R3SpringCoefficients value);
16804
16809RAPIER_API struct R3SpringCoefficients RAPIER_CALL r3StaticContactSoftness(const struct R3World *world);
16810
16815RAPIER_API
16816R3Status RAPIER_CALL r3SetStaticContactSoftness(struct R3World *world,
16817 struct R3SpringCoefficients value);
16818
16823RAPIER_API
16824R3Status RAPIER_CALL r3ContactModificationContext_UpdateAsOnewayPlatform(struct R3ContactModificationContext *context,
16825 struct R3Vector allowed_local_n1,
16826 R3Real allowed_angle);
16827
16832RAPIER_API
16833R3Status RAPIER_CALL r3ContactModificationContext_SetTangentVelocity(struct R3ContactModificationContext *context,
16834 struct R3Vector velocity);
16835
16840RAPIER_API struct R3EventCollector *RAPIER_CALL r3NewEventCollector(void);
16841
16847RAPIER_API R3Status RAPIER_CALL r3FreeEventCollector(struct R3EventCollector *events);
16848
16853RAPIER_API R3Status RAPIER_CALL r3EventCollector_Clear(struct R3EventCollector *events);
16854
16860RAPIER_API
16861size_t RAPIER_CALL r3EventCollector_CollisionEvents(const struct R3EventCollector *events,
16862 struct R3CollisionEvent *buffer,
16863 size_t capacity);
16864
16870RAPIER_API
16871size_t RAPIER_CALL r3EventCollector_ContactForceEvents(const struct R3EventCollector *events,
16872 struct R3ContactForceEvent *buffer,
16873 size_t capacity);
16874
16879RAPIER_API size_t RAPIER_CALL r3EventCollector_TearEventCount(const struct R3EventCollector *events);
16880
16886RAPIER_API
16887struct R3SoftBodyTearEvent *RAPIER_CALL r3EventCollector_TearEvent(const struct R3EventCollector *events,
16888 size_t index);
16889
16894RAPIER_API struct R3Vector RAPIER_CALL r3Gravity(const struct R3World *world);
16895
16900RAPIER_API R3Status RAPIER_CALL r3SetGravity(struct R3World *world, struct R3Vector value);
16901
16908RAPIER_API
16909R3Status RAPIER_CALL r3Step(struct R3World *world,
16910 const struct R3PhysicsHooks *hooks,
16911 const struct R3EventCollector *events);
16912
16918RAPIER_API
16919R3Status RAPIER_CALL r3DetectCollisions(struct R3World *world,
16920 const struct R3PhysicsHooks *hooks,
16921 const struct R3EventCollector *events);
16922
16928RAPIER_API struct R3ByteView RAPIER_CALL r3Bytes_Data(const struct R3Bytes *bytes);
16929
16935RAPIER_API R3Status RAPIER_CALL r3FreeBytes(struct R3Bytes *bytes);
16936
16942RAPIER_API struct R3Bytes *RAPIER_CALL r3SerializeWorld(const struct R3World *world);
16943
16949RAPIER_API struct R3World *RAPIER_CALL r3DeserializeWorld(const uint8_t *data, size_t count);
16950
16957RAPIER_API
16958size_t RAPIER_CALL r3DebugRender(const struct R3World *world,
16959 uint32_t mode,
16960 struct R3DebugLine *buffer,
16961 size_t capacity);
16962
16967RAPIER_API R3Status RAPIER_CALL r3SoftBodiesSetResweepStrain(struct R3World *world, R3Real value);
16968
16973RAPIER_API R3Real RAPIER_CALL r3SoftBodiesResweepStrain(const struct R3World *world);
16974
16979RAPIER_API R3Status RAPIER_CALL r3SoftBodiesSetContactStiffening(struct R3World *world, R3Real value);
16980
16985RAPIER_API R3Real RAPIER_CALL r3SoftBodiesContactStiffening(const struct R3World *world);
16986
16991RAPIER_API R3Status RAPIER_CALL r3SoftBodiesSetMaxExtraSubsteps(struct R3World *world, size_t value);
16992
16997RAPIER_API size_t RAPIER_CALL r3SoftBodiesMaxExtraSubsteps(const struct R3World *world);
16998
17003RAPIER_API
17004R3Status RAPIER_CALL r3RecoverySetAuthoredVelocityMargin(struct R3World *world,
17005 R3Bool value);
17006
17011RAPIER_API R3Status RAPIER_CALL r3RecoverySetEdgeSpeculation(struct R3World *world, R3Bool value);
17012
17017RAPIER_API
17018R3Status RAPIER_CALL r3RecoverySetInvertedCellDetection(struct R3World *world,
17019 R3Bool value);
17020
17025RAPIER_API
17026R3Status RAPIER_CALL r3RecoverySetSelfCrossingDetection(struct R3World *world,
17027 R3Bool value);
17028
17033RAPIER_API
17034R3Status RAPIER_CALL r3RecoverySetDetectionMotionGating(struct R3World *world,
17035 R3Bool value);
17036
17041RAPIER_API R3Status RAPIER_CALL r3RecoverySetCrossBodyDetection(struct R3World *world, R3Bool value);
17042
17047RAPIER_API R3Status RAPIER_CALL r3RecoverySetSelfStandDown(struct R3World *world, R3Bool value);
17048
17053RAPIER_API R3Status RAPIER_CALL r3RecoverySetCrossBodyExpelGate(struct R3World *world, R3Bool value);
17054
17059RAPIER_API R3Status RAPIER_CALL r3RecoverySetEdgeStandDown(struct R3World *world, R3Bool value);
17060
17065RAPIER_API R3Status RAPIER_CALL r3RecoverySetCrossingRepulsion(struct R3World *world, R3Bool value);
17066
17071RAPIER_API
17072R3Status RAPIER_CALL r3RecoverySetCrossingRepulsionGuide(struct R3World *world,
17073 R3Bool value);
17074
17079RAPIER_API
17080R3Status RAPIER_CALL r3RecoverySetCrossingRepulsionSelfGuide(struct R3World *world,
17081 R3Bool value);
17082
17087RAPIER_API R3Status RAPIER_CALL r3RecoverySetRecoveryPace(struct R3World *world, R3Real value);
17088
17093RAPIER_API R3Status RAPIER_CALL r3RecoverySetOverlapConstraints(struct R3World *world, R3Bool value);
17094
17099RAPIER_API R3Status RAPIER_CALL r3RecoverySetOverlapRigid(struct R3World *world, R3Bool value);
17100
17105RAPIER_API
17106R3Status RAPIER_CALL r3RecoverySetOverlapSkipSelfTangled(struct R3World *world,
17107 R3Bool value);
17108
17113RAPIER_API
17114R3Status RAPIER_CALL r3RecoverySetOverlapEdgeStandDown(struct R3World *world,
17115 R3Bool value);
17116
17121RAPIER_API
17122R3Status RAPIER_CALL r3RecoverySetOverlapConstraintPace(struct R3World *world,
17123 R3Real value);
17124
17129RAPIER_API R3Status RAPIER_CALL r3RecoverySetOverlapSkinVolume(struct R3World *world, R3Bool value);
17130
17135RAPIER_API R3Status RAPIER_CALL r3RecoverySetOverlapKeptDepth(struct R3World *world, R3Real value);
17136
17141RAPIER_API R3Status RAPIER_CALL r3RecoverySetOverlapSelfRegions(struct R3World *world, R3Bool value);
17142
17147RAPIER_API R3Status RAPIER_CALL r3RecoverySetOverlapNormalPush(struct R3World *world, R3Bool value);
17148
17153RAPIER_API R3Status RAPIER_CALL r3RecoverySetOverlapMultiVolume(struct R3World *world, R3Bool value);
17154
17159RAPIER_API
17160R3Status RAPIER_CALL r3RecoverySetOverlapProgressMargin(struct R3World *world,
17161 R3Real value);
17162
17163#if defined(RAPIER_FEM)
17168RAPIER_API R3Status RAPIER_CALL r3FemSetLinearTolerance(struct R3World *world, R3Real value);
17169#endif
17170
17171#if defined(RAPIER_FEM)
17176RAPIER_API R3Status RAPIER_CALL r3FemSetMaxLinearIterations(struct R3World *world, size_t value);
17177#endif
17178
17179#if defined(RAPIER_FEM)
17184RAPIER_API R3Status RAPIER_CALL r3FemSetMaxDenseDofs(struct R3World *world, size_t value);
17185#endif
17186
17194RAPIER_API R3Status RAPIER_CALL r3SetNumThreads(struct R3World *world, size_t num_threads);
17195
17202RAPIER_API R3Status RAPIER_CALL r3ClearThreadPool(struct R3World *world);
17203
17209RAPIER_API size_t RAPIER_CALL r3NumThreads(const struct R3World *world);
17210
17216RAPIER_API R3Status RAPIER_CALL r3SetCountersEnabled(struct R3World *world, R3Bool enabled);
17217
17224RAPIER_API double RAPIER_CALL r3StepTimeMs(const struct R3World *world);
17225
17234RAPIER_API struct R3World *RAPIER_CALL r3DeserializeRigidState(const uint8_t *data, size_t count);
17235
17240RAPIER_API struct R3QueryFilter RAPIER_CALL r3DefaultQueryFilter(void);
17241
17246RAPIER_API struct R3ShapeCastOptions RAPIER_CALL r3DefaultShapeCastOptions(void);
17247
17252RAPIER_API R3Status RAPIER_CALL r3RemoveSoftBody(struct R3SoftBodyHandle handle);
17253
17258RAPIER_API R3Status RAPIER_CALL r3SoftBody_WakeUp(struct R3SoftBodyHandle handle);
17259
17265RAPIER_API R3Status RAPIER_CALL r3FreeSoftBodyTearEvent(struct R3SoftBodyTearEvent *event);
17266
17271RAPIER_API
17272struct R3SoftBodyHandle RAPIER_CALL r3SoftBodyTearEvent_SoftBody(const struct R3SoftBodyTearEvent *event);
17273
17281RAPIER_API
17282size_t RAPIER_CALL r3SoftBodyTearEvent_Bodies(const struct R3SoftBodyTearEvent *event,
17283 struct R3SoftBodyHandle *buffer,
17284 size_t capacity);
17285
17290RAPIER_API
17291struct R3ParticleDestination RAPIER_CALL r3SoftBodyTearEvent_ParticleDestination(const struct R3SoftBodyTearEvent *event,
17292 uint32_t particle);
17293
17299RAPIER_API
17300size_t RAPIER_CALL r3SoftBodyTearEvent_TornEdges(const struct R3SoftBodyTearEvent *event,
17301 uint32_t *buffer,
17302 size_t capacity);
17303
17309RAPIER_API
17310size_t RAPIER_CALL r3SoftBodyTearEvent_TornCells(const struct R3SoftBodyTearEvent *event,
17311 uint32_t *buffer,
17312 size_t capacity);
17313
17319RAPIER_API
17320size_t RAPIER_CALL r3SoftBodyTearEvent_RemovedEdges(const struct R3SoftBodyTearEvent *event,
17321 uint32_t *buffer,
17322 size_t capacity);
17323
17329RAPIER_API
17330size_t RAPIER_CALL r3SoftBodyTearEvent_SplitParticles(const struct R3SoftBodyTearEvent *event,
17331 uint32_t *buffer,
17332 size_t capacity);
17333
17339RAPIER_API
17340size_t RAPIER_CALL r3SoftBodyTearEvent_InsertedParticles(const struct R3SoftBodyTearEvent *event,
17341 uint32_t *buffer,
17342 size_t capacity);
17343
17351RAPIER_API
17352size_t RAPIER_CALL r3SoftBodyTearEvent_PieceParticles(const struct R3SoftBodyTearEvent *event,
17353 size_t piece_index,
17354 uint32_t *buffer,
17355 size_t capacity);
17356
17362RAPIER_API
17363size_t RAPIER_CALL r3SoftBodyTearEvent_Clusters(const struct R3SoftBodyTearEvent *event,
17364 struct R3SoftClusterSplit *buffer,
17365 size_t capacity);
17366
17372RAPIER_API
17373size_t RAPIER_CALL r3SoftBodyTearEvent_MovedJoints(const struct R3SoftBodyTearEvent *event,
17374 struct R3SoftJointMove *buffer,
17375 size_t capacity);
17376
17382RAPIER_API
17383struct R3SoftBodyTearEvent *RAPIER_CALL r3SoftBody_Tear(struct R3SoftBodyHandle handle,
17384 const uint32_t *edges,
17385 size_t edge_count,
17386 const uint32_t *cells,
17387 size_t cell_count);
17388
17393RAPIER_API
17394uint32_t RAPIER_CALL r3SoftBody_AddCluster(struct R3SoftBodyHandle handle,
17395 const uint32_t *particles,
17396 size_t count);
17397
17402RAPIER_API
17403R3Status RAPIER_CALL r3SoftBody_RemoveCluster(struct R3SoftBodyHandle handle,
17404 uint32_t cluster);
17405
17411RAPIER_API
17412struct R3OptionalParticleDestination RAPIER_CALL r3SoftBodyTearEvent_TryParticleDestination(const struct R3SoftBodyTearEvent *event,
17413 uint32_t particle);
17414
17420RAPIER_API
17421struct R3SoftBodyTearEvent *RAPIER_CALL r3CutSoftBody(struct R3SoftBodyHandle handle,
17422 const struct R3Vector *blade);
17423
17429RAPIER_API struct R3VolumeMeshParameters RAPIER_CALL r3NewVolumeMeshParameters(R3Real cell_size);
17430
17435RAPIER_API struct R3BuildInfo RAPIER_CALL r3BuildInfo(void);
17436
17444RAPIER_API const char *RAPIER_CALL r3Version(void);
17445
17453RAPIER_API const char *RAPIER_CALL r3BuildProfile(void);
17454
17459RAPIER_API struct R3BuildFeatures RAPIER_CALL r3BuildFeatures(void);
17460
17466RAPIER_API
17467R3SharedShape *RAPIER_CALL r3HeightfieldSharedShape(struct R3RealView heights,
17468 size_t rows,
17469 size_t columns,
17470 struct R3Vector scale);
17471
17476RAPIER_API
17477struct R3Aabb RAPIER_CALL r3SharedShape_ComputeAabb(const R3SharedShape *shape,
17478 struct R3Pose pose);
17479
17484RAPIER_API
17485struct R3MassProperties RAPIER_CALL r3SharedShape_MassProperties(const R3SharedShape *shape,
17486 R3Real density);
17487
17492RAPIER_API
17493R3Bool RAPIER_CALL r3SharedShape_ContainsPoint(const R3SharedShape *shape,
17494 struct R3Pose pose,
17495 struct R3Vector point);
17496
17502RAPIER_API
17503size_t RAPIER_CALL r3ContactPairs(const struct R3World *world,
17504 struct R3ContactPair *buffer,
17505 size_t capacity);
17506
17512RAPIER_API
17513struct R3ContactPair RAPIER_CALL r3ContactPair(struct R3ColliderHandle collider1,
17514 struct R3ColliderHandle collider2);
17515
17521RAPIER_API
17522size_t RAPIER_CALL r3IntersectionPairs(const struct R3World *world,
17523 struct R3IntersectionPair *buffer,
17524 size_t capacity);
17525
17535RAPIER_API
17536size_t RAPIER_CALL r3ContactPoints(struct R3ColliderHandle collider1,
17537 struct R3ColliderHandle collider2,
17538 struct R3ContactPoint *buffer,
17539 size_t capacity);
17540
17546RAPIER_API
17547size_t RAPIER_CALL r3MultibodyJoint_GeneralizedVelocity(struct R3MultibodyJointHandle handle,
17548 R3Real *buffer,
17549 size_t capacity);
17550
17555RAPIER_API
17556R3Status RAPIER_CALL r3MultibodyJoint_SetGeneralizedVelocity(struct R3MultibodyJointHandle handle,
17557 const R3Real *values,
17558 size_t count);
17559
17568RAPIER_API
17569R3Status RAPIER_CALL r3CheckAbi(uint32_t version,
17570 uint32_t dimension,
17571 size_t real_size,
17572 size_t vector_size,
17573 size_t pose_size,
17574 uint32_t features);
17575
17584RAPIER_API
17585size_t RAPIER_CALL r3QuarantinedRigidBodies(const struct R3World *world,
17586 struct R3RigidBodyHandle *buffer,
17587 size_t capacity);
17588
17597RAPIER_API
17598size_t RAPIER_CALL r3QuarantinedColliders(const struct R3World *world,
17599 struct R3ColliderHandle *buffer,
17600 size_t capacity);
17601
17610RAPIER_API
17611size_t RAPIER_CALL r3QuarantinedSoftBodies(const struct R3World *world,
17612 struct R3SoftBodyHandle *buffer,
17613 size_t capacity);
17614
17615#if defined(RAPIER_DIM3)
17620RAPIER_API uint32_t RAPIER_CALL r3FrictionModel(const struct R3World *world);
17621#endif
17622
17623#if defined(RAPIER_DIM3)
17628RAPIER_API R3Status RAPIER_CALL r3SetFrictionModel(struct R3World *world, uint32_t value);
17629#endif
17630
17636RAPIER_API R3Real RAPIER_CALL r3Sin(R3Real x);
17637
17642RAPIER_API R3Real RAPIER_CALL r3Cos(R3Real x);
17643
17648RAPIER_API R3Real RAPIER_CALL r3Tan(R3Real x);
17649
17654RAPIER_API R3Real RAPIER_CALL r3Asin(R3Real x);
17655
17660RAPIER_API R3Real RAPIER_CALL r3Acos(R3Real x);
17661
17667RAPIER_API R3Real RAPIER_CALL r3Atan2(R3Real y, R3Real x);
17668
17673RAPIER_API R3Real RAPIER_CALL r3Exp(R3Real x);
17674
17679RAPIER_API R3Real RAPIER_CALL r3Ln(R3Real x);
17680
17685RAPIER_API R3Real RAPIER_CALL r3Powf(R3Real base, R3Real exponent);
17686
17692RAPIER_API
17693struct R3ShapeMesh *RAPIER_CALL r3SharedShape_Tessellate(const R3SharedShape *shape,
17694 uint32_t subdivisions);
17695
17701RAPIER_API
17702size_t RAPIER_CALL r3ShapeMesh_Triangles(const struct R3ShapeMesh *mesh,
17703 struct R3Vector *buffer,
17704 size_t capacity);
17705
17711RAPIER_API
17712size_t RAPIER_CALL r3ShapeMesh_Lines(const struct R3ShapeMesh *mesh,
17713 struct R3Vector *buffer,
17714 size_t capacity);
17715
17721RAPIER_API R3Status RAPIER_CALL r3FreeShapeMesh(struct R3ShapeMesh *mesh);
17722
17723#if defined(RAPIER_DIM3)
17728RAPIER_API
17729R3SharedShape *RAPIER_CALL r3RoundCylinderSharedShape(R3Real half_height,
17730 R3Real radius,
17731 R3Real border_radius);
17732#endif
17733
17734#if defined(RAPIER_DIM3)
17739RAPIER_API
17740R3SharedShape *RAPIER_CALL r3RoundConeSharedShape(R3Real half_height,
17741 R3Real radius,
17742 R3Real border_radius);
17743#endif
17744
17745#if defined(RAPIER_DIM3)
17753RAPIER_API
17754struct R3TriMeshData *RAPIER_CALL r3SharedShape_ToTrimesh(const R3SharedShape *shape,
17755 uint32_t ntheta,
17756 uint32_t nphi);
17757#endif
17758
17759#if defined(RAPIER_DIM3)
17765RAPIER_API
17766size_t RAPIER_CALL r3TriMeshData_Vertices(const struct R3TriMeshData *mesh,
17767 struct R3Vector *buffer,
17768 size_t capacity);
17769#endif
17770
17771#if defined(RAPIER_DIM3)
17777RAPIER_API
17778size_t RAPIER_CALL r3TriMeshData_Indices(const struct R3TriMeshData *mesh,
17779 uint32_t *buffer,
17780 size_t capacity);
17781#endif
17782
17783#if defined(RAPIER_DIM3)
17789RAPIER_API R3Status RAPIER_CALL r3FreeTriMeshData(struct R3TriMeshData *mesh);
17790#endif
17791
17792#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17797RAPIER_API struct R3UrdfLoaderOptions RAPIER_CALL r3DefaultUrdfLoaderOptions(void);
17798#endif
17799
17800#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17806RAPIER_API R3Status RAPIER_CALL r3FreeUrdfRobot(struct R3UrdfRobot *object);
17807#endif
17808
17809#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17815RAPIER_API
17816struct R3UrdfRobot *RAPIER_CALL r3UrdfRobotFromFile(const char *path,
17817 const struct R3UrdfLoaderOptions *options);
17818#endif
17819
17820#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17825RAPIER_API
17826R3Status RAPIER_CALL r3UrdfRobot_AppendTransform(struct R3UrdfRobot *robot,
17827 struct R3Pose transform);
17828#endif
17829
17830#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17836RAPIER_API R3Status RAPIER_CALL r3FreeUrdfRobotHandles(struct R3UrdfRobotHandles *handles);
17837#endif
17838
17839#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17844RAPIER_API
17845struct R3UrdfRobotHandles *RAPIER_CALL r3UrdfRobot_InsertUsingImpulseJoints(struct R3World *world,
17846 const struct R3UrdfRobot *robot);
17847#endif
17848
17849#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17854RAPIER_API
17855struct R3UrdfRobotHandles *RAPIER_CALL r3UrdfRobot_InsertUsingMultibodyJoints(struct R3World *world,
17856 const struct R3UrdfRobot *robot,
17857 uint8_t options);
17858#endif
17859
17860#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17867RAPIER_API
17868size_t RAPIER_CALL r3UrdfRobotHandles_Bodies(const struct R3UrdfRobotHandles *handles,
17869 struct R3RigidBodyHandle *buffer,
17870 size_t capacity);
17871#endif
17872
17873#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17878RAPIER_API struct R3MjcfLoaderOptions RAPIER_CALL r3DefaultMjcfLoaderOptions(void);
17879#endif
17880
17881#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17887RAPIER_API R3Status RAPIER_CALL r3FreeMjcfRobot(struct R3MjcfRobot *object);
17888#endif
17889
17890#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17896RAPIER_API
17897struct R3MjcfRobot *RAPIER_CALL r3MjcfRobotFromFile(const char *path,
17898 const struct R3MjcfLoaderOptions *options);
17899#endif
17900
17901#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17906RAPIER_API
17907R3Status RAPIER_CALL r3MjcfRobot_AppendTransform(struct R3MjcfRobot *robot,
17908 struct R3Pose transform);
17909#endif
17910
17911#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17917RAPIER_API R3Status RAPIER_CALL r3FreeMjcfRobotHandles(struct R3MjcfRobotHandles *handles);
17918#endif
17919
17920#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17925RAPIER_API
17926struct R3MjcfRobotHandles *RAPIER_CALL r3MjcfRobot_InsertUsingImpulseJoints(struct R3World *world,
17927 const struct R3MjcfRobot *robot);
17928#endif
17929
17930#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17935RAPIER_API
17936struct R3MjcfRobotHandles *RAPIER_CALL r3MjcfRobot_InsertUsingMultibodyJoints(struct R3World *world,
17937 const struct R3MjcfRobot *robot,
17938 uint8_t options);
17939#endif
17940
17941#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17947RAPIER_API
17948size_t RAPIER_CALL r3MjcfRobotHandles_Bodies(const struct R3MjcfRobotHandles *handles,
17949 struct R3RigidBodyHandle *buffer,
17950 size_t capacity);
17951#endif
17952
17953#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17958RAPIER_API struct R3Vector RAPIER_CALL r3MjcfRobot_Gravity(const struct R3MjcfRobot *robot);
17959#endif
17960
17961#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17966RAPIER_API size_t RAPIER_CALL r3MjcfRobot_BodyCount(const struct R3MjcfRobot *robot);
17967#endif
17968
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);
17975#endif
17976
17977#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17982RAPIER_API
17983R3Status RAPIER_CALL r3MjcfRobot_SetBodyColliderCollisionGroups(struct R3MjcfRobot *robot,
17984 size_t body,
17985 size_t collider,
17986 struct R3InteractionGroups groups);
17987#endif
17988
17989#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
17994RAPIER_API size_t RAPIER_CALL r3MjcfRobot_KeyframeCount(const struct R3MjcfRobot *robot);
17995#endif
17996
17997#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18003RAPIER_API
18004size_t RAPIER_CALL r3MjcfRobot_KeyframeName(const struct R3MjcfRobot *robot,
18005 size_t key,
18006 char *buffer,
18007 size_t capacity);
18008#endif
18009
18010#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18015RAPIER_API
18016R3Status RAPIER_CALL r3MjcfRobot_AppendKeyframe(struct R3MjcfRobot *robot,
18017 const struct R3MjcfRobot *source,
18018 size_t key);
18019#endif
18020
18021#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18027RAPIER_API
18028size_t RAPIER_CALL r3MjcfRobot_KeyframeControls(const struct R3MjcfRobot *robot,
18029 size_t key,
18030 R3Real *buffer,
18031 size_t capacity);
18032#endif
18033
18034#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18039RAPIER_API size_t RAPIER_CALL r3MjcfRobotHandles_ActuatorCount(const struct R3MjcfRobotHandles *handles);
18040#endif
18041
18042#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18047RAPIER_API
18048R3Status RAPIER_CALL r3MjcfRobotHandles_ApplyKeyframe(const struct R3MjcfRobotHandles *handles,
18049 const struct R3MjcfRobot *robot,
18050 size_t key);
18051#endif
18052
18053#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18058RAPIER_API
18059R3Status RAPIER_CALL r3MjcfRobotHandles_ApplyControlsScaled(const struct R3MjcfRobotHandles *handles,
18060 const R3Real *controls,
18061 size_t count,
18062 R3Real gain);
18063#endif
18064
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);
18071#endif
18072
18073#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18079RAPIER_API
18080const R3MjcfVisualMesh *RAPIER_CALL r3MjcfRobot_BodyVisual(const struct R3MjcfRobot *robot,
18081 size_t body,
18082 size_t visual);
18083#endif
18084
18085#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18090RAPIER_API struct R3MjcfVisualMeshInfo RAPIER_CALL r3MjcfVisualMesh_Info(const R3MjcfVisualMesh *visual);
18091#endif
18092
18093#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18099RAPIER_API R3SharedShape *RAPIER_CALL r3MjcfVisualMesh_CloneShape(const R3MjcfVisualMesh *visual);
18100#endif
18101
18102#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18108RAPIER_API
18109size_t RAPIER_CALL r3MjcfVisualMesh_Uvs(const R3MjcfVisualMesh *visual,
18110 float *buffer,
18111 size_t capacity);
18112#endif
18113
18114#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18120RAPIER_API
18121size_t RAPIER_CALL r3MjcfVisualMesh_Normals(const R3MjcfVisualMesh *visual,
18122 float *buffer,
18123 size_t capacity);
18124#endif
18125
18126#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18132RAPIER_API
18133size_t RAPIER_CALL r3MjcfVisualMesh_Texture(const R3MjcfVisualMesh *visual,
18134 char *buffer,
18135 size_t capacity);
18136#endif
18137
18138#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18145RAPIER_API
18146struct R3UrdfRobot *RAPIER_CALL r3UrdfRobotFromString(const char *urdf,
18147 const char *mesh_dir,
18148 const struct R3UrdfLoaderOptions *options);
18149#endif
18150
18151#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18157RAPIER_API R3Status RAPIER_CALL r3FreeMjcfContactHooks(struct R3MjcfContactHooks *hooks);
18158#endif
18159
18160#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18166RAPIER_API
18167struct R3MjcfContactHooks *RAPIER_CALL r3MjcfRobotHandles_ContactHooks(const struct R3MjcfRobotHandles *handles,
18168 const struct R3MjcfRobot *robot);
18169#endif
18170
18171#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18178RAPIER_API
18179struct R3PhysicsHooks RAPIER_CALL r3MjcfContactHooks_PhysicsHooks(const struct R3MjcfContactHooks *hooks);
18180#endif
18181
18182#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18188RAPIER_API R3Status RAPIER_CALL r3FreeLoadedMeshes(struct R3LoadedMeshes *meshes);
18189#endif
18190
18191#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18199RAPIER_API
18200struct R3LoadedMeshes *RAPIER_CALL r3LoadedMeshesFromFile(const char *path,
18201 uint32_t converter,
18202 uint32_t trimesh_flags,
18203 struct R3Vector scale);
18204#endif
18205
18206#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18211RAPIER_API size_t RAPIER_CALL r3LoadedMeshes_Count(const struct R3LoadedMeshes *meshes);
18212#endif
18213
18214#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18221RAPIER_API
18222R3SharedShape *RAPIER_CALL r3LoadedMeshes_CloneShape(const struct R3LoadedMeshes *meshes,
18223 size_t index);
18224#endif
18225
18226#if (defined(RAPIER_ROBOTICS) && defined(RAPIER_DIM3) && defined(RAPIER_F32))
18232RAPIER_API
18233struct R3Pose RAPIER_CALL r3LoadedMeshes_Pose(const struct R3LoadedMeshes *meshes,
18234 size_t index);
18235#endif
18236
18241RAPIER_API struct R3Pose RAPIER_CALL r3RigidBody_Position(struct R3RigidBodyHandle handle);
18242
18247RAPIER_API struct R3Vector RAPIER_CALL r3RigidBody_Translation(struct R3RigidBodyHandle handle);
18248
18253RAPIER_API struct R3Vector RAPIER_CALL r3RigidBody_Linvel(struct R3RigidBodyHandle handle);
18254
18259RAPIER_API R3AngVector RAPIER_CALL r3RigidBody_Angvel(struct R3RigidBodyHandle handle);
18260
18265RAPIER_API R3Bool RAPIER_CALL r3RigidBody_IsSleeping(struct R3RigidBodyHandle handle);
18266
18271RAPIER_API R3Bool RAPIER_CALL r3RigidBody_IsEnabled(struct R3RigidBodyHandle handle);
18272
18277RAPIER_API struct R3UserData RAPIER_CALL r3RigidBody_UserData(struct R3RigidBodyHandle handle);
18278
18284RAPIER_API
18285R3Status RAPIER_CALL r3RigidBody_SetPosition(struct R3RigidBodyHandle handle,
18286 struct R3Pose value,
18287 R3Bool wake_up);
18288
18294RAPIER_API
18295R3Status RAPIER_CALL r3RigidBody_SetTranslation(struct R3RigidBodyHandle handle,
18296 struct R3Vector value,
18297 R3Bool wake_up);
18298
18304RAPIER_API
18305R3Status RAPIER_CALL r3RigidBody_SetLinvel(struct R3RigidBodyHandle handle,
18306 struct R3Vector value,
18307 R3Bool wake_up);
18308
18314RAPIER_API
18315R3Status RAPIER_CALL r3RigidBody_SetAngvel(struct R3RigidBodyHandle handle,
18316 R3AngVector value,
18317 R3Bool wake_up);
18318
18323RAPIER_API
18324R3Status RAPIER_CALL r3RigidBody_SetNextKinematicPosition(struct R3RigidBodyHandle handle,
18325 struct R3Pose value);
18326
18331RAPIER_API
18332R3Status RAPIER_CALL r3RigidBody_SetNextKinematicTranslation(struct R3RigidBodyHandle handle,
18333 struct R3Vector value);
18334
18340RAPIER_API
18341R3Status RAPIER_CALL r3RigidBody_SetGravityScale(struct R3RigidBodyHandle handle,
18342 R3Real value,
18343 R3Bool wake_up);
18344
18349RAPIER_API
18350R3Status RAPIER_CALL r3RigidBody_SetLinearDamping(struct R3RigidBodyHandle handle,
18351 R3Real value);
18352
18357RAPIER_API
18358R3Status RAPIER_CALL r3RigidBody_SetAngularDamping(struct R3RigidBodyHandle handle,
18359 R3Real value);
18360
18365RAPIER_API R3Status RAPIER_CALL r3RigidBody_SetEnabled(struct R3RigidBodyHandle handle, R3Bool value);
18366
18371RAPIER_API
18372R3Status RAPIER_CALL r3RigidBody_SetUserData(struct R3RigidBodyHandle handle,
18373 struct R3UserData value);
18374
18380RAPIER_API
18381R3Status RAPIER_CALL r3RigidBody_ApplyImpulse(struct R3RigidBodyHandle handle,
18382 struct R3Vector value,
18383 R3Bool wake_up);
18384
18390RAPIER_API
18391R3Status RAPIER_CALL r3RigidBody_ApplyImpulseAtPoint(struct R3RigidBodyHandle handle,
18392 struct R3Vector value,
18393 struct R3Vector point,
18394 R3Bool wake_up);
18395
18401RAPIER_API
18402R3Status RAPIER_CALL r3RigidBody_AddForce(struct R3RigidBodyHandle handle,
18403 struct R3Vector value,
18404 R3Bool wake_up);
18405
18411RAPIER_API R3Status RAPIER_CALL r3RigidBody_ResetForces(struct R3RigidBodyHandle handle, R3Bool wake_up);
18412
18417RAPIER_API R3Status RAPIER_CALL r3RigidBody_Sleep(struct R3RigidBodyHandle handle);
18418
18423RAPIER_API struct R3Pose RAPIER_CALL r3Collider_Position(struct R3ColliderHandle handle);
18424
18429RAPIER_API struct R3Vector RAPIER_CALL r3Collider_Translation(struct R3ColliderHandle handle);
18430
18435RAPIER_API R3Real RAPIER_CALL r3Collider_Friction(struct R3ColliderHandle handle);
18436
18441RAPIER_API R3Real RAPIER_CALL r3Collider_Restitution(struct R3ColliderHandle handle);
18442
18447RAPIER_API R3Bool RAPIER_CALL r3Collider_IsSensor(struct R3ColliderHandle handle);
18448
18453RAPIER_API struct R3RigidBodyHandle RAPIER_CALL r3Collider_Parent(struct R3ColliderHandle handle);
18454
18460RAPIER_API
18461R3Status RAPIER_CALL r3Collider_SetPosition(struct R3ColliderHandle handle,
18462 struct R3Pose value);
18463
18469RAPIER_API
18470R3Status RAPIER_CALL r3Collider_SetTranslation(struct R3ColliderHandle handle,
18471 struct R3Vector value);
18472
18477RAPIER_API R3Status RAPIER_CALL r3Collider_SetFriction(struct R3ColliderHandle handle, R3Real value);
18478
18483RAPIER_API R3Status RAPIER_CALL r3Collider_SetRestitution(struct R3ColliderHandle handle, R3Real value);
18484
18489RAPIER_API R3Status RAPIER_CALL r3Collider_SetSensor(struct R3ColliderHandle handle, R3Bool value);
18490
18495RAPIER_API
18496R3Status RAPIER_CALL r3Collider_SetCollisionGroups(struct R3ColliderHandle handle,
18497 struct R3InteractionGroups value);
18498
18503RAPIER_API
18504R3Status RAPIER_CALL r3Collider_SetUserData(struct R3ColliderHandle handle,
18505 struct R3UserData value);
18506
18511RAPIER_API
18512struct R3Vector RAPIER_CALL r3SoftBody_ParticlePosition(struct R3SoftBodyHandle handle,
18513 size_t index);
18514
18520RAPIER_API
18521size_t RAPIER_CALL r3SoftBody_ParticlePositions(struct R3SoftBodyHandle handle,
18522 struct R3Vector *buffer,
18523 size_t capacity);
18524
18529RAPIER_API struct R3SoftBodyMaterial RAPIER_CALL r3SoftBody_Material(struct R3SoftBodyHandle handle);
18530
18535RAPIER_API
18536R3Status RAPIER_CALL r3SoftBody_SetParticlePosition(struct R3SoftBodyHandle handle,
18537 size_t index,
18538 struct R3Vector value);
18539
18544RAPIER_API
18545R3Status RAPIER_CALL r3SoftBody_SetMaterial(struct R3SoftBodyHandle handle,
18546 const struct R3SoftBodyMaterial *data);
18547
18553RAPIER_API
18554R3Status RAPIER_CALL r3SoftBody_AddParticleForce(struct R3SoftBodyHandle handle,
18555 size_t index,
18556 struct R3Vector value,
18557 R3Bool wake_up);
18558
18565RAPIER_API
18566size_t RAPIER_CALL r3RigidBodyReadStates(const struct R3World *world,
18567 const struct R3RigidBodyHandle *handles,
18568 size_t handle_count,
18569 struct R3RigidBodyState *states,
18570 size_t capacity);
18571
18576RAPIER_API struct R3JointDesc RAPIER_CALL r3ImpulseJoint_Desc(struct R3ImpulseJointHandle handle);
18577
18583RAPIER_API
18584R3Status RAPIER_CALL r3ImpulseJoint_SetDesc(struct R3ImpulseJointHandle handle,
18585 const struct R3JointDesc *desc,
18586 R3Bool wake_up);
18587
18592RAPIER_API uint16_t RAPIER_CALL r3Collider_ActiveCollisionTypes(struct R3ColliderHandle handle);
18593
18598RAPIER_API uint32_t RAPIER_CALL r3Collider_ActiveHooks(struct R3ColliderHandle handle);
18599
18604RAPIER_API uint32_t RAPIER_CALL r3Collider_FrictionCombineRule(struct R3ColliderHandle handle);
18605
18610RAPIER_API uint32_t RAPIER_CALL r3Collider_RestitutionCombineRule(struct R3ColliderHandle handle);
18611
18617RAPIER_API struct R3Pose RAPIER_CALL r3Collider_PositionWrtParent(struct R3ColliderHandle handle);
18618
18623RAPIER_API int8_t RAPIER_CALL r3RigidBody_DominanceGroup(struct R3RigidBodyHandle handle);
18624
18629RAPIER_API size_t RAPIER_CALL r3RigidBody_AdditionalSolverIterations(struct R3RigidBodyHandle handle);
18630
18635RAPIER_API size_t RAPIER_CALL r3RigidBody_AdditionalPgsIterations(struct R3RigidBodyHandle handle);
18636
18641RAPIER_API R3Bool RAPIER_CALL r3RigidBody_IsFastRotationAllowed(struct R3RigidBodyHandle handle);
18642
18648RAPIER_API
18649R3Status RAPIER_CALL r3Collider_SetRotation(struct R3ColliderHandle handle,
18650 struct R3Rotation value);
18651
18657RAPIER_API
18658R3Status RAPIER_CALL r3RigidBody_SetAllowFastRotation(struct R3RigidBodyHandle handle,
18659 R3Bool value);
18660
18667RAPIER_API
18668R3Status RAPIER_CALL r3ShapeDesc_SetTrimesh(struct R3ShapeDesc *desc,
18669 struct R3VectorView vertices,
18670 struct R3TriangleView indices,
18671 uint32_t flags);
18672
18679RAPIER_API
18680R3Status RAPIER_CALL r3ShapeDesc_SetPolyline(struct R3ShapeDesc *desc,
18681 struct R3VectorView vertices,
18682 struct R3EdgeView indices,
18683 uint32_t flags);
18684
18689RAPIER_API
18690R3Status RAPIER_CALL r3ShapeDesc_SetConvexHull(struct R3ShapeDesc *desc,
18691 struct R3VectorView vertices);
18692
18697RAPIER_API
18698R3Status RAPIER_CALL r3SoftBodyDesc_SetParticles(struct R3SoftBodyDesc *desc,
18699 struct R3VectorView positions);
18700
18705RAPIER_API
18706R3Status RAPIER_CALL r3SoftBodyDesc_SetSurfaceMesh(struct R3SoftBodyDesc *desc,
18707 struct R3VectorView vertices,
18708 R3SurfaceElementView elements);
18709
18710#if defined(RAPIER_DIM2)
18717RAPIER_API
18718R3Status RAPIER_CALL r3SoftBodyDesc_SetTrimesh(struct R3SoftBodyDesc *desc,
18719 struct R3VectorView vertices,
18720 struct R3TriangleView triangles);
18721#endif
18722
18729RAPIER_API
18730R3Status RAPIER_CALL r3SoftBodyDesc_SetAppended(struct R3SoftBodyDesc *desc,
18731 struct R3SoftBodyDescView view);
18732
18739RAPIER_API
18740R3Status RAPIER_CALL r3SoftBodyDesc_SetAddedEdges(struct R3SoftBodyDesc *desc,
18741 struct R3EdgeView view);
18742
18747RAPIER_API
18748R3Status RAPIER_CALL r3SoftBodyDesc_SetSkin(struct R3SoftBodyDesc *desc,
18749 struct R3VectorView vertices,
18750 R3SurfaceElementView elements);
18751
18759RAPIER_API
18760R3Status RAPIER_CALL r3SoftBodyDesc_SetMasses(struct R3SoftBodyDesc *desc,
18761 struct R3RealView view);
18762
18770RAPIER_API
18771R3Status RAPIER_CALL r3SoftBodyDesc_SetPinnedParticles(struct R3SoftBodyDesc *desc,
18772 struct R3IndexView view);
18773
18781RAPIER_API
18782R3Status RAPIER_CALL r3SoftBodyDesc_SetEdges(struct R3SoftBodyDesc *desc,
18783 struct R3EdgeView view);
18784
18792RAPIER_API
18793R3Status RAPIER_CALL r3SoftBodyDesc_SetBendEdges(struct R3SoftBodyDesc *desc,
18794 struct R3EdgeView view);
18795
18803RAPIER_API R3Status RAPIER_CALL r3SoftBodyDesc_SetCells(struct R3SoftBodyDesc *desc, R3CellView view);
18804
18812RAPIER_API
18813R3Status RAPIER_CALL r3SoftBodyDesc_SetSurface(struct R3SoftBodyDesc *desc,
18814 R3SurfaceElementView view);
18815
18823RAPIER_API
18824R3Status RAPIER_CALL r3SoftBodyDesc_SetTensionOnlyEdges(struct R3SoftBodyDesc *desc,
18825 struct R3IndexView view);
18826
18827#if defined(RAPIER_DIM3)
18835RAPIER_API
18836R3Status RAPIER_CALL r3SoftBodyDesc_SetDihedrals(struct R3SoftBodyDesc *desc,
18837 struct R3DihedralView view);
18838#endif
18839
18840#if defined(RAPIER_DIM3)
18848RAPIER_API
18849R3Status RAPIER_CALL r3SoftBodyDesc_SetWire(struct R3SoftBodyDesc *desc,
18850 struct R3EdgeView view);
18851#endif
18852
18858RAPIER_API
18859struct R3ColliderDesc RAPIER_CALL r3RoundCuboidColliderDesc(struct R3Vector half_extents,
18860 R3Real border_radius);
18861
18867RAPIER_API
18868struct R3ColliderDesc RAPIER_CALL r3CapsuleColliderDesc(struct R3Vector a,
18869 struct R3Vector b,
18870 R3Real radius);
18871
18877RAPIER_API struct R3ColliderDesc RAPIER_CALL r3SegmentColliderDesc(struct R3Vector a, struct R3Vector b);
18878
18884RAPIER_API
18885struct R3ColliderDesc RAPIER_CALL r3TriangleColliderDesc(struct R3Vector a,
18886 struct R3Vector b,
18887 struct R3Vector c);
18888
18894RAPIER_API struct R3ColliderDesc RAPIER_CALL r3HalfspaceColliderDesc(struct R3Vector normal);
18895
18896#if defined(RAPIER_DIM3)
18902RAPIER_API struct R3ColliderDesc RAPIER_CALL r3CylinderColliderDesc(R3Real half_height, R3Real radius);
18903#endif
18904
18905#if defined(RAPIER_DIM3)
18911RAPIER_API struct R3ColliderDesc RAPIER_CALL r3ConeColliderDesc(R3Real half_height, R3Real radius);
18912#endif
18913
18914#if defined(RAPIER_DIM3)
18920RAPIER_API
18921struct R3ColliderDesc RAPIER_CALL r3RoundCylinderColliderDesc(R3Real half_height,
18922 R3Real radius,
18923 R3Real border_radius);
18924#endif
18925
18926#if defined(RAPIER_DIM3)
18932RAPIER_API
18933struct R3ColliderDesc RAPIER_CALL r3RoundConeColliderDesc(R3Real half_height,
18934 R3Real radius,
18935 R3Real border_radius);
18936#endif
18937
18943RAPIER_API struct R3ColliderDesc RAPIER_CALL r3CapsuleXColliderDesc(R3Real half_height, R3Real radius);
18944
18950RAPIER_API struct R3ColliderDesc RAPIER_CALL r3CapsuleYColliderDesc(R3Real half_height, R3Real radius);
18951
18952#if defined(RAPIER_DIM3)
18958RAPIER_API struct R3ColliderDesc RAPIER_CALL r3CapsuleZColliderDesc(R3Real half_height, R3Real radius);
18959#endif
18960
18966RAPIER_API
18967struct R3SoftBodyDesc RAPIER_CALL r3RopeSoftBodyDesc(struct R3Vector a,
18968 struct R3Vector b,
18969 size_t particles);
18970
18971#if defined(RAPIER_DIM2)
18977RAPIER_API
18978struct R3SoftBodyDesc RAPIER_CALL r3GridSoftBodyDesc(struct R3Vector center,
18979 struct R3Vector half_extents,
18980 size_t nx,
18981 size_t ny);
18982#endif
18983
18984#if defined(RAPIER_DIM3)
18990RAPIER_API
18991struct R3SoftBodyDesc RAPIER_CALL r3CuboidSoftBodyDesc(struct R3Vector center,
18992 struct R3Vector half_extents,
18993 size_t nx,
18994 size_t ny,
18995 size_t nz);
18996#endif
18997
18998#if defined(RAPIER_DIM3)
19004RAPIER_API
19005struct R3SoftBodyDesc RAPIER_CALL r3ClothSoftBodyDesc(struct R3Vector origin,
19006 struct R3Vector du,
19007 struct R3Vector dv,
19008 size_t nu,
19009 size_t nv);
19010#endif
19011
19012#if defined(RAPIER_DIM3)
19020RAPIER_API
19021struct R3SoftBodyDesc RAPIER_CALL r3ClothAnisotropicSoftBodyDesc(struct R3Vector origin,
19022 struct R3Vector du,
19023 struct R3Vector dv,
19024 size_t nu,
19025 size_t nv,
19026 struct R3SpringCoefficients warp,
19027 struct R3SpringCoefficients weft,
19028 struct R3SpringCoefficients shear);
19029#endif
19030
19031#if defined(RAPIER_DIM2)
19039RAPIER_API struct R3SoftBodyDesc RAPIER_CALL r3PolygonSoftBodyDesc(struct R3VectorView points);
19040#endif
19041
19042#if defined(RAPIER_DIM2)
19049RAPIER_API
19050struct R3SoftBodyDesc RAPIER_CALL r3DiskSoftBodyDesc(struct R3Vector center,
19051 R3Real radius,
19052 size_t particles);
19053#endif
19054
19055#if defined(RAPIER_DIM3)
19061RAPIER_API
19062struct R3SoftBodyDesc RAPIER_CALL r3SphereSoftBodyDesc(struct R3Vector center,
19063 R3Real radius,
19064 uint32_t subdivisions);
19065#endif
19066
19067#if defined(RAPIER_DIM3)
19074RAPIER_API
19075struct R3SoftBodyDesc RAPIER_CALL r3ClothTubeSoftBodyDesc(struct R3Vector origin,
19076 struct R3Vector axis,
19077 R3Real radius_start,
19078 R3Real radius_end,
19079 size_t num_around,
19080 size_t num_along);
19081#endif
19082
19087RAPIER_API
19088struct R3SoftBodyDesc RAPIER_CALL r3VolumetricSoftBodyDesc(struct R3VectorView vertices,
19089 R3SurfaceElementView surface,
19090 struct R3VolumeMeshParameters parameters);
19091
19096RAPIER_API
19097struct R3SoftBodyMaterial RAPIER_CALL r3UniformSoftBodyMaterial(struct R3SpringCoefficients value);
19098
19104RAPIER_API
19105size_t RAPIER_CALL r3SoftBodyDesc_ParticlePositions(const struct R3SoftBodyDesc *desc,
19106 struct R3Vector *buffer,
19107 size_t capacity);
19108
19114RAPIER_API
19115size_t RAPIER_CALL r3SoftBodyDesc_CellIndices(const struct R3SoftBodyDesc *desc,
19116 uint32_t *buffer,
19117 size_t capacity);
19118
19123RAPIER_API
19124struct R3Vector RAPIER_CALL r3SoftBody_ParticleVelocity(struct R3SoftBodyHandle handle,
19125 size_t index);
19126
19132RAPIER_API uint32_t RAPIER_CALL r3SoftBody_Solver(struct R3SoftBodyHandle handle);
19133
19139RAPIER_API
19140R3Status RAPIER_CALL r3SoftBody_SetClusterEdgeSoftness(struct R3SoftBodyHandle handle,
19141 uint32_t cluster,
19142 const struct R3SpringCoefficients *softness);
19143
19152RAPIER_API
19153R3Status RAPIER_CALL r3SoftBody_ApplyImpulseAtPoint(struct R3SoftBodyHandle handle,
19154 struct R3Vector impulse,
19155 struct R3Vector point,
19156 R3Real falloff_radius,
19157 R3Bool wake_up);
19158
19168RAPIER_API
19169R3Status RAPIER_CALL r3SoftBody_ApplyRadialImpulse(struct R3SoftBodyHandle handle,
19170 struct R3Vector center,
19171 R3Real magnitude,
19172 R3Real falloff_radius,
19173 R3Bool wake_up);
19174
19181RAPIER_API R3Status RAPIER_CALL r3SoftBody_ResetPlasticity(struct R3SoftBodyHandle handle);
19182
19188RAPIER_API R3Status RAPIER_CALL r3SoftBody_TearEdge(struct R3SoftBodyHandle handle, size_t index);
19189
19196RAPIER_API R3Status RAPIER_CALL r3SoftBody_TearCell(struct R3SoftBodyHandle handle, size_t index);
19197
19203RAPIER_API struct R3SoftBodyHandle RAPIER_CALL r3Collider_SoftBody(struct R3ColliderHandle handle);
19204
19210RAPIER_API
19211struct R3SoftBodyHandle RAPIER_CALL r3ReadCollider_SoftBody(const struct R3ReadContext *context,
19212 struct R3ColliderHandle handle);
19213
19220RAPIER_API size_t RAPIER_CALL r3SoftBodyTearEvent_PieceCount(const struct R3SoftBodyTearEvent *event);
19221
19226RAPIER_API R3Bool RAPIER_CALL r3RecoveryAuthoredVelocityMargin(const struct R3World *world);
19227
19232RAPIER_API R3Bool RAPIER_CALL r3RecoveryEdgeSpeculation(const struct R3World *world);
19233
19238RAPIER_API R3Bool RAPIER_CALL r3RecoveryInvertedCellDetection(const struct R3World *world);
19239
19244RAPIER_API R3Bool RAPIER_CALL r3RecoverySelfCrossingDetection(const struct R3World *world);
19245
19250RAPIER_API R3Bool RAPIER_CALL r3RecoveryDetectionMotionGating(const struct R3World *world);
19251
19256RAPIER_API R3Bool RAPIER_CALL r3RecoveryCrossBodyDetection(const struct R3World *world);
19257
19262RAPIER_API R3Bool RAPIER_CALL r3RecoverySelfStandDown(const struct R3World *world);
19263
19268RAPIER_API R3Bool RAPIER_CALL r3RecoveryCrossBodyExpelGate(const struct R3World *world);
19269
19274RAPIER_API R3Bool RAPIER_CALL r3RecoveryEdgeStandDown(const struct R3World *world);
19275
19280RAPIER_API R3Bool RAPIER_CALL r3RecoveryCrossingRepulsion(const struct R3World *world);
19281
19286RAPIER_API R3Bool RAPIER_CALL r3RecoveryCrossingRepulsionGuide(const struct R3World *world);
19287
19292RAPIER_API R3Bool RAPIER_CALL r3RecoveryCrossingRepulsionSelfGuide(const struct R3World *world);
19293
19298RAPIER_API R3Real RAPIER_CALL r3RecoveryRecoveryPace(const struct R3World *world);
19299
19304RAPIER_API R3Bool RAPIER_CALL r3RecoveryOverlapConstraints(const struct R3World *world);
19305
19310RAPIER_API R3Bool RAPIER_CALL r3RecoveryOverlapRigid(const struct R3World *world);
19311
19316RAPIER_API R3Bool RAPIER_CALL r3RecoveryOverlapSkipSelfTangled(const struct R3World *world);
19317
19322RAPIER_API R3Bool RAPIER_CALL r3RecoveryOverlapEdgeStandDown(const struct R3World *world);
19323
19328RAPIER_API R3Real RAPIER_CALL r3RecoveryOverlapConstraintPace(const struct R3World *world);
19329
19334RAPIER_API uint32_t RAPIER_CALL r3RecoveryOverlapPatchConstraints(const struct R3World *world);
19335
19340RAPIER_API
19341R3Status RAPIER_CALL r3RecoverySetOverlapPatchConstraints(struct R3World *world,
19342 uint32_t value);
19343
19348RAPIER_API R3Bool RAPIER_CALL r3RecoveryOverlapSkinVolume(const struct R3World *world);
19349
19354RAPIER_API R3Real RAPIER_CALL r3RecoveryOverlapKeptDepth(const struct R3World *world);
19355
19360RAPIER_API R3Bool RAPIER_CALL r3RecoveryOverlapSelfRegions(const struct R3World *world);
19361
19366RAPIER_API R3Bool RAPIER_CALL r3RecoveryOverlapNormalPush(const struct R3World *world);
19367
19372RAPIER_API R3Bool RAPIER_CALL r3RecoveryOverlapMultiVolume(const struct R3World *world);
19373
19378RAPIER_API uint32_t RAPIER_CALL r3RecoveryOverlapSplit(const struct R3World *world);
19379
19384RAPIER_API R3Status RAPIER_CALL r3RecoverySetOverlapSplit(struct R3World *world, uint32_t value);
19385
19390RAPIER_API uint32_t RAPIER_CALL r3RecoveryOverlapPatience(const struct R3World *world);
19391
19396RAPIER_API R3Status RAPIER_CALL r3RecoverySetOverlapPatience(struct R3World *world, uint32_t value);
19397
19402RAPIER_API R3Real RAPIER_CALL r3RecoveryOverlapProgressMargin(const struct R3World *world);
19403
19404#if defined(RAPIER_FEM)
19409RAPIER_API R3Real RAPIER_CALL r3FemLinearTolerance(const struct R3World *world);
19410#endif
19411
19412#if defined(RAPIER_FEM)
19417RAPIER_API size_t RAPIER_CALL r3FemMaxLinearIterations(const struct R3World *world);
19418#endif
19419
19420#if defined(RAPIER_FEM)
19425RAPIER_API size_t RAPIER_CALL r3FemMaxDenseDofs(const struct R3World *world);
19426#endif
19427
19433RAPIER_API size_t RAPIER_CALL r3Collider_ShapeIdentity(struct R3ColliderHandle handle);
19434
19439RAPIER_API size_t RAPIER_CALL r3SoftBody_NumParticles(struct R3SoftBodyHandle handle);
19440
19446RAPIER_API uint32_t RAPIER_CALL r3SoftBody_TopologyVersion(struct R3SoftBodyHandle handle);
19447
19452RAPIER_API R3Real RAPIER_CALL r3SoftBody_Mass(struct R3SoftBodyHandle handle);
19453
19458RAPIER_API R3Real RAPIER_CALL r3SoftBody_Volume(struct R3SoftBodyHandle handle);
19459
19464RAPIER_API R3Real RAPIER_CALL r3SoftBody_RestVolume(struct R3SoftBodyHandle handle);
19465
19470RAPIER_API R3Real RAPIER_CALL r3SoftBody_VolumeFactor(struct R3SoftBodyHandle handle);
19471
19476RAPIER_API struct R3Vector RAPIER_CALL r3SoftBody_CenterOfMass(struct R3SoftBodyHandle handle);
19477
19482RAPIER_API struct R3RigidBodyHandle RAPIER_CALL r3SoftBody_RootBody(struct R3SoftBodyHandle handle);
19483
19488RAPIER_API R3Bool RAPIER_CALL r3SoftBody_IsEnabled(struct R3SoftBodyHandle handle);
19489
19494RAPIER_API R3Bool RAPIER_CALL r3SoftBody_IsSleeping(struct R3SoftBodyHandle handle);
19495
19501RAPIER_API
19502size_t RAPIER_CALL r3SoftBody_ParticleVelocities(struct R3SoftBodyHandle handle,
19503 struct R3Vector *buffer,
19504 size_t capacity);
19505
19511RAPIER_API
19512size_t RAPIER_CALL r3SoftBody_Edges(struct R3SoftBodyHandle handle,
19513 uint32_t *buffer,
19514 size_t capacity);
19515
19521RAPIER_API
19522size_t RAPIER_CALL r3SoftBody_Cells(struct R3SoftBodyHandle handle,
19523 uint32_t *buffer,
19524 size_t capacity);
19525
19531RAPIER_API
19532size_t RAPIER_CALL r3SoftBody_Boundary(struct R3SoftBodyHandle handle,
19533 uint32_t *buffer,
19534 size_t capacity);
19535
19541RAPIER_API
19542size_t RAPIER_CALL r3SoftBody_Pieces(struct R3SoftBodyHandle handle,
19543 struct R3SoftBodyHandle *buffer,
19544 size_t capacity);
19545
19550RAPIER_API
19551R3Status RAPIER_CALL r3SoftBody_SetParticleVelocity(struct R3SoftBodyHandle handle,
19552 size_t index,
19553 struct R3Vector value);
19554
19559RAPIER_API
19560R3Status RAPIER_CALL r3SoftBody_SetParticleKinematicTarget(struct R3SoftBodyHandle handle,
19561 size_t index,
19562 struct R3Vector value);
19563
19568RAPIER_API
19569R3Status RAPIER_CALL r3SoftBody_SetParticlePinned(struct R3SoftBodyHandle handle,
19570 size_t index,
19571 R3Bool value);
19572
19578RAPIER_API
19579R3Status RAPIER_CALL r3SoftBody_ApplyParticleImpulse(struct R3SoftBodyHandle handle,
19580 size_t index,
19581 struct R3Vector value,
19582 R3Bool wake_up);
19583
19589RAPIER_API
19590R3Status RAPIER_CALL r3SoftBody_AddForce(struct R3SoftBodyHandle handle,
19591 struct R3Vector value,
19592 R3Bool wake_up);
19593
19601RAPIER_API
19602R3Status RAPIER_CALL r3SoftBody_ApplyImpulse(struct R3SoftBodyHandle handle,
19603 struct R3Vector value,
19604 R3Bool wake_up);
19605
19611RAPIER_API R3Status RAPIER_CALL r3SoftBody_ResetForces(struct R3SoftBodyHandle handle, R3Bool wake_up);
19612
19617RAPIER_API R3Status RAPIER_CALL r3SoftBody_SetEnabled(struct R3SoftBodyHandle handle, R3Bool value);
19618
19623RAPIER_API
19624R3Status RAPIER_CALL r3SoftBody_SetVolumeFactor(struct R3SoftBodyHandle handle,
19625 R3Real value);
19626
19633RAPIER_API
19634R3Status RAPIER_CALL r3SoftBody_AttachParticle(struct R3SoftBodyHandle handle,
19635 size_t index,
19636 struct R3RigidBodyHandle rigid_body);
19637
19643RAPIER_API R3Bool RAPIER_CALL r3SoftBody_DetachParticle(struct R3SoftBodyHandle handle, size_t index);
19644
19650RAPIER_API
19651size_t RAPIER_CALL r3SoftBody_Clusters(struct R3SoftBodyHandle handle,
19652 uint32_t *buffer,
19653 size_t capacity);
19654
19659RAPIER_API
19660struct R3RigidBodyHandle RAPIER_CALL r3SoftBody_ClusterProxy(struct R3SoftBodyHandle handle,
19661 uint32_t cluster);
19662
19668RAPIER_API
19669size_t RAPIER_CALL r3SoftBody_ClusterParticles(struct R3SoftBodyHandle handle,
19670 uint32_t cluster,
19671 uint32_t *buffer,
19672 size_t capacity);
19673
19678RAPIER_API
19679R3Status RAPIER_CALL r3SoftBody_SetClusterPinned(struct R3SoftBodyHandle handle,
19680 uint32_t cluster,
19681 R3Bool value);
19682
19687RAPIER_API
19688R3Status RAPIER_CALL r3SoftBody_SetClusterKinematicTarget(struct R3SoftBodyHandle handle,
19689 uint32_t cluster,
19690 struct R3Pose value);
19691
19696RAPIER_API
19697R3Status RAPIER_CALL r3SoftBody_SetClusterShapeMatchingEnabled(struct R3SoftBodyHandle handle,
19698 uint32_t cluster,
19699 R3Bool value);
19700
19707RAPIER_API
19708R3Status RAPIER_CALL r3SoftBody_SetClusterStiffnessScale(struct R3SoftBodyHandle handle,
19709 uint32_t cluster,
19710 R3Real value);
19711
19716RAPIER_API
19717R3Status RAPIER_CALL r3SoftBody_SetClusterTearResistance(struct R3SoftBodyHandle handle,
19718 uint32_t cluster,
19719 R3Real value);
19720
19726RAPIER_API
19727size_t RAPIER_CALL r3SoftBody_Meshes(struct R3SoftBodyHandle handle,
19728 struct R3SoftMeshInfo *buffer,
19729 size_t capacity);
19730
19736RAPIER_API
19737size_t RAPIER_CALL r3SoftBody_MeshVerticesById(struct R3SoftBodyHandle handle,
19738 struct R3SoftMeshId id,
19739 struct R3Vector *buffer,
19740 size_t capacity);
19741
19747RAPIER_API
19748size_t RAPIER_CALL r3SoftBody_MeshIndicesById(struct R3SoftBodyHandle handle,
19749 struct R3SoftMeshId id,
19750 uint32_t *buffer,
19751 size_t capacity);
19752
19758RAPIER_API
19759size_t RAPIER_CALL r3SoftBody_MeshColliders(struct R3SoftBodyHandle handle,
19760 struct R3ColliderHandle *buffer,
19761 size_t capacity);
19762
19768RAPIER_API
19769size_t RAPIER_CALL r3SoftBody_MeshVertices(struct R3SoftBodyHandle handle,
19770 struct R3ColliderHandle collider,
19771 struct R3Vector *buffer,
19772 size_t capacity);
19773
19779RAPIER_API
19780size_t RAPIER_CALL r3SoftBody_MeshIndices(struct R3SoftBodyHandle handle,
19781 struct R3ColliderHandle collider,
19782 uint32_t *buffer,
19783 size_t capacity);
19784
19789RAPIER_API
19790size_t RAPIER_CALL r3SoftBody_MeshArity(struct R3SoftBodyHandle handle,
19791 struct R3ColliderHandle collider);
19792
19797RAPIER_API
19798uint32_t RAPIER_CALL r3SoftBody_MeshTopologyVersion(struct R3SoftBodyHandle handle,
19799 struct R3ColliderHandle collider);
19800
19801#if defined(RAPIER_FEM)
19806RAPIER_API R3Status RAPIER_CALL r3SoftBody_SetSolver(struct R3SoftBodyHandle handle, uint32_t solver);
19807#endif
19808
19813RAPIER_API
19814R3Status RAPIER_CALL r3SoftBody_SetClusterShapeMatchingTarget(struct R3SoftBodyHandle handle,
19815 uint32_t cluster,
19816 const struct R3Pose *target);
19817
19822RAPIER_API
19823R3Status RAPIER_CALL r3SoftBody_SetEdgeTearResistance(struct R3SoftBodyHandle handle,
19824 size_t index,
19825 R3Real resistance);
19826
19831RAPIER_API
19832R3Bool RAPIER_CALL r3SoftBody_MeshIsClosed(struct R3SoftBodyHandle handle,
19833 struct R3ColliderHandle collider);
19834
19840RAPIER_API
19841R3Status RAPIER_CALL r3RigidBody_SetAdditionalMassProperties(struct R3RigidBodyHandle handle,
19842 struct R3MassProperties properties,
19843 R3Bool wake_up);
19844
19849RAPIER_API
19850R3Status RAPIER_CALL r3RigidBody_RecomputeMassPropertiesFromColliders(struct R3RigidBodyHandle handle);
19851
19856RAPIER_API
19857R3Status RAPIER_CALL r3Collider_SetMassProperties(struct R3ColliderHandle handle,
19858 struct R3MassProperties properties);
19859
19864RAPIER_API struct R3MassProperties RAPIER_CALL r3Collider_MassProperties(struct R3ColliderHandle handle);
19865
19871RAPIER_API
19872R3Status RAPIER_CALL r3RigidBody_SetLockedAxes(struct R3RigidBodyHandle handle,
19873 uint8_t axes,
19874 R3Bool wake_up);
19875
19880RAPIER_API uint8_t RAPIER_CALL r3RigidBody_LockedAxes(struct R3RigidBodyHandle handle);
19881
19886RAPIER_API R3Bool RAPIER_CALL r3Collider_IsVoxels(struct R3ColliderHandle handle);
19887
19892RAPIER_API
19893struct R3VoxelQuery RAPIER_CALL r3Collider_VoxelAtFlatId(struct R3ColliderHandle handle,
19894 uint32_t id);
19895
19900RAPIER_API
19901R3Status RAPIER_CALL r3Collider_SetVoxel(struct R3ColliderHandle handle,
19902 struct R3VoxelKey key,
19903 R3Bool filled);
19904
19909RAPIER_API struct R3Pose RAPIER_CALL r3RigidBody_NextPosition(struct R3RigidBodyHandle handle);
19910
19915RAPIER_API struct R3Rotation RAPIER_CALL r3RigidBody_Rotation(struct R3RigidBodyHandle handle);
19916
19921RAPIER_API struct R3Vector RAPIER_CALL r3RigidBody_CenterOfMass(struct R3RigidBodyHandle handle);
19922
19927RAPIER_API struct R3Vector RAPIER_CALL r3RigidBody_LocalCenterOfMass(struct R3RigidBodyHandle handle);
19928
19933RAPIER_API struct R3Vector RAPIER_CALL r3RigidBody_UserForce(struct R3RigidBodyHandle handle);
19934
19939RAPIER_API R3AngVector RAPIER_CALL r3RigidBody_UserTorque(struct R3RigidBodyHandle handle);
19940
19945RAPIER_API uint32_t RAPIER_CALL r3RigidBody_BodyType(struct R3RigidBodyHandle handle);
19946
19951RAPIER_API R3Real RAPIER_CALL r3RigidBody_Mass(struct R3RigidBodyHandle handle);
19952
19957RAPIER_API R3Real RAPIER_CALL r3RigidBody_GravityScale(struct R3RigidBodyHandle handle);
19958
19963RAPIER_API R3Real RAPIER_CALL r3RigidBody_LinearDamping(struct R3RigidBodyHandle handle);
19964
19969RAPIER_API R3Real RAPIER_CALL r3RigidBody_AngularDamping(struct R3RigidBodyHandle handle);
19970
19975RAPIER_API R3Real RAPIER_CALL r3RigidBody_KineticEnergy(struct R3RigidBodyHandle handle);
19976
19981RAPIER_API R3Real RAPIER_CALL r3RigidBody_SoftCcdPrediction(struct R3RigidBodyHandle handle);
19982
19987RAPIER_API R3Bool RAPIER_CALL r3RigidBody_IsCcdEnabled(struct R3RigidBodyHandle handle);
19988
19993RAPIER_API R3Bool RAPIER_CALL r3RigidBody_IsDynamic(struct R3RigidBodyHandle handle);
19994
19999RAPIER_API struct R3SoftBodyHandle RAPIER_CALL r3RigidBody_SoftBody(struct R3RigidBodyHandle handle);
20000
20005RAPIER_API R3Bool RAPIER_CALL r3RigidBody_IsSoftFrame(struct R3RigidBodyHandle handle);
20006
20011RAPIER_API R3Bool RAPIER_CALL r3RigidBody_IsFixed(struct R3RigidBodyHandle handle);
20012
20017RAPIER_API R3Bool RAPIER_CALL r3RigidBody_IsKinematic(struct R3RigidBodyHandle handle);
20018
20023RAPIER_API R3Bool RAPIER_CALL r3RigidBody_IsMoving(struct R3RigidBodyHandle handle);
20024
20029RAPIER_API R3Bool RAPIER_CALL r3RigidBody_IsCcdActive(struct R3RigidBodyHandle handle);
20030
20036RAPIER_API
20037R3Status RAPIER_CALL r3RigidBody_SetRotation(struct R3RigidBodyHandle handle,
20038 struct R3Rotation value,
20039 R3Bool wake_up);
20040
20046RAPIER_API
20047R3Status RAPIER_CALL r3RigidBody_SetBodyType(struct R3RigidBodyHandle handle,
20048 uint32_t value,
20049 R3Bool wake_up);
20050
20055RAPIER_API
20056R3Status RAPIER_CALL r3RigidBody_SetNextKinematicRotation(struct R3RigidBodyHandle handle,
20057 struct R3Rotation value);
20058
20064RAPIER_API
20065R3Status RAPIER_CALL r3RigidBody_SetAdditionalMass(struct R3RigidBodyHandle handle,
20066 R3Real value,
20067 R3Bool wake_up);
20068
20073RAPIER_API
20074R3Status RAPIER_CALL r3RigidBody_SetSoftCcdPrediction(struct R3RigidBodyHandle handle,
20075 R3Real value);
20076
20081RAPIER_API
20082R3Status RAPIER_CALL r3RigidBody_SetCcdEnabled(struct R3RigidBodyHandle handle,
20083 R3Bool value);
20084
20090RAPIER_API
20091R3Status RAPIER_CALL r3RigidBody_SetTranslationsLocked(struct R3RigidBodyHandle handle,
20092 R3Bool value,
20093 R3Bool wake_up);
20094
20100RAPIER_API
20101R3Status RAPIER_CALL r3RigidBody_SetRotationsLocked(struct R3RigidBodyHandle handle,
20102 R3Bool value,
20103 R3Bool wake_up);
20104
20109RAPIER_API
20110R3Status RAPIER_CALL r3RigidBody_SetDominanceGroup(struct R3RigidBodyHandle handle,
20111 int8_t value);
20112
20117RAPIER_API
20118R3Status RAPIER_CALL r3RigidBody_SetAdditionalSolverIterations(struct R3RigidBodyHandle handle,
20119 size_t value);
20120
20125RAPIER_API
20126R3Status RAPIER_CALL r3RigidBody_SetAdditionalPgsIterations(struct R3RigidBodyHandle handle,
20127 size_t value);
20128
20134RAPIER_API
20135R3Status RAPIER_CALL r3RigidBody_AddTorque(struct R3RigidBodyHandle handle,
20136 R3AngVector value,
20137 R3Bool wake_up);
20138
20144RAPIER_API
20145R3Status RAPIER_CALL r3RigidBody_ApplyTorqueImpulse(struct R3RigidBodyHandle handle,
20146 R3AngVector value,
20147 R3Bool wake_up);
20148
20154RAPIER_API
20155R3Status RAPIER_CALL r3RigidBody_AddForceAtPoint(struct R3RigidBodyHandle handle,
20156 struct R3Vector value,
20157 struct R3Vector point,
20158 R3Bool wake_up);
20159
20165RAPIER_API
20166R3Status RAPIER_CALL r3RigidBody_ResetTorques(struct R3RigidBodyHandle handle,
20167 R3Bool wake_up);
20168
20173RAPIER_API
20174struct R3Vector RAPIER_CALL r3RigidBody_VelocityAtPoint(struct R3RigidBodyHandle handle,
20175 struct R3Vector point);
20176
20182RAPIER_API
20183size_t RAPIER_CALL r3RigidBody_Colliders(struct R3RigidBodyHandle handle,
20184 struct R3ColliderHandle *buffer,
20185 size_t capacity);
20186
20187#if defined(RAPIER_DIM3)
20192RAPIER_API R3Bool RAPIER_CALL r3RigidBody_GyroscopicForcesEnabled(struct R3RigidBodyHandle handle);
20193#endif
20194
20195#if defined(RAPIER_DIM3)
20200RAPIER_API
20201R3Status RAPIER_CALL r3RigidBody_SetGyroscopicForcesEnabled(struct R3RigidBodyHandle handle,
20202 R3Bool enabled);
20203#endif
20204
20209RAPIER_API R3Status RAPIER_CALL r3Collider_SetDensity(struct R3ColliderHandle handle, R3Real value);
20210
20215RAPIER_API R3Status RAPIER_CALL r3Collider_SetMass(struct R3ColliderHandle handle, R3Real value);
20216
20221RAPIER_API R3Status RAPIER_CALL r3Collider_SetEnabled(struct R3ColliderHandle handle, R3Bool value);
20222
20227RAPIER_API
20228R3Status RAPIER_CALL r3Collider_SetSolverGroups(struct R3ColliderHandle handle,
20229 struct R3InteractionGroups value);
20230
20235RAPIER_API
20236R3Status RAPIER_CALL r3Collider_SetFrictionCombineRule(struct R3ColliderHandle handle,
20237 uint32_t value);
20238
20243RAPIER_API
20244R3Status RAPIER_CALL r3Collider_SetRestitutionCombineRule(struct R3ColliderHandle handle,
20245 uint32_t value);
20246
20251RAPIER_API R3Status RAPIER_CALL r3Collider_SetContactSkin(struct R3ColliderHandle handle, R3Real value);
20252
20257RAPIER_API
20258R3Status RAPIER_CALL r3Collider_SetContactForceEventThreshold(struct R3ColliderHandle handle,
20259 R3Real value);
20260
20265RAPIER_API
20266R3Status RAPIER_CALL r3Collider_SetActiveEvents(struct R3ColliderHandle handle,
20267 uint32_t value);
20268
20273RAPIER_API R3Status RAPIER_CALL r3Collider_SetActiveHooks(struct R3ColliderHandle handle, uint32_t value);
20274
20279RAPIER_API
20280R3Status RAPIER_CALL r3Collider_SetActiveCollisionTypes(struct R3ColliderHandle handle,
20281 uint16_t value);
20282
20287RAPIER_API struct R3Rotation RAPIER_CALL r3Collider_Rotation(struct R3ColliderHandle handle);
20288
20293RAPIER_API
20294struct R3InteractionGroups RAPIER_CALL r3Collider_CollisionGroups(struct R3ColliderHandle handle);
20295
20300RAPIER_API struct R3InteractionGroups RAPIER_CALL r3Collider_SolverGroups(struct R3ColliderHandle handle);
20301
20306RAPIER_API struct R3UserData RAPIER_CALL r3Collider_UserData(struct R3ColliderHandle handle);
20307
20313RAPIER_API uint32_t RAPIER_CALL r3Collider_ActiveEvents(struct R3ColliderHandle handle);
20314
20319RAPIER_API R3Real RAPIER_CALL r3Collider_Mass(struct R3ColliderHandle handle);
20320
20325RAPIER_API R3Real RAPIER_CALL r3Collider_Density(struct R3ColliderHandle handle);
20326
20331RAPIER_API R3Real RAPIER_CALL r3Collider_Volume(struct R3ColliderHandle handle);
20332
20337RAPIER_API R3Real RAPIER_CALL r3Collider_ContactSkin(struct R3ColliderHandle handle);
20338
20343RAPIER_API R3Real RAPIER_CALL r3Collider_ContactForceEventThreshold(struct R3ColliderHandle handle);
20344
20349RAPIER_API R3Bool RAPIER_CALL r3Collider_IsEnabled(struct R3ColliderHandle handle);
20350
20355RAPIER_API struct R3Aabb RAPIER_CALL r3Collider_ComputeAabb(struct R3ColliderHandle handle);
20356
20361RAPIER_API R3SharedShape *RAPIER_CALL r3Collider_CloneShape(struct R3ColliderHandle handle);
20362
20367RAPIER_API
20368R3Status RAPIER_CALL r3Collider_SetShape(struct R3ColliderHandle handle,
20369 const R3SharedShape *shape);
20370
20375RAPIER_API
20376R3Status RAPIER_CALL r3Collider_SetPositionWrtParent(struct R3ColliderHandle handle,
20377 struct R3Pose value);
20378
20384RAPIER_API R3Status RAPIER_CALL r3RigidBody_ValidateHandle(struct R3RigidBodyHandle handle);
20385
20391RAPIER_API R3Status RAPIER_CALL r3Collider_ValidateHandle(struct R3ColliderHandle handle);
20392
20398RAPIER_API R3Status RAPIER_CALL r3SoftBody_ValidateHandle(struct R3SoftBodyHandle handle);
20399
20404RAPIER_API
20405R3Status RAPIER_CALL r3JointDesc_SetLocalFrame1(struct R3JointDesc *desc,
20406 struct R3Pose value);
20407
20413RAPIER_API
20414R3Status RAPIER_CALL r3ImpulseJoint_SetLocalFrame1(struct R3ImpulseJointHandle handle,
20415 struct R3Pose value,
20416 R3Bool wake_up);
20417
20422RAPIER_API
20423R3Status RAPIER_CALL r3JointDesc_SetLocalFrame2(struct R3JointDesc *desc,
20424 struct R3Pose value);
20425
20431RAPIER_API
20432R3Status RAPIER_CALL r3ImpulseJoint_SetLocalFrame2(struct R3ImpulseJointHandle handle,
20433 struct R3Pose value,
20434 R3Bool wake_up);
20435
20440RAPIER_API
20441R3Status RAPIER_CALL r3JointDesc_SetLocalAnchor1(struct R3JointDesc *desc,
20442 struct R3Vector value);
20443
20449RAPIER_API
20450R3Status RAPIER_CALL r3ImpulseJoint_SetLocalAnchor1(struct R3ImpulseJointHandle handle,
20451 struct R3Vector value,
20452 R3Bool wake_up);
20453
20458RAPIER_API
20459R3Status RAPIER_CALL r3JointDesc_SetLocalAnchor2(struct R3JointDesc *desc,
20460 struct R3Vector value);
20461
20467RAPIER_API
20468R3Status RAPIER_CALL r3ImpulseJoint_SetLocalAnchor2(struct R3ImpulseJointHandle handle,
20469 struct R3Vector value,
20470 R3Bool wake_up);
20471
20476RAPIER_API R3Status RAPIER_CALL r3JointDesc_SetContactsEnabled(struct R3JointDesc *desc, R3Bool value);
20477
20483RAPIER_API
20484R3Status RAPIER_CALL r3ImpulseJoint_SetContactsEnabled(struct R3ImpulseJointHandle handle,
20485 R3Bool value,
20486 R3Bool wake_up);
20487
20492RAPIER_API R3Status RAPIER_CALL r3JointDesc_SetEnabled(struct R3JointDesc *desc, R3Bool value);
20493
20499RAPIER_API
20500R3Status RAPIER_CALL r3ImpulseJoint_SetEnabled(struct R3ImpulseJointHandle handle,
20501 R3Bool value,
20502 R3Bool wake_up);
20503
20508RAPIER_API
20509R3Status RAPIER_CALL r3JointDesc_SetSoftness(struct R3JointDesc *desc,
20510 struct R3SpringCoefficients value);
20511
20517RAPIER_API
20518R3Status RAPIER_CALL r3ImpulseJoint_SetSoftness(struct R3ImpulseJointHandle handle,
20519 struct R3SpringCoefficients value,
20520 R3Bool wake_up);
20521
20526RAPIER_API R3Status RAPIER_CALL r3JointDesc_SetLockedAxes(struct R3JointDesc *desc, uint8_t value);
20527
20533RAPIER_API
20534R3Status RAPIER_CALL r3ImpulseJoint_SetLockedAxes(struct R3ImpulseJointHandle handle,
20535 uint8_t value,
20536 R3Bool wake_up);
20537
20542RAPIER_API R3Status RAPIER_CALL r3JointDesc_SetLimitAxes(struct R3JointDesc *desc, uint8_t value);
20543
20549RAPIER_API
20550R3Status RAPIER_CALL r3ImpulseJoint_SetLimitAxes(struct R3ImpulseJointHandle handle,
20551 uint8_t value,
20552 R3Bool wake_up);
20553
20558RAPIER_API R3Status RAPIER_CALL r3JointDesc_SetMotorAxes(struct R3JointDesc *desc, uint8_t value);
20559
20565RAPIER_API
20566R3Status RAPIER_CALL r3ImpulseJoint_SetMotorAxes(struct R3ImpulseJointHandle handle,
20567 uint8_t value,
20568 R3Bool wake_up);
20569
20574RAPIER_API R3Status RAPIER_CALL r3JointDesc_SetCoupledAxes(struct R3JointDesc *desc, uint8_t value);
20575
20581RAPIER_API
20582R3Status RAPIER_CALL r3ImpulseJoint_SetCoupledAxes(struct R3ImpulseJointHandle handle,
20583 uint8_t value,
20584 R3Bool wake_up);
20585
20590RAPIER_API
20591R3Status RAPIER_CALL r3JointDesc_SetLocalAxis1(struct R3JointDesc *desc,
20592 struct R3Vector value);
20593
20599RAPIER_API
20600R3Status RAPIER_CALL r3ImpulseJoint_SetLocalAxis1(struct R3ImpulseJointHandle handle,
20601 struct R3Vector value,
20602 R3Bool wake_up);
20603
20608RAPIER_API
20609R3Status RAPIER_CALL r3JointDesc_SetLocalAxis2(struct R3JointDesc *desc,
20610 struct R3Vector value);
20611
20617RAPIER_API
20618R3Status RAPIER_CALL r3ImpulseJoint_SetLocalAxis2(struct R3ImpulseJointHandle handle,
20619 struct R3Vector value,
20620 R3Bool wake_up);
20621
20626RAPIER_API
20627R3Status RAPIER_CALL r3JointDesc_SetLimits(struct R3JointDesc *desc,
20628 uint32_t joint_axis,
20629 R3Real min,
20630 R3Real max);
20631
20638RAPIER_API
20639R3Status RAPIER_CALL r3ImpulseJoint_SetLimits(struct R3ImpulseJointHandle handle,
20640 uint32_t joint_axis,
20641 R3Real min,
20642 R3Real max,
20643 R3Bool wake_up);
20644
20649RAPIER_API
20650R3Status RAPIER_CALL r3JointDesc_SetMotor(struct R3JointDesc *desc,
20651 uint32_t joint_axis,
20652 R3Real target_position,
20653 R3Real target_velocity,
20654 R3Real stiffness,
20655 R3Real damping);
20656
20662RAPIER_API
20663R3Status RAPIER_CALL r3ImpulseJoint_SetMotor(struct R3ImpulseJointHandle handle,
20664 uint32_t joint_axis,
20665 R3Real target_position,
20666 R3Real target_velocity,
20667 R3Real stiffness,
20668 R3Real damping,
20669 R3Bool wake_up);
20670
20675RAPIER_API
20676R3Status RAPIER_CALL r3JointDesc_SetMotorMaxForce(struct R3JointDesc *desc,
20677 uint32_t joint_axis,
20678 R3Real max_force);
20679
20685RAPIER_API
20686R3Status RAPIER_CALL r3ImpulseJoint_SetMotorMaxForce(struct R3ImpulseJointHandle handle,
20687 uint32_t joint_axis,
20688 R3Real max_force,
20689 R3Bool wake_up);
20690
20695RAPIER_API
20696R3Status RAPIER_CALL r3JointDesc_SetMotorModel(struct R3JointDesc *desc,
20697 uint32_t joint_axis,
20698 uint32_t model);
20699
20705RAPIER_API
20706R3Status RAPIER_CALL r3ImpulseJoint_SetMotorModel(struct R3ImpulseJointHandle handle,
20707 uint32_t joint_axis,
20708 uint32_t model,
20709 R3Bool wake_up);
20710
20715RAPIER_API
20716R3Status RAPIER_CALL r3JointDesc_SetUserData(struct R3JointDesc *desc,
20717 struct R3UserData value);
20718
20724RAPIER_API
20725R3Status RAPIER_CALL r3ImpulseJoint_SetUserData(struct R3ImpulseJointHandle handle,
20726 struct R3UserData value,
20727 R3Bool wake_up);
20728
20733RAPIER_API
20734R3Status RAPIER_CALL r3JointDesc_SetMotorPosition(struct R3JointDesc *desc,
20735 uint32_t joint_axis,
20736 R3Real target_position,
20737 R3Real stiffness,
20738 R3Real damping);
20739
20745RAPIER_API
20746R3Status RAPIER_CALL r3ImpulseJoint_SetMotorPosition(struct R3ImpulseJointHandle handle,
20747 uint32_t joint_axis,
20748 R3Real target_position,
20749 R3Real stiffness,
20750 R3Real damping,
20751 R3Bool wake_up);
20752
20757RAPIER_API
20758R3Status RAPIER_CALL r3JointDesc_SetMotorVelocity(struct R3JointDesc *desc,
20759 uint32_t joint_axis,
20760 R3Real target_velocity,
20761 R3Real factor);
20762
20768RAPIER_API
20769R3Status RAPIER_CALL r3ImpulseJoint_SetMotorVelocity(struct R3ImpulseJointHandle handle,
20770 uint32_t joint_axis,
20771 R3Real target_velocity,
20772 R3Real factor,
20773 R3Bool wake_up);
20774
20780RAPIER_API struct R3JointImpulses RAPIER_CALL r3ImpulseJoint_Impulses(struct R3ImpulseJointHandle handle);
20781
20786RAPIER_API struct R3UserData RAPIER_CALL r3ImpulseJoint_UserData(struct R3ImpulseJointHandle handle);
20787
20792RAPIER_API size_t RAPIER_CALL r3ImpulseJointCount(const struct R3World *world);
20793
20799RAPIER_API size_t RAPIER_CALL r3MultibodyJointCount(const struct R3World *world);
20800
20805RAPIER_API struct R3JointDesc RAPIER_CALL r3MultibodyJoint_Desc(struct R3MultibodyJointHandle handle);
20806
20813RAPIER_API
20814R3Status RAPIER_CALL r3MultibodyJoint_SetDesc(struct R3MultibodyJointHandle handle,
20815 const struct R3JointDesc *desc,
20816 R3Bool wake_up);
20817
20822RAPIER_API struct R3JointBodies RAPIER_CALL r3MultibodyJoint_Bodies(struct R3MultibodyJointHandle handle);
20823
20830RAPIER_API
20831R3SharedShape *RAPIER_CALL r3ConvexDecompositionSharedShape(struct R3VectorView vertices,
20832 R3SurfaceElementView indices);
20833
20840RAPIER_API
20841R3SharedShape *RAPIER_CALL r3VoxelsSharedShapeFromPoints(struct R3Vector voxel_size,
20842 struct R3VectorView points);
20843
20850RAPIER_API
20851R3SharedShape *RAPIER_CALL r3VoxelizedMeshSharedShape(struct R3VectorView vertices,
20852 R3SurfaceElementView indices,
20853 R3Real voxel_size);
20854
20860RAPIER_API R3SharedShape *RAPIER_CALL r3ConvexHullSharedShape(struct R3VectorView vertices);
20861
20862#if defined(RAPIER_DIM3)
20869RAPIER_API
20870R3SharedShape *RAPIER_CALL r3ConvexMeshSharedShape(struct R3VectorView vertices,
20871 struct R3TriangleView indices);
20872#endif
20873
20880RAPIER_API
20881R3SharedShape *RAPIER_CALL r3TrimeshSharedShape(struct R3VectorView vertices,
20882 struct R3TriangleView indices);
20883
20890RAPIER_API
20891R3SharedShape *RAPIER_CALL r3PolylineSharedShape(struct R3VectorView vertices,
20892 struct R3EdgeView indices);
20893
20894#if defined(RAPIER_DIM2)
20901RAPIER_API
20902R3SharedShape *RAPIER_CALL r3OrientedPolylineSharedShape(struct R3VectorView vertices,
20903 struct R3EdgeView indices);
20904#endif
20905
20906#if defined(RAPIER_DIM2)
20913RAPIER_API R3SharedShape *RAPIER_CALL r3ConvexPolylineSharedShape(struct R3VectorView vertices);
20914#endif
20915
20921RAPIER_API
20922R3SharedShape *RAPIER_CALL r3RoundConvexHullSharedShape(struct R3VectorView vertices,
20923 R3Real border_radius);
20924
20931RAPIER_API
20932R3SharedShape *RAPIER_CALL r3TrimeshSharedShapeWithFlags(struct R3VectorView vertices,
20933 struct R3TriangleView indices,
20934 uint32_t flags);
20935
20940RAPIER_API struct R3World *RAPIER_CALL r3NewWorld(void);
20941
20947RAPIER_API R3Status RAPIER_CALL r3FreeWorld(struct R3World *world);
20948
20954RAPIER_API
20955struct R3VelocityCorrection RAPIER_CALL r3ReadPidController_RigidBodyCorrection(const struct R3ReadContext *context,
20956 struct R3PidController *controller,
20957 R3Real dt,
20958 struct R3RigidBodyHandle body,
20959 struct R3Pose target_pose,
20960 struct R3Vector target_linvel,
20961 R3AngVector target_angvel);
20962
20968RAPIER_API
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);
20975
20981RAPIER_API size_t RAPIER_CALL r3ReadRigidBodyCount(const struct R3ReadContext *context);
20982
20988RAPIER_API
20989size_t RAPIER_CALL r3ReadRigidBodyHandles(const struct R3ReadContext *context,
20990 struct R3RigidBodyHandle *buffer,
20991 size_t capacity);
20992
20998RAPIER_API
20999R3Bool RAPIER_CALL r3ReadRigidBody_Contains(const struct R3ReadContext *context,
21000 struct R3RigidBodyHandle handle);
21001
21007RAPIER_API size_t RAPIER_CALL r3ReadColliderCount(const struct R3ReadContext *context);
21008
21014RAPIER_API
21015size_t RAPIER_CALL r3ReadColliderHandles(const struct R3ReadContext *context,
21016 struct R3ColliderHandle *buffer,
21017 size_t capacity);
21018
21024RAPIER_API
21025R3Bool RAPIER_CALL r3ReadCollider_Contains(const struct R3ReadContext *context,
21026 struct R3ColliderHandle handle);
21027
21034RAPIER_API
21035size_t RAPIER_CALL r3ReadCollider_ShapeIdentity(const struct R3ReadContext *context,
21036 struct R3ColliderHandle handle);
21037
21043RAPIER_API
21044struct R3MassProperties RAPIER_CALL r3ReadCollider_MassProperties(const struct R3ReadContext *context,
21045 struct R3ColliderHandle handle);
21046
21052RAPIER_API
21053uint8_t RAPIER_CALL r3ReadRigidBody_LockedAxes(const struct R3ReadContext *context,
21054 struct R3RigidBodyHandle handle);
21055
21061RAPIER_API
21062R3Bool RAPIER_CALL r3ReadCollider_IsVoxels(const struct R3ReadContext *context,
21063 struct R3ColliderHandle handle);
21064
21070RAPIER_API
21071struct R3VoxelQuery RAPIER_CALL r3ReadCollider_VoxelAtFlatId(const struct R3ReadContext *context,
21072 struct R3ColliderHandle handle,
21073 uint32_t id);
21074
21080RAPIER_API
21081struct R3Pose RAPIER_CALL r3ReadRigidBody_NextPosition(const struct R3ReadContext *context,
21082 struct R3RigidBodyHandle handle);
21083
21089RAPIER_API
21090struct R3Rotation RAPIER_CALL r3ReadRigidBody_Rotation(const struct R3ReadContext *context,
21091 struct R3RigidBodyHandle handle);
21092
21098RAPIER_API
21099struct R3Vector RAPIER_CALL r3ReadRigidBody_CenterOfMass(const struct R3ReadContext *context,
21100 struct R3RigidBodyHandle handle);
21101
21107RAPIER_API
21108struct R3Vector RAPIER_CALL r3ReadRigidBody_LocalCenterOfMass(const struct R3ReadContext *context,
21109 struct R3RigidBodyHandle handle);
21110
21116RAPIER_API
21117struct R3Vector RAPIER_CALL r3ReadRigidBody_UserForce(const struct R3ReadContext *context,
21118 struct R3RigidBodyHandle handle);
21119
21125RAPIER_API
21126R3AngVector RAPIER_CALL r3ReadRigidBody_UserTorque(const struct R3ReadContext *context,
21127 struct R3RigidBodyHandle handle);
21128
21134RAPIER_API
21135uint32_t RAPIER_CALL r3ReadRigidBody_BodyType(const struct R3ReadContext *context,
21136 struct R3RigidBodyHandle handle);
21137
21143RAPIER_API
21144R3Real RAPIER_CALL r3ReadRigidBody_Mass(const struct R3ReadContext *context,
21145 struct R3RigidBodyHandle handle);
21146
21152RAPIER_API
21153R3Real RAPIER_CALL r3ReadRigidBody_GravityScale(const struct R3ReadContext *context,
21154 struct R3RigidBodyHandle handle);
21155
21161RAPIER_API
21162R3Real RAPIER_CALL r3ReadRigidBody_LinearDamping(const struct R3ReadContext *context,
21163 struct R3RigidBodyHandle handle);
21164
21170RAPIER_API
21171R3Real RAPIER_CALL r3ReadRigidBody_AngularDamping(const struct R3ReadContext *context,
21172 struct R3RigidBodyHandle handle);
21173
21179RAPIER_API
21180R3Real RAPIER_CALL r3ReadRigidBody_KineticEnergy(const struct R3ReadContext *context,
21181 struct R3RigidBodyHandle handle);
21182
21188RAPIER_API
21189R3Real RAPIER_CALL r3ReadRigidBody_SoftCcdPrediction(const struct R3ReadContext *context,
21190 struct R3RigidBodyHandle handle);
21191
21197RAPIER_API
21198R3Bool RAPIER_CALL r3ReadRigidBody_IsCcdEnabled(const struct R3ReadContext *context,
21199 struct R3RigidBodyHandle handle);
21200
21206RAPIER_API
21207R3Bool RAPIER_CALL r3ReadRigidBody_IsDynamic(const struct R3ReadContext *context,
21208 struct R3RigidBodyHandle handle);
21209
21215RAPIER_API
21216struct R3SoftBodyHandle RAPIER_CALL r3ReadRigidBody_SoftBody(const struct R3ReadContext *context,
21217 struct R3RigidBodyHandle handle);
21218
21224RAPIER_API
21225R3Bool RAPIER_CALL r3ReadRigidBody_IsSoftFrame(const struct R3ReadContext *context,
21226 struct R3RigidBodyHandle handle);
21227
21233RAPIER_API
21234R3Bool RAPIER_CALL r3ReadRigidBody_IsFixed(const struct R3ReadContext *context,
21235 struct R3RigidBodyHandle handle);
21236
21242RAPIER_API
21243R3Bool RAPIER_CALL r3ReadRigidBody_IsKinematic(const struct R3ReadContext *context,
21244 struct R3RigidBodyHandle handle);
21245
21251RAPIER_API
21252R3Bool RAPIER_CALL r3ReadRigidBody_IsMoving(const struct R3ReadContext *context,
21253 struct R3RigidBodyHandle handle);
21254
21260RAPIER_API
21261R3Bool RAPIER_CALL r3ReadRigidBody_IsCcdActive(const struct R3ReadContext *context,
21262 struct R3RigidBodyHandle handle);
21263
21269RAPIER_API
21270struct R3Vector RAPIER_CALL r3ReadRigidBody_VelocityAtPoint(const struct R3ReadContext *context,
21271 struct R3RigidBodyHandle handle,
21272 struct R3Vector point);
21273
21280RAPIER_API
21281size_t RAPIER_CALL r3ReadRigidBody_Colliders(const struct R3ReadContext *context,
21282 struct R3RigidBodyHandle handle,
21283 struct R3ColliderHandle *buffer,
21284 size_t capacity);
21285
21286#if defined(RAPIER_DIM3)
21292RAPIER_API
21293R3Bool RAPIER_CALL r3ReadRigidBody_GyroscopicForcesEnabled(const struct R3ReadContext *context,
21294 struct R3RigidBodyHandle handle);
21295#endif
21296
21302RAPIER_API
21303struct R3Rotation RAPIER_CALL r3ReadCollider_Rotation(const struct R3ReadContext *context,
21304 struct R3ColliderHandle handle);
21305
21311RAPIER_API
21312struct R3InteractionGroups RAPIER_CALL r3ReadCollider_CollisionGroups(const struct R3ReadContext *context,
21313 struct R3ColliderHandle handle);
21314
21320RAPIER_API
21321struct R3InteractionGroups RAPIER_CALL r3ReadCollider_SolverGroups(const struct R3ReadContext *context,
21322 struct R3ColliderHandle handle);
21323
21329RAPIER_API
21330struct R3UserData RAPIER_CALL r3ReadCollider_UserData(const struct R3ReadContext *context,
21331 struct R3ColliderHandle handle);
21332
21338RAPIER_API
21339uint32_t RAPIER_CALL r3ReadCollider_ActiveEvents(const struct R3ReadContext *context,
21340 struct R3ColliderHandle handle);
21341
21346RAPIER_API
21347R3Real RAPIER_CALL r3ReadCollider_Mass(const struct R3ReadContext *context,
21348 struct R3ColliderHandle handle);
21349
21355RAPIER_API
21356R3Real RAPIER_CALL r3ReadCollider_Density(const struct R3ReadContext *context,
21357 struct R3ColliderHandle handle);
21358
21364RAPIER_API
21365R3Real RAPIER_CALL r3ReadCollider_Volume(const struct R3ReadContext *context,
21366 struct R3ColliderHandle handle);
21367
21373RAPIER_API
21374R3Real RAPIER_CALL r3ReadCollider_ContactSkin(const struct R3ReadContext *context,
21375 struct R3ColliderHandle handle);
21376
21382RAPIER_API
21383R3Real RAPIER_CALL r3ReadCollider_ContactForceEventThreshold(const struct R3ReadContext *context,
21384 struct R3ColliderHandle handle);
21385
21391RAPIER_API
21392R3Bool RAPIER_CALL r3ReadCollider_IsEnabled(const struct R3ReadContext *context,
21393 struct R3ColliderHandle handle);
21394
21400RAPIER_API
21401struct R3Aabb RAPIER_CALL r3ReadCollider_ComputeAabb(const struct R3ReadContext *context,
21402 struct R3ColliderHandle handle);
21403
21410RAPIER_API
21411R3SharedShape *RAPIER_CALL r3ReadCollider_CloneShape(const struct R3ReadContext *context,
21412 struct R3ColliderHandle handle);
21413
21419RAPIER_API
21420R3Status RAPIER_CALL r3ReadRigidBody_ValidateHandle(const struct R3ReadContext *context,
21421 struct R3RigidBodyHandle handle);
21422
21428RAPIER_API
21429R3Status RAPIER_CALL r3ReadCollider_ValidateHandle(const struct R3ReadContext *context,
21430 struct R3ColliderHandle handle);
21431
21437RAPIER_API
21438struct R3Pose RAPIER_CALL r3ReadRigidBody_Position(const struct R3ReadContext *context,
21439 struct R3RigidBodyHandle handle);
21440
21446RAPIER_API
21447struct R3Vector RAPIER_CALL r3ReadRigidBody_Translation(const struct R3ReadContext *context,
21448 struct R3RigidBodyHandle handle);
21449
21455RAPIER_API
21456struct R3Vector RAPIER_CALL r3ReadRigidBody_Linvel(const struct R3ReadContext *context,
21457 struct R3RigidBodyHandle handle);
21458
21464RAPIER_API
21465R3AngVector RAPIER_CALL r3ReadRigidBody_Angvel(const struct R3ReadContext *context,
21466 struct R3RigidBodyHandle handle);
21467
21473RAPIER_API
21474R3Bool RAPIER_CALL r3ReadRigidBody_IsSleeping(const struct R3ReadContext *context,
21475 struct R3RigidBodyHandle handle);
21476
21482RAPIER_API
21483R3Bool RAPIER_CALL r3ReadRigidBody_IsEnabled(const struct R3ReadContext *context,
21484 struct R3RigidBodyHandle handle);
21485
21491RAPIER_API
21492struct R3UserData RAPIER_CALL r3ReadRigidBody_UserData(const struct R3ReadContext *context,
21493 struct R3RigidBodyHandle handle);
21494
21500RAPIER_API
21501struct R3Pose RAPIER_CALL r3ReadCollider_Position(const struct R3ReadContext *context,
21502 struct R3ColliderHandle handle);
21503
21509RAPIER_API
21510struct R3Vector RAPIER_CALL r3ReadCollider_Translation(const struct R3ReadContext *context,
21511 struct R3ColliderHandle handle);
21512
21518RAPIER_API
21519R3Real RAPIER_CALL r3ReadCollider_Friction(const struct R3ReadContext *context,
21520 struct R3ColliderHandle handle);
21521
21527RAPIER_API
21528R3Real RAPIER_CALL r3ReadCollider_Restitution(const struct R3ReadContext *context,
21529 struct R3ColliderHandle handle);
21530
21536RAPIER_API
21537R3Bool RAPIER_CALL r3ReadCollider_IsSensor(const struct R3ReadContext *context,
21538 struct R3ColliderHandle handle);
21539
21545RAPIER_API
21546struct R3RigidBodyHandle RAPIER_CALL r3ReadCollider_Parent(const struct R3ReadContext *context,
21547 struct R3ColliderHandle handle);
21548
21555RAPIER_API
21556size_t RAPIER_CALL r3ReadRigidBodyReadStates(const struct R3ReadContext *context,
21557 const struct R3RigidBodyHandle *handles,
21558 size_t handle_count,
21559 struct R3RigidBodyState *states,
21560 size_t capacity);
21561
21567RAPIER_API
21568uint16_t RAPIER_CALL r3ReadCollider_ActiveCollisionTypes(const struct R3ReadContext *context,
21569 struct R3ColliderHandle handle);
21570
21576RAPIER_API
21577uint32_t RAPIER_CALL r3ReadCollider_ActiveHooks(const struct R3ReadContext *context,
21578 struct R3ColliderHandle handle);
21579
21585RAPIER_API
21586uint32_t RAPIER_CALL r3ReadCollider_FrictionCombineRule(const struct R3ReadContext *context,
21587 struct R3ColliderHandle handle);
21588
21594RAPIER_API
21595uint32_t RAPIER_CALL r3ReadCollider_RestitutionCombineRule(const struct R3ReadContext *context,
21596 struct R3ColliderHandle handle);
21597
21604RAPIER_API
21605struct R3Pose RAPIER_CALL r3ReadCollider_PositionWrtParent(const struct R3ReadContext *context,
21606 struct R3ColliderHandle handle);
21607
21613RAPIER_API
21614int8_t RAPIER_CALL r3ReadRigidBody_DominanceGroup(const struct R3ReadContext *context,
21615 struct R3RigidBodyHandle handle);
21616
21622RAPIER_API
21623size_t RAPIER_CALL r3ReadRigidBody_AdditionalSolverIterations(const struct R3ReadContext *context,
21624 struct R3RigidBodyHandle handle);
21625
21631RAPIER_API
21632size_t RAPIER_CALL r3ReadRigidBody_AdditionalPgsIterations(const struct R3ReadContext *context,
21633 struct R3RigidBodyHandle handle);
21634
21640RAPIER_API
21641R3Bool RAPIER_CALL r3ReadRigidBody_IsFastRotationAllowed(const struct R3ReadContext *context,
21642 struct R3RigidBodyHandle handle);
21643
21653RAPIER_API
21654size_t RAPIER_CALL r3IntersectRay(const struct R3World *world,
21655 const struct R3QueryOptions *query_options,
21656 struct R3Vector origin,
21657 struct R3Vector direction,
21658 R3Real max_toi,
21659 R3Bool solid,
21660 struct R3RayHit *buffer,
21661 size_t capacity);
21662
21670RAPIER_API
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);
21677
21685RAPIER_API
21686struct R3OptionalPointProjection RAPIER_CALL r3TryProjectPoint(const struct R3World *world,
21687 const struct R3QueryOptions *query_options,
21688 struct R3Vector point,
21689 R3Real max_distance,
21690 R3Bool solid);
21691
21696RAPIER_API
21697struct R3Pose RAPIER_CALL r3NonlinearRigidMotion_PositionAtTime(const struct R3NonlinearRigidMotion *motion,
21698 R3Real time);
21699
21710RAPIER_API
21711struct R3OptionalShapeCastHit RAPIER_CALL r3TryCastShapeNonlinear(const struct R3World *world,
21712 const struct R3QueryOptions *query_options,
21713 const struct R3NonlinearRigidMotion *motion,
21714 const R3SharedShape *shape,
21715 R3Real start_time,
21716 R3Real end_time,
21717 R3Bool stop_at_penetration);
21718
21725RAPIER_API
21726struct R3OptionalContactPair RAPIER_CALL r3TryContactPair(struct R3ColliderHandle collider1,
21727 struct R3ColliderHandle collider2);
21728
21734RAPIER_API
21735struct R3IntersectionPair RAPIER_CALL r3IntersectionPair(struct R3ColliderHandle collider1,
21736 struct R3ColliderHandle collider2);
21737
21743RAPIER_API
21744struct R3OptionalIntersectionPair RAPIER_CALL r3TryIntersectionPair(struct R3ColliderHandle collider1,
21745 struct R3ColliderHandle collider2);
21746
21753RAPIER_API
21754size_t RAPIER_CALL r3Collider_ContactPairs(struct R3ColliderHandle handle,
21755 struct R3ContactPair *buffer,
21756 size_t capacity);
21757
21764RAPIER_API
21765size_t RAPIER_CALL r3Collider_IntersectionPairs(struct R3ColliderHandle handle,
21766 struct R3IntersectionPair *buffer,
21767 size_t capacity);
21768
21776RAPIER_API
21777size_t RAPIER_CALL r3ContactManifolds(struct R3ColliderHandle collider1,
21778 struct R3ColliderHandle collider2,
21779 struct R3ContactManifold *buffer,
21780 size_t capacity);
21781
21789RAPIER_API
21790size_t RAPIER_CALL r3SolverContacts(struct R3ColliderHandle collider1,
21791 struct R3ColliderHandle collider2,
21792 size_t manifold_index,
21793 struct R3SolverContact *buffer,
21794 size_t capacity);
21795
21801RAPIER_API
21802R3Bool RAPIER_CALL r3ContactModificationContext_IsSoft(const struct R3ContactModificationContext *context);
21803
21808RAPIER_API
21809size_t RAPIER_CALL r3ContactModificationContext_SolverContactCount(const struct R3ContactModificationContext *context);
21810
21815RAPIER_API
21816struct R3SolverContact RAPIER_CALL r3ContactModificationContext_SolverContact(const struct R3ContactModificationContext *context,
21817 size_t index);
21818
21824RAPIER_API
21825R3Status RAPIER_CALL r3ContactModificationContext_SetSolverContact(struct R3ContactModificationContext *context,
21826 size_t index,
21827 const struct R3SolverContact *contact);
21828
21833RAPIER_API
21834R3Status RAPIER_CALL r3ContactModificationContext_RemoveSolverContact(struct R3ContactModificationContext *context,
21835 size_t index);
21836
21842RAPIER_API
21843R3Status RAPIER_CALL r3EventCollector_SetCallbacks(struct R3EventCollector *events,
21844 const struct R3EventCallbacks *callbacks);
21845
21850RAPIER_API struct R3DebugRenderStyle RAPIER_CALL r3DefaultDebugRenderStyle(void);
21851
21858RAPIER_API
21859size_t RAPIER_CALL r3DebugRenderWithStyle(const struct R3World *world,
21860 uint32_t mode,
21861 const struct R3DebugRenderStyle *style,
21862 struct R3DebugLine *buffer,
21863 size_t capacity);
21864
21865#ifdef __cplusplus
21866} // extern "C"
21867#endif // __cplusplus
21868
21869#endif
21870
21871#endif /* RAPIER_H */
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.
struct R2EdgeView R2SurfaceElementView
Borrowed surface array: edges in 2D, triangles in 3D.
Definition rapier.h:2214
int32_t R2VoxelCoord
Voxel coordinates have DIM signed integer components.
Definition rapier.h:4224
R2Real r2Tan(R2Real x)
Tangent of an angle in radians, computed by Rapier's math backend.
float R2Real
Floating-point scalar: float for f32, double for f64.
Definition rapier.h:1255
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
Contact-force event, enabled by flags and the collider force threshold.
Definition rapier.h:3595
R2Bool started
1 for the first step the total force magnitude exceeds the threshold, 0 on the following steps while ...
Definition rapier.h:3624
struct R2Vector total_force
Sum of world-space contact forces.
Definition rapier.h:3607
struct R2ColliderHandle collider2
Second collider in the pair.
Definition rapier.h:3603
struct R2Vector max_force_direction
World-space direction of the strongest contact force.
Definition rapier.h:3615
R2Real total_force_magnitude
Sum of contact force magnitudes.
Definition rapier.h:3611
struct R2ColliderHandle collider1
First collider in the pair.
Definition rapier.h:3599
R2Real max_force_magnitude
Magnitude of the strongest contact force.
Definition rapier.h:3619
Geometric contact manifold of a contact pair: contacts sharing one normal.
Definition rapier.h:4391
uint32_t user_data
Application data, persistent across steps and editable by contact-modification hooks.
Definition rapier.h:4423
size_t num_solver_contacts
Number of solver contacts; see r2SolverContacts.
Definition rapier.h:4419
struct R2Vector local_n2
Contact normal in collider 2 local coordinates, pointing outward from it.
Definition rapier.h:4399
size_t num_points
Number of geometric contact points; see r2ContactPoints.
Definition rapier.h:4415
uint32_t subshape1
Index of the subshape of collider 1 (for composite shapes), zero otherwise.
Definition rapier.h:4407
struct R2Vector local_n1
Contact normal in collider 1 local coordinates, pointing outward from it.
Definition rapier.h:4395
struct R2Vector normal
World-space contact normal, pointing from collider 1 toward collider 2.
Definition rapier.h:4403
uint32_t subshape2
Index of the subshape of collider 2 (for composite shapes), zero otherwise.
Definition rapier.h:4411
Mutable per-manifold properties.
Definition rapier.h:3644
R2Real friction
Nonnegative friction coefficient.
Definition rapier.h:3652
R2Real restitution
Nonnegative restitution coefficient.
Definition rapier.h:3656
uint32_t user_data
Application data; Rapier does not own pointers encoded in it.
Definition rapier.h:3660
struct R2Vector normal
World-space contact or surface normal.
Definition rapier.h:3648
R2Bool enabled
Whether this setting/object is enabled (0 or 1).
Definition rapier.h:3664
Current narrow-phase pair and accumulated solver impulse summary.
Definition rapier.h:3883
struct R2Vector max_impulse_direction
World-space direction of the largest contact impulse.
Definition rapier.h:3911
R2Real total_impulse_magnitude
Sum of contact impulse magnitudes.
Definition rapier.h:3903
struct R2Vector total_impulse
Sum of world-space contact impulse vectors.
Definition rapier.h:3899
R2Bool has_any_active_contact
Whether the pair has an active solver contact.
Definition rapier.h:3895
struct R2ColliderHandle collider2
Second collider in the pair.
Definition rapier.h:3891
R2Real max_impulse
Largest contact impulse magnitude.
Definition rapier.h:3907
struct R2ColliderHandle collider1
First collider in the pair.
Definition rapier.h:3887
One manifold contact and its normal solver impulse.
Definition rapier.h:3937
struct R2Vector local_p2
Contact point in collider 2 local coordinates.
Definition rapier.h:3949
R2Real distance
Signed separation; negative means penetration.
Definition rapier.h:3957
struct R2Vector normal
World-space contact or surface normal.
Definition rapier.h:3953
R2Real tangent_impulse[1]
Friction impulse along the tangent basis of the contact.
Definition rapier.h:3966
size_t manifold_index
Index of the contact manifold within its pair.
Definition rapier.h:3941
struct R2Vector local_p1
Contact point in collider 1 local coordinates.
Definition rapier.h:3945
R2Real impulse
Normal impulse applied at this contact.
Definition rapier.h:3961
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 contact pair; check found before reading the pair.
Definition rapier.h:4360
struct R2ContactPair pair
Contact pair summary.
Definition rapier.h:4364
R2Bool found
Whether a result exists; other result fields are meaningful only when this is 1.
Definition rapier.h:4368
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
Contact seen by the constraint solver.
Definition rapier.h:4430
struct R2Vector point2
World-space contact point on collider 2's body.
Definition rapier.h:4438
struct R2Vector tangent_velocity
Desired world-space tangent relative velocity, e.g.
Definition rapier.h:4446
R2Real distance
Signed separation along the normal, contact skins deducted; negative means penetration.
Definition rapier.h:4442
struct R2Vector point1
World-space contact point on collider 1's body.
Definition rapier.h:4434
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