Panda3D
Loading...
Searching...
No Matches
auxSceneData.h
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.h
10 * @author drose
11 * @date 2004-09-27
12 */
13
14#ifndef AUXSCENEDATA_H
15#define AUXSCENEDATA_H
16
17#include "pandabase.h"
18
19#include "typedReferenceCount.h"
20#include "clockObject.h"
21
22/**
23 * This is a base class for a generic data structure that can be attached per-
24 * instance to the camera, to store per-instance data that must be preserved
25 * over multiple frames.
26 *
27 * In particular, this is used to implement the FadeLODNode, which must
28 * remember during traversal at what point it is in the fade, separately for
29 * each instance and for each camera.
30 */
31class EXPCL_PANDA_PGRAPH AuxSceneData : public TypedReferenceCount {
32protected:
33 INLINE AuxSceneData(double duration = 0.0);
34
35PUBLISHED:
36 INLINE void set_duration(double duration);
37 INLINE double get_duration() const;
38
39 INLINE void set_last_render_time(double render_time);
40 INLINE double get_last_render_time() const;
41
42 INLINE double get_expiration_time() const;
43
44 virtual void output(std::ostream &out) const;
45 virtual void write(std::ostream &out, int indent_level = 0) const;
46
47protected:
48 double _duration;
49 double _last_render_time;
50
51public:
52 static TypeHandle get_class_type() {
53 return _type_handle;
54 }
55 static void init_type() {
56 TypedReferenceCount::init_type();
57 register_type(_type_handle, "AuxSceneData",
58 TypedReferenceCount::get_class_type());
59 }
60 virtual TypeHandle get_type() const {
61 return get_class_type();
62 }
63 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
64
65private:
66 static TypeHandle _type_handle;
67};
68
69INLINE std::ostream &operator << (std::ostream &out, const AuxSceneData &data);
70
71#include "auxSceneData.I"
72
73#endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 ...
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.