Panda3D
|
This is a named collection of AnimControl pointers. More...
#include "animControlCollection.h"
Public Member Functions | |
AnimControlCollection () | |
Returns the AnimControl associated with the given name, or NULL if no such control has been associated. | |
void | clear_anims () |
Disassociates all anims from this collection. | |
AnimControl * | find_anim (const std::string &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 |
std::string | get_anim_name (int n) const |
int | get_frame () const |
Returns the current frame in the last-started animation. | |
int | get_frame (const std::string &anim_name) const |
Returns the current frame in the named animation, or 0 if the animation is not found. | |
int | get_num_anims () const |
int | get_num_frames () const |
Returns the total number of frames in the last-started animation. | |
int | get_num_frames (const std::string &anim_name) const |
Returns the total number of frames in the named animation, or 0 if the animation is not found. | |
bool | is_playing () const |
Returns true if the last-started animation is currently playing, false otherwise. | |
bool | is_playing (const std::string &anim_name) const |
Returns true if the named animation is currently playing, false otherwise. | |
bool | loop (const std::string &anim_name, bool restart) |
Starts the named animation looping. | |
bool | loop (const std::string &anim_name, bool restart, double from, double to) |
Starts the named animation looping. | |
void | loop_all (bool restart) |
Starts all animations looping. | |
void | loop_all (bool restart, double from, double to) |
Starts all animations looping. | |
void | output (std::ostream &out) const |
bool | play (const std::string &anim_name) |
Starts the named animation playing. | |
bool | play (const std::string &anim_name, double from, double to) |
Starts the named animation playing. | |
void | play_all () |
Starts all animations playing. | |
void | play_all (double from, double to) |
Starts all animations playing. | |
bool | pose (const std::string &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 (const std::string &anim_name) |
Stops the named animation. | |
bool | stop_all () |
Stops all currently playing animations. | |
void | store_anim (AnimControl *control, const std::string &name) |
Associates the given AnimControl with this collection under the given name. | |
bool | unbind_anim (const std::string &name) |
Removes the AnimControl associated with the given name, if any. | |
std::string | which_anim_playing () const |
Returns the name of the bound AnimControl currently playing, if any. | |
void | write (std::ostream &out) const |
Public Attributes | |
get_anim | |
Returns the nth AnimControl associated with this collection. | |
get_anim_name | |
Returns the name of the nth AnimControl associated with this collection. | |
get_num_anims | |
Returns the number of AnimControls associated with this collection. | |
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).
Definition at line 33 of file animControlCollection.h.
AnimControlCollection::AnimControlCollection | ( | ) |
Returns the AnimControl associated with the given name, or NULL if no such control has been associated.
Definition at line 23 of file animControlCollection.cxx.
AnimControlCollection::~AnimControlCollection | ( | ) |
Definition at line 31 of file animControlCollection.cxx.
void AnimControlCollection::clear_anims | ( | ) |
Disassociates all anims from this collection.
Definition at line 145 of file animControlCollection.cxx.
AnimControl * AnimControlCollection::find_anim | ( | const std::string & | name | ) | const |
Returns the AnimControl associated with the given name, or NULL if no such control has been associated.
Definition at line 70 of file animControlCollection.cxx.
Referenced by get_frame(), get_num_frames(), is_playing(), loop(), loop(), play(), play(), pose(), and stop().
|
inline |
Returns the current frame in the last-started animation.
Definition at line 114 of file animControlCollection.I.
References AnimInterface::get_frame.
|
inline |
Returns the current frame in the named animation, or 0 if the animation is not found.
Definition at line 102 of file animControlCollection.I.
References find_anim(), and AnimInterface::get_frame.
|
inline |
Returns the total number of frames in the last-started animation.
Definition at line 162 of file animControlCollection.I.
References AnimInterface::get_num_frames.
|
inline |
Returns the total number of frames in the named animation, or 0 if the animation is not found.
Definition at line 150 of file animControlCollection.I.
References find_anim(), and AnimInterface::get_num_frames.
|
inline |
Returns true if the last-started animation is currently playing, false otherwise.
Definition at line 138 of file animControlCollection.I.
References AnimInterface::is_playing.
|
inline |
Returns true if the named animation is currently playing, false otherwise.
Definition at line 125 of file animControlCollection.I.
References find_anim(), and AnimInterface::is_playing.
|
inline |
Starts the named animation looping.
Definition at line 45 of file animControlCollection.I.
References find_anim(), and AnimInterface::loop().
|
inline |
Starts the named animation looping.
Definition at line 59 of file animControlCollection.I.
References find_anim(), and AnimInterface::loop().
void AnimControlCollection::loop_all | ( | bool | restart | ) |
Starts all animations looping.
Definition at line 178 of file animControlCollection.cxx.
References AnimInterface::loop().
Referenced by WindowFramework::loop_animations(), and WindowFramework::next_anim_control().
void AnimControlCollection::loop_all | ( | bool | restart, |
double | from, | ||
double | to ) |
Starts all animations looping.
Definition at line 190 of file animControlCollection.cxx.
References AnimInterface::loop().
void AnimControlCollection::output | ( | std::ostream & | out | ) | const |
Definition at line 256 of file animControlCollection.cxx.
|
inline |
Starts the named animation playing.
Definition at line 17 of file animControlCollection.I.
References find_anim(), and AnimInterface::play().
|
inline |
Starts the named animation playing.
Definition at line 31 of file animControlCollection.I.
References find_anim(), and AnimInterface::play().
void AnimControlCollection::play_all | ( | ) |
Starts all animations playing.
Definition at line 154 of file animControlCollection.cxx.
void AnimControlCollection::play_all | ( | double | from, |
double | to ) |
Starts all animations playing.
Definition at line 166 of file animControlCollection.cxx.
References AnimInterface::play().
|
inline |
Sets to a particular frame in the named animation.
Definition at line 87 of file animControlCollection.I.
References find_anim(), and AnimInterface::pose().
void AnimControlCollection::pose_all | ( | double | frame | ) |
Sets all animations to the indicated frame.
Definition at line 220 of file animControlCollection.cxx.
|
inline |
Stops the named animation.
Definition at line 73 of file animControlCollection.I.
References find_anim(), and AnimInterface::stop().
bool AnimControlCollection::stop_all | ( | ) |
Stops all currently playing animations.
Returns true if any animations were stopped, false if none were playing.
Definition at line 203 of file animControlCollection.cxx.
References AnimInterface::stop().
void AnimControlCollection::store_anim | ( | AnimControl * | control, |
const std::string & | 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.
Definition at line 41 of file animControlCollection.cxx.
bool AnimControlCollection::unbind_anim | ( | const std::string & | 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.
Definition at line 87 of file animControlCollection.cxx.
string AnimControlCollection::which_anim_playing | ( | ) | 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.
Definition at line 234 of file animControlCollection.cxx.
void AnimControlCollection::write | ( | std::ostream & | out | ) | const |
Definition at line 264 of file animControlCollection.cxx.
AnimControl * AnimControlCollection::get_anim |
Returns the nth AnimControl associated with this collection.
Definition at line 45 of file animControlCollection.h.
Referenced by WindowFramework::stagger_animations().
string AnimControlCollection::get_anim_name |
Returns the name of the nth AnimControl associated with this collection.
Definition at line 46 of file animControlCollection.h.
int AnimControlCollection::get_num_anims |
Returns the number of AnimControls associated with this collection.
Definition at line 45 of file animControlCollection.h.
Referenced by WindowFramework::next_anim_control(), and WindowFramework::stagger_animations().