18 play(
const std::string &anim_name) {
20 if (control ==
nullptr) {
23 _last_started_control = control;
32 play(
const std::string &anim_name,
double from,
double to) {
34 if (control ==
nullptr) {
37 _last_started_control = control;
38 control->
play(from, to);
46 loop(
const std::string &anim_name,
bool restart) {
48 if (control ==
nullptr) {
51 _last_started_control = control;
52 control->
loop(restart);
60 loop(
const std::string &anim_name,
bool restart,
double from,
double to) {
62 if (control ==
nullptr) {
65 _last_started_control = control;
66 control->
loop(restart, from, to);
74 stop(
const std::string &anim_name) {
76 if (control ==
nullptr) {
88 pose(
const std::string &anim_name,
double frame) {
90 if (control ==
nullptr) {
93 _last_started_control = control;
105 if (control ==
nullptr) {
116 if (_last_started_control ==
nullptr) {
119 return _last_started_control->
get_frame();
128 if (control ==
nullptr) {
140 if (_last_started_control ==
nullptr) {
153 if (control ==
nullptr) {
164 if (_last_started_control ==
nullptr) {
170 INLINE std::ostream &
172 collection.output(out);
int get_frame() const
Returns the current frame in the last-started animation.
void loop(bool restart)
Starts the entire animation looping.
bool play(const std::string &anim_name)
Starts the named animation playing.
bool stop(const std::string &anim_name)
Stops the named animation.
bool is_playing() const
Returns true if the last-started animation is currently playing, false otherwise.
void stop()
Stops a currently playing or looping animation right where it is.
bool loop(const std::string &anim_name, bool restart)
Starts the named animation looping.
This is a named collection of AnimControl pointers.
get_frame
Returns the current integer frame number.
AnimControl * find_anim(const std::string &name) const
Returns the AnimControl associated with the given name, or NULL if no such control has been associate...
int get_num_frames() const
Returns the total number of frames in the last-started animation.
is_playing
Returns true if the animation is currently playing, false if it is stopped (e.g.
get_num_frames
Returns the number of frames in the animation.
void pose(double frame)
Sets the animation to the indicated frame and holds it there.
Controls the timing of a character animation.
void play()
Runs the entire animation from beginning to end and stops.
bool pose(const std::string &anim_name, double frame)
Sets to a particular frame in the named animation.