Panda3D
Loading...
Searching...
No Matches
CullPlanes Class Reference

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"

Inheritance diagram for CullPlanes:
ReferenceCount MemoryBase

Public Member Functions

ConstPointerTo< CullPlanesapply_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< CullPlanesdo_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< CullPlanesremove_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< CullPlanesremove_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< CullPlanesxform (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
 
WeakReferenceListget_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.
 
WeakReferenceListweak_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< CullPlanesmake_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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~CullPlanes()

CullPlanes::~CullPlanes ( )
inline

Definition at line 43 of file cullPlanes.I.

Member Function Documentation

◆ apply_state()

ConstPointerTo< CullPlanes > CullPlanes::apply_state ( const CullTraverser * trav,
const CullTraverserData * data,
const ClipPlaneAttrib * net_attrib,
const ClipPlaneAttrib * off_attrib,
const OccluderEffect * node_effect ) const

◆ do_cull()

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().

◆ is_empty()

bool CullPlanes::is_empty ( ) const
inline

Returns true if there are no planes listed in the CullPlanes object.

Definition at line 50 of file cullPlanes.I.

◆ make_empty()

ConstPointerTo< CullPlanes > CullPlanes::make_empty ( )
static

Returns a pointer to an empty CullPlanes object.

Definition at line 27 of file cullPlanes.cxx.

Referenced by CullTraverserData::apply_transform().

◆ remove_occluder()

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.

◆ remove_plane()

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.

◆ write()

void CullPlanes::write ( std::ostream & out) const

Definition at line 434 of file cullPlanes.cxx.

◆ xform()

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.


The documentation for this class was generated from the following files: