Panda3D
movingPartBase.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 movingPartBase.I
10  * @author drose
11  * @date 1999-02-22
12  */
13 
14 /**
15  * Normally, you'd use make_copy() or copy_subgraph() to make a copy of this.
16  */
17 INLINE MovingPartBase::
18 MovingPartBase(const MovingPartBase &copy) :
19  PartGroup(copy),
20  _num_effective_channels(0),
21  _effective_control(nullptr),
22  _forced_channel(copy._forced_channel)
23 {
24  // We don't copy the bound channels. We do copy the forced_channel, though
25  // this is just a pointerwise copy.
26 }
27 
28 /**
29  * Returns the number of channels that might be bound to this PartGroup. This
30  * might not be the actual number of channels, since there might be holes in
31  * the list; it is one more than the index number of the highest bound
32  * channel. Thus, it is called get_max_bound() instead of get_num_bound().
33  */
34 INLINE int MovingPartBase::
35 get_max_bound() const {
36  return _channels.size();
37 }
38 
39 /**
40  * Returns the nth bound channel on this PartGroup. n can be determined by
41  * iterating from 0 to one less than get_max_bound(); or n might be
42  * AnimControl::get_channel_index().
43  *
44  * This will return NULL if there is no channel bound on the indicated index.
45  * It is an error to call this if n is less than zero or greater than or equal
46  * to get_max_bound().
47  */
49 get_bound(int n) const {
50  nassertr(n >= 0 && n < (int)_channels.size(), nullptr);
51  return _channels[n];
52 }
This is the base class for a single animatable piece that may be bound to one channel (or more,...
Parent class for all animation channels.
int get_max_bound() const
Returns the number of channels that might be bound to this PartGroup.
AnimChannelBase * get_bound(int n) const
Returns the nth bound channel on this PartGroup.
This is the base class for PartRoot and MovingPart.
Definition: partGroup.h:43