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