Panda3D
|
00001 // Filename: auxSceneData.I 00002 // Created by: drose (27Sep04) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 //////////////////////////////////////////////////////////////////// 00016 // Function: AuxSceneData::Constructor 00017 // Access: Protected 00018 // Description: This is protected, since you normally don't want to 00019 // create a plain AuxSceneData object; instead, create 00020 // an instance of a derived class that actually has some 00021 // useful data in it. 00022 //////////////////////////////////////////////////////////////////// 00023 INLINE AuxSceneData:: 00024 AuxSceneData(double duration) : 00025 _duration(duration), 00026 _last_render_time(0.0) 00027 { 00028 } 00029 00030 //////////////////////////////////////////////////////////////////// 00031 // Function: AuxSceneData::set_duration 00032 // Access: Public 00033 // Description: Specifies the minimum length in time, in seconds, to 00034 // keep this AuxSceneData object around in the scene 00035 // graph after the last time it was rendered. 00036 //////////////////////////////////////////////////////////////////// 00037 INLINE void AuxSceneData:: 00038 set_duration(double duration) { 00039 _duration = duration; 00040 } 00041 00042 //////////////////////////////////////////////////////////////////// 00043 // Function: AuxSceneData::get_duration 00044 // Access: Public 00045 // Description: Returns the minimum length in time, in seconds, to 00046 // keep this AuxSceneData object around in the scene 00047 // graph after the last time it was rendered. 00048 //////////////////////////////////////////////////////////////////// 00049 INLINE double AuxSceneData:: 00050 get_duration() const { 00051 return _duration; 00052 } 00053 00054 //////////////////////////////////////////////////////////////////// 00055 // Function: AuxSceneData::set_last_render_time 00056 // Access: Public 00057 // Description: Should be called with the current frame_time each 00058 // time the AuxSceneData is used during traversal. 00059 //////////////////////////////////////////////////////////////////// 00060 INLINE void AuxSceneData:: 00061 set_last_render_time(double last_render_time) { 00062 _last_render_time = last_render_time; 00063 } 00064 00065 //////////////////////////////////////////////////////////////////// 00066 // Function: AuxSceneData::get_last_render_time 00067 // Access: Public 00068 // Description: Returns the last time this object was used during 00069 // traversal (according to set_last_render_time()). 00070 //////////////////////////////////////////////////////////////////// 00071 INLINE double AuxSceneData:: 00072 get_last_render_time() const { 00073 return _last_render_time; 00074 } 00075 00076 //////////////////////////////////////////////////////////////////// 00077 // Function: AuxSceneData::get_expiration_time 00078 // Access: Public 00079 // Description: Returns the frame_time at which this AuxSceneData 00080 // object is currently scheduled to be removed from the 00081 // scene graph. 00082 //////////////////////////////////////////////////////////////////// 00083 INLINE double AuxSceneData:: 00084 get_expiration_time() const { 00085 return _last_render_time + _duration; 00086 } 00087 00088 INLINE ostream & 00089 operator << (ostream &out, const AuxSceneData &data) { 00090 data.output(out); 00091 return out; 00092 }