Panda3D
auxSceneData.I
1 // Filename: auxSceneData.I
2 // Created by: drose (27Sep04)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 ////////////////////////////////////////////////////////////////////
16 // Function: AuxSceneData::Constructor
17 // Access: Protected
18 // Description: This is protected, since you normally don't want to
19 // create a plain AuxSceneData object; instead, create
20 // an instance of a derived class that actually has some
21 // useful data in it.
22 ////////////////////////////////////////////////////////////////////
23 INLINE AuxSceneData::
24 AuxSceneData(double duration) :
25  _duration(duration),
26  _last_render_time(0.0)
27 {
28 }
29 
30 ////////////////////////////////////////////////////////////////////
31 // Function: AuxSceneData::set_duration
32 // Access: Public
33 // Description: Specifies the minimum length in time, in seconds, to
34 // keep this AuxSceneData object around in the scene
35 // graph after the last time it was rendered.
36 ////////////////////////////////////////////////////////////////////
37 INLINE void AuxSceneData::
38 set_duration(double duration) {
39  _duration = duration;
40 }
41 
42 ////////////////////////////////////////////////////////////////////
43 // Function: AuxSceneData::get_duration
44 // Access: Public
45 // Description: Returns the minimum length in time, in seconds, to
46 // keep this AuxSceneData object around in the scene
47 // graph after the last time it was rendered.
48 ////////////////////////////////////////////////////////////////////
49 INLINE double AuxSceneData::
50 get_duration() const {
51  return _duration;
52 }
53 
54 ////////////////////////////////////////////////////////////////////
55 // Function: AuxSceneData::set_last_render_time
56 // Access: Public
57 // Description: Should be called with the current frame_time each
58 // time the AuxSceneData is used during traversal.
59 ////////////////////////////////////////////////////////////////////
60 INLINE void AuxSceneData::
61 set_last_render_time(double last_render_time) {
62  _last_render_time = last_render_time;
63 }
64 
65 ////////////////////////////////////////////////////////////////////
66 // Function: AuxSceneData::get_last_render_time
67 // Access: Public
68 // Description: Returns the last time this object was used during
69 // traversal (according to set_last_render_time()).
70 ////////////////////////////////////////////////////////////////////
71 INLINE double AuxSceneData::
73  return _last_render_time;
74 }
75 
76 ////////////////////////////////////////////////////////////////////
77 // Function: AuxSceneData::get_expiration_time
78 // Access: Public
79 // Description: Returns the frame_time at which this AuxSceneData
80 // object is currently scheduled to be removed from the
81 // scene graph.
82 ////////////////////////////////////////////////////////////////////
83 INLINE double AuxSceneData::
85  return _last_render_time + _duration;
86 }
87 
88 INLINE ostream &
89 operator << (ostream &out, const AuxSceneData &data) {
90  data.output(out);
91  return out;
92 }
This is a base class for a generic data structure that can be attached per-instance to the camera...
Definition: auxSceneData.h:35
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:84
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:38
double get_duration() const
Returns the minimum length in time, in seconds, to keep this AuxSceneData object around in the scene ...
Definition: auxSceneData.I:50
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:72
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:61