Panda3D
animControl.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file animControl.I
10  * @author drose
11  * @date 1999-02-19
12  */
13 
14 /**
15  * Returns true if the AnimControl is being bound asynchronously, and has not
16  * yet finished. If this is true, the AnimControl's interface is still
17  * available and will be perfectly useful (though get_anim() might return
18  * NULL), but nothing visible will happen immediately.
19  */
20 INLINE bool AnimControl::
21 is_pending() const {
22  return _pending;
23 }
24 
25 /**
26  * Returns true if the AnimControl was successfully loaded, or false if there
27  * was a problem. This may return false while is_pending() is true.
28  */
29 INLINE bool AnimControl::
30 has_anim() const {
31  return (_anim != nullptr);
32 }
33 
34 /**
35  * Returns the AnimBundle bound in with this AnimControl.
36  */
38 get_anim() const {
39  return _anim;
40 }
41 
42 /**
43  * Returns the particular channel index associated with this AnimControl.
44  * This channel index is the slot on which each AnimGroup is bound to its
45  * associated PartGroup, for each joint in the animation.
46  *
47  * It will be true that
48  * get_part()->find_child("n")->get_bound(get_channel_index()) ==
49  * get_anim()->find_child("n"), for each joint "n".
50  */
51 INLINE int AnimControl::
53  return _channel_index;
54 }
55 
56 /**
57  * Returns the subset of joints controlled by this AnimControl. Most of the
58  * time, this will be BitArray::all_on(), for a normal full-body animation.
59  * For a subset animation, however, this will be just a subset of those bits,
60  * corresponding to the set of joints and sliders actually bound (as
61  * enumerated by bind_hierarchy() in depth-first LIFO order).
62  */
63 INLINE const BitArray &AnimControl::
65  return _bound_joints;
66 }
67 
68 /**
69  * Associates the indicated PandaNode with the AnimControl. By convention,
70  * this node represents the root node of the model file that corresponds to
71  * this AnimControl's animation file, though nothing in this code makes this
72  * assumption or indeed does anything with this node.
73  *
74  * The purpose of this is simply to allow the AnimControl to keep a reference
75  * count on the ModelRoot node that generated it, so that the model will not
76  * disappear from the model pool until it is no longer referenced.
77  */
78 INLINE void AnimControl::
80  _anim_model = model;
81 }
82 
83 /**
84  * Retrieves the pointer set via set_anim_model(). See set_anim_model().
85  */
87 get_anim_model() const {
88  return _anim_model;
89 }
90 
91 INLINE std::ostream &
92 operator << (std::ostream &out, const AnimControl &control) {
93  control.output(out);
94  return out;
95 }
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
const BitArray & get_bound_joints() const
Returns the subset of joints controlled by this AnimControl.
Definition: animControl.I:64
This is the root of an AnimChannel hierarchy.
Definition: animBundle.h:29
AnimBundle * get_anim() const
Returns the AnimBundle bound in with this AnimControl.
Definition: animControl.I:38
A dynamic array with an unlimited number of bits.
Definition: bitArray.h:39
bool has_anim() const
Returns true if the AnimControl was successfully loaded, or false if there was a problem.
Definition: animControl.I:30
PandaNode * get_anim_model() const
Retrieves the pointer set via set_anim_model().
Definition: animControl.I:87
int get_channel_index() const
Returns the particular channel index associated with this AnimControl.
Definition: animControl.I:52
Controls the timing of a character animation.
Definition: animControl.h:38
bool is_pending() const
Returns true if the AnimControl is being bound asynchronously, and has not yet finished.
Definition: animControl.I:21
void set_anim_model(PandaNode *model)
Associates the indicated PandaNode with the AnimControl.
Definition: animControl.I:79