Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Public Attributes

# CullTraverser Class Reference

This object performs a depth-first traversal of the scene graph, with optional view-frustum culling, collecting CullState and searching for GeomNodes. More...

Inheritance diagram for CullTraverser:

List of all members.

## Public Member Functions
| CullTraverser ()
| CullTraverser (CullTraverser const copy)
| drawBoundingVolume (BoundingVolume const vol, TransformState const net_transform, TransformState const modelview_transform)
| Draws an appropriate visualization of the indicated bounding volume.
| endTraverse ()
| Should be called when the traverser has finished traversing its scene, this gives it a chance to do any necessary finalization.
BitMaskunsigned const | getCameraMask ()
TransformState const | getCameraTransform ()
| Returns the position of the camera relative to the starting node.
CullHandler | getCullHandler ()
| Returns the object that will receive the culled Geoms.
Thread | getCurrentThread ()
| Returns the currently-executing thread object, as passed to the CullTraverser constructor.
bool | getDepthOffsetDecals ()
| Returns the depth_offset_decals flag.
bool | getEffectiveIncompleteRender ()
| Returns true if the cull traversal is effectively in incomplete_render state, considering both the GSG's incomplete_render and the current DisplayRegion's incomplete_render flags.
GraphicsStateGuardianBase | getGsg ()
| Returns the GraphicsStateGuardian in effect.
RenderState const | getInitialState ()
| Returns the initial RenderState at the top of the scene graph we are traversing, or the empty state if the initial state was never set.
PortalClipper | getPortalClipper ()
| Returns the _portal_clipper pointer.
SceneSetup | getScene ()
| Returns the SceneSetup object.
string | getTagStateKey ()
| Returns the tag state key that has been specified for the scene's camera, if any.
GeometricBoundingVolume | getViewFrustum ()
| Returns the bounding volume that corresponds to the view frustum, or NULL if the view frustum is not in use or has not been set.
TransformState const | getWorldTransform ()
| Returns the position of the starting node relative to the camera.
bool | hasTagStateKey ()
| Returns true if a nonempty tag state key has been specified for the scene's camera, false otherwise.
| setCameraMask (BitMaskunsigned int, 32 const camera_mask)
| Changes the visibility mask for the camera viewing the scene.
| setCullHandler (CullHandler cull_handler)
| Specifies the object that will receive the culled Geoms.
| setPortalClipper (PortalClipper portal_clipper)
| Specifies _portal_clipper object pointer that subsequent traverse() or traverse_below may use.
| setScene (SceneSetup scene_setup, GraphicsStateGuardianBase gsg, bool dr_incomplete_render)
| Sets the SceneSetup object that indicates the initial camera position, etc.
| setViewFrustum (GeometricBoundingVolume view_frustum)
| Specifies the bounding volume that corresponds to the view frustum.
| traverse (NodePath const root)
| Begins the traversal from the indicated node.
| traverse (CullTraverserData data)
| Traverses from the next node with the given data, which has been constructed with the node but has not yet been converted into the node's space.
| traverseBelow (CullTraverserData data)
| Traverses all the children of the indicated node, with the given data, which has been converted into the node's space.
## Static Public Member Functions
static | flushLevel ()
| Flushes the PStatCollectors used during traversal.
static TypeHandle | getClassType ()
## Public Attributes
BitMaskunsigned | int
| Returns the visibility mask from the camera viewing the scene.

## Detailed Description

This object performs a depth-first traversal of the scene graph, with optional view-frustum culling, collecting CullState and searching for GeomNodes.

Each renderable Geom encountered is passed along with its associated RenderState to the CullHandler object.

## Constructor & Destructor Documentation

CullTraverser | ( |  | ) |

CullTraverser | ( | CullTraverser const | copy | ) |

## Member Function Documentation

drawBoundingVolume | ( | BoundingVolume const | vol,
|  | TransformState const | net_transform,
|  | TransformState const | modelview_transform
| ) |  |

Draws an appropriate visualization of the indicated bounding volume.

endTraverse | ( |  | ) |

Should be called when the traverser has finished traversing its scene, this gives it a chance to do any necessary finalization.

Reimplemented in PipeOcclusionCullTraverser.

static flushLevel | ( |  | ) | `[static]`

Flushes the PStatCollectors used during traversal.

BitMaskunsigned const getCameraMask | ( |  | ) |

TransformState const getCameraTransform | ( |  | ) |

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

static TypeHandle getClassType | ( |  | ) | `[static]`

Reimplemented from TypedReferenceCount.

Reimplemented in PipeOcclusionCullTraverser.

CullHandler getCullHandler | ( |  | ) |

Returns the object that will receive the culled Geoms.

Thread getCurrentThread | ( |  | ) |

Returns the currently-executing thread object, as passed to the CullTraverser constructor.

bool getDepthOffsetDecals | ( |  | ) |

Returns the depth_offset_decals flag.

See set_depth_offset_decals().

bool getEffectiveIncompleteRender | ( |  | ) |

Returns true if the cull traversal is effectively in incomplete_render state, considering both the GSG's incomplete_render and the current DisplayRegion's incomplete_render flags.

This returns the flag during the cull traversal; see GSG.get_effective_incomplete_render() for this same flag during the draw traversal.

GraphicsStateGuardianBase getGsg | ( |  | ) |

Returns the GraphicsStateGuardian in effect.

RenderState const getInitialState | ( |  | ) |

Returns the initial RenderState at the top of the scene graph we are traversing, or the empty state if the initial state was never set.

PortalClipper getPortalClipper | ( |  | ) |

Returns the _portal_clipper pointer.

SceneSetup getScene | ( |  | ) |

Returns the SceneSetup object.

string getTagStateKey | ( |  | ) |

Returns the tag state key that has been specified for the scene's camera, if any.

GeometricBoundingVolume getViewFrustum | ( |  | ) |

Returns the bounding volume that corresponds to the view frustum, or NULL if the view frustum is not in use or has not been set.

Note that the view frustum returned here is always in the coordinate space of the starting node, not the current node, even if it is sampled during a traversal. To get the view frustum in the current node's coordinate space, check in the current CullTraverserData.

TransformState const getWorldTransform | ( |  | ) |

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

This is the inverse of the camera transform.

Note that this value is always the position of the starting node, not the current node, even if it is sampled during a traversal. To get the transform of the current node use CullTraverserData.get_modelview_transform().

bool hasTagStateKey | ( |  | ) |

Returns true if a nonempty tag state key has been specified for the scene's camera, false otherwise.

setCameraMask | ( | BitMaskunsigned | int,
|  | 32 const | camera_mask
| ) |  |

Changes the visibility mask for the camera viewing the scene.

This is normally set automatically at the time setup_scene() is called; you should change this only if you want to render some set of objects different from what the camera normally would draw.

setCullHandler | ( | CullHandler | cull_handler | ) |

Specifies the object that will receive the culled Geoms.

This must be set before calling traverse().

setPortalClipper | ( | PortalClipper | portal_clipper | ) |

Specifies _portal_clipper object pointer that subsequent traverse() or traverse_below may use.

setScene | ( | SceneSetup | scene_setup,
|  | GraphicsStateGuardianBase | gsg,
|  | bool | dr_incomplete_render
| ) |  |

Sets the SceneSetup object that indicates the initial camera position, etc.

This must be called before traversal begins.

Reimplemented in PipeOcclusionCullTraverser.

setViewFrustum | ( | GeometricBoundingVolume | view_frustum | ) |

Specifies the bounding volume that corresponds to the view frustum.

Any primitives that fall entirely outside of this volume are not drawn.

traverse | ( | NodePath const | root | ) |

Begins the traversal from the indicated node.

traverse | ( | CullTraverserData | data | ) |

Traverses from the next node with the given data, which has been constructed with the node but has not yet been converted into the node's space.

traverseBelow | ( | CullTraverserData | data | ) |

Traverses all the children of the indicated node, with the given data, which has been converted into the node's space.

## Member Data Documentation

BitMaskunsigned int

Returns the visibility mask from the camera viewing the scene.

Reimplemented in PipeOcclusionCullTraverser.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties