Panda3D
eggAnimPreload.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 eggAnimPreload.I
10  * @author drose
11  * @date 2008-08-06
12  */
13 
14 /**
15  *
16  */
17 INLINE EggAnimPreload::
18 EggAnimPreload(const std::string &name) : EggNode(name) {
19  _has_fps = false;
20  _has_num_frames = false;
21 }
22 
23 
24 /**
25  *
26  */
27 INLINE EggAnimPreload::
28 EggAnimPreload(const EggAnimPreload &copy) :
29  EggNode(copy),
30  _fps(copy._fps),
31  _has_fps(copy._has_fps),
32  _num_frames(copy._num_frames),
33  _has_num_frames(copy._has_num_frames)
34 {
35 }
36 
37 
38 /**
39  *
40  */
41 INLINE EggAnimPreload &EggAnimPreload::
42 operator = (const EggAnimPreload &copy) {
43  EggNode::operator = (copy);
44  _fps = copy._fps;
45  _has_fps = copy._has_fps;
46  _num_frames = copy._num_frames;
47  _has_num_frames = copy._has_num_frames;
48 
49  return *this;
50 }
51 
52 
53 /**
54  *
55  */
56 INLINE void EggAnimPreload::
57 set_fps(double fps) {
58  _fps = fps;
59  _has_fps = true;
60 }
61 
62 
63 /**
64  *
65  */
66 INLINE void EggAnimPreload::
67 clear_fps() {
68  _has_fps = false;
69 }
70 
71 /**
72  *
73  */
74 INLINE bool EggAnimPreload::
75 has_fps() const {
76  return _has_fps;
77 }
78 
79 /**
80  * This is only valid if has_fps() returns true.
81  */
82 INLINE double EggAnimPreload::
83 get_fps() const {
84  nassertr(has_fps(), 0.0);
85  return _fps;
86 }
87 
88 /**
89  *
90  */
91 INLINE void EggAnimPreload::
92 set_num_frames(int num_frames) {
93  _num_frames = num_frames;
94  _has_num_frames = true;
95 }
96 
97 
98 /**
99  *
100  */
101 INLINE void EggAnimPreload::
102 clear_num_frames() {
103  _has_num_frames = false;
104 }
105 
106 /**
107  *
108  */
109 INLINE bool EggAnimPreload::
110 has_num_frames() const {
111  return _has_num_frames;
112 }
113 
114 /**
115  * This is only valid if has_num_frames() returns true.
116  */
117 INLINE int EggAnimPreload::
118 get_num_frames() const {
119  nassertr(has_num_frames(), 0);
120  return _num_frames;
121 }
double get_fps() const
This is only valid if has_fps() returns true.
int get_num_frames() const
This is only valid if has_num_frames() returns true.
This corresponds to an <AnimPreload> entry.
A base class for things that may be directly added into the egg hierarchy.
Definition: eggNode.h:35