These ids serve as handles to internal Box3D objects. More...
Data Structures | |
| struct | b3WorldId |
| World id references a world instance. This should be treated as an opaque handle. More... | |
| struct | b3BodyId |
| Body id references a body instance. This should be treated as an opaque handle. More... | |
| struct | b3ShapeId |
| Shape id references a shape instance. This should be treated as an opaque handle. More... | |
| struct | b3JointId |
| Joint id references a joint instance. This should be treated as an opaque handle. More... | |
| struct | b3ContactId |
| Contact id references a contact instance. This should be treated as an opaque handle. More... | |
Macros | |
| #define | B3_NULL_ID { 0 } |
| A null id. Works for any id type. | |
| #define | B3_ID_INLINE static inline |
| This macro bridges C and C++ inline functions. C++ has the one definition rule that C lacks. | |
| #define | B3_IS_NULL(id) |
| Macro to determine if any id is null. | |
| #define | B3_IS_NON_NULL(id) |
| Macro to determine if any id is non-null. | |
| #define | B3_ID_EQUALS(id1, id2) |
| Compare two ids for equality. Doesn't work for b3WorldId. Don't mix types. | |
Functions | |
| B3_ID_INLINE uint32_t | b3StoreWorldId (b3WorldId id) |
| Store a world id into a uint32_t. | |
| B3_ID_INLINE b3WorldId | b3LoadWorldId (uint32_t x) |
| Load a uint32_t into a world id. | |
| B3_ID_INLINE uint64_t | b3StoreBodyId (b3BodyId id) |
| Store a body id into a uint64_t. | |
| B3_ID_INLINE b3BodyId | b3LoadBodyId (uint64_t x) |
| Load a uint64_t into a body id. | |
| B3_ID_INLINE uint64_t | b3StoreShapeId (b3ShapeId id) |
| Store a shape id into a uint64_t. | |
| B3_ID_INLINE b3ShapeId | b3LoadShapeId (uint64_t x) |
| Load a uint64_t into a shape id. | |
| B3_ID_INLINE uint64_t | b3StoreJointId (b3JointId id) |
| Store a joint id into a uint64_t. | |
| B3_ID_INLINE b3JointId | b3LoadJointId (uint64_t x) |
| Load a uint64_t into a joint id. | |
| B3_ID_INLINE void | b3StoreContactId (b3ContactId id, uint32_t values[3]) |
| Store a contact id into three uint32 values. | |
| B3_ID_INLINE b3ContactId | b3LoadContactId (uint32_t values[3]) |
| Load a contact id from three uint32 values. | |
These ids serve as handles to internal Box3D objects.
These should be considered opaque data and passed by value. Include this header if you need the id types and not the whole Box3D API. All ids are considered null if initialized to zero.
For example in C++:
Or in C:
These are both considered null.
| struct b3WorldId |
| struct b3BodyId |
| struct b3ShapeId |
| struct b3JointId |
| struct b3ContactId |
| #define B3_ID_EQUALS | ( | id1, | |
| id2 ) |
Compare two ids for equality. Doesn't work for b3WorldId. Don't mix types.
| #define B3_IS_NON_NULL | ( | id | ) |
Macro to determine if any id is non-null.
| #define B3_IS_NULL | ( | id | ) |
Macro to determine if any id is null.