osg::CullStack Class Reference

`#include <CullStack>`

Inheritance diagram for osg::CullStack:

## Public Types

typedef std::vector< ShadowVolumeOccluder > | OccluderList
typedef std::vector< CullingSet > | CullingStack
typedef fast_back_stack< ref_ptr< RefMatrix > > | MatrixStack
Public Types inherited from osg::CullSettings

enum

VariablesMask {
COMPUTE_NEAR_FAR_MODE = (0x1 << 0) , CULLING_MODE = (0x1 << 1) , LOD_SCALE = (0x1 << 2) , SMALL_FEATURE_CULLING_PIXEL_SIZE = (0x1 << 3) ,
CLAMP_PROJECTION_MATRIX_CALLBACK = (0x1 << 4) , NEAR_FAR_RATIO = (0x1 << 5) , IMPOSTOR_ACTIVE = (0x1 << 6) , DEPTH_SORT_IMPOSTOR_SPRITES = (0x1 << 7) ,
IMPOSTOR_PIXEL_ERROR_THRESHOLD = (0x1 << 8) , NUM_FRAMES_TO_KEEP_IMPOSTORS_SPRITES = (0x1 << 9) , CULL_MASK = (0x1 << 10) , CULL_MASK_LEFT = (0x1 << 11) ,
CULL_MASK_RIGHT = (0x1 << 12) , CLEAR_COLOR = (0x1 << 13) , CLEAR_MASK = (0x1 << 14) , LIGHTING_MODE = (0x1 << 15) ,
LIGHT = (0x1 << 16) , DRAW_BUFFER = (0x1 << 17) , READ_BUFFER = (0x1 << 18) , NO_VARIABLES = 0x00000000 ,
ALL_VARIABLES = 0x7FFFFFFF
}

enum | InheritanceMaskActionOnAttributeSetting { DISABLE_ASSOCIATED_INHERITANCE_MASK_BIT , DO_NOT_MODIFY_INHERITANCE_MASK }
enum | ComputeNearFarMode { DO_NOT_COMPUTE_NEAR_FAR = 0 , COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES , COMPUTE_NEAR_FAR_USING_PRIMITIVES , COMPUTE_NEAR_USING_PRIMITIVES }
enum | CullingModeValues { 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 , CLUSTER_CULLING = 0x20 , DEFAULT_CULLING , ENABLE_ALL_CULLING }
typedef int | InheritanceMask
typedef int | CullingMode

## Public Member Functions

