Panda3D
auxSceneData.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 auxSceneData.I
10  * @author drose
11  * @date 2004-09-27
12  */
13 
14 /**
15  * This is protected, since you normally don't want to create a plain
16  * AuxSceneData object; instead, create an instance of a derived class that
17  * actually has some useful data in it.
18  */
19 INLINE AuxSceneData::
20 AuxSceneData(double duration) :
21  _duration(duration),
22  _last_render_time(0.0)
23 {
24 }
25 
26 /**
27  * Specifies the minimum length in time, in seconds, to keep this AuxSceneData
28  * object around in the scene graph after the last time it was rendered.
29  */
30 INLINE void AuxSceneData::
31 set_duration(double duration) {
32  _duration = duration;
33 }
34 
35 /**
36  * Returns the minimum length in time, in seconds, to keep this AuxSceneData
37  * object around in the scene graph after the last time it was rendered.
38  */
39 INLINE double AuxSceneData::
40 get_duration() const {
41  return _duration;
42 }
43 
44 /**
45  * Should be called with the current frame_time each time the AuxSceneData is
46  * used during traversal.
47  */
48 INLINE void AuxSceneData::
49 set_last_render_time(double last_render_time) {
50  _last_render_time = last_render_time;
51 }
52 
53 /**
54  * Returns the last time this object was used during traversal (according to
55  * set_last_render_time()).
56  */
57 INLINE double AuxSceneData::
59  return _last_render_time;
60 }
61 
62 /**
63  * Returns the frame_time at which this AuxSceneData object is currently
64  * scheduled to be removed from the scene graph.
65  */
66 INLINE double AuxSceneData::
68  return _last_render_time + _duration;
69 }
70 
71 INLINE std::ostream &
72 operator << (std::ostream &out, const AuxSceneData &data) {
73  data.output(out);
74  return out;
75 }
This is a base class for a generic data structure that can be attached per- instance to the camera,...
Definition: auxSceneData.h:31
double get_expiration_time() const
Returns the frame_time at which this AuxSceneData object is currently scheduled to be removed from th...
Definition: auxSceneData.I:67
void set_duration(double duration)
Specifies the minimum length in time, in seconds, to keep this AuxSceneData object around in the scen...
Definition: auxSceneData.I:31
double get_duration() const
Returns the minimum length in time, in seconds, to keep this AuxSceneData object around in the scene ...
Definition: auxSceneData.I:40
double get_last_render_time() const
Returns the last time this object was used during traversal (according to set_last_render_time()).
Definition: auxSceneData.I:58
void set_last_render_time(double render_time)
Should be called with the current frame_time each time the AuxSceneData is used during traversal.
Definition: auxSceneData.I:49