/
AnimationController.h
106 lines (84 loc) · 1.88 KB
/
AnimationController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#ifndef ANIMATIONCONTROLLER_H_
#define ANIMATIONCONTROLLER_H_
#include "AnimationClip.h"
#include "Animation.h"
#include "AnimationTarget.h"
#include "Properties.h"
namespace gameplay
{
/**
* Defines a class for controlling game animation.
*/
class AnimationController
{
friend class Game;
friend class Animation;
friend class AnimationClip;
friend class SceneLoader;
public:
/**
* Stops all AnimationClips currently playing on the AnimationController.
*/
void stopAllAnimations();
private:
/**
* The states that the AnimationController may be in.
*/
enum State
{
RUNNING,
IDLE,
PAUSED,
STOPPED
};
/**
* Constructor.
*/
AnimationController();
/**
* Constructor.
*/
AnimationController(const AnimationController& copy);
/**
* Destructor.
*/
~AnimationController();
/**
* Gets the controller's state.
*
* @return The current state.
*/
State getState() const;
/**
* Callback for when the controller is initialized.
*/
void initialize();
/*
* Callback for when the controller is finalized.
*/
void finalize();
/**
* Resumes the AnimationController.
*/
void resume();
/**
* Pauses the AnimationController.
*/
void pause();
/**
* Schedules an AnimationClip to run.
*/
void schedule(AnimationClip* clip);
/**
* Unschedules an AnimationClip.
*/
void unschedule(AnimationClip* clip);
/**
* Callback for when the controller receives a frame update event.
*/
void update(float elapsedTime);
State _state; // The current state of the AnimationController.
std::list<AnimationClip*> _runningClips; // A list of running AnimationClips.
};
}
#endif