Nudge Physics
A single file, header-only 3D physics library
Loading...
Searching...
No Matches
nudge::BodyData Struct Reference

The main struct contained in context_t: it exposes every per-body data in the simulation, except collisions. More...

#include <nudge.h>

Public Attributes

Transformtransforms
 
BodyPropertiesproperties
 
BodyMomentummomentum
 
BodyFilterfilters
 
BodyLayoutlayouts
 
BodyInfoinfos
 
uint8_t * idle_counters
 
uint32_t count
 

Detailed Description

The main struct contained in context_t: it exposes every per-body data in the simulation, except collisions.

Note
This structure contains arrays of size: count. Every array index is persistent (it's never shuffled or moved)

Member Data Documentation

◆ transforms

Transform* nudge::BodyData::transforms

array of size count, containing the position and rotation (in quaternion form) of each body

◆ properties

BodyProperties* nudge::BodyData::properties

array of size count, containing the mass, inertia, gravity and friction of each body

◆ momentum

BodyMomentum* nudge::BodyData::momentum

array of size count, containing the linear and angular velocity of each body

◆ filters

BodyFilter* nudge::BodyData::filters

array of size count, containing the collision group, the collision mask, and flags for each body

◆ layouts

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)

◆ infos

BodyInfo* nudge::BodyData::infos

array of size count, , and customizable per-body user data

◆ idle_counters

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

◆ count

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)


The documentation for this struct was generated from the following file: