Panda3D
eggXfmSAnim.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 eggXfmSAnim.I
10  * @author drose
11  * @date 1999-02-19
12  */
13 
14 /**
15  *
16  */
17 INLINE EggXfmSAnim::
18 EggXfmSAnim(const std::string &name, CoordinateSystem cs) : EggGroupNode(name) {
19  _has_fps = false;
20  _coordsys = cs;
21 }
22 
23 
24 /**
25  *
26  */
27 INLINE EggXfmSAnim::
28 EggXfmSAnim(const EggXfmSAnim &copy)
29  : EggGroupNode(copy),
30  _fps(copy._fps),
31  _has_fps(copy._has_fps),
32  _order(copy._order),
33  _coordsys(copy._coordsys) {
34 }
35 
36 
37 /**
38  *
39  */
40 INLINE EggXfmSAnim &EggXfmSAnim::
41 operator = (const EggXfmSAnim &copy) {
42  EggGroupNode::operator = (copy);
43  _fps = copy._fps;
44  _has_fps = copy._has_fps;
45  _order = copy._order;
46  _coordsys = copy._coordsys;
47 
48  return *this;
49 }
50 
51 
52 /**
53  *
54  */
55 INLINE void EggXfmSAnim::
56 set_fps(double fps) {
57  _fps = fps;
58  _has_fps = true;
59 }
60 
61 
62 /**
63  *
64  */
65 INLINE void EggXfmSAnim::
66 clear_fps() {
67  _has_fps = false;
68 }
69 
70 /**
71  *
72  */
73 INLINE bool EggXfmSAnim::
74 has_fps() const {
75  return _has_fps;
76 }
77 
78 /**
79  * This is only valid if has_fps() returns true.
80  */
81 INLINE double EggXfmSAnim::
82 get_fps() const {
83  nassertr(has_fps(), 0.0);
84  return _fps;
85 }
86 
87 /**
88  *
89  */
90 INLINE void EggXfmSAnim::
91 set_order(const std::string &order) {
92  _order = order;
93 }
94 
95 /**
96  *
97  */
98 INLINE void EggXfmSAnim::
99 clear_order() {
100  _order = "";
101 }
102 
103 /**
104  *
105  */
106 INLINE bool EggXfmSAnim::
107 has_order() const {
108  return !_order.empty();
109 }
110 
111 /**
112  *
113  */
114 INLINE const std::string &EggXfmSAnim::
115 get_order() const {
116  if (has_order()) {
117  return _order;
118  } else {
119  return get_standard_order();
120  }
121 }
122 
123 /**
124  * Returns the standard order of matrix component composition. This is what
125  * the order string must be set to in order to use set_value() or add_data()
126  * successfully.
127  */
128 INLINE const std::string &EggXfmSAnim::
130  return _standard_order;
131 }
132 
133 /**
134  * Returns the coordinate system this table believes it is defined within.
135  * This should always match the coordinate system of the EggData structure
136  * that owns it. It is necessary to store it here because the meaning of the
137  * h, p, and r columns depends on the coordinate system.
138  */
139 INLINE CoordinateSystem EggXfmSAnim::
141  return _coordsys;
142 }
143 
144 /**
145  * Removes all data from the table. It does this by removing all of its
146  * children.
147  */
148 INLINE void EggXfmSAnim::
150  EggGroupNode::clear();
151 }
A base class for nodes in the hierarchy that are not leaf nodes.
Definition: eggGroupNode.h:46
This corresponds to an <Xfm$Anim_S$> entry, which is a collection of up to nine <S$Anim> entries that...
Definition: eggXfmSAnim.h:28
void clear_data()
Removes all data from the table.
Definition: eggXfmSAnim.I:149
CoordinateSystem get_coordinate_system() const
Returns the coordinate system this table believes it is defined within.
Definition: eggXfmSAnim.I:140
double get_fps() const
This is only valid if has_fps() returns true.
Definition: eggXfmSAnim.I:82
static const std::string & get_standard_order()
Returns the standard order of matrix component composition.
Definition: eggXfmSAnim.I:129