SceneSetup

class SceneSetup

Bases: TypedReferenceCount

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

Inheritance diagram

Inheritance diagram of SceneSetup

SceneSetup(SceneSetup const&) = default
Camera *get_camera_node(void) const

Returns the camera used to render the scene.

NodePath const &get_camera_path(void) const

Returns the NodePath to the camera.

TransformState const *get_camera_transform(void) const

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

static TypeHandle get_class_type(void)
TransformState const *get_cs_transform(void) const

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

TransformState const *get_cs_world_transform(void) const

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

PointerTo<BoundingVolume> get_cull_bounds(void) const

Returns the bounding volume that should be used to perform view-frustum culling (in the space of get_cull_center()). This is normally the current lens’ bounding volume, but it may be overridden with Camera::set_cull_bounds().

NodePath const &get_cull_center(void) const

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.

DisplayRegion *get_display_region(void) const

Returns the display region for the scene.

RenderState const *get_initial_state(void) const

Returns the initial state as set by a previous call to set_initial_state().

bool get_inverted(void) const

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.

Lens const *get_lens(void) const

Returns the particular Lens used for rendering.

NodePath const &get_scene_root(void) const

Returns the root node of the scene.

int get_viewport_height(void) const

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

int get_viewport_width(void) const

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

TransformState const *get_world_transform(void) const

Returns the position of the starting node relative to the camera. This is the inverse of the camera transform.

void set_camera_node(Camera *camera_node)

Specifies the camera used to render the scene.

void set_camera_path(NodePath const &camera_path)

Specifies the NodePath to the camera.

void set_camera_transform(TransformState const *camera_transform)

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

void set_cs_transform(TransformState const *cs_transform)

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

void set_cs_world_transform(TransformState const *cs_world_transform)

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

void set_display_region(DisplayRegion *display_region)

Specifies the display region for the scene.

void set_initial_state(RenderState const *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. 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.

void set_lens(Lens const *lens)

Indicates the particular Lens used for rendering.

void set_scene_root(NodePath const &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(TransformState const *world_transform)

Specifies the position of the starting node relative to the camera. This is the inverse of the camera transform.