ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
BlinkTrack.h
Go to the documentation of this file.
1/**
2 * @file BlinkTrack.h
3 * @brief Declares the BlinkTrack template class for animating eye blinking.
4 *
5 * This file defines the BlinkTrack class, which inherits from AnimationTrack
6 * and provides a predefined animation sequence for blinking eyes.
7 *
8 * @author Coela Can't
9 * @date 22/12/2024
10 */
11
12#pragma once
13
14#include "AnimationTrack.h" // Include for base AnimationTrack class.
15
16/**
17 * @class BlinkTrack
18 * @brief A template class for animating eye blinking using keyframes.
19 *
20 * The BlinkTrack class inherits from AnimationTrack and provides a specific
21 * keyframe animation sequence to simulate eye blinking. The animation defines
22 * keyframes for opening and closing the eyes at precise time intervals.
23 *
24 * @tparam parameters The number of parameters for the blink animation.
25 */
26template<size_t parameters>
27class BlinkTrack : public AnimationTrack<parameters, 10> {
28private:
29 /**
30 * @brief Adds predefined keyframes for the blink animation.
31 *
32 * This function initializes the keyframes to create the blinking effect,
33 * including the timing for opening and closing the eyes.
34 */
35 void AddKeyFrames() {
36 this->track.AddKeyFrame(0.0f, 0.0f); ///< Eyes fully open at time 0.0.
37 this->track.AddKeyFrame(2.75f, 0.0f); ///< Eyes remain open until time 2.75.
38 this->track.AddKeyFrame(3.0f, 1.0f); ///< Eyes start to close at time 3.0.
39 this->track.AddKeyFrame(3.25f, 0.0f); ///< Eyes fully open again at time 3.25.
40 this->track.AddKeyFrame(9.75f, 0.0f); ///< Eyes remain open until time 9.75.
41 this->track.AddKeyFrame(10.0f, 1.0f); ///< Eyes start to close at time 10.0.
42 this->track.AddKeyFrame(10.25f, 0.0f); ///< Eyes fully open again at time 10.25.
43 this->track.AddKeyFrame(10.75f, 0.0f); ///< Eyes remain open until time 10.75.
44 this->track.AddKeyFrame(11.0f, 1.0f); ///< Eyes start to close at time 11.0.
45 this->track.AddKeyFrame(11.25f, 0.0f); ///< Eyes fully open again at time 11.25.
46 this->track.AddKeyFrame(15.0f, 0.0f); ///< Eyes remain open until time 15.0.
47 }
48
49public:
50 /**
51 * @brief Default constructor.
52 *
53 * Constructs a BlinkTrack object and initializes the blink animation keyframes.
54 */
57 }
58};
Declares the AnimationTrack template class for managing animation tracks with keyframes.
A template class for managing animation tracks with keyframes.
KeyFrameTrack< maxParameters, maxKeyFrames > track
Internal track object for keyframe management.
A template class for animating eye blinking using keyframes.
Definition BlinkTrack.h:27
void AddKeyFrames()
Adds predefined keyframes for the blink animation.
Definition BlinkTrack.h:35
BlinkTrack()
Default constructor.
Definition BlinkTrack.h:55