from panda3d.core import CullTraverser
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
RenderStateto the CullHandler object.
drawBoundingVolume(vol: BoundingVolume, internal_transform: TransformState) → None¶
Draws an appropriate visualization of the indicated bounding volume.
endTraverse() → None¶
Should be called when the traverser has finished traversing its scene, this gives it a chance to do any necessary finalization.
getCameraTransform() → TransformState¶
Returns the position of the camera relative to the starting node.
getCullHandler() → CullHandler¶
Returns the object that will receive the culled Geoms.
getCurrentThread() → Thread¶
Returns the currently-executing thread object, as passed to the
getDepthOffsetDecals() → bool¶
Returns true, as depth offsets are the only way that we implement decals nowadays.
getEffectiveIncompleteRender() → bool¶
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.
getInitialState() → RenderState¶
Returns the initial
RenderStateat the top of the scene graph we are traversing, or the empty state if the initial state was never set.
getPortalClipper() → PortalClipper¶
Returns the _portal_clipper pointer
getTagStateKey() → str¶
Returns the tag state key that has been specified for the scene’s camera, if any.
getViewFrustum() → GeometricBoundingVolume¶
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
getWorldTransform() → TransformState¶
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
hasTagStateKey() → bool¶
Returns true if a nonempty tag state key has been specified for the scene’s camera, false otherwise.
setCameraMask(camera_mask: DrawMask) → None¶
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(cull_handler: CullHandler) → None¶
Specifies the object that will receive the culled Geoms. This must be set before calling
setPortalClipper(portal_clipper: PortalClipper) → None¶
setScene(scene_setup: SceneSetup, gsg: GraphicsStateGuardianBase, dr_incomplete_render: bool) → None¶
SceneSetupobject that indicates the initial camera position, etc. This must be called before traversal begins.
setViewFrustum(view_frustum: GeometricBoundingVolume) → None¶
Specifies the bounding volume that corresponds to the view frustum. Any primitives that fall entirely outside of this volume are not drawn.
traverse(data: CullTraverserData) → None¶
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.