| CullStack ()
| CullStack (const CullStack &cs)
| ~CullStack ()
void | reset ()
void | pushCullingSet ()
void | popCullingSet ()
void | setOccluderList (const ShadowVolumeOccluderList &svol)
ShadowVolumeOccluderList & | getOccluderList ()
const ShadowVolumeOccluderList & | getOccluderList () const
void | pushViewport (osg::Viewport *viewport)
void | popViewport ()
void | pushProjectionMatrix (osg::RefMatrix *matrix)
void | popProjectionMatrix ()
void | pushModelViewMatrix (osg::RefMatrix *matrix, Transform::ReferenceFrame referenceFrame)
void | popModelViewMatrix ()
float | getFrustumVolume ()
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
void | disableAndPushOccludersCurrentMask (NodePath &nodePath)
void | popOccludersCurrentMask (NodePath &nodePath)
bool | isCulled (const std::vector< Vec3 > &vertices)
bool | isCulled (const BoundingBox &bb)
bool | isCulled (const BoundingSphere &bs)
bool | isCulled (const osg::Node &node)
void | pushCurrentMask ()
void | popCurrentMask ()
CullingStack & | getClipSpaceCullingStack ()
CullingStack & | getProjectionCullingStack ()
CullingStack & | getModelViewCullingStack ()
CullingSet & | getCurrentCullingSet ()
const CullingSet & | getCurrentCullingSet () const
osg::Viewport * | getViewport ()
const osg::Viewport * | getViewport () const
osg::RefMatrix * | getModelViewMatrix ()
const osg::RefMatrix * | getModelViewMatrix () const
osg::RefMatrix * | getProjectionMatrix ()
const osg::RefMatrix * | getProjectionMatrix () const
osg::Matrix | getWindowMatrix () const
const osg::RefMatrix * | getMVPW ()
const osg::Vec3 & | getReferenceViewPoint () const
void | pushReferenceViewPoint (const osg::Vec3 &viewPoint)
void | popReferenceViewPoint ()
const osg::Vec3 & | getEyeLocal () const
const osg::Vec3 & | getViewPointLocal () const
const osg::Vec3 | getUpLocal () const
const osg::Vec3 | getLookVectorLocal () const
MatrixStack & | getProjectionStack ()
const MatrixStack & | getProjectionStack () const
MatrixStack & | getModelViewStack ()
const MatrixStack & | getModelViewStack () const
MatrixStack & | getMVPWStack ()
const MatrixStack & | getMVPWStack () const
Public Member Functions inherited from osg::CullSettings
| CullSettings ()
| CullSettings (ArgumentParser &arguments)
| CullSettings (const CullSettings &cs)
virtual | ~CullSettings ()
CullSettings & | operator= (const CullSettings &settings)
virtual void | setDefaults ()
void | setInheritanceMask (InheritanceMask mask)
InheritanceMask | getInheritanceMask () const
void | setCullSettings (const CullSettings &settings)
virtual void | inheritCullSettings (const CullSettings &settings)
virtual void | inheritCullSettings (const CullSettings &settings, unsigned int inheritanceMask)
void | readEnvironmentalVariables ()
void | readCommandLine (ArgumentParser &arguments)
void | setInheritanceMaskActionOnAttributeSetting (InheritanceMaskActionOnAttributeSetting action)
InheritanceMaskActionOnAttributeSetting | getInheritanceMaskActionOnAttributeSetting () const
void | applyMaskAction (unsigned int maskBit)
void | setImpostorsActive (bool active)
bool | getImpostorsActive () const
void | setImpostorPixelErrorThreshold (float numPixels)
float | getImpostorPixelErrorThreshold () const
void | setDepthSortImpostorSprites (bool doDepthSort)
bool | getDepthSortImpostorSprites () const
void | setNumberOfFrameToKeepImpostorSprites (int numFrames)
int | getNumberOfFrameToKeepImpostorSprites () const
void | setComputeNearFarMode (ComputeNearFarMode cnfm)
ComputeNearFarMode | getComputeNearFarMode () const
void | setNearFarRatio (double ratio)
double | getNearFarRatio () const
void | setCullingMode (CullingMode mode)
CullingMode | getCullingMode () const
void | setCullMask (osg::Node::NodeMask nm)
osg::Node::NodeMask | getCullMask () const
void | setCullMaskLeft (osg::Node::NodeMask nm)
osg::Node::NodeMask | getCullMaskLeft () const
void | setCullMaskRight (osg::Node::NodeMask nm)
osg::Node::NodeMask | getCullMaskRight () const
void | setLODScale (float scale)
float | getLODScale () const
void | setSmallFeatureCullingPixelSize (float value)
float | getSmallFeatureCullingPixelSize () const
void | setClampProjectionMatrixCallback (ClampProjectionMatrixCallback *cpmc)
ClampProjectionMatrixCallback * | getClampProjectionMatrixCallback ()
const ClampProjectionMatrixCallback * | getClampProjectionMatrixCallback () const
void | write (std::ostream &out)

## Protected Types

typedef fast_back_stack< ref_ptr< Viewport > > | ViewportStack
typedef fast_back_stack< Vec3 > | EyePointStack
typedef std::vector< osg::ref_ptr< osg::RefMatrix > > | MatrixList

## Protected Member Functions

void | computeFrustumVolume ()
osg::RefMatrix * | createOrReuseMatrix (const osg::Matrix &value)

## Protected Attributes

ShadowVolumeOccluderList | _occluderList
MatrixStack | _projectionStack
MatrixStack | _modelviewStack
MatrixStack | _MVPW_Stack
ViewportStack | _viewportStack
EyePointStack | _referenceViewPoints
EyePointStack | _eyePointStack
EyePointStack | _viewPointStack
CullingStack | _clipspaceCullingStack
CullingStack | _projectionCullingStack
CullingStack | _modelviewCullingStack
unsigned int | _index_modelviewCullingStack
CullingSet * | _back_modelviewCullingStack
float | _frustumVolume
unsigned int | _bbCornerNear
unsigned int | _bbCornerFar
ref_ptr< osg::RefMatrix > | _identity
MatrixList | _reuseMatrixList
unsigned int | _currentReuseMatrixIndex
Protected Attributes inherited from osg::CullSettings
InheritanceMask | _inheritanceMask
InheritanceMaskActionOnAttributeSetting | _inheritanceMaskActionOnAttributeSetting
ComputeNearFarMode | _computeNearFar
CullingMode | _cullingMode
float | _LODScale
float | _smallFeatureCullingPixelSize
ref_ptr< ClampProjectionMatrixCallback > | _clampProjectionMatrixCallback
double | _nearFarRatio
bool | _impostorActive
bool | _depthSortImpostorSprites
float | _impostorPixelErrorThreshold
int | _numFramesToKeepImpostorSprites
Node::NodeMask | _cullMask
Node::NodeMask | _cullMaskLeft
Node::NodeMask | _cullMaskRight

## Detailed Description

A CullStack class which accumulates the current project, modelview matrices and the CullingSet.

## Member Typedef Documentation

## CullingStack

typedef std::vector< CullingSet > osg::CullStack::CullingStack

## EyePointStack

typedef fast_back_stack<Vec3> osg::CullStack::EyePointStack

protected

## MatrixList

typedef std::vector< osg::ref_ptr<osg::RefMatrix> > osg::CullStack::MatrixList

protected

## MatrixStack

typedef fast_back_stack< ref_ptr<RefMatrix> > osg::CullStack::MatrixStack

## OccluderList

typedef std::vector<ShadowVolumeOccluder> osg::CullStack::OccluderList

## ViewportStack

typedef fast_back_stack<ref_ptr<Viewport> > osg::CullStack::ViewportStack

protected

## Constructor & Destructor Documentation

## CullStack() [1/2]

osg::CullStack::CullStack | ( |  | ) |

Referenced by CullStack().

## CullStack() [2/2]

osg::CullStack::CullStack | ( | const CullStack & | cs | ) |

References CullStack().

## ~CullStack()

osg::CullStack::~CullStack | ( |  | ) |

## Member Function Documentation

## clampedPixelSize() [1/2]

float osg::CullStack::clampedPixelSize | ( | const BoundingSphere & | bs | ) | const

inline

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

References osg::BoundingSphereImpl< VT >::center(), clampedPixelSize(), and osg::BoundingSphereImpl< VT >::radius().

## clampedPixelSize() [2/2]

float osg::CullStack::clampedPixelSize | ( | const Vec3 & | v,
|  | float | radius ) const

inline

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

References getCurrentCullingSet().

Referenced by clampedPixelSize().

## computeFrustumVolume()

void osg::CullStack::computeFrustumVolume | ( |  | ) |

protected

Referenced by getFrustumVolume().

## createOrReuseMatrix()

RefMatrix * osg::CullStack::createOrReuseMatrix | ( | const osg::Matrix & | value | ) |

inline protected

References _currentReuseMatrixIndex, _reuseMatrixList, and osg::Matrixd::set().

Referenced by getMVPW().

## disableAndPushOccludersCurrentMask()

void osg::CullStack::disableAndPushOccludersCurrentMask | ( | NodePath & | nodePath | ) |

inline

References getCurrentCullingSet().

## getClipSpaceCullingStack()

CullingStack & osg::CullStack::getClipSpaceCullingStack | ( |  | ) |

inline

References _clipspaceCullingStack.

## getCurrentCullingSet() [1/2]

CullingSet & osg::CullStack::getCurrentCullingSet | ( |  | ) |

inline

References _back_modelviewCullingStack.

Referenced by clampedPixelSize(), disableAndPushOccludersCurrentMask(), isCulled(), isCulled(), isCulled(), isCulled(), pixelSize(), popCurrentMask(), popOccludersCurrentMask(), and pushCurrentMask().

## getCurrentCullingSet() [2/2]

const CullingSet & osg::CullStack::getCurrentCullingSet | ( |  | ) | const

inline

References _back_modelviewCullingStack.

## getEyeLocal()

const osg::Vec3 & osg::CullStack::getEyeLocal | ( |  | ) | const

inline

References _eyePointStack.

Referenced by osgUtil::CullVisitor::getEyePoint().

## getFrustumVolume()

float osg::CullStack::getFrustumVolume | ( |  | ) |

inline

References _frustumVolume, and computeFrustumVolume().

## getLookVectorLocal()

const osg::Vec3 osg::CullStack::getLookVectorLocal | ( |  | ) | const

inline

References _modelviewStack.

## getModelViewCullingStack()

CullingStack & osg::CullStack::getModelViewCullingStack | ( |  | ) |

inline

References _modelviewCullingStack.

## getModelViewMatrix() [1/2]

osg::RefMatrix * osg::CullStack::getModelViewMatrix | ( |  | ) |

inline

References _identity, and _modelviewStack.

Referenced by getMVPW().

## getModelViewMatrix() [2/2]

const osg::RefMatrix * osg::CullStack::getModelViewMatrix | ( |  | ) | const

inline

References _identity, and _modelviewStack.

## getModelViewStack() [1/2]

MatrixStack & osg::CullStack::getModelViewStack | ( |  | ) |

inline

References _modelviewStack.

## getModelViewStack() [2/2]

const MatrixStack & osg::CullStack::getModelViewStack | ( |  | ) | const

inline

References _modelviewStack.

## getMVPW()

const osg::RefMatrix * osg::CullStack::getMVPW | ( |  | ) |

inline

References _identity, _MVPW_Stack, createOrReuseMatrix(), getModelViewMatrix(), getProjectionMatrix(), and getWindowMatrix().

## getMVPWStack() [1/2]

MatrixStack & osg::CullStack::getMVPWStack | ( |  | ) |

inline

References _MVPW_Stack.

## getMVPWStack() [2/2]

const MatrixStack & osg::CullStack::getMVPWStack | ( |  | ) | const

inline

References _MVPW_Stack.

## getOccluderList() [1/2]

ShadowVolumeOccluderList & osg::CullStack::getOccluderList | ( |  | ) |

inline

References _occluderList.

## getOccluderList() [2/2]

const ShadowVolumeOccluderList & osg::CullStack::getOccluderList | ( |  | ) | const

inline

References _occluderList.

## getProjectionCullingStack()

CullingStack & osg::CullStack::getProjectionCullingStack | ( |  | ) |

inline

References _projectionCullingStack.

## getProjectionMatrix() [1/2]

osg::RefMatrix * osg::CullStack::getProjectionMatrix | ( |  | ) |

inline

References _identity, and _projectionStack.

Referenced by getMVPW().

## getProjectionMatrix() [2/2]

const osg::RefMatrix * osg::CullStack::getProjectionMatrix | ( |  | ) | const

inline

References _identity, and _projectionStack.

## getProjectionStack() [1/2]

MatrixStack & osg::CullStack::getProjectionStack | ( |  | ) |

inline

References _projectionStack.

## getProjectionStack() [2/2]

const MatrixStack & osg::CullStack::getProjectionStack | ( |  | ) | const

inline

References _projectionStack.

## getReferenceViewPoint()

const osg::Vec3 & osg::CullStack::getReferenceViewPoint | ( |  | ) | const

inline

References _referenceViewPoints.

## getUpLocal()

const osg::Vec3 osg::CullStack::getUpLocal | ( |  | ) | const

inline

References _modelviewStack.

## getViewPointLocal()

const osg::Vec3 & osg::CullStack::getViewPointLocal | ( |  | ) | const

inline

References _viewPointStack.

Referenced by osgUtil::CullVisitor::getViewPoint().

## getViewport() [1/2]

osg::Viewport * osg::CullStack::getViewport | ( |  | ) |

inline

References _viewportStack.

## getViewport() [2/2]

const osg::Viewport * osg::CullStack::getViewport | ( |  | ) | const

inline

References _viewportStack.

## getWindowMatrix()

osg::Matrix osg::CullStack::getWindowMatrix | ( |  | ) | const

inline

References _identity, _viewportStack, and osg::Viewport::computeWindowMatrix().

Referenced by getMVPW().

## isCulled() [1/4]

bool osg::CullStack::isCulled | ( | const BoundingBox & | bb | ) |

inline

References getCurrentCullingSet(), and osg::BoundingBoxImpl< VT >::valid().

## isCulled() [2/4]

bool osg::CullStack::isCulled | ( | const BoundingSphere & | bs | ) |

inline

References getCurrentCullingSet().

## isCulled() [3/4]

bool osg::CullStack::isCulled | ( | const osg::Node & | node | ) |

inline

References osg::Node::getBound(), getCurrentCullingSet(), and osg::Node::isCullingActive().

## isCulled() [4/4]

bool osg::CullStack::isCulled | ( | const std::vector< Vec3 > & | vertices | ) |

inline

References getCurrentCullingSet().

## pixelSize() [1/2]

float osg::CullStack::pixelSize | ( | const BoundingSphere & | bs | ) | const

inline

Compute the pixel size of the bounding sphere.

References osg::BoundingSphereImpl< VT >::center(), pixelSize(), and osg::BoundingSphereImpl< VT >::radius().

## pixelSize() [2/2]

float osg::CullStack::pixelSize | ( | const Vec3 & | v,
|  | float | radius ) const

inline

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

References getCurrentCullingSet().

Referenced by pixelSize().

## popCullingSet()

void osg::CullStack::popCullingSet | ( |  | ) |

## popCurrentMask()

void osg::CullStack::popCurrentMask | ( |  | ) |

inline

References getCurrentCullingSet().

## popModelViewMatrix()

void osg::CullStack::popModelViewMatrix | ( |  | ) |

## popOccludersCurrentMask()

void osg::CullStack::popOccludersCurrentMask | ( | NodePath & | nodePath | ) |

inline

References getCurrentCullingSet().

## popProjectionMatrix()

void osg::CullStack::popProjectionMatrix | ( |  | ) |

## popReferenceViewPoint()

void osg::CullStack::popReferenceViewPoint | ( |  | ) |

inline

References _referenceViewPoints.

## popViewport()

void osg::CullStack::popViewport | ( |  | ) |

## pushCullingSet()

void osg::CullStack::pushCullingSet | ( |  | ) |

## pushCurrentMask()

void osg::CullStack::pushCurrentMask | ( |  | ) |

inline

References getCurrentCullingSet().

## pushModelViewMatrix()

void osg::CullStack::pushModelViewMatrix | ( | osg::RefMatrix * | matrix,
|  | Transform::ReferenceFrame | referenceFrame )

## pushProjectionMatrix()

void osg::CullStack::pushProjectionMatrix | ( | osg::RefMatrix * | matrix | ) |

## pushReferenceViewPoint()

void osg::CullStack::pushReferenceViewPoint | ( | const osg::Vec3 & | viewPoint | ) |

inline

References _referenceViewPoints.

## pushViewport()

void osg::CullStack::pushViewport | ( | osg::Viewport * | viewport | ) |

## reset()

void osg::CullStack::reset | ( |  | ) |

## setOccluderList()

void osg::CullStack::setOccluderList | ( | const ShadowVolumeOccluderList & | svol | ) |

inline

References _occluderList.

## Member Data Documentation

## _back_modelviewCullingStack

CullingSet* osg::CullStack::_back_modelviewCullingStack

protected

Referenced by getCurrentCullingSet(), and getCurrentCullingSet().

## _bbCornerFar

unsigned int osg::CullStack::_bbCornerFar

protected

## _bbCornerNear

unsigned int osg::CullStack::_bbCornerNear

protected

## _clipspaceCullingStack

CullingStack osg::CullStack::_clipspaceCullingStack

protected

Referenced by getClipSpaceCullingStack().

## _currentReuseMatrixIndex

unsigned int osg::CullStack::_currentReuseMatrixIndex

protected

Referenced by createOrReuseMatrix().

## _eyePointStack

EyePointStack osg::CullStack::_eyePointStack

protected

Referenced by getEyeLocal().

## _frustumVolume

float osg::CullStack::_frustumVolume

protected

Referenced by getFrustumVolume().

## _identity

ref_ptr<osg::RefMatrix> osg::CullStack::_identity

protected

Referenced by getModelViewMatrix(), getModelViewMatrix(), getMVPW(), getProjectionMatrix(), getProjectionMatrix(), and getWindowMatrix().

## _index_modelviewCullingStack

unsigned int osg::CullStack::_index_modelviewCullingStack

protected

## _modelviewCullingStack

CullingStack osg::CullStack::_modelviewCullingStack

protected

Referenced by getModelViewCullingStack().

## _modelviewStack

MatrixStack osg::CullStack::_modelviewStack

protected

Referenced by getLookVectorLocal(), getModelViewMatrix(), getModelViewMatrix(), getModelViewStack(), getModelViewStack(), and getUpLocal().

## _MVPW_Stack

MatrixStack osg::CullStack::_MVPW_Stack

protected

Referenced by getMVPW(), getMVPWStack(), and getMVPWStack().

## _occluderList

ShadowVolumeOccluderList osg::CullStack::_occluderList

protected

Referenced by getOccluderList(), getOccluderList(), and setOccluderList().

## _projectionCullingStack

CullingStack osg::CullStack::_projectionCullingStack

protected

Referenced by getProjectionCullingStack().

## _projectionStack

MatrixStack osg::CullStack::_projectionStack

protected

Referenced by osgUtil::CullVisitor::addDrawable(), osgUtil::CullVisitor::addDrawableAndDepth(), getProjectionMatrix(), getProjectionMatrix(), getProjectionStack(), and getProjectionStack().

## _referenceViewPoints

EyePointStack osg::CullStack::_referenceViewPoints

protected

Referenced by getReferenceViewPoint(), popReferenceViewPoint(), and pushReferenceViewPoint().

## _reuseMatrixList

MatrixList osg::CullStack::_reuseMatrixList

protected

Referenced by createOrReuseMatrix().

## _viewPointStack

EyePointStack osg::CullStack::_viewPointStack

protected

Referenced by getViewPointLocal().

## _viewportStack

ViewportStack osg::CullStack::_viewportStack

protected

Referenced by getViewport(), getViewport(), and getWindowMatrix().

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

- CullStack