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

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

Inheritance diagram for osg::CullingSet:
Inheritance graph
[legend]

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)
 Threshold at which small features are culled. More...
 
float & getSmallFeatureCullingPixelSize ()
 
float getSmallFeatureCullingPixelSize () const
 
float pixelSize (const Vec3 &v, float radius) const
 Compute the pixel of an object at position v, with specified radius. More...
 
float pixelSize (const BoundingSphere &bs) const
 Compute the pixel of a bounding sphere. More...
 
float clampedPixelSize (const Vec3 &v, float radius) const
 Compute the pixel of an object at position v, with specified radius. More...
 
float clampedPixelSize (const BoundingSphere &bs) const
 Compute the pixel of a bounding sphere. More...
 
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 threadSafe)
 Set whether to use a mutex to ensure ref() and unref() are thread safe. More...
 
bool getThreadSafeRefUnref () const
 Get whether a mutex is used to ensure ref() and unref() are thread safe. More...
 
OpenThreads::Mutex * getRefMutex () const
 Get the mutex used to ensure thread safety of ref()/unref(). More...
 
int ref () const
 Increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
int unref () const
 Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
 
int unref_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
 
int referenceCount () const
 Return the number of pointers currently referencing this object. More...
 
ObserverSetgetObserverSet () const
 Get the ObserverSet if one is attached, otherwise return NULL. More...
 
ObserverSetgetOrCreateObserverSet () const
 Get the ObserverSet if one is attached, otherwise create an ObserverSet, attach it, then return this newly created ObserverSet. More...
 
void addObserver (Observer *observer) const
 Add a Observer that is observing this object, notify the Observer when this object gets deleted. More...
 
void removeObserver (Observer *observer) const
 Remove Observer that is observing this object. More...
 

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::Mutex * getGlobalReferencedMutex ()
 Get the optional global Referenced mutex, this can be shared between all osg::Referenced. More...
 
static void setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting)
 Set whether reference counting should use a mutex for thread safe reference counting. More...
 
static bool getThreadSafeReferenceCounting ()
 Get whether reference counting is active. More...
 
static void setDeleteHandler (DeleteHandler *handler)
 Set a DeleteHandler to which deletion of all referenced counted objects will be delegated. More...
 
static DeleteHandlergetDeleteHandler ()
 Get a DeleteHandler. More...
 

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

typedef int osg::CullingSet::Mask

Member Enumeration Documentation

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

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

Member Function Documentation

void osg::CullingSet::addOccluder ( ShadowVolumeOccluder cv)
inline
void osg::CullingSet::addStateFrustum ( StateSet stateset,
Polytope polytope 
)
inline
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.

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

Compute the pixel of a bounding sphere.

fabs()ed to always be positive.

static osg::Vec4 osg::CullingSet::computePixelSizeVector ( const Viewport W,
const Matrix P,
const Matrix M 
)
static
void osg::CullingSet::disableAndPushOccludersCurrentMask ( NodePath nodePath)
Mask osg::CullingSet::getCullingMask ( ) const
inline
Polytope& osg::CullingSet::getFrustum ( )
inline
const Polytope& osg::CullingSet::getFrustum ( ) const
inline
Vec4& osg::CullingSet::getPixelSizeVector ( )
inline
const Vec4& osg::CullingSet::getPixelSizeVector ( ) const
inline
float& osg::CullingSet::getSmallFeatureCullingPixelSize ( )
inline
float osg::CullingSet::getSmallFeatureCullingPixelSize ( ) const
inline
void osg::CullingSet::getStateFrustumList ( StateFrustumList sfl)
inline
StateFrustumList& osg::CullingSet::getStateFrustumList ( )
inline
bool osg::CullingSet::isCulled ( const std::vector< Vec3 > &  vertices)
inline
bool osg::CullingSet::isCulled ( const BoundingBox bb)
inline
bool osg::CullingSet::isCulled ( const BoundingSphere bs)
inline
CullingSet& osg::CullingSet::operator= ( const CullingSet cs)
inline
float osg::CullingSet::pixelSize ( const Vec3 v,
float  radius 
) const
inline

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

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

Compute the pixel of a bounding sphere.

void osg::CullingSet::popCurrentMask ( )
inline
void osg::CullingSet::popOccludersCurrentMask ( NodePath nodePath)
void osg::CullingSet::pushCurrentMask ( )
inline
void osg::CullingSet::resetCullingMask ( )
inline
void osg::CullingSet::set ( const CullingSet cs)
inline
void osg::CullingSet::set ( const CullingSet cs,
const Matrix matrix,
const Vec4 pixelSizeVector 
)
inline
void osg::CullingSet::setCullingMask ( Mask  mask)
inline
void osg::CullingSet::setFrustum ( Polytope cv)
inline
void osg::CullingSet::setPixelSizeVector ( const Vec4 v)
inline
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

Polytope osg::CullingSet::_frustum
protected
Mask osg::CullingSet::_mask
protected
OccluderList osg::CullingSet::_occluderList
protected
Vec4 osg::CullingSet::_pixelSizeVector
protected
float osg::CullingSet::_smallFeatureCullingPixelSize
protected
StateFrustumList osg::CullingSet::_stateFrustumList
protected

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

osg logo
Generated at Wed Nov 11 2015 22:14:31 for the OpenSceneGraph by doxygen 1.8.10.