AnimControlCollection

class AnimControlCollection

This is a named collection of AnimControl pointers. An AnimControl may be added to the collection by name. While an AnimControl is associated, its reference count is maintained; associating a new AnimControl with the same name will decrement the previous control’s reference count (and possibly delete it, unbinding its animation).

Inheritance diagram

Inheritance diagram of AnimControlCollection

AnimControlCollection(void)
AnimControlCollection(AnimControlCollection const&) = default

Returns the AnimControl associated with the given name, or NULL if no such control has been associated.

void clear_anims(void)

Disassociates all anims from this collection.

AnimControl *find_anim(std::string const &name) const

Returns the AnimControl associated with the given name, or NULL if no such control has been associated.

AnimControl *get_anim(int n) const

Returns the nth AnimControl associated with this collection.

std::string get_anim_name(int n) const

Returns the name of the nth AnimControl associated with this collection.

int get_frame(std::string const &anim_name) const
int get_frame(void) const

Returns the current frame in the named animation, or 0 if the animation is not found.

Returns the current frame in the last-started animation.

int get_num_anims(void) const

Returns the number of AnimControls associated with this collection.

int get_num_frames(std::string const &anim_name) const
int get_num_frames(void) const

Returns the total number of frames in the named animation, or 0 if the animation is not found.

Returns the total number of frames in the last-started animation.

bool is_playing(std::string const &anim_name) const
bool is_playing(void) const

Returns true if the named animation is currently playing, false otherwise.

Returns true if the last-started animation is currently playing, false otherwise.

bool loop(std::string const &anim_name, bool restart)
bool loop(std::string const &anim_name, bool restart, double from, double to)

Starts the named animation looping.

void loop_all(bool restart)
void loop_all(bool restart, double from, double to)

Starts all animations looping.

void output(std::ostream &out) const
bool play(std::string const &anim_name)
bool play(std::string const &anim_name, double from, double to)

Starts the named animation playing.

void play_all(void)
void play_all(double from, double to)

These functions operate on all anims at once.

Starts all animations playing.

Starts all animations playing.

bool pose(std::string const &anim_name, double frame)

Sets to a particular frame in the named animation.

void pose_all(double frame)

Sets all animations to the indicated frame.

bool stop(std::string const &anim_name)

Stops the named animation.

bool stop_all(void)

Stops all currently playing animations. Returns true if any animations were stopped, false if none were playing.

void store_anim(AnimControl *control, std::string const &name)

Associates the given AnimControl with this collection under the given name. The AnimControl will remain associated until a new AnimControl is associated with the same name later, or until unbind_anim() is called with this name.

bool unbind_anim(std::string const &name)

Removes the AnimControl associated with the given name, if any. Returns true if an AnimControl was removed, false if there was no AnimControl with the indicated name.

std::string which_anim_playing(void) const

Returns the name of the bound AnimControl currently playing, if any. If more than one AnimControl is currently playing, returns all of the names separated by spaces.

void write(std::ostream &out) const