CullTraverser

from panda3d.core import CullTraverser
class CullTraverser

Bases: TypedReferenceCount

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.

Inheritance diagram

Inheritance diagram of CullTraverser

__init__(*args, **kwargs)
doTraverse()

C++ Interface: do_traverse(const CullTraverser self, CullTraverserData data)

/**
  • Internal method called by traverse() and traverse_down(). Traverses the

  • given node, assuming it has already been checked with is_in_view().

*/

do_traverse()

C++ Interface: do_traverse(const CullTraverser self, CullTraverserData data)

/**
  • Internal method called by traverse() and traverse_down(). Traverses the

  • given node, assuming it has already been checked with is_in_view().

*/

drawBoundingVolume()

C++ Interface: draw_bounding_volume(CullTraverser self, const BoundingVolume vol, const TransformState internal_transform)

/**
  • Draws an appropriate visualization of the indicated bounding volume.

*/

draw_bounding_volume()

C++ Interface: draw_bounding_volume(CullTraverser self, const BoundingVolume vol, const TransformState internal_transform)

/**
  • Draws an appropriate visualization of the indicated bounding volume.

*/

endTraverse()

C++ Interface: end_traverse(const CullTraverser self)

/**
  • Should be called when the traverser has finished traversing its scene, this

  • gives it a chance to do any necessary finalization.

*/

end_traverse()

C++ Interface: end_traverse(const CullTraverser self)

/**
  • Should be called when the traverser has finished traversing its scene, this

  • gives it a chance to do any necessary finalization.

*/

flushLevel()

C++ Interface: flush_level()

/**
  • Flushes the PStatCollectors used during traversal.

*/

flush_level()

C++ Interface: flush_level()

/**
  • Flushes the PStatCollectors used during traversal.

*/

getCameraMask()

C++ Interface: get_camera_mask(CullTraverser self)

/**
  • Returns the visibility mask from the camera viewing the scene.

*/

getCameraTransform()

C++ Interface: get_camera_transform(CullTraverser self)

/**
  • Returns the position of the camera relative to the starting node.

*/

getClassType()

C++ Interface: get_class_type()

getCurrentThread()

C++ Interface: get_current_thread(CullTraverser self)

/**
  • Returns the currently-executing thread object, as passed to the

  • CullTraverser constructor.

*/

getDepthOffsetDecals()

C++ Interface: get_depth_offset_decals(CullTraverser self)

/**
  • Returns true, as depth offsets are the only way that we implement decals

  • nowadays.

*/

getEffectiveIncompleteRender()

C++ Interface: get_effective_incomplete_render(CullTraverser self)

/**
  • 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.

*/

getFakeViewFrustumCull()

C++ Interface: get_fake_view_frustum_cull(CullTraverser self)

/**
  • Returns true if fake view frustum culling is active.

*/

getGsg()

C++ Interface: get_gsg(CullTraverser self)

/**
  • Returns the GraphicsStateGuardian in effect.

*/

getInitialState()

C++ Interface: get_initial_state(CullTraverser self)

/**
  • 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.

*/

getScene()

C++ Interface: get_scene(CullTraverser self)

/**
  • Returns the SceneSetup object.

*/

getTagStateKey()

C++ Interface: get_tag_state_key(CullTraverser self)

/**
  • Returns the tag state key that has been specified for the scene’s camera,

  • if any.

*/

getViewFrustum()

C++ Interface: get_view_frustum(CullTraverser self)

/**
  • 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.

*/

getWorldTransform()

C++ Interface: get_world_transform(CullTraverser self)

/**
  • 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().

*/

get_camera_mask()

C++ Interface: get_camera_mask(CullTraverser self)

/**
  • Returns the visibility mask from the camera viewing the scene.

*/

get_camera_transform()

C++ Interface: get_camera_transform(CullTraverser self)

/**
  • Returns the position of the camera relative to the starting node.

*/

get_class_type()

C++ Interface: get_class_type()

get_current_thread()

C++ Interface: get_current_thread(CullTraverser self)

/**
  • Returns the currently-executing thread object, as passed to the

  • CullTraverser constructor.

*/

get_depth_offset_decals()

C++ Interface: get_depth_offset_decals(CullTraverser self)

/**
  • Returns true, as depth offsets are the only way that we implement decals

  • nowadays.

*/

get_effective_incomplete_render()

C++ Interface: get_effective_incomplete_render(CullTraverser self)

/**
  • 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.

*/

get_fake_view_frustum_cull()

C++ Interface: get_fake_view_frustum_cull(CullTraverser self)

/**
  • Returns true if fake view frustum culling is active.

*/

get_gsg()

C++ Interface: get_gsg(CullTraverser self)

/**
  • Returns the GraphicsStateGuardian in effect.

*/

get_initial_state()

C++ Interface: get_initial_state(CullTraverser self)

/**
  • 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.

*/

get_scene()

C++ Interface: get_scene(CullTraverser self)

/**
  • Returns the SceneSetup object.

*/

get_tag_state_key()

C++ Interface: get_tag_state_key(CullTraverser self)

/**
  • Returns the tag state key that has been specified for the scene’s camera,

  • if any.

*/

get_view_frustum()

C++ Interface: get_view_frustum(CullTraverser self)

/**
  • 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.

*/

get_world_transform()

C++ Interface: get_world_transform(CullTraverser self)

/**
  • 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().

*/

hasTagStateKey()

C++ Interface: has_tag_state_key(CullTraverser self)

/**
  • Returns true if a nonempty tag state key has been specified for the scene’s

  • camera, false otherwise.

*/

has_tag_state_key()

C++ Interface: has_tag_state_key(CullTraverser self)

/**
  • Returns true if a nonempty tag state key has been specified for the scene’s

  • camera, false otherwise.

*/

setCameraMask()

C++ Interface: set_camera_mask(const CullTraverser self, const BitMask 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.

*/

setScene()

C++ Interface: set_scene(const CullTraverser self, 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.

*/

setViewFrustum()

C++ Interface: set_view_frustum(const CullTraverser self, 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.

  • Nowadays, this gets set automatically by set_scene().

*/

set_camera_mask()

C++ Interface: set_camera_mask(const CullTraverser self, const BitMask 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.

*/

set_scene()

C++ Interface: set_scene(const CullTraverser self, 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.

*/

set_view_frustum()

C++ Interface: set_view_frustum(const CullTraverser self, 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.

  • Nowadays, this gets set automatically by set_scene().

*/

traverse()

C++ Interface: traverse(const CullTraverser self, const NodePath root)

/**
  • Begins the traversal from the indicated node.

*/

traverseBelow()

C++ Interface: traverse_below(const CullTraverser self, CullTraverserData data)

/**
  • Calls traverse_down on each child.

*/

traverse_below()

C++ Interface: traverse_below(const CullTraverser self, CullTraverserData data)

/**
  • Calls traverse_down on each child.

*/