Panda3D
|
This object holds the camera position, etc., and other general setup information for rendering a particular scene. More...
#include "sceneSetup.h"
Public Member Functions | |
virtual TypeHandle | force_init_type () |
Camera * | get_camera_node () const |
Returns the camera used to render the scene. | |
const NodePath & | get_camera_path () const |
Returns the NodePath to the camera. | |
const TransformState * | get_camera_transform () const |
Returns the position of the camera relative to the starting node. | |
const NodePath & | get_cull_center () const |
Returns the point from which the culling operations will be performed. | |
DisplayRegion * | get_display_region () const |
Returns the display region for the scene. | |
const RenderState * | get_initial_state () const |
Returns the initial state as set by a previous call to set_initial_state(). | |
bool | get_inverted () const |
Returns the current setting of the inverted flag. | |
const Lens * | get_lens () const |
Returns the particular Lens used for rendering. | |
const NodePath & | get_scene_root () const |
Returns the root node of the scene. | |
virtual TypeHandle | get_type () const |
int | get_viewport_height () const |
Returns the height of the viewport (display region) in pixels. | |
int | get_viewport_width () const |
Returns the width of the viewport (display region) in pixels. | |
const TransformState * | get_world_transform () const |
Returns the position of the starting node relative to the camera. | |
PT (BoundingVolume) get_cull_bounds() const | |
void | set_camera_node (Camera *camera_node) |
Specifies the camera used to render the scene. | |
void | set_camera_path (const NodePath &camera_path) |
Specifies the NodePath to the camera. | |
void | set_camera_transform (const TransformState *camera_transform) |
Specifies the position of the camera relative to the starting node. | |
void | set_display_region (DisplayRegion *display_region) |
Specifies the display region for the scene. | |
void | set_initial_state (const RenderState *initial_state) |
Sets the initial state which is applied to all nodes in the scene, as if it were set at the top of the scene graph. | |
void | set_inverted (bool inverted) |
Changes the current setting of the inverted flag. | |
void | set_lens (const Lens *lens) |
Indicates the particular Lens used for rendering. | |
void | set_scene_root (const NodePath &scene_root) |
Specifies the root node of the scene. | |
void | set_viewport_size (int width, int height) |
Specifies the size of the viewport (display region), in pixels. | |
void | set_world_transform (const TransformState *world_transform) |
Specifies the position of the starting node relative to the camera. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. |
This object holds the camera position, etc., and other general setup information for rendering a particular scene.
Definition at line 35 of file sceneSetup.h.
Camera * SceneSetup::get_camera_node | ( | ) | const [inline] |
Returns the camera used to render the scene.
Definition at line 142 of file sceneSetup.I.
Referenced by CullTraverserData::apply_transform_and_state(), FadeLODNode::cull_callback(), and CullTraverser::set_scene().
const NodePath & SceneSetup::get_camera_path | ( | ) | const [inline] |
Returns the NodePath to the camera.
Definition at line 122 of file sceneSetup.I.
const TransformState * SceneSetup::get_camera_transform | ( | ) | const [inline] |
Returns the position of the camera relative to the starting node.
Definition at line 269 of file sceneSetup.I.
Referenced by GraphicsStateGuardian::fetch_specified_part().
const NodePath & SceneSetup::get_cull_center | ( | ) | const [inline] |
Returns the point from which the culling operations will be performed.
This is normally the camera, but if camera->set_cull_center() has been specified, it will be that special node instead.
Definition at line 201 of file sceneSetup.I.
Referenced by PortalNode::cull_callback(), GraphicsEngine::do_cull(), and PortalClipper::prepare_portal().
DisplayRegion * SceneSetup::get_display_region | ( | ) | const [inline] |
Returns the display region for the scene.
Definition at line 48 of file sceneSetup.I.
Referenced by GraphicsEngine::do_cull(), DisplayRegionDrawCallbackData::upcall(), and DisplayRegionCullCallbackData::upcall().
const RenderState * SceneSetup::get_initial_state | ( | ) | const [inline] |
Returns the initial state as set by a previous call to set_initial_state().
Definition at line 247 of file sceneSetup.I.
Referenced by CullTraverser::set_scene().
bool SceneSetup::get_inverted | ( | ) | const [inline] |
Returns the current setting of the inverted flag.
When this is true, the scene is rendered into the window upside-down, flipped like a mirror along the X axis.
Definition at line 188 of file sceneSetup.I.
const Lens * SceneSetup::get_lens | ( | ) | const [inline] |
Returns the particular Lens used for rendering.
Definition at line 162 of file sceneSetup.I.
Referenced by SpeedTreeNode::cull_callback(), ScissorEffect::cull_callback(), PortalClipper::prepare_portal(), and GraphicsStateGuardian::set_scene().
const NodePath & SceneSetup::get_scene_root | ( | ) | const [inline] |
Returns the root node of the scene.
Definition at line 102 of file sceneSetup.I.
Referenced by SpeedTreeNode::cull_callback(), and GraphicsEngine::do_cull().
int SceneSetup::get_viewport_height | ( | ) | const [inline] |
Returns the height of the viewport (display region) in pixels.
Definition at line 82 of file sceneSetup.I.
int SceneSetup::get_viewport_width | ( | ) | const [inline] |
Returns the width of the viewport (display region) in pixels.
Definition at line 71 of file sceneSetup.I.
const TransformState * SceneSetup::get_world_transform | ( | ) | const [inline] |
Returns the position of the starting node relative to the camera.
This is the inverse of the camera transform.
Definition at line 293 of file sceneSetup.I.
Referenced by GraphicsStateGuardian::fetch_specified_part().
static void SceneSetup::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from TypedReferenceCount.
Definition at line 91 of file sceneSetup.h.
References TypedReferenceCount::init_type().
void SceneSetup::set_camera_node | ( | Camera * | camera_node | ) | [inline] |
Specifies the camera used to render the scene.
Definition at line 132 of file sceneSetup.I.
void SceneSetup::set_camera_path | ( | const NodePath & | camera_path | ) | [inline] |
Specifies the NodePath to the camera.
Definition at line 112 of file sceneSetup.I.
void SceneSetup::set_camera_transform | ( | const TransformState * | camera_transform | ) | [inline] |
Specifies the position of the camera relative to the starting node.
Definition at line 258 of file sceneSetup.I.
void SceneSetup::set_display_region | ( | DisplayRegion * | display_region | ) | [inline] |
Specifies the display region for the scene.
Definition at line 38 of file sceneSetup.I.
void SceneSetup::set_initial_state | ( | const RenderState * | initial_state | ) | [inline] |
Sets the initial state which is applied to all nodes in the scene, as if it were set at the top of the scene graph.
Definition at line 236 of file sceneSetup.I.
void SceneSetup::set_inverted | ( | bool | inverted | ) | [inline] |
Changes the current setting of the inverted flag.
When this is true, the scene is rendered into the window upside-down and backwards, that is, inverted as if viewed through a mirror placed on the floor.
Definition at line 175 of file sceneSetup.I.
void SceneSetup::set_lens | ( | const Lens * | lens | ) | [inline] |
Indicates the particular Lens used for rendering.
Definition at line 152 of file sceneSetup.I.
void SceneSetup::set_scene_root | ( | const NodePath & | scene_root | ) | [inline] |
Specifies the root node of the scene.
Definition at line 92 of file sceneSetup.I.
void SceneSetup::set_viewport_size | ( | int | width, |
int | height | ||
) | [inline] |
Specifies the size of the viewport (display region), in pixels.
Definition at line 59 of file sceneSetup.I.
void SceneSetup::set_world_transform | ( | const TransformState * | world_transform | ) | [inline] |
Specifies the position of the starting node relative to the camera.
This is the inverse of the camera transform.
Definition at line 281 of file sceneSetup.I.