Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions | Public Attributes
Camera Class Reference

A node that can be positioned around in the scene graph to represent a point of view for rendering a scene. More...

Inheritance diagram for Camera:
LensNode PandaNode TypedWritable Namable LinkedListNode ReferenceCount TypedObject LightLensNode DirectionalLight PointLight Spotlight

List of all members.

Public Member Functions

 Camera (Camera const copy)
 Camera (string name, Lens lens)
 Camera (string name)
int cleanupAuxSceneData (Thread current_thread)
 Walks through the list of currently-assigned AuxSceneData objects and releases any that are past their expiration times.
int cleanupAuxSceneData ()
 Walks through the list of currently-assigned AuxSceneData objects and releases any that are past their expiration times.
bool clearAuxSceneData (NodePath const node_path)
 Removes the AuxSceneData associated with the indicated NodePath.
 clearTagState (string tag_state)
 Removes the association established by a previous call to set_tag_state().
AuxSceneData getAuxSceneData (NodePath const node_path)
 Returns the AuxSceneData associated with the indicated NodePath, or NULL if nothing is associated.
BitMaskunsigned getCameraMask ()
BoundingVolume getCullBounds ()
 Returns the custom cull volume that was set by set_cull_bounds(), if any, or NULL if no custom cull volume was set.
NodePath const getCullCenter ()
 Returns the point from which the culling operations will be performed, if it was set by set_cull_center(), or the empty NodePath otherwise.
DisplayRegionBase getDisplayRegion (int n)
 Returns the nth display region associated with the camera.
list getDisplayRegions ()
RenderState const getInitialState ()
 Returns the initial state as set by a previous call to set_initial_state().
NodePath const getLodCenter ()
 Returns the point from which the LOD distances will be measured, if it was set by set_lod_center(), or the empty NodePath otherwise.
int getNumDisplayRegions ()
 Returns the number of display regions associated with the camera.
NodePath const getScene ()
 Returns the scene that will be rendered by the camera.
RenderState const getTagState (string tag_state)
 Returns the state associated with the indicated tag state by a previous call to set_tag_state(), or the empty state if nothing has been associated.
string getTagStateKey ()
 Returns the tag key as set by a previous call to set_tag_state_key().
bool hasTagState (string tag_state)
 Returns true if set_tag_state() has previously been called with the indicated tag state, false otherwise.
