Rapier C — 2D / f64 0.36.0+c.0
Loading...
Searching...
No Matches
Rapier C API

Choose the reference matching your library's dimension and scalar precision. Function names use r2 or r3; types and constants use R2 or R3. Instance methods separate their receiver with an underscore, for example r3RigidBody_SetTranslation. Include rapier.h; rapier_math.h adds inline math and rapier_helpers.h adds explicit invalid-handle constants.

Start with Ownership and lifetimes and Errors and returned values, then falling_ball.c. The topic groups list the API by purpose. The optional C++ ownership helpers helpers provide RAII ownership; they do not change the C ABI.

Build selection

Define exactly one of RAPIER_DIM2 / RAPIER_DIM3 and one of RAPIER_F32 / RAPIER_F64 before including the headers. The defaults are 3D/f32. Flags must match the linked library, including RAPIER_FEM and RAPIER_ROBOTICS. CheckAbi, given ABI_FEATURES, checks the version, core layouts, and these feature defines. PodLayout exposes additional structure sizes for foreign-language bindings. Use uint32_t for ABI booleans, not C/C++ bool; inputs must be 0 or 1.

These references include RAPIER_PARALLEL and RAPIER_FEM declarations. Enable the matching library features before using them. Robotics requires RAPIER_ROBOTICS, 3D, and f32. Version returns the release string; BuildInfo and BuildFeatures describe the binary actually loaded.

Coordinates and units

Positions and lengths use your chosen consistent length unit; time is seconds, angles are radians. A 2D rotation is an angle; a 3D rotation is a quaternion in x,y,z,w order, normalized on input. Zero-initialized 3D quaternions are invalid: use description constructors or TranslationPose with a zero translation. World-space coordinates are used unless a parameter or field says local/relative. LengthUnit scales solver tolerances; it does not convert supplied geometry.