Nudge Physics
A single file, header-only 3D physics library
|
The GlobalData struct inglobes global fields that could not fit in the SimulationParams struct. More...
#include <nudge.h>
Public Attributes | |
float | gravity [3] |
uint32_t | flags |
FlagMask | exclude_smoothing_graphic_transform_flags |
uint32_t * | removed_bodies |
uint32_t | removed_bodies_count |
uint32_t | finalized_removed_bodies_count |
const uint32_t | removed_bodies_capacity |
The GlobalData struct inglobes global fields that could not fit in the SimulationParams struct.
float nudge::GlobalData::gravity[3] |
by default each body uses its own gravity (in its 'properties'), but by using the GF_USE_GLOBAL_GRAVITY flags, all the bodies share this gravity value (defaults to {0,-9.82,0})
uint32_t nudge::GlobalData::flags |
bit mask of GF_ flags; please do not reset it, just set or reset flags inside it (because some flags could be set by default, and other flags could be added in the future)
FlagMask nudge::GlobalData::exclude_smoothing_graphic_transform_flags |
bit mask of BF_ flags; default value is 0; this flag just affects body transform smoothing in two functions (calculate_graphic_transform_for_body(...) and calculate_graphic_transforms(...)); note that in any case static bodies and dynamic sleeping bodies are always not smoothed, because they are still; possible values are usually: BF_IS_DYNAMIC and/or BF_IS_KINEMATIC (both together disable transform smoothing completely)
uint32_t* nudge::GlobalData::removed_bodies |
[internal usage, remove_body(...)] since we can't remove bodies properly, instead we put bodies in stand-by ready to be reused (when new bodies are added) and we free their colliders; removed bodies end in this list and can be filtered out using their BF_IS_REMOVED flag
uint32_t nudge::GlobalData::removed_bodies_count |
[internal usage]
uint32_t nudge::GlobalData::finalized_removed_bodies_count |
[internal usage] finalized_removed_bodies_count<=removed_bodies_count; finalization happens at the start of the simulation_step(...) function
const uint32_t nudge::GlobalData::removed_bodies_capacity |
[internal usage] should be == c->MAX_NUM_BODIES