|
|
|
Controls the timing of a character animation.
More...
#include "animControl.h"
List of all members.
Public Member Functions |
| | AnimControl (const string &name, PartBundle *part, double frame_rate, int num_frames) |
| | This constructor is used to create a temporarily uninitialized AnimControl that will serve as a placeholder for an animation while the animation is being loaded during an asynchronous load-and-bind operation.
|
| bool | channel_has_changed (AnimChannelBase *channel, bool frame_blend_flag) const |
| | Returns true if the indicated channel value has changed since the last call to mark_channels().
|
| void | fail_anim (PartBundle *part) |
| | This can only be called once for a given AnimControl.
|
|
virtual TypeHandle | force_init_type () |
| AnimBundle * | get_anim () const |
| | Returns the AnimBundle bound in with this AnimControl.
|
| PandaNode * | get_anim_model () const |
| | Retrieves the pointer set via set_anim_model().
|
| const BitArray & | get_bound_joints () const |
| | Returns the subset of joints controlled by this AnimControl.
|
| int | get_channel_index () const |
| | Returns the particular channel index associated with this AnimControl.
|
| PartBundle * | get_part () const |
| | Returns the PartBundle bound in with this AnimControl.
|
| string | get_pending_done_event () const |
| | Returns the event name that will be thrown when the AnimControl is finished binding asynchronously.
|
|
virtual TypeHandle | get_type () const |
| bool | has_anim () const |
| | Returns true if the AnimControl was successfully loaded, or false if there was a problem.
|
| bool | is_pending () const |
| | Returns true if the AnimControl is being bound asynchronously, and has not yet finished.
|
| void | mark_channels (bool frame_blend_flag) |
| | Marks this point as the point of reference for the next call to channel_has_changed().
|
| virtual void | output (ostream &out) const |
| | Outputs the Namable.
|
| void | set_anim_model (PandaNode *model) |
| | Associates the indicated PandaNode with the AnimControl.
|
| void | set_bound_joints (const BitArray &bound_joints) |
| | Called to initialize the AnimControl with its array of bound_joints, before setup_anim() has completed.
|
| void | set_pending_done_event (const string &done_event) |
| | Specifies an event name that will be thrown when the AnimControl is finished binding asynchronously.
|
| void | setup_anim (PartBundle *part, AnimBundle *anim, int channel_index, const BitArray &bound_joints) |
| | This can only be called once for a given AnimControl.
|
| void | wait_pending () |
| | Blocks the current thread until the AnimControl has finished loading and is fully bound.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
|
static void | init_type () |
Protected Member Functions |
| virtual void | animation_activated () |
| | This is provided as a callback method for when the user calls one of the play/loop/pose type methods to start the animation playing.
|
Detailed Description
Controls the timing of a character animation.
An AnimControl object is created for each character/bundle binding and manages the state of the animation: whether started, stopped, or looping, and the current frame number and play rate.
Definition at line 41 of file animControl.h.
Constructor & Destructor Documentation
| AnimControl::AnimControl |
( |
const string & |
name, |
|
|
PartBundle * |
part, |
|
|
double |
frame_rate, |
|
|
int |
num_frames |
|
) |
| |
Member Function Documentation
| void AnimControl::animation_activated |
( |
| ) |
[protected, virtual] |
| bool AnimControl::channel_has_changed |
( |
AnimChannelBase * |
channel, |
|
|
bool |
frame_blend_flag |
|
) |
| const |
| AnimBundle * AnimControl::get_anim |
( |
| ) |
const [inline] |
| PandaNode * AnimControl::get_anim_model |
( |
| ) |
const [inline] |
| const BitArray & AnimControl::get_bound_joints |
( |
| ) |
const [inline] |
Returns the subset of joints controlled by this AnimControl.
Most of the time, this will be BitArray::all_on(), for a normal full-body animation. For a subset animation, however, this will be just a subset of those bits, corresponding to the set of joints and sliders actually bound (as enumerated by bind_hierarchy() in depth-first LIFO order).
Definition at line 83 of file animControl.I.
| int AnimControl::get_channel_index |
( |
| ) |
const [inline] |
| string AnimControl::get_pending_done_event |
( |
| ) |
const |
Returns the event name that will be thrown when the AnimControl is finished binding asynchronously.
Definition at line 170 of file animControl.cxx.
| bool AnimControl::has_anim |
( |
| ) |
const [inline] |
| bool AnimControl::is_pending |
( |
| ) |
const [inline] |
Returns true if the AnimControl is being bound asynchronously, and has not yet finished.
If this is true, the AnimControl's interface is still available and will be perfectly useful (though get_anim() might return NULL), but nothing visible will happen immediately.
Definition at line 27 of file animControl.I.
Referenced by output().
| void AnimControl::mark_channels |
( |
bool |
frame_blend_flag | ) |
|
| void AnimControl::output |
( |
ostream & |
out | ) |
const [virtual] |
| void AnimControl::set_anim_model |
( |
PandaNode * |
model | ) |
[inline] |
Associates the indicated PandaNode with the AnimControl.
By convention, this node represents the root node of the model file that corresponds to this AnimControl's animation file, though nothing in this code makes this assumption or indeed does anything with this node.
The purpose of this is simply to allow the AnimControl to keep a reference count on the ModelRoot node that generated it, so that the model will not disappear from the model pool until it is no longer referenced.
Definition at line 104 of file animControl.I.
| void AnimControl::set_bound_joints |
( |
const BitArray & |
bound_joints | ) |
|
| void AnimControl::set_pending_done_event |
( |
const string & |
done_event | ) |
|
Specifies an event name that will be thrown when the AnimControl is finished binding asynchronously.
If the AnimControl has already finished binding, the event will be thrown immediately.
Definition at line 155 of file animControl.cxx.
| void AnimControl::wait_pending |
( |
| ) |
|
The documentation for this class was generated from the following files:
| | |