![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
A template class for managing animations with multiple parameters and keyframes. More...
#include <KeyFrameTrack.h>
Public Member Functions | |
KeyFrameTrack (float min, float max, InterpolationMethod interpMethod) | |
Constructs a KeyFrameTrack object with the specified settings. | |
float | GetCurrentTime () |
Retrieves the current animation time. | |
void | SetCurrentTime (float setTime) |
Sets the current animation time. | |
void | Pause () |
Pauses the animation. | |
void | Play () |
Resumes the animation. | |
void | AddParameter (float *parameter) |
Adds a parameter to the track. | |
void | AddKeyFrame (float time, float value) |
Adds a keyframe to the track. | |
float | GetParameterValue () |
Retrieves the current interpolated parameter value. | |
void | Reset () |
Resets the animation track to its initial state. | |
float | Update () |
Updates the animation track and computes the new parameter value. | |
Private Member Functions | |
void | ShiftKeyFrameArray (int position) |
Shifts the keyframe array starting at a specific position. | |
Private Attributes | |
InterpolationMethod | interpMethod |
The interpolation method for the track. | |
float * | parameters [maxParameters] |
Array of pointers to parameters being animated. | |
KeyFrame | keyFrames [maxKeyFrames] |
Array of keyframes defining the animation. | |
float | min = 0.0f |
Minimum value for the parameters. | |
float | max = 0.0f |
Maximum value for the parameters. | |
float | startFrameTime = Mathematics::FLTMAX |
Start time of the animation (initialized out of bounds). | |
float | stopFrameTime = Mathematics::FLTMIN |
End time of the animation (initialized out of bounds). | |
uint8_t | currentFrames = 0 |
Current number of keyframes. | |
uint8_t | currentParameters = 0 |
Current number of parameters. | |
bool | isActive = true |
Indicates whether the track is active. | |
float | parameterValue = 0.0f |
Current interpolated parameter value. | |
float | currentTime = 0.0f |
Current time of the animation. | |
float | timeOffset = 0.0f |
Offset for the animation time. | |
Additional Inherited Members | |
![]() | |
enum | InterpolationMethod { Linear , Cosine , Step } |
Enumeration of interpolation methods. More... | |
A template class for managing animations with multiple parameters and keyframes.
The KeyFrameTrack class handles animations by managing a set of parameters and their corresponding keyframes. It supports playback controls, interpolation, and time-based updates.
maxParameters | The maximum number of parameters this track can handle. |
maxKeyFrames | The maximum number of keyframes this track can contain. |
Definition at line 50 of file KeyFrameTrack.h.
KeyFrameTrack | ( | float | min, |
float | max, | ||
InterpolationMethod | interpMethod | ||
) |
Constructs a KeyFrameTrack object with the specified settings.
min | The minimum value for the parameters. |
max | The maximum value for the parameters. |
interpMethod | The interpolation method for the track. |
Adds a keyframe to the track.
time | The time of the keyframe. |
value | The value of the keyframe. |
Referenced by ProtogenArtleckAnimation::AddBlinkKeyFrames(), WaffleDaProtoAnimation::AddBlinkKeyFrames(), AlphaAnimation::AddBlinkKeyFrames(), NukudeFaceAnimation::AddBlinkKeyFrames(), TamamoAnimation::AddBotFinKeyFrames(), AlphaAnimation::AddBotFinKeyFrames(), BetaProject::AddBotFinKeyFrames(), AlphaAnimation::AddMidFinKeyFrames(), ProtogenArtleckAnimation::AddMouthKeyFrames(), WaffleDaProtoAnimation::AddMouthKeyFrames(), AlphaAnimation::AddMouthKeyFrames(), NukudeFaceAnimation::AddMouthKeyFrames(), and AlphaAnimation::AddTopFinKeyFrames().
Adds a parameter to the track.
parameter | A pointer to the parameter to be animated. |
Referenced by BetaProject::LinkControlParameters(), ProtogenArtleckAnimation::LinkParameters(), WaffleDaProtoAnimation::LinkParameters(), TamamoAnimation::LinkParameters(), AlphaAnimation::LinkParameters(), and NukudeFaceAnimation::LinkParameters().
Retrieves the current animation time.
Retrieves the current interpolated parameter value.
Pauses the animation.
Referenced by AlphaAnimation::AlphaGenCircle(), AlphaAnimation::AlphaGenSquare(), AlphaAnimation::AngryFace(), AlphaAnimation::AudioReactiveGradientDisplay(), AlphaAnimation::Dead(), AlphaAnimation::Heart(), AlphaAnimation::HideAll(), AlphaAnimation::OwO(), AlphaAnimation::OwO2(), AlphaAnimation::Sad(), and AlphaAnimation::SpectrumAnalyzerDisplay().
Resumes the animation.
Referenced by ProtogenArtleckAnimation::Angry(), WaffleDaProtoAnimation::Angry(), NukudeFaceAnimation::Angry(), AlphaAnimation::Dead(), ProtogenArtleckAnimation::Default(), WaffleDaProtoAnimation::Default(), AlphaAnimation::Default(), NukudeFaceAnimation::Default(), ProtogenArtleckAnimation::Doubt(), WaffleDaProtoAnimation::Doubt(), NukudeFaceAnimation::Doubt(), ProtogenArtleckAnimation::Frown(), WaffleDaProtoAnimation::Frown(), NukudeFaceAnimation::Frown(), AlphaAnimation::Heart(), ProtogenArtleckAnimation::LookDown(), WaffleDaProtoAnimation::LookDown(), NukudeFaceAnimation::LookDown(), ProtogenArtleckAnimation::LookUp(), WaffleDaProtoAnimation::LookUp(), NukudeFaceAnimation::LookUp(), AlphaAnimation::OwO(), ProtogenArtleckAnimation::Sad(), WaffleDaProtoAnimation::Sad(), AlphaAnimation::Sad(), NukudeFaceAnimation::Sad(), ProtogenArtleckAnimation::Surprised(), WaffleDaProtoAnimation::Surprised(), and NukudeFaceAnimation::Surprised().
Resets the animation track to its initial state.
Referenced by AlphaAnimation::AlphaGenCircle(), AlphaAnimation::AlphaGenSquare(), AlphaAnimation::AngryFace(), AlphaAnimation::AudioReactiveGradientDisplay(), AlphaAnimation::Dead(), AlphaAnimation::Heart(), AlphaAnimation::HideAll(), AlphaAnimation::OwO(), AlphaAnimation::OwO2(), AlphaAnimation::Sad(), and AlphaAnimation::SpectrumAnalyzerDisplay().
Sets the current animation time.
setTime | The new current time to set. |
Shifts the keyframe array starting at a specific position.
Used for reorganizing keyframes when inserting or removing elements.
position | The index from which to shift the keyframe array. |
Updates the animation track and computes the new parameter value.
Referenced by ProtogenArtleckAnimation::UpdateKeyFrameTracks(), WaffleDaProtoAnimation::UpdateKeyFrameTracks(), TamamoAnimation::UpdateKeyFrameTracks(), TamamoAnimation::UpdateKeyframeTracks(), AlphaAnimation::UpdateKeyFrameTracks(), BetaProject::UpdateKeyFrameTracks(), BetaProject::UpdateKeyframeTracks(), and NukudeFaceAnimation::UpdateKeyFrameTracks().
Current number of keyframes.
Definition at line 59 of file KeyFrameTrack.h.
Current number of parameters.
Definition at line 60 of file KeyFrameTrack.h.
Current time of the animation.
Definition at line 63 of file KeyFrameTrack.h.
|
private |
The interpolation method for the track.
Definition at line 52 of file KeyFrameTrack.h.
Indicates whether the track is active.
Definition at line 61 of file KeyFrameTrack.h.
|
private |
Array of keyframes defining the animation.
Definition at line 54 of file KeyFrameTrack.h.
Maximum value for the parameters.
Definition at line 56 of file KeyFrameTrack.h.
Minimum value for the parameters.
Definition at line 55 of file KeyFrameTrack.h.
|
private |
Array of pointers to parameters being animated.
Definition at line 53 of file KeyFrameTrack.h.
Current interpolated parameter value.
Definition at line 62 of file KeyFrameTrack.h.
|
private |
Start time of the animation (initialized out of bounds).
Definition at line 57 of file KeyFrameTrack.h.
|
private |
End time of the animation (initialized out of bounds).
Definition at line 58 of file KeyFrameTrack.h.
Offset for the animation time.
Definition at line 64 of file KeyFrameTrack.h.