Panda3D
Loading...
Searching...
No Matches
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 */
19INLINE AuxSceneData::
20AuxSceneData(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 */
30INLINE void AuxSceneData::
31set_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 */
39INLINE double AuxSceneData::
40get_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 */
48INLINE void AuxSceneData::
49set_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 */
57INLINE 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 */
66INLINE double AuxSceneData::
67get_expiration_time() const {
68 return _last_render_time + _duration;
69}
70
71INLINE std::ostream &
72operator << (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,...
void set_last_render_time(double render_time)
Should be called with the current frame_time each time the AuxSceneData is used during traversal.
double get_expiration_time() const
Returns the frame_time at which this AuxSceneData object is currently scheduled to be removed from th...
void set_duration(double duration)
Specifies the minimum length in time, in seconds, to keep this AuxSceneData object around in the scen...
double get_last_render_time() const
Returns the last time this object was used during traversal (according to set_last_render_time()).
double get_duration() const
Returns the minimum length in time, in seconds, to keep this AuxSceneData object around in the scene ...