TazGraph Project v0.1.0
Loading...
Searching...
No Matches
AnimatorManager.h
1#pragma once
2
3#include <map>
4#include "Animation.h"
5#include "MovingAnimation.h"
6#include "FlashAnimation.h"
7
8
10{
11public:
12 std::map<std::string, Animation> animations;
13 std::map<std::string, MovingAnimation> moving_animations;
14 std::map<std::string, FlashAnimation> flash_animations;
15
17 {
18 }
19
20 static AnimatorManager& getInstance() {
21 static AnimatorManager instance;
22 return instance;
23 }
24
25 void InitializeAnimators()
26 {
27 Animation defaultAnimation = Animation(6, 2, 1, 0.04f, "looped");
28
29 animations.emplace("Default", defaultAnimation);
30
31 MovingAnimation defaultMoveAnimation = MovingAnimation(glm::vec3(0), 1, 0, "looped", glm::vec3(0));
32 MovingAnimation testMoveAnimation = MovingAnimation(glm::vec3(0), 100, 1.0f, "play_n_times", glm::vec3(5.0f, 5.0f, 0.0f), 1);
33
34 moving_animations.emplace("Default", defaultMoveAnimation);
35 moving_animations.emplace("StepMove", testMoveAnimation);
36
37 FlashAnimation defaultFlashAnimation = FlashAnimation(3, 0.0f, "looped", { 0.2f, 1.0f, 0.2f, 1.0f }, { 0,0,0,255 });
38 FlashAnimation lineTransferFlashAnimation = FlashAnimation(3, 0.01f, "play_n_times", { 0.01f, 0.01f, 0.00f, 0.01f }, { 255,255,255,255 }, 1);
39 FlashAnimation rectangleInterpolationFlashAnimation = FlashAnimation(3, 0.01f, "play_n_times", { 0.5f, 0.01f, 1.00f, 0.01f }, { 255,0,0,255 }, 1);
40
41 flash_animations.emplace("Default", defaultFlashAnimation);
42 flash_animations.emplace("LineTransfer", lineTransferFlashAnimation);
43 flash_animations.emplace("RectInterpolation", rectangleInterpolationFlashAnimation);
44
45
46 }
47};
Definition MovingAnimation.h:9
Definition Animation.h:6
Definition AnimatorManager.h:10
Definition FlashAnimation.h:10