Nudge Physics
A single file, header-only 3D physics library
|
The main struct contained in context_t: it exposes every per-body data in the simulation, except collisions. More...
#include <nudge.h>
Public Attributes | |
Transform * | transforms |
BodyProperties * | properties |
BodyMomentum * | momentum |
BodyFilter * | filters |
BodyLayout * | layouts |
BodyInfo * | infos |
uint8_t * | idle_counters |
uint32_t | count |
The main struct contained in context_t: it exposes every per-body data in the simulation, except collisions.
Transform* nudge::BodyData::transforms |
array of size count, containing the position and rotation (in quaternion form) of each body
BodyProperties* nudge::BodyData::properties |
array of size count, containing the mass, inertia, gravity and friction of each body
BodyMomentum* nudge::BodyData::momentum |
array of size count, containing the linear and angular velocity of each body
BodyFilter* nudge::BodyData::filters |
array of size count, containing the collision group, the collision mask, and flags for each body
BodyLayout* nudge::BodyData::layouts |
array of size count, containing the colliders (i.e. collision shapes) indices of each body (see also the c->colliders arrays)
BodyInfo* nudge::BodyData::infos |
array of size count, , and customizable per-body user data
uint8_t* nudge::BodyData::idle_counters |
array of size count, containing a counter per body, where a value of 0xFF indicates that the body is sleeping (it currently affectes only dynamic bodies); each value can be set to 0x00 to wake up a dynamic body
uint32_t nudge::BodyData::count |
the number of bodies in the world. Bodies are never shuffled in the array, so indices are preserved. When bodies are removed count does not change (tip: filter the bodies with their flags to exclude removed and disabled bodies)