Panda3D
sceneSetup.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 sceneSetup.h
10  * @author drose
11  * @date 2002-03-27
12  */
13 
14 #ifndef SCENESETUP_H
15 #define SCENESETUP_H
16 
17 #include "pandabase.h"
18 
19 #include "typedReferenceCount.h"
20 #include "nodePath.h"
21 #include "camera.h"
22 #include "transformState.h"
23 #include "lens.h"
24 #include "pointerTo.h"
25 
26 class DisplayRegion;
27 
28 /**
29  * This object holds the camera position, etc., and other general setup
30  * information for rendering a particular scene.
31  */
32 class EXPCL_PANDA_PGRAPH SceneSetup : public TypedReferenceCount {
33 public:
34  INLINE SceneSetup();
35 
36 PUBLISHED:
37  INLINE void set_display_region(DisplayRegion *display_region);
38  INLINE DisplayRegion *get_display_region() const;
39 
40  INLINE void set_viewport_size(int width, int height);
41  INLINE int get_viewport_width() const;
42  INLINE int get_viewport_height() const;
43 
44  INLINE void set_scene_root(const NodePath &scene_root);
45  INLINE const NodePath &get_scene_root() const;
46 
47  INLINE void set_camera_path(const NodePath &camera_path);
48  INLINE const NodePath &get_camera_path() const;
49 
50  INLINE void set_camera_node(Camera *camera_node);
51  INLINE Camera *get_camera_node() const;
52 
53  INLINE void set_lens(const Lens *lens);
54  INLINE const Lens *get_lens() const;
55 
56  INLINE void set_inverted(bool inverted);
57  INLINE bool get_inverted() const;
58 
59  INLINE const NodePath &get_cull_center() const;
60  INLINE PT(BoundingVolume) get_cull_bounds() const;
61 
62  INLINE void set_initial_state(const RenderState *initial_state);
63  INLINE const RenderState *get_initial_state() const;
64 
65  INLINE void set_camera_transform(const TransformState *camera_transform);
66  INLINE const TransformState *get_camera_transform() const;
67 
68  INLINE void set_world_transform(const TransformState *world_transform);
69  INLINE const TransformState *get_world_transform() const;
70 
71  INLINE void set_cs_transform(const TransformState *cs_transform);
72  INLINE const TransformState *get_cs_transform() const;
73 
74  INLINE void set_cs_world_transform(const TransformState *cs_world_transform);
75  INLINE const TransformState *get_cs_world_transform() const;
76 
77 private:
78  DisplayRegion *_display_region;
79  int _viewport_width;
80  int _viewport_height;
81  NodePath _scene_root;
82  NodePath _camera_path;
83  PT(Camera) _camera_node;
84  CPT(Lens) _lens;
85  bool _inverted;
86  CPT(RenderState) _initial_state;
87  CPT(TransformState) _camera_transform;
88  CPT(TransformState) _world_transform;
89  CPT(TransformState) _cs_transform;
90  CPT(TransformState) _cs_world_transform;
91 
92 public:
93  static TypeHandle get_class_type() {
94  return _type_handle;
95  }
96  static void init_type() {
97  TypedReferenceCount::init_type();
98  register_type(_type_handle, "SceneSetup",
99  TypedReferenceCount::get_class_type());
100  }
101  virtual TypeHandle get_type() const {
102  return get_class_type();
103  }
104  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
105 
106 private:
107  static TypeHandle _type_handle;
108 };
109 
110 #include "sceneSetup.I"
111 
112 #endif
Indicates a coordinate-system transform on vertices.
A base class for any number of different kinds of lenses, linear and otherwise.
Definition: lens.h:41
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(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition: renderState.h:47
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A rectangular subregion within a window for rendering into.
Definition: displayRegion.h:57
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
This object holds the camera position, etc., and other general setup information for rendering a part...
Definition: sceneSetup.h:32
A node that can be positioned around in the scene graph to represent a point of view for rendering a ...
Definition: camera.h:35
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:161