Panda3D
Public Member Functions | Static Public Member Functions | List of all members
SceneSetup Class Reference

This object holds the camera position, etc., and other general setup information for rendering a particular scene. More...

#include "sceneSetup.h"

Inheritance diagram for SceneSetup:
TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

Public Member Functions

virtual TypeHandle force_init_type ()
 
Cameraget_camera_node () const
 Returns the camera used to render the scene. More...
 
const NodePathget_camera_path () const
 Returns the NodePath to the camera. More...
 
const TransformState * get_camera_transform () const
 Returns the position of the camera relative to the starting node. More...
 
const TransformState * get_cs_transform () const
 Returns the transform from the camera's coordinate system to the GSG's internal coordinate system. More...
 
const TransformState * get_cs_world_transform () const
 Returns the position from the starting node relative to the camera, in the GSG's internal coordinate system. More...
 
const NodePathget_cull_center () const
 Returns the point from which the culling operations will be performed. More...
 
DisplayRegionget_display_region () const
 Returns the display region for the scene. More...
 
const RenderStateget_initial_state () const
 Returns the initial state as set by a previous call to set_initial_state(). More...
 
bool get_inverted () const
 Returns the current setting of the inverted flag. More...
 
const Lensget_lens () const
 Returns the particular Lens used for rendering. More...
 
const NodePathget_scene_root () const
 Returns the root node of the scene. More...
 
virtual TypeHandle get_type () const
 
int get_viewport_height () const
 Returns the height of the viewport (display region) in pixels. More...
 
int get_viewport_width () const
 Returns the width of the viewport (display region) in pixels. More...
 
const TransformState * get_world_transform () const
 Returns the position of the starting node relative to the camera. More...
 
 PT (BoundingVolume) get_cull_bounds() const
 
void set_camera_node (Camera *camera_node)
 Specifies the camera used to render the scene. More...
 
void set_camera_path (const NodePath &camera_path)
 Specifies the NodePath to the camera. More...
 
void set_camera_transform (const TransformState *camera_transform)
 Specifies the position of the camera relative to the starting node. More...
 
void set_cs_transform (const TransformState *cs_transform)
 Specifies the transform from the camera's coordinate system to the GSG's internal coordinate system. More...
 
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 coordinate system. More...
 
void set_display_region (DisplayRegion *display_region)
 Specifies the display region for the scene. More...
 
void set_initial_state (const RenderState *initial_state)
 
void set_inverted (bool inverted)
 Changes the current setting of the inverted flag. More...
 
void set_lens (const Lens *lens)
 Indicates the particular Lens used for rendering. More...
 
void set_scene_root (const NodePath &scene_root)
 Specifies the root node of the scene. More...
 
void set_viewport_size (int width, int height)
 Specifies the size of the viewport (display region), in pixels. More...
 
void set_world_transform (const TransformState *world_transform)
 Specifies the position of the starting node relative to the camera. More...
 
- Public Member Functions inherited from TypedReferenceCount
 TypedReferenceCount (const TypedReferenceCount &copy)
 
void operator= (const TypedReferenceCount &copy)
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
void operator= (const TypedObject &copy)
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 Returns the current reference count. More...
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object. More...
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
 
void ref () const
 Explicitly increments the reference count. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
virtual bool unref () const
 Explicitly decrements the reference count. More...
 
void weak_ref (WeakPointerToVoid *ptv)
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref (WeakPointerToVoid *ptv)
 Removes the indicated PointerToVoid as a weak reference to this object. More...
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
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. More...
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 

Detailed Description

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.

Member Function Documentation

◆ get_camera_node()

Camera * SceneSetup::get_camera_node ( ) const
inline

◆ get_camera_path()

const NodePath & SceneSetup::get_camera_path ( ) const
inline

Returns the NodePath to the camera.

Definition at line 124 of file sceneSetup.I.

References set_camera_node().

Referenced by set_camera_path().

◆ get_camera_transform()

const TransformState * SceneSetup::get_camera_transform ( ) const
inline

Returns the position of the camera relative to the starting node.

Definition at line 271 of file sceneSetup.I.

References set_world_transform().

Referenced by set_camera_transform().

◆ get_cs_transform()

const TransformState * SceneSetup::get_cs_transform ( ) const
inline

Returns the transform from the camera's coordinate system to the GSG's internal coordinate system.

Definition at line 317 of file sceneSetup.I.

References set_cs_world_transform().

Referenced by SpeedTreeNode::cull_callback(), set_cs_transform(), and PipeOcclusionCullTraverser::set_scene().

◆ get_cs_world_transform()

const TransformState * SceneSetup::get_cs_world_transform ( ) const
inline

Returns the position from the starting node relative to the camera, in the GSG's internal coordinate system.

Definition at line 341 of file sceneSetup.I.

Referenced by CullTraverserData::node_reader(), RocketRenderInterface::render(), and set_cs_world_transform().

◆ get_cull_center()

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 203 of file sceneSetup.I.

References get_initial_state().

Referenced by PortalNode::cull_callback(), PolylightEffect::cull_callback(), GraphicsEngine::do_cull(), and get_inverted().

◆ get_display_region()

DisplayRegion * SceneSetup::get_display_region ( ) const
inline

Returns the display region for the scene.

Definition at line 50 of file sceneSetup.I.

References set_viewport_size().

Referenced by GraphicsEngine::do_cull(), set_display_region(), and DisplayRegionDrawCallbackData::upcall().

◆ get_initial_state()

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 249 of file sceneSetup.I.

References set_camera_transform().

Referenced by get_cull_center(), and CullTraverser::set_scene().

◆ get_inverted()

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 190 of file sceneSetup.I.

References get_cull_center().

Referenced by set_inverted().

◆ get_lens()

const Lens * SceneSetup::get_lens ( ) const
inline

Returns the particular Lens used for rendering.

Definition at line 164 of file sceneSetup.I.

References set_inverted().

Referenced by SpeedTreeNode::cull_callback(), PlaneNode::is_renderable(), CullableObject::munge_geom(), set_lens(), and GraphicsStateGuardian::set_scene().

◆ get_scene_root()

const NodePath & SceneSetup::get_scene_root ( ) const
inline

Returns the root node of the scene.

Definition at line 104 of file sceneSetup.I.

References set_camera_path().

Referenced by PolylightEffect::cull_callback(), SpeedTreeNode::cull_callback(), GraphicsEngine::do_cull(), and set_scene_root().

◆ get_viewport_height()

int SceneSetup::get_viewport_height ( ) const
inline

Returns the height of the viewport (display region) in pixels.

Definition at line 84 of file sceneSetup.I.

References set_scene_root().

Referenced by get_viewport_width(), and CullableObject::munge_geom().

◆ get_viewport_width()

int SceneSetup::get_viewport_width ( ) const
inline

Returns the width of the viewport (display region) in pixels.

Definition at line 73 of file sceneSetup.I.

References get_viewport_height().

Referenced by CullableObject::munge_geom(), and set_viewport_size().

◆ get_world_transform()

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 295 of file sceneSetup.I.

References set_cs_transform().

Referenced by set_world_transform().

◆ set_camera_node()

void SceneSetup::set_camera_node ( Camera camera_node)
inline

Specifies the camera used to render the scene.

Definition at line 134 of file sceneSetup.I.

References get_camera_node().

Referenced by get_camera_path().

◆ set_camera_path()

void SceneSetup::set_camera_path ( const NodePath camera_path)
inline

Specifies the NodePath to the camera.

Definition at line 114 of file sceneSetup.I.

References get_camera_path().

Referenced by get_scene_root().

◆ set_camera_transform()

void SceneSetup::set_camera_transform ( const TransformState *  camera_transform)
inline

Specifies the position of the camera relative to the starting node.

Definition at line 260 of file sceneSetup.I.

References get_camera_transform().

Referenced by get_initial_state().

◆ set_cs_transform()

void SceneSetup::set_cs_transform ( const TransformState *  cs_transform)
inline

Specifies the transform from the camera's coordinate system to the GSG's internal coordinate system.

Definition at line 306 of file sceneSetup.I.

References get_cs_transform().

Referenced by get_world_transform().

◆ set_cs_world_transform()

void SceneSetup::set_cs_world_transform ( const TransformState *  cs_world_transform)
inline

Specifies the position from the starting node relative to the camera, in the GSG's internal coordinate system.

Definition at line 329 of file sceneSetup.I.

References get_cs_world_transform().

Referenced by get_cs_transform().

◆ set_display_region()

void SceneSetup::set_display_region ( DisplayRegion display_region)
inline

Specifies the display region for the scene.

Definition at line 40 of file sceneSetup.I.

References get_display_region().

◆ set_inverted()

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 177 of file sceneSetup.I.

References get_inverted().

Referenced by get_lens().

◆ set_lens()

void SceneSetup::set_lens ( const Lens lens)
inline

Indicates the particular Lens used for rendering.

Definition at line 154 of file sceneSetup.I.

References get_lens().

Referenced by get_camera_node().

◆ set_scene_root()

void SceneSetup::set_scene_root ( const NodePath scene_root)
inline

Specifies the root node of the scene.

Definition at line 94 of file sceneSetup.I.

References get_scene_root().

Referenced by get_viewport_height().

◆ set_viewport_size()

void SceneSetup::set_viewport_size ( int  width,
int  height 
)
inline

Specifies the size of the viewport (display region), in pixels.

Definition at line 61 of file sceneSetup.I.

References get_viewport_width().

Referenced by get_display_region().

◆ set_world_transform()

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 283 of file sceneSetup.I.

References get_world_transform().

Referenced by get_camera_transform().


The documentation for this class was generated from the following files: