![]() |
COGS
Computer Graphics Structures library
|
Wrapper class for key frame animation offering effective interpolation between values in time. More...
Public Member Functions | |
| Interpolator () | |
| Creates an Action with no keys. | |
| Interpolator (const std::initializer_list< std::pair< float, Type >> &keys) | |
| Creates an Action from list of <time,value> pairs. | |
| void | Clear () |
| Deletes current all current key frames. | |
| void | ClearAndSet (const std::initializer_list< std::pair< float, Type >> &keys) |
| Deletes current key array and sets up new array from list of <time,value> pairs. | |
| bool | IsEmpty () const |
| Returns true when no key exist. | |
| size_t | GetKeyCount () const |
| Returns number of key frames. | |
| void | InsertKey (const float time, Type value) |
| Creates new key frame with specified value and inserts it into array. | |
| Type | GetValueAtTime (const float time) const |
| Binary searches two keys nearest to specified time and interpolates between them. More... | |
| Type | GetValueAtTimeCubic (const float time) const |
| Type | GetKeyValue (const size_t key_index) const |
| Returns value of key on specified index (position in array ordered by time). | |
| float | GetTimeValue (const size_t key_index) const |
| Returns time of key on specified index. | |
| void | SetKeyValue (const size_t key_index, const Type value) |
| Returns value of key on specified index (position in array ordered by time). | |
| float | GetLastKeyTime () const |
| Returns time of last existing key frame. | |
| int32_t | GetKeyBefore (const float time) const |
| Returns index of key at, or immediately before specified time. More... | |
| void | Reserve (size_t keyframe_count) |
| Reserves required memory for specified amount of key frames. Improves speed of adding new key frames. | |
| void | ShrinkToFit () |
| Releases allocated and not used memory for new frames. | |
| void | RemoveLastKey () |
Wrapper class for key frame animation offering effective interpolation between values in time.
|
inline |
Returns index of key at, or immediately before specified time.
|
inline |
Binary searches two keys nearest to specified time and interpolates between them.