Panda3D
Loading...
Searching...
No Matches
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 */
17INLINE EggXfmSAnim::
18EggXfmSAnim(const std::string &name, CoordinateSystem cs) : EggGroupNode(name) {
19 _has_fps = false;
20 _coordsys = cs;
21}
22
23
24/**
25 *
26 */
27INLINE EggXfmSAnim::
28EggXfmSAnim(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 */
40INLINE EggXfmSAnim &EggXfmSAnim::
41operator = (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 */
55INLINE void EggXfmSAnim::
56set_fps(double fps) {
57 _fps = fps;
58 _has_fps = true;
59}
60
61
62/**
63 *
64 */
65INLINE void EggXfmSAnim::
66clear_fps() {
67 _has_fps = false;
68}
69
70/**
71 *
72 */
73INLINE bool EggXfmSAnim::
74has_fps() const {
75 return _has_fps;
76}
77
78/**
79 * This is only valid if has_fps() returns true.
80 */
81INLINE double EggXfmSAnim::
82get_fps() const {
83 nassertr(has_fps(), 0.0);
84 return _fps;
85}
86
87/**
88 *
89 */
90INLINE void EggXfmSAnim::
91set_order(const std::string &order) {
92 _order = order;
93}
94
95/**
96 *
97 */
98INLINE void EggXfmSAnim::
99clear_order() {
100 _order = "";
101}
102
103/**
104 *
105 */
106INLINE bool EggXfmSAnim::
107has_order() const {
108 return !_order.empty();
109}
110
111/**
112 *
113 */
114INLINE const std::string &EggXfmSAnim::
115get_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 */
128INLINE 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 */
139INLINE CoordinateSystem EggXfmSAnim::
140get_coordinate_system() const {
141 return _coordsys;
142}
143
144/**
145 * Removes all data from the table. It does this by removing all of its
146 * children.
147 */
148INLINE void EggXfmSAnim::
149clear_data() {
150 EggGroupNode::clear();
151}
A base class for nodes in the hierarchy that are not leaf nodes.
This corresponds to an <Xfm$Anim_S$> entry, which is a collection of up to nine entries that specify...
Definition eggXfmSAnim.h:28
CoordinateSystem get_coordinate_system() const
Returns the coordinate system this table believes it is defined within.
void clear_data()
Removes all data from the table.
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.