bool isActive ()
 Returns the current setting of the active flag on the camera.
 listAuxSceneData (ostream out)
 Outputs all of the NodePaths and AuxSceneDatas in use.
 setActive (bool active)
 Sets the active flag on the camera.
 setAuxSceneData (NodePath const node_path, AuxSceneData data)
 Associates the indicated AuxSceneData object with the given NodePath, possibly replacing a previous data defined for the same NodePath, if any.
 setCameraMask (BitMaskunsigned int, 32 mask)
 Changes the set of bits that represent the subset of the scene graph the camera will render.
 setCullBounds (BoundingVolume cull_bounds)
 Specifies the bounding volume that should be used to perform culling from this camera.
 setCullCenter (NodePath const cull_center)
 Specifies the point from which the culling operations are performed.
 setInitialState (RenderState const 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.
 setLodCenter (NodePath const lod_center)
 Specifies the point from which the LOD distances are measured.
 setScene (NodePath const scene)
 Sets the scene that will be rendered by the camera.
 setTagState (string tag_state, RenderState const state)
 Associates a particular state transition with the indicated tag value.
 setTagStateKey (string tag_state_key)
 Sets the tag key which, when encountered as a tag on nodes in the scene graph, causes this Camera to apply an arbitrary state transition based on the value of the tag (as specified to set_tag_state()).

Static Public Member Functions

static TypeHandle getClassType ()

Public Attributes

BitMaskunsigned int
 Returns the set of bits that represent the subset of the scene graph the camera will render.

Detailed Description

A node that can be positioned around in the scene graph to represent a point of view for rendering a scene.


Constructor & Destructor Documentation

Camera ( Camera const  copy)
Camera ( string  name,
Lens  lens 
)
Camera ( string  name)

Member Function Documentation

int cleanupAuxSceneData ( Thread  current_thread)

Walks through the list of currently-assigned AuxSceneData objects and releases any that are past their expiration times.

Returns the number of elements released.

Walks through the list of currently-assigned AuxSceneData objects and releases any that are past their expiration times.

Returns the number of elements released.

bool clearAuxSceneData ( NodePath const  node_path)

Removes the AuxSceneData associated with the indicated NodePath.

Returns true if it is removed successfully, false if it was already gone.

clearTagState ( string  tag_state)

Removes the association established by a previous call to set_tag_state().

AuxSceneData getAuxSceneData ( NodePath const  node_path)

Returns the AuxSceneData associated with the indicated NodePath, or NULL if nothing is associated.

BitMaskunsigned getCameraMask ( )
static TypeHandle getClassType ( ) [static]

Reimplemented from LensNode.

Reimplemented in Spotlight, PointLight, DirectionalLight, and LightLensNode.

Returns the custom cull volume that was set by set_cull_bounds(), if any, or NULL if no custom cull volume was set.

Returns the point from which the culling operations will be performed, if it was set by set_cull_center(), or the empty NodePath otherwise.

Returns the nth display region associated with the camera.

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

Returns the point from which the LOD distances will be measured, if it was set by set_lod_center(), or the empty NodePath otherwise.

Returns the number of display regions associated with the camera.

NodePath const getScene ( )

Returns the scene that will be rendered by the camera.

See set_scene().

RenderState const getTagState ( string  tag_state)

Returns the state associated with the indicated tag state by a previous call to set_tag_state(), or the empty state if nothing has been associated.

string getTagStateKey ( )

Returns the tag key as set by a previous call to set_tag_state_key().

bool hasTagState ( string  tag_state)

Returns true if set_tag_state() has previously been called with the indicated tag state, false otherwise.

bool isActive ( )

Returns the current setting of the active flag on the camera.

Outputs all of the NodePaths and AuxSceneDatas in use.

setActive ( bool  active)

Sets the active flag on the camera.

When the camera is not active, nothing will be rendered.

setAuxSceneData ( NodePath const  node_path,
AuxSceneData  data 
)

Associates the indicated AuxSceneData object with the given NodePath, possibly replacing a previous data defined for the same NodePath, if any.

setCameraMask ( BitMaskunsigned  int,
32  mask 
)

Changes the set of bits that represent the subset of the scene graph the camera will render.

During the cull traversal, a node is not visited if none of its draw mask bits intersect with the camera's camera mask bits. These masks can be used to selectively hide and show different parts of the scene graph from different cameras that are otherwise viewing the same scene.

setCullBounds ( BoundingVolume  cull_bounds)

Specifies the bounding volume that should be used to perform culling from this camera.

Normally, this is the bounding volume returned from the active lens' make_bounds() call, but you may override this to specify a custom volume if you require. The specified bounding volume will be understood to be in the coordinate space of the get_cull_center() node.

setCullCenter ( NodePath const  cull_center)

Specifies the point from which the culling operations are performed.

Normally, this is the same as the camera, and that is the default if this is not specified; but it may sometimes be useful to perform the culling from some other viewpoint, particularly when you are debugging the culling itself.

setInitialState ( RenderState const  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.

setLodCenter ( NodePath const  lod_center)

Specifies the point from which the LOD distances are measured.

Normally, this is the same as the camera, and that is the default if this is not specified; but it may sometimes be useful to perform the distance test from some other viewpoint. This may be used, for instance, to reduce LOD popping when the camera rotates in a small circle about an avatar.

setScene ( NodePath const  scene)

Sets the scene that will be rendered by the camera.

This is normally the root node of a scene graph, typically a node called 'render', although it could represent the root of any subgraph.

Note that the use of this method is now deprecated. In the absence of an explicit scene set on the camera, the camera will render whatever scene it is parented into. This is the preferred way to specify the scene, since it is the more intuitive mechanism.

setTagState ( string  tag_state,
RenderState const  state 
)

Associates a particular state transition with the indicated tag value.

When a node is encountered during traversal with the tag key specified by set_tag_state_key(), if the value of that tag matches tag_state, then the indicated state is applied to this node--but only when it is rendered by this camera.

This can be used to apply special effects to nodes when they are rendered by certain cameras. It is particularly useful for multipass rendering, in which specialty cameras might be needed to render the scene with a particular set of effects.

setTagStateKey ( string  tag_state_key)

Sets the tag key which, when encountered as a tag on nodes in the scene graph, causes this Camera to apply an arbitrary state transition based on the value of the tag (as specified to set_tag_state()).


Member Data Documentation

BitMaskunsigned int

Returns the set of bits that represent the subset of the scene graph the camera will render.

See set_camera_mask().

Reimplemented from PandaNode.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties