openscenegraph
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
osg::CullingSet Class Reference

#include <CullingSet>

Inheritance diagram for osg::CullingSet:
osg::Referenced

Public Types

enum  MaskValues {
  NO_CULLING = 0x0 , VIEW_FRUSTUM_SIDES_CULLING = 0x1 , NEAR_PLANE_CULLING = 0x2 , FAR_PLANE_CULLING = 0x4 ,
  VIEW_FRUSTUM_CULLING , SMALL_FEATURE_CULLING = 0x8 , SHADOW_OCCLUSION_CULLING = 0x10 , DEFAULT_CULLING ,
  ENABLE_ALL_CULLING
}
 
typedef std::pair< osg::ref_ptr< osg::StateSet >, osg::PolytopeStateFrustumPair
 
typedef std::vector< StateFrustumPairStateFrustumList
 
typedef std::vector< ShadowVolumeOccluderOccluderList
 
typedef int Mask
 

Public Member Functions

 CullingSet ()
 
 CullingSet (const CullingSet &cs)
 
 CullingSet (const CullingSet &cs, const Matrix &matrix, const Vec4 &pixelSizeVector)
 
CullingSetoperator= (const CullingSet &cs)
 
void set (const CullingSet &cs)
 
void set (const CullingSet &cs, const Matrix &matrix, const Vec4 &pixelSizeVector)
 
void setCullingMask (Mask mask)
 
Mask getCullingMask () const
 
void setFrustum (Polytope &cv)
 
PolytopegetFrustum ()
 
const PolytopegetFrustum () const
 
void addStateFrustum (StateSet *stateset, Polytope &polytope)
 
void getStateFrustumList (StateFrustumList &sfl)
 
StateFrustumListgetStateFrustumList ()
 
void addOccluder (ShadowVolumeOccluder &cv)
 
void setPixelSizeVector (const Vec4 &v)
 
Vec4getPixelSizeVector ()
 
const Vec4getPixelSizeVector () const
 
void setSmallFeatureCullingPixelSize (float value)
 
float & getSmallFeatureCullingPixelSize ()
 
float getSmallFeatureCullingPixelSize () const
 
float pixelSize (const Vec3 &v, float radius) const
 
float pixelSize (const BoundingSphere &bs) const
 
float clampedPixelSize (const Vec3 &v, float radius) const
 
float clampedPixelSize (const BoundingSphere &bs) const
 
bool isCulled (const std::vector< Vec3 > &vertices)
 
bool isCulled (const BoundingBox &bb)
 
bool isCulled (const BoundingSphere &bs)
 
void pushCurrentMask ()
 
void popCurrentMask ()
 
void resetCullingMask ()
 
void disableAndPushOccludersCurrentMask (NodePath &nodePath)
 
void popOccludersCurrentMask (NodePath &nodePath)
 
virtual ~CullingSet ()
 
- Public Member Functions inherited from osg::Referenced
 Referenced ()
 
 Referenced (bool threadSafeRefUnref)
 
 Referenced (const Referenced &)
 
Referencedoperator= (const Referenced &)
 
virtual void setThreadSafeRefUnref (bool)
 
bool getThreadSafeRefUnref () const
 
OpenThreads::MutexgetRefMutex () const
 
int ref () const
 
int unref () const
 
int unref_nodelete () const
 
int referenceCount () const
 
ObserverSetgetObserverSet () const
 
ObserverSetgetOrCreateObserverSet () const
 
void addObserver (Observer *observer) const
 
void removeObserver (Observer *observer) const
 

Static Public Member Functions

static osg::Vec4 computePixelSizeVector (const Viewport &W, const Matrix &P, const Matrix &M)
 
- Static Public Member Functions inherited from osg::Referenced
static OpenThreads::MutexgetGlobalReferencedMutex ()
 
static void setDeleteHandler (DeleteHandler *handler)
 
static DeleteHandlergetDeleteHandler ()
 

Protected Attributes

Mask _mask
 
Polytope _frustum
 
StateFrustumList _stateFrustumList
 
OccluderList _occluderList
 
Vec4 _pixelSizeVector
 
float _smallFeatureCullingPixelSize
 
- Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr _observerSet
 
OpenThreads::Atomic _refCount
 

Additional Inherited Members

- Protected Member Functions inherited from osg::Referenced
virtual ~Referenced ()
 
void signalObserversAndDelete (bool signalDelete, bool doDelete) const
 
void deleteUsingDeleteHandler () const
 

Detailed Description

A CullingSet class which contains a frustum and a list of occluders.

Member Typedef Documentation

◆ Mask

typedef int osg::CullingSet::Mask

◆ OccluderList

◆ StateFrustumList

◆ StateFrustumPair

Member Enumeration Documentation

◆ MaskValues

Enumerator
NO_CULLING 
VIEW_FRUSTUM_SIDES_CULLING 
NEAR_PLANE_CULLING 
FAR_PLANE_CULLING 
VIEW_FRUSTUM_CULLING 
SMALL_FEATURE_CULLING 
SHADOW_OCCLUSION_CULLING 
DEFAULT_CULLING 
ENABLE_ALL_CULLING 

Constructor & Destructor Documentation

◆ CullingSet() [1/3]

osg::CullingSet::CullingSet ( )

◆ CullingSet() [2/3]

osg::CullingSet::CullingSet ( const CullingSet cs)
inline

◆ CullingSet() [3/3]

osg::CullingSet::CullingSet ( const CullingSet cs,
const Matrix matrix,
const Vec4 pixelSizeVector 
)
inline

◆ ~CullingSet()

virtual osg::CullingSet::~CullingSet ( )
virtual

Member Function Documentation

◆ addOccluder()

void osg::CullingSet::addOccluder ( ShadowVolumeOccluder cv)
inline

◆ addStateFrustum()

void osg::CullingSet::addStateFrustum ( StateSet stateset,
Polytope polytope 
)
inline

◆ clampedPixelSize() [1/2]

float osg::CullingSet::clampedPixelSize ( const BoundingSphere bs) const
inline

Compute the pixel of a bounding sphere. fabs()ed to always be positive.

◆ clampedPixelSize() [2/2]

float osg::CullingSet::clampedPixelSize ( const Vec3 v,
float  radius 
) const
inline

Compute the pixel of an object at position v, with specified radius. fabs()ed to always be positive.

◆ computePixelSizeVector()

static osg::Vec4 osg::CullingSet::computePixelSizeVector ( const Viewport W,
const Matrix P,
const Matrix M 
)
static

◆ disableAndPushOccludersCurrentMask()

void osg::CullingSet::disableAndPushOccludersCurrentMask ( NodePath nodePath)

◆ getCullingMask()

Mask osg::CullingSet::getCullingMask ( ) const
inline

◆ getFrustum() [1/2]

Polytope & osg::CullingSet::getFrustum ( )
inline

◆ getFrustum() [2/2]

const Polytope & osg::CullingSet::getFrustum ( ) const
inline

◆ getPixelSizeVector() [1/2]

Vec4 & osg::CullingSet::getPixelSizeVector ( )
inline

◆ getPixelSizeVector() [2/2]

const Vec4 & osg::CullingSet::getPixelSizeVector ( ) const
inline

◆ getSmallFeatureCullingPixelSize() [1/2]

float & osg::CullingSet::getSmallFeatureCullingPixelSize ( )
inline

◆ getSmallFeatureCullingPixelSize() [2/2]

float osg::CullingSet::getSmallFeatureCullingPixelSize ( ) const
inline

◆ getStateFrustumList() [1/2]

StateFrustumList & osg::CullingSet::getStateFrustumList ( )
inline

◆ getStateFrustumList() [2/2]

void osg::CullingSet::getStateFrustumList ( StateFrustumList sfl)
inline

◆ isCulled() [1/3]

bool osg::CullingSet::isCulled ( const BoundingBox bb)
inline

◆ isCulled() [2/3]

bool osg::CullingSet::isCulled ( const BoundingSphere bs)
inline

◆ isCulled() [3/3]

bool osg::CullingSet::isCulled ( const std::vector< Vec3 > &  vertices)
inline

◆ operator=()

CullingSet & osg::CullingSet::operator= ( const CullingSet cs)
inline

◆ pixelSize() [1/2]

float osg::CullingSet::pixelSize ( const BoundingSphere bs) const
inline

Compute the pixel of a bounding sphere.

◆ pixelSize() [2/2]

float osg::CullingSet::pixelSize ( const Vec3 v,
float  radius 
) const
inline

Compute the pixel of an object at position v, with specified radius.

◆ popCurrentMask()

void osg::CullingSet::popCurrentMask ( )
inline

◆ popOccludersCurrentMask()

void osg::CullingSet::popOccludersCurrentMask ( NodePath nodePath)

◆ pushCurrentMask()

void osg::CullingSet::pushCurrentMask ( )
inline

◆ resetCullingMask()

void osg::CullingSet::resetCullingMask ( )
inline

◆ set() [1/2]

void osg::CullingSet::set ( const CullingSet cs)
inline

◆ set() [2/2]

void osg::CullingSet::set ( const CullingSet cs,
const Matrix matrix,
const Vec4 pixelSizeVector 
)
inline

◆ setCullingMask()

void osg::CullingSet::setCullingMask ( Mask  mask)
inline

◆ setFrustum()

void osg::CullingSet::setFrustum ( Polytope cv)
inline

◆ setPixelSizeVector()

void osg::CullingSet::setPixelSizeVector ( const Vec4 v)
inline

◆ setSmallFeatureCullingPixelSize()

void osg::CullingSet::setSmallFeatureCullingPixelSize ( float  value)
inline

Threshold at which small features are culled.

Parameters
valueBounding volume size in screen space. Default is 2.0.

Member Data Documentation

◆ _frustum

Polytope osg::CullingSet::_frustum
protected

◆ _mask

Mask osg::CullingSet::_mask
protected

◆ _occluderList

OccluderList osg::CullingSet::_occluderList
protected

◆ _pixelSizeVector

Vec4 osg::CullingSet::_pixelSizeVector
protected

◆ _smallFeatureCullingPixelSize

float osg::CullingSet::_smallFeatureCullingPixelSize
protected

◆ _stateFrustumList

StateFrustumList osg::CullingSet::_stateFrustumList
protected

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