|
Panda3D
|
This represents the set of clip planes and/or occluders that are definitely in effect for the current node of the CullTraverserData, as well as on all child nodes. More...
#include "cullPlanes.h"
Public Member Functions | |
| ConstPointerTo< CullPlanes > | apply_state (const CullTraverser *trav, const CullTraverserData *data, const ClipPlaneAttrib *net_attrib, const ClipPlaneAttrib *off_attrib, const OccluderEffect *node_effect) const |
| Returns a pointer to a new CullPlanes object that is the same as this one, but with the indicated attributes applied to the state. | |
| ConstPointerTo< CullPlanes > | do_cull (int &result, ConstPointerTo< RenderState > &state, const GeometricBoundingVolume *node_gbv) const |
| Tests the indicated bounding volume against all of the clip planes in this object. | |
| bool | is_empty () const |
| Returns true if there are no planes listed in the CullPlanes object. | |
| ConstPointerTo< CullPlanes > | remove_occluder (const NodePath &occluder) const |
| Returns a pointer to a new CullPlanes object that is the same as this one, but with the indicated occluder removed. | |
| ConstPointerTo< CullPlanes > | remove_plane (const NodePath &clip_plane) const |
| Returns a pointer to a new CullPlanes object that is the same as this one, but with the indicated clip plane removed. | |
| void | write (std::ostream &out) const |
| ConstPointerTo< CullPlanes > | xform (const LMatrix4 &mat) const |
| Returns a pointer to a new CullPlanes object that is the same as this one, but with the clip planes modified by the indicated transform. | |
Public Member Functions inherited from ReferenceCount | |
| int | get_ref_count () const |
| WeakReferenceList * | get_weak_list () const |
| Returns the WeakReferenceList associated with this ReferenceCount object. | |
| bool | has_weak_list () const |
| Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. | |
| void | local_object () |
| This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. | |
| void | ref () const |
| Explicitly increments the reference count. | |
| bool | ref_if_nonzero () const |
| Atomically increases the reference count of this object if it is not zero. | |
| bool | test_ref_count_integrity () const |
| Does some easy checks to make sure that the reference count isn't completely bogus. | |
| bool | test_ref_count_nonzero () const |
| Does some easy checks to make sure that the reference count isn't zero, or completely bogus. | |
| virtual bool | unref () const |
| Explicitly decrements the reference count. | |
| bool | unref_if_one () const |
| Atomically decreases the reference count of this object if it is one. | |
| WeakReferenceList * | weak_ref () |
| Adds the indicated PointerToVoid as a weak reference to this object. | |
| void | weak_unref () |
| Removes the indicated PointerToVoid as a weak reference to this object. | |
Public Member Functions inherited from MemoryBase | |
| void | operator delete (void *, void *) |
| void | operator delete (void *ptr) |
| void | operator delete[] (void *, void *) |
| void | operator delete[] (void *ptr) |
| void * | operator new (size_t size) |
| void * | operator new (size_t size, void *ptr) |
| void * | operator new[] (size_t size) |
| void * | operator new[] (size_t size, void *ptr) |
Static Public Member Functions | |
| static ConstPointerTo< CullPlanes > | make_empty () |
| Returns a pointer to an empty CullPlanes object. | |
Static Public Member Functions inherited from ReferenceCount | |
| static TypeHandle | get_class_type () |
| static void | init_type () |
Additional Inherited Members | |
Public Attributes inherited from ReferenceCount | |
| get_ref_count | |
| Returns the current reference count. | |
This represents the set of clip planes and/or occluders that are definitely in effect for the current node of the CullTraverserData, as well as on all child nodes.
Any clip planes and occluders in this list may be safely culled against.
This does not include the clip planes that are in effect now, but might later be turned off by a child node, since we can't safely cull against such clip planes.
The bounding volumes in this object are transformed for each level of the scene graph.
Definition at line 42 of file cullPlanes.h.
|
inline |
Definition at line 43 of file cullPlanes.I.
| ConstPointerTo< CullPlanes > CullPlanes::apply_state | ( | const CullTraverser * | trav, |
| const CullTraverserData * | data, | ||
| const ClipPlaneAttrib * | net_attrib, | ||
| const ClipPlaneAttrib * | off_attrib, | ||
| const OccluderEffect * | node_effect ) const |
Returns a pointer to a new CullPlanes object that is the same as this one, but with the indicated attributes applied to the state.
In particular, any new ClipPlanes given in net_attrib, if it is not NULL, will be added to the state, unless those ClipPlanes are also listed in off_attrib.
Definition at line 82 of file cullPlanes.cxx.
References CullTraverser::draw_bounding_volume(), SceneSetup::get_cull_center(), Lens::get_far, SceneSetup::get_lens(), TransformState::get_mat, OccluderNode::get_min_coverage, OccluderEffect::get_num_on_occluders, ClipPlaneAttrib::get_num_on_planes, OccluderNode::get_num_vertices, OccluderEffect::get_on_occluder, ClipPlaneAttrib::get_on_plane, PlaneNode::get_plane, ReferenceCount::get_ref_count, CullTraverser::get_scene(), NodePath::get_transform(), OccluderNode::get_vertex, ClipPlaneAttrib::has_off_plane(), OccluderNode::is_double_sided, NodePath::node(), and Lens::project().
| ConstPointerTo< CullPlanes > CullPlanes::do_cull | ( | int & | result, |
| ConstPointerTo< RenderState > & | state, | ||
| const GeometricBoundingVolume * | node_gbv ) const |
Tests the indicated bounding volume against all of the clip planes in this object.
Sets result to an appropriate union of BoundingVolume::IntersectionFlags, similar to the result of BoundingVolume::contains().
Also, if the bounding volume is completely in front of any of the clip planes, removes those planes both from this object and from the indicated state, returning a new CullPlanes object in that case.
Definition at line 315 of file cullPlanes.cxx.
References RenderState::add_attrib(), and ClipPlaneAttrib::remove_on_plane().
|
inline |
Returns true if there are no planes listed in the CullPlanes object.
Definition at line 50 of file cullPlanes.I.
|
static |
Returns a pointer to an empty CullPlanes object.
Definition at line 27 of file cullPlanes.cxx.
Referenced by CullTraverserData::apply_transform().
| ConstPointerTo< CullPlanes > CullPlanes::remove_occluder | ( | const NodePath & | occluder | ) | const |
Returns a pointer to a new CullPlanes object that is the same as this one, but with the indicated occluder removed.
Definition at line 415 of file cullPlanes.cxx.
References ReferenceCount::get_ref_count.
| ConstPointerTo< CullPlanes > CullPlanes::remove_plane | ( | const NodePath & | clip_plane | ) | const |
Returns a pointer to a new CullPlanes object that is the same as this one, but with the indicated clip plane removed.
Definition at line 395 of file cullPlanes.cxx.
References ReferenceCount::get_ref_count.
| void CullPlanes::write | ( | std::ostream & | out | ) | const |
Definition at line 434 of file cullPlanes.cxx.
| ConstPointerTo< CullPlanes > CullPlanes::xform | ( | const LMatrix4 & | mat | ) | const |
Returns a pointer to a new CullPlanes object that is the same as this one, but with the clip planes modified by the indicated transform.
Definition at line 44 of file cullPlanes.cxx.
References ReferenceCount::get_ref_count.