Panda3D
Loading...
Searching...
No Matches
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
26class DisplayRegion;
27
28/**
29 * This object holds the camera position, etc., and other general setup
30 * information for rendering a particular scene.
31 */
32class EXPCL_PANDA_PGRAPH SceneSetup : public TypedReferenceCount {
33public:
34 INLINE SceneSetup();
35
36PUBLISHED:
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
77private:
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
92public:
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
106private:
107 static TypeHandle _type_handle;
108};
109
110#include "sceneSetup.I"
111
112#endif
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...
A node that can be positioned around in the scene graph to represent a point of view for rendering a ...
Definition camera.h:35
A rectangular subregion within a window for rendering into.
A base class for any number of different kinds of lenses, linear and otherwise.
Definition lens.h:41
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition nodePath.h:159
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition renderState.h:47
void set_world_transform(const TransformState *world_transform)
Specifies the position of the starting node relative to the camera.
Definition sceneSetup.I:223
const Lens * get_lens() const
Returns the particular Lens used for rendering.
Definition sceneSetup.I:131
void set_viewport_size(int width, int height)
Specifies the size of the viewport (display region), in pixels.
Definition sceneSetup.I:50
DisplayRegion * get_display_region() const
Returns the display region for the scene.
Definition sceneSetup.I:42
int get_viewport_width() const
Returns the width of the viewport (display region) in pixels.
Definition sceneSetup.I:59
void set_cs_world_transform(const TransformState *cs_world_transform)
Specifies the position from the starting node relative to the camera, in the GSG's internal coordinat...
Definition sceneSetup.I:259
const NodePath & get_scene_root() const
Returns the root node of the scene.
Definition sceneSetup.I:83
void set_scene_root(const NodePath &scene_root)
Specifies the root node of the scene.
Definition sceneSetup.I:75
void set_cs_transform(const TransformState *cs_transform)
Specifies the transform from the camera's coordinate system to the GSG's internal coordinate system.
Definition sceneSetup.I:241
const RenderState * get_initial_state() const
Returns the initial state as set by a previous call to set_initial_state().
Definition sceneSetup.I:198
void set_lens(const Lens *lens)
Indicates the particular Lens used for rendering.
Definition sceneSetup.I:123
bool get_inverted() const
Returns the current setting of the inverted flag.
Definition sceneSetup.I:151
const TransformState * get_camera_transform() const
Returns the position of the camera relative to the starting node.
Definition sceneSetup.I:214
void set_camera_path(const NodePath &camera_path)
Specifies the NodePath to the camera.
Definition sceneSetup.I:91
const NodePath & get_cull_center() const
Returns the point from which the culling operations will be performed.
Definition sceneSetup.I:161
void set_display_region(DisplayRegion *display_region)
Specifies the display region for the scene.
Definition sceneSetup.I:34
const TransformState * get_cs_transform() const
Returns the transform from the camera's coordinate system to the GSG's internal coordinate system.
Definition sceneSetup.I:250
int get_viewport_height() const
Returns the height of the viewport (display region) in pixels.
Definition sceneSetup.I:67
void set_camera_transform(const TransformState *camera_transform)
Specifies the position of the camera relative to the starting node.
Definition sceneSetup.I:206
const NodePath & get_camera_path() const
Returns the NodePath to the camera.
Definition sceneSetup.I:99
const TransformState * get_cs_world_transform() const
Returns the position from the starting node relative to the camera, in the GSG's internal coordinate ...
Definition sceneSetup.I:268
void set_inverted(bool inverted)
Changes the current setting of the inverted flag.
Definition sceneSetup.I:141
void set_camera_node(Camera *camera_node)
Specifies the camera used to render the scene.
Definition sceneSetup.I:107
Camera * get_camera_node() const
Returns the camera used to render the scene.
Definition sceneSetup.I:115
const TransformState * get_world_transform() const
Returns the position of the starting node relative to the camera.
Definition sceneSetup.I:232
Indicates a coordinate-system transform on vertices.
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.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.