|
Rapier C — 3D / f32 0.36.0+c.0
|
Build identity, layout checks, status codes, and thread-local diagnostics. More...
Data Structures | |
| struct | R3ErrorHandler |
| An optional thread-local error handler. More... | |
| struct | R3BuildInfo |
| Runtime ABI identity and fundamental type sizes. More... | |
| struct | R3BuildFeatures |
| Features available through the loaded C library, independent of consumer defines. More... | |
Macros | |
| #define | R3_ABI_VERSION 1 |
| C binary ABI revision expected by this header. | |
| #define | R3_ABI_FEATURE_FEM 1 |
| ABI feature bit: RAPIER_FEM, which changes the layout of R3IntegrationParameters. | |
| #define | R3_ABI_FEATURE_ROBOTICS 2 |
| ABI feature bit: RAPIER_ROBOTICS (3D, f32 only), which declares the URDF/MJCF API. | |
| #define | R3_ABI_FEATURES 3 |
| R3_ABI_FEATURE_* bits selected by the defines of this header; pass it to CheckAbi. | |
| #define | R3_OK 0 |
| Operation succeeded. | |
| #define | R3_NULL_POINTER 1 |
| A required pointer was NULL. | |
| #define | R3_INVALID_ARGUMENT 2 |
| An argument failed validation. | |
| #define | R3_INVALID_HANDLE 3 |
| The entity handle is stale, invalid, or belongs to another world. | |
| #define | R3_BUFFER_TOO_SMALL 4 |
| Output capacity is insufficient; the returned count is the required capacity. | |
| #define | R3_UNSUPPORTED 5 |
| This build or object does not support the operation. | |
| #define | R3_PANIC 6 |
| Rust panicked; discard objects mutated by the call. | |
| #define | R3_NOT_FOUND 7 |
| No matching query result or object was found. | |
| #define | R3_WORLD_BUSY 8 |
| Conflicting or reentrant access to simulation state. | |
Typedefs | |
| typedef uint32_t | R3Status |
| Status-returning operations use these integer codes. | |
| typedef void(*) | R3ErrorCallback(R3Status, const char *, void *) |
| Called synchronously on the calling thread when an operation reports an error. | |
| typedef struct R3ErrorHandler | R3ErrorHandler |
| An optional thread-local error handler. | |
| typedef struct R3BuildInfo | R3BuildInfo |
| Runtime ABI identity and fundamental type sizes. | |
| typedef struct R3BuildFeatures | R3BuildFeatures |
| Features available through the loaded C library, independent of consumer defines. | |
Functions | |
| struct R3PodLayout | r3PodLayout (void) |
| Return POD structure sizes for checking foreign-language layouts against this library. | |
| struct R3ErrorHandler | r3SetErrorHandler (struct R3ErrorHandler handler) |
| Replace this thread's error handler and return the previous handler so it can be restored at the end of a scope. | |
| R3Status | r3LastStatus (void) |
| Status of the most recent fallible operation on this thread. | |
| const char * | r3LastError (void) |
| Thread-local UTF-8 diagnostic, valid until the next fallible call on this thread. | |
| struct R3BuildInfo | r3BuildInfo (void) |
| Return ABI version, dimension, scalar size, and pointer size of the linked library. | |
| const char * | r3Version (void) |
| Release version of the loaded C bindings, e.g. | |
| const char * | r3BuildProfile (void) |
| Cargo profile of the loaded physics library: "debug" or "release". | |
| struct R3BuildFeatures | r3BuildFeatures (void) |
| Return profiling, SIMD width, parallelism, and determinism of the linked library. | |
| R3Status | r3CheckAbi (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. | |
Build identity, layout checks, status codes, and thread-local diagnostics.
See Errors and returned values for the return-value convention.
| #define R3_ABI_FEATURE_FEM 1 |
ABI feature bit: RAPIER_FEM, which changes the layout of R3IntegrationParameters.
| #define R3_ABI_FEATURE_ROBOTICS 2 |
ABI feature bit: RAPIER_ROBOTICS (3D, f32 only), which declares the URDF/MJCF API.
| #define R3_ABI_FEATURES 3 |
R3_ABI_FEATURE_* bits selected by the defines of this header; pass it to CheckAbi.
| #define R3_ABI_VERSION 1 |
C binary ABI revision expected by this header.
| #define R3_BUFFER_TOO_SMALL 4 |
Output capacity is insufficient; the returned count is the required capacity.
| #define R3_INVALID_ARGUMENT 2 |
An argument failed validation.
| #define R3_INVALID_HANDLE 3 |
The entity handle is stale, invalid, or belongs to another world.
| #define R3_NOT_FOUND 7 |
No matching query result or object was found.
| #define R3_NULL_POINTER 1 |
A required pointer was NULL.
| #define R3_OK 0 |
Operation succeeded.
| #define R3_PANIC 6 |
Rust panicked; discard objects mutated by the call.
| #define R3_UNSUPPORTED 5 |
This build or object does not support the operation.
| #define R3_WORLD_BUSY 8 |
Conflicting or reentrant access to simulation state.
No mutation was performed.
| typedef struct R3BuildFeatures R3BuildFeatures |
Features available through the loaded C library, independent of consumer defines.
| typedef struct R3BuildInfo R3BuildInfo |
Runtime ABI identity and fundamental type sizes.
| typedef void(*) R3ErrorCallback(R3Status, const char *, void *) |
Called synchronously on the calling thread when an operation reports an error.
The diagnostic is borrowed for the duration of the callback. The callback must return normally or terminate the process: never throw or longjmp across the Rust/C boundary. Nested failing calls do not invoke the handler recursively.
| typedef struct R3ErrorHandler R3ErrorHandler |
An optional thread-local error handler.
A null callback disables reporting. Keep the callback and user_data alive until the handler is replaced.
| typedef uint32_t R3Status |
Status-returning operations use these integer codes.
| struct R3BuildFeatures r3BuildFeatures | ( | void | ) |
Return profiling, SIMD width, parallelism, and determinism of the linked library.
| struct R3BuildInfo r3BuildInfo | ( | void | ) |
Return ABI version, dimension, scalar size, and pointer size of the linked library.
| const char * r3BuildProfile | ( | void | ) |
Cargo profile of the loaded physics library: "debug" or "release".
Custom profiles report the corresponding inherited Cargo profile category. The UTF-8, NUL-terminated string is borrowed for the library's lifetime; do not free it. This is independent of the consumer's build mode and of per-package optimization overrides.
| R3Status r3CheckAbi | ( | 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.
Pass R3_ABI_VERSION, R3_DIMENSION, the sizes of R3Real, R3Vector and R3Pose, and R3_ABI_FEATURES. Fails with R3_INVALID_ARGUMENT when the version, dimension, precision, or the RAPIER_FEM/RAPIER_ROBOTICS defines differ from the library, since they change structure layouts.
| const char * r3LastError | ( | void | ) |
Thread-local UTF-8 diagnostic, valid until the next fallible call on this thread.
| R3Status r3LastStatus | ( | void | ) |
Status of the most recent fallible operation on this thread.
Reading this or LastError does not clear it. Infallible value constructors do not change it. Check immediately after a fallible value-returning operation when recovering from errors instead of using a fail-fast error callback.
| struct R3PodLayout r3PodLayout | ( | void | ) |
Return POD structure sizes for checking foreign-language layouts against this library.
| struct R3ErrorHandler r3SetErrorHandler | ( | struct R3ErrorHandler | handler | ) |
Replace this thread's error handler and return the previous handler so it can be restored at the end of a scope.
Status returns are unchanged. A handler that returns lets the caller recover by checking the status; a fail-fast handler may terminate the process. Includes R3_NOT_FOUND query misses.
| const char * r3Version | ( | void | ) |
Release version of the loaded C bindings, e.g.
"0.35.3+c.2". The suffix identifies the C bindings revision for the Rust crate version. The UTF-8, NUL-terminated string is borrowed for the library's lifetime; do not free it. This release identifier is independent of the ABI compatibility version.