Radium Engine
1.5.20
|
#include <Core/Animation/KeyFramedValue.hpp>
Public Types | |
using | KeyFrame = std::pair<Scalar, VALUE_TYPE> |
The type for a keyframe. | |
using | KeyFrames = std::vector<KeyFrame> |
The type for the keyframes container. | |
using | Interpolator = std::function<VALUE_TYPE( const KeyFramedValue<VALUE_TYPE>&, Scalar )> |
The type for interpolators. | |
Public Member Functions | |
KeyFramedValue (Scalar t, VALUE_TYPE frame) | |
KeyFramedValue (const KeyFramedValue &keyframe)=default | |
KeyFramedValue & | operator= (const KeyFramedValue &keyframe)=default |
std::vector< Scalar > | getTimes () const override |
KeyFrame Management | |
size_t | size () const override |
const KeyFrames & | getKeyFrames () const |
const KeyFrame & | operator[] (size_t i) const |
void | insertKeyFrame (const Scalar &t, const VALUE_TYPE &frame) |
void | insertInterpolatedKeyFrame (const Scalar &t, const Interpolator &interpolator) |
bool | removeKeyFrame (size_t i) override |
void | moveKeyFrame (size_t i, const Scalar &t) override |
VALUE_TYPE | at (const Scalar &t, const Interpolator &interpolator) const |
std::tuple< size_t, size_t, Scalar > | findRange (Scalar t) const |
Comparison operators | |
bool | operator== (const KeyFramedValue &keyframe) const |
bool | operator!= (const KeyFramedValue &keyframe) const |
Public Member Functions inherited from Ra::Core::Animation::KeyFramedValueBase |
Protected Attributes | |
KeyFrames | m_keyframes |
The list of keyframes. | |
KeyFramedValue extends KeyFramedValueBase by implementing its interface, adding management for the VALUE_TYPE KeyFramedValue::KeyFrame, which are pairs (time,value) sorted by time.
It also introduces the concept of Interpolator: a KeyFramedValue::Interpolator is a function that takes as input a KeyFramedValue and returns the value for a given time t (see for instance Ra::Core::Animation::linearInterpolate).
Definition at line 62 of file KeyFramedValue.hpp.
using Ra::Core::Animation::KeyFramedValue< VALUE_TYPE >::Interpolator = std::function<VALUE_TYPE( const KeyFramedValue<VALUE_TYPE>&, Scalar )> |
The type for interpolators.
Definition at line 72 of file KeyFramedValue.hpp.
using Ra::Core::Animation::KeyFramedValue< VALUE_TYPE >::KeyFrame = std::pair<Scalar, VALUE_TYPE> |
The type for a keyframe.
Definition at line 66 of file KeyFramedValue.hpp.
using Ra::Core::Animation::KeyFramedValue< VALUE_TYPE >::KeyFrames = std::vector<KeyFrame> |
The type for the keyframes container.
Definition at line 69 of file KeyFramedValue.hpp.
|
inline |
Creates a KeyFramedValue from a first keyframe.
t | the first keyframe point in time. |
frame | the first keyframe value. |
Definition at line 79 of file KeyFramedValue.hpp.
|
inline |
t
, interpolated from the keyframes using the given interpolator. Definition at line 163 of file KeyFramedValue.hpp.
|
inline |
Look for the keyframes around time t
.
t | The time to search for. |
t
between times ti
and tj
at keyframes i and j. t
is lower than the first keyframe's time tf, then i
= j
= 0 and dt
= 0. If t
is higher than the last keyframe's time tl, then i
= j
= the index of the last keyframe and dt
= 0. If t
is an exact match on a keyframe's time tt, then i
= j
= the index of the keyframe and dt
= 0. Definition at line 181 of file KeyFramedValue.hpp.
|
inline |
Definition at line 105 of file KeyFramedValue.hpp.
|
inlineoverridevirtual |
Implements Ra::Core::Animation::KeyFramedValueBase.
Definition at line 85 of file KeyFramedValue.hpp.
|
inline |
Inserts a keyframe at time t
corresponding to the value interpolated at t
using the given interpolator.
Definition at line 134 of file KeyFramedValue.hpp.
|
inline |
Inserts a new keyframe with value frame
at time t
.
t
, it will be overwritten. Definition at line 116 of file KeyFramedValue.hpp.
|
inlineoverridevirtual |
Moves the i-th
keyframe to time t
.
Implements Ra::Core::Animation::KeyFramedValueBase.
Definition at line 151 of file KeyFramedValue.hpp.
|
inline |
keyframe
do not have the exact same keyframes, false otherwise. Definition at line 227 of file KeyFramedValue.hpp.
|
inline |
keyframe
have the exact same keyframes, false otherwise. Definition at line 219 of file KeyFramedValue.hpp.
|
inline |
i-th
keyframe. Definition at line 110 of file KeyFramedValue.hpp.
|
inlineoverridevirtual |
Removes the i-th
keyframe, if not the only one.
Implements Ra::Core::Animation::KeyFramedValueBase.
Definition at line 142 of file KeyFramedValue.hpp.
|
inlineoverridevirtual |
Implements Ra::Core::Animation::KeyFramedValueBase.
Definition at line 100 of file KeyFramedValue.hpp.
|
protected |
The list of keyframes.
Definition at line 234 of file KeyFramedValue.hpp.