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. More... | |
void | clear_anims () |
Disassociates all anims from this collection. More... | |
AnimControl * | find_anim (const string &name) const |
Returns the AnimControl associated with the given name, or NULL if no such control has been associated. More... | |
AnimControl * | get_anim (int n) const |
Returns the nth AnimControl associated with this collection. More... | |
string | get_anim_name (int n) const |
Returns the name of the nth AnimControl associated with this collection. More... | |
int | get_frame (const string &anim_name) const |
Returns the current frame in the named animation, or 0 if the animation is not found. More... | |
int | get_frame () const |
Returns the current frame in the last-started animation. More... | |
int | get_num_anims () const |
Returns the number of AnimControls associated with this collection. More... | |
int | get_num_frames (const string &anim_name) const |
Returns the total number of frames in the named animation, or 0 if the animation is not found. More... | |
int | get_num_frames () const |
Returns the total number of frames in the last-started animation. More... | |
bool | is_playing (const string &anim_name) const |
Returns true if the named animation is currently playing, false otherwise. More... | |
bool | is_playing () const |
Returns true if the last-started animation is currently playing, false otherwise. More... | |
bool | loop (const string &anim_name, bool restart) |
Starts the named animation looping. More... | |
bool | loop (const string &anim_name, bool restart, int from, int to) |
Starts the named animation looping. More... | |
void | loop_all (bool restart) |
Starts all animations looping. More... | |
void | loop_all (bool restart, int from, int to) |
Starts all animations looping. More... | |
MAKE_SEQ (get_anims, get_num_anims, get_anim) | |
MAKE_SEQ (get_anim_names, get_num_anims, get_anim_name) | |
void | output (ostream &out) const |
bool | play (const string &anim_name) |
Starts the named animation playing. More... | |
bool | play (const string &anim_name, int from, int to) |
Starts the named animation playing. More... | |
void | play_all () |
Starts all animations playing. More... | |
void | play_all (int from, int to) |
Starts all animations playing. More... | |
bool | pose (const string &anim_name, int frame) |
Sets to a particular frame in the named animation. More... | |
void | pose_all (int frame) |
Sets all animations to the indicated frame. More... | |
bool | stop (const string &anim_name) |
Stops the named animation. More... | |
bool | stop_all () |
Stops all currently playing animations. More... | |
void | store_anim (AnimControl *control, const string &name) |
Associates the given AnimControl with this collection under the given name. More... | |
bool | unbind_anim (const string &name) |
Removes the AnimControl associated with the given name, if any. More... | |
string | which_anim_playing () const |
Returns the name of the bound AnimControl currently playing, if any. More... | |
void | write (ostream &out) const |
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 37 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 26 of file animControlCollection.cxx.
References store_anim().
void AnimControlCollection::clear_anims | ( | ) |
Disassociates all anims from this collection.
Definition at line 169 of file animControlCollection.cxx.
References play_all().
Referenced by get_anim_name().
AnimControl * AnimControlCollection::find_anim | ( | const string & | name | ) | const |
Returns the AnimControl associated with the given name, or NULL if no such control has been associated.
Definition at line 80 of file animControlCollection.cxx.
References unbind_anim().
Referenced by get_frame(), get_num_frames(), is_playing(), loop(), play(), pose(), stop(), and store_anim().
AnimControl * AnimControlCollection::get_anim | ( | int | n | ) | const |
Returns the nth AnimControl associated with this collection.
Definition at line 146 of file animControlCollection.cxx.
References get_anim_name().
Referenced by get_num_anims().
string AnimControlCollection::get_anim_name | ( | int | n | ) | const |
Returns the name of the nth AnimControl associated with this collection.
Definition at line 158 of file animControlCollection.cxx.
References clear_anims().
Referenced by get_anim().
|
inline |
Returns the current frame in the named animation, or 0 if the animation is not found.
Definition at line 119 of file animControlCollection.I.
References find_anim(), AnimInterface::get_frame(), and get_frame().
|
inline |
Returns the current frame in the last-started animation.
Definition at line 134 of file animControlCollection.I.
References AnimInterface::get_frame(), and is_playing().
Referenced by get_frame(), and pose().
int AnimControlCollection::get_num_anims | ( | ) | const |
Returns the number of AnimControls associated with this collection.
Definition at line 135 of file animControlCollection.cxx.
References get_anim().
Referenced by unbind_anim().
|
inline |
Returns the total number of frames in the named animation, or 0 if the animation is not found.
Definition at line 177 of file animControlCollection.I.
References find_anim(), AnimInterface::get_num_frames(), and get_num_frames().
|
inline |
Returns the total number of frames in the last-started animation.
Definition at line 192 of file animControlCollection.I.
References AnimInterface::get_num_frames().
Referenced by get_num_frames(), and is_playing().
|
inline |
Returns true if the named animation is currently playing, false otherwise.
Definition at line 148 of file animControlCollection.I.
References find_anim(), AnimInterface::is_playing(), and is_playing().
|
inline |
Returns true if the last-started animation is currently playing, false otherwise.
Definition at line 163 of file animControlCollection.I.
References get_num_frames(), and AnimInterface::is_playing().
Referenced by get_frame(), and is_playing().
|
inline |
Starts the named animation looping.
Definition at line 54 of file animControlCollection.I.
References find_anim(), and AnimInterface::loop().
Referenced by play().
|
inline |
Starts the named animation looping.
Definition at line 70 of file animControlCollection.I.
References find_anim(), AnimInterface::loop(), and stop().
void AnimControlCollection::loop_all | ( | bool | restart | ) |
Starts all animations looping.
Definition at line 208 of file animControlCollection.cxx.
Referenced by play_all().
void AnimControlCollection::loop_all | ( | bool | restart, |
int | from, | ||
int | to | ||
) |
Starts all animations looping.
Definition at line 222 of file animControlCollection.cxx.
References stop_all().
|
inline |
Starts the named animation playing.
Definition at line 22 of file animControlCollection.I.
References find_anim(), and AnimInterface::play().
|
inline |
Starts the named animation playing.
Definition at line 38 of file animControlCollection.I.
References find_anim(), loop(), and AnimInterface::play().
void AnimControlCollection::play_all | ( | ) |
Starts all animations playing.
Definition at line 180 of file animControlCollection.cxx.
Referenced by clear_anims().
void AnimControlCollection::play_all | ( | int | from, |
int | to | ||
) |
Starts all animations playing.
Definition at line 194 of file animControlCollection.cxx.
References loop_all().
|
inline |
Sets to a particular frame in the named animation.
Definition at line 102 of file animControlCollection.I.
References find_anim(), get_frame(), and AnimInterface::pose().
Referenced by stop().
void AnimControlCollection::pose_all | ( | int | frame | ) |
Sets all animations to the indicated frame.
Definition at line 257 of file animControlCollection.cxx.
References which_anim_playing().
Referenced by stop_all().
|
inline |
Stops the named animation.
Definition at line 86 of file animControlCollection.I.
References find_anim(), pose(), and AnimInterface::stop().
Referenced by loop().
bool AnimControlCollection::stop_all | ( | ) |
Stops all currently playing animations.
Returns true if any animations were stopped, false if none were playing.
Definition at line 238 of file animControlCollection.cxx.
References pose_all().
Referenced by loop_all().
void AnimControlCollection::store_anim | ( | AnimControl * | control, |
const 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 49 of file animControlCollection.cxx.
References find_anim().
Referenced by AnimControlCollection().
bool AnimControlCollection::unbind_anim | ( | const 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 100 of file animControlCollection.cxx.
References get_num_anims().
Referenced by find_anim().
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 274 of file animControlCollection.cxx.
Referenced by pose_all().