Panda3D
animChannelFixed.I
1 // Filename: animChannelFixed.I
2 // Created by: drose (24Feb99)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 template<class SwitchType>
16 TypeHandle AnimChannelFixed<SwitchType>::_type_handle;
17 
18 ////////////////////////////////////////////////////////////////////
19 // Function: AnimChannelFixed::Copy Constructor
20 // Access: Protected
21 // Description: Creates a new AnimChannelFixed, just like this one,
22 // without copying any children. The new copy is added
23 // to the indicated parent. Intended to be called by
24 // make_copy() only.
25 ////////////////////////////////////////////////////////////////////
26 template<class SwitchType>
29  AnimChannel<SwitchType>(parent, copy),
30  _value(copy._value)
31 {
32 }
33 
34 ////////////////////////////////////////////////////////////////////
35 // Function: AnimChannelFixed::Constructor
36 // Access: Public
37 // Description:
38 ////////////////////////////////////////////////////////////////////
39 template<class SwitchType>
41 AnimChannelFixed(const string &name, const ValueType &value)
42  : AnimChannel<SwitchType>(name),
43  _value(value) {
44 }
45 
46 
47 ////////////////////////////////////////////////////////////////////
48 // Function: AnimChannelFixed::has_changed
49 // Access: Public, Virtual
50 // Description:
51 ////////////////////////////////////////////////////////////////////
52 template<class SwitchType>
54 has_changed(int, double, int, double) {
55  return false;
56 }
57 
58 
59 ////////////////////////////////////////////////////////////////////
60 // Function: AnimChannelFixed::get_value
61 // Access: Public, Virtual
62 // Description:
63 ////////////////////////////////////////////////////////////////////
64 template<class SwitchType>
66 get_value(int, ValueType &value) {
67  value = _value;
68 }
69 
70 
71 ////////////////////////////////////////////////////////////////////
72 // Function: AnimChannelFixed::output
73 // Access: Public, Virtual
74 // Description:
75 ////////////////////////////////////////////////////////////////////
76 template<class SwitchType>
78 output(ostream &out) const {
80  out << " = " << _value;
81 }
virtual void output(ostream &out) const
Writes a one-line description of the group.
Definition: animGroup.cxx:214
This template class is the parent class for all kinds of AnimChannels that return different values...
Definition: animChannel.h:30
This is the base class for AnimChannel and AnimBundle.
Definition: animGroup.h:36
This template class is a special kind of AnimChannel that always returns just one fixed value...
virtual void output(ostream &out) const
Writes a one-line description of the group.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
virtual bool has_changed(int last_frame, double last_frac, int this_frame, double this_frac)
Returns true if the value has changed since the last call to has_changed().