Panda3D
Loading...
Searching...
No Matches
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 */
17INLINE EggAnimPreload::
18EggAnimPreload(const std::string &name) : EggNode(name) {
19 _has_fps = false;
20 _has_num_frames = false;
21}
22
23
24/**
25 *
26 */
27INLINE EggAnimPreload::
28EggAnimPreload(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 */
41INLINE EggAnimPreload &EggAnimPreload::
42operator = (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 */
56INLINE void EggAnimPreload::
57set_fps(double fps) {
58 _fps = fps;
59 _has_fps = true;
60}
61
62
63/**
64 *
65 */
66INLINE void EggAnimPreload::
67clear_fps() {
68 _has_fps = false;
69}
70
71/**
72 *
73 */
74INLINE bool EggAnimPreload::
75has_fps() const {
76 return _has_fps;
77}
78
79/**
80 * This is only valid if has_fps() returns true.
81 */
82INLINE double EggAnimPreload::
83get_fps() const {
84 nassertr(has_fps(), 0.0);
85 return _fps;
86}
87
88/**
89 *
90 */
91INLINE void EggAnimPreload::
92set_num_frames(int num_frames) {
93 _num_frames = num_frames;
94 _has_num_frames = true;
95}
96
97
98/**
99 *
100 */
101INLINE void EggAnimPreload::
102clear_num_frames() {
103 _has_num_frames = false;
104}
105
106/**
107 *
108 */
109INLINE bool EggAnimPreload::
110has_num_frames() const {
111 return _has_num_frames;
112}
113
114/**
115 * This is only valid if has_num_frames() returns true.
116 */
117INLINE int EggAnimPreload::
118get_num_frames() const {
119 nassertr(has_num_frames(), 0);
120 return _num_frames;
121}
This corresponds to an <AnimPreload> entry.
get_fps
This is only valid if has_fps() returns true.
get_num_frames
This is only valid if has_num_frames() returns true.
A base class for things that may be directly added into the egg hierarchy.
Definition eggNode.h:36