Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions
AnimControl Class Reference

Controls the timing of a character animation. More...

Inheritance diagram for AnimControl:
TypedReferenceCount AnimInterface Namable TypedObject ReferenceCount

List of all members.

Public Member Functions

AnimBundle getAnim ()
 Returns the AnimBundle bound in with this AnimControl.
PandaNode getAnimModel ()
 Retrieves the pointer set via set_anim_model().
BitArray const getBoundJoints ()
 Returns the subset of joints controlled by this AnimControl.
int getChannelIndex ()
 Returns the particular channel index associated with this AnimControl.
PartBundle getPart ()
 Returns the PartBundle bound in with this AnimControl.
string getPendingDoneEvent ()
 Returns the event name that will be thrown when the AnimControl is finished binding asynchronously.
bool hasAnim ()
 Returns true if the AnimControl was successfully loaded, or false if there was a problem.
bool isPending ()
 Returns true if the AnimControl is being bound asynchronously, and has not yet finished.
 output (ostream out)
 Outputs the Namable.
 setAnimModel (PandaNode model)
 Associates the indicated PandaNode with the AnimControl.
 setPendingDoneEvent (string done_event)
 Specifies an event name that will be thrown when the AnimControl is finished binding asynchronously.
 waitPending ()
 Blocks the current thread until the AnimControl has finished loading and is fully bound.

Static Public Member Functions

static TypeHandle getClassType ()

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.


Member Function Documentation

Returns the AnimBundle bound in with this AnimControl.

Retrieves the pointer set via set_anim_model().

See set_anim_model().

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).

Returns the particular channel index associated with this AnimControl.

This channel index is the slot on which each AnimGroup is bound to its associated PartGroup, for each joint in the animation.

It will be true that get_part()->find_child("n")->get_bound(get_channel_index()) == get_anim()->find_child("n"), for each joint "n".

static TypeHandle getClassType ( ) [static]

Reimplemented from TypedReferenceCount.

Returns the PartBundle bound in with this AnimControl.

string getPendingDoneEvent ( )

Returns the event name that will be thrown when the AnimControl is finished binding asynchronously.

bool hasAnim ( )

Returns true if the AnimControl was successfully loaded, or false if there was a problem.

This may return false while is_pending() is true.

bool isPending ( )

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.

output ( ostream  out)

Outputs the Namable.

This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.

Reimplemented from Namable.

setAnimModel ( PandaNode  model)

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.

setPendingDoneEvent ( 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.

Blocks the current thread until the AnimControl has finished loading and is fully bound.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties