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

The KinematicData is composed by two arrays: an array of global key frames and an array of animations. Each animation owns a (kinematic) body index and a range of key frames. More...

#include <nudge.h>

Classes

struct  Animation
 The Animation class. Each animation owns a (kinematic) body index and a range of key frames. More...
 

Public Types

enum  TimeMode { TM_NORMAL =0 , TM_ACCELERATE , TM_DECELERATE }
 TimeMode enum is an optional experimental flag. More...
 

Public Attributes

Transformkey_frame_transforms
 
enum nudge::KinematicData::TimeModekey_frame_modes
 
uint32_t key_frame_capacity
 
uint32_t key_frame_count
 
struct nudge::KinematicData::Animationanimations
 
uint32_t animations_capacity
 
uint32_t animations_count
 

Detailed Description

The KinematicData is composed by two arrays: an array of global key frames and an array of animations. Each animation owns a (kinematic) body index and a range of key frames.

Note
Kinematic animations are just used to automatically move kinematic bodies. Each range of key frames can be used by more than one Animation (i.e. body), because each Animation can have an offset transform (baseT) and/or an offset time (offset_time).
All the times are intended in seconds, and they represent the (relative) time to get to the current key frame.

Member Enumeration Documentation

◆ TimeMode

TimeMode enum is an optional experimental flag.

Enumerator
TM_NORMAL 

uniform speed across the transforms

TM_ACCELERATE 

accelerated speed across the transforms

TM_DECELERATE 

decelerated speed across the transforms

Member Data Documentation

◆ key_frame_transforms

Transform* nudge::KinematicData::key_frame_transforms

array of size key_frame_count of Transform structs, where each element has the Transform::time field set (it represents the seconds to get from the previous frame to that frame when the animation speed is 1.0f)

◆ key_frame_modes

enum nudge::KinematicData::TimeMode* nudge::KinematicData::key_frame_modes

array of size key_frame_count of TimeMode enums (experimental, it can probably be completely ignored in most cases) [TODO: remove?]

◆ key_frame_capacity

uint32_t nudge::KinematicData::key_frame_capacity

the number of key frames the arrays can contain (use kinematic_data_reserve_key_frames(...) to increase it)

◆ key_frame_count

uint32_t nudge::KinematicData::key_frame_count

the number of inserted key frames

◆ animations

struct nudge::KinematicData::Animation* nudge::KinematicData::animations

array of size animations_count of Animation structs; by default entries in this array are persistent, i.e. not deleted or reordered by nudge (but this behavior can be changed using the definition NUDGE_DELETE_KINEMATIC_ANIMATIONS_REFERENCING_REMOVED_BODIES)

◆ animations_capacity

uint32_t nudge::KinematicData::animations_capacity

the number of animations the array can contain (use kinematic_data_reserve_animations(...) to increase it)

◆ animations_count

uint32_t nudge::KinematicData::animations_count

the number of inserted animations


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