OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
osg::CullStack Class Reference

#include <CullStack.h>

Inheritance diagram for osg::CullStack:
Inheritance graph
[legend]
Collaboration diagram for osg::CullStack:
Collaboration graph
[legend]

Public Types

typedef std::vector
< ShadowVolumeOccluder
OccluderList
 
typedef std::vector< CullingSetCullingStack
 
- 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)
 
ShadowVolumeOccluderListgetOccluderList ()
 
const ShadowVolumeOccluderListgetOccluderList () 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 ()
 
CullingStackgetClipSpaceCullingStack ()
 
CullingStackgetProjectionCullingStack ()
 
CullingStackgetModelViewCullingStack ()
 
CullingSetgetCurrentCullingSet ()
 
const CullingSetgetCurrentCullingSet () const
 
osg::ViewportgetViewport ()
 
osg::RefMatrixgetModelViewMatrix ()
 
osg::RefMatrixgetProjectionMatrix ()
 
osg::Matrix getWindowMatrix ()
 
const osg::RefMatrixgetMVPW ()
 
const osg::Vec3getReferenceViewPoint () const
 
void pushReferenceViewPoint (const osg::Vec3 &viewPoint)
 
void popReferenceViewPoint ()
 
const osg::Vec3getEyeLocal () const
 
const osg::Vec3getViewPointLocal () const
 
const osg::Vec3 getUpLocal () const
 
const osg::Vec3 getLookVectorLocal () const
 
- Public Member Functions inherited from osg::CullSettings
 CullSettings ()
 
 CullSettings (ArgumentParser &arguments)
 
 CullSettings (const CullSettings &cs)
 
virtual ~CullSettings ()
 
CullSettingsoperator= (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)
 
ClampProjectionMatrixCallbackgetClampProjectionMatrixCallback ()
 
const
ClampProjectionMatrixCallback
getClampProjectionMatrixCallback () const
 
void write (std::ostream &out)
 

Protected Types

typedef fast_back_stack
< ref_ptr< RefMatrix > > 
MatrixStack
 
typedef fast_back_stack
< ref_ptr< Viewport > > 
ViewportStack
 
typedef fast_back_stack< Vec3EyePointStack
 
typedef std::vector
< osg::ref_ptr< osg::RefMatrix > > 
MatrixList
 

Protected Member Functions

void computeFrustumVolume ()
 
osg::RefMatrixcreateOrReuseMatrix (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.

Definition at line 27 of file CullStack.h.

Member Typedef Documentation

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

Definition at line 134 of file CullStack.h.

Definition at line 187 of file CullStack.h.

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

Definition at line 207 of file CullStack.h.

Definition at line 177 of file CullStack.h.

Definition at line 38 of file CullStack.h.

Definition at line 184 of file CullStack.h.

Constructor & Destructor Documentation

osg::CullStack::CullStack ( )
osg::CullStack::CullStack ( const CullStack cs)
osg::CullStack::~CullStack ( )

Member Function Documentation

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.

Definition at line 74 of file CullStack.h.

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

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

Definition at line 80 of file CullStack.h.

Here is the call graph for this function:

void osg::CullStack::computeFrustumVolume ( )
protected
RefMatrix * osg::CullStack::createOrReuseMatrix ( const osg::Matrix value)
inlineprotected

Definition at line 283 of file CullStack.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void osg::CullStack::disableAndPushOccludersCurrentMask ( NodePath nodePath)
inline

Definition at line 85 of file CullStack.h.

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

Definition at line 136 of file CullStack.h.

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

Definition at line 142 of file CullStack.h.

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

Definition at line 143 of file CullStack.h.

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

Definition at line 155 of file CullStack.h.

float osg::CullStack::getFrustumVolume ( )
inline

Definition at line 58 of file CullStack.h.

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

Definition at line 165 of file CullStack.h.

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

Definition at line 140 of file CullStack.h.

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

Definition at line 228 of file CullStack.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 265 of file CullStack.h.

Here is the call graph for this function:

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

Definition at line 46 of file CullStack.h.

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

Definition at line 47 of file CullStack.h.

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

Definition at line 138 of file CullStack.h.

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

Definition at line 240 of file CullStack.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 151 of file CullStack.h.

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

Definition at line 159 of file CullStack.h.

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

Definition at line 157 of file CullStack.h.

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

Definition at line 216 of file CullStack.h.

Here is the call graph for this function:

osg::Matrix osg::CullStack::getWindowMatrix ( )
inline

Definition at line 252 of file CullStack.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 95 of file CullStack.h.

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

Definition at line 100 of file CullStack.h.

Here is the call graph for this function:

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

Definition at line 105 of file CullStack.h.

bool osg::CullStack::isCulled ( const osg::Node node)
inline

Definition at line 110 of file CullStack.h.

Here is the call graph for this function:

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

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

Definition at line 62 of file CullStack.h.

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

Compute the pixel size of the bounding sphere.

Definition at line 68 of file CullStack.h.

Here is the call graph for this function:

void osg::CullStack::popCullingSet ( )
void osg::CullStack::popCurrentMask ( )
inline

Definition at line 128 of file CullStack.h.

void osg::CullStack::popModelViewMatrix ( )
void osg::CullStack::popOccludersCurrentMask ( NodePath nodePath)
inline

Definition at line 90 of file CullStack.h.

void osg::CullStack::popProjectionMatrix ( )
void osg::CullStack::popReferenceViewPoint ( )
inline

Definition at line 153 of file CullStack.h.

void osg::CullStack::popViewport ( )
void osg::CullStack::pushCullingSet ( )
void osg::CullStack::pushCurrentMask ( )
inline

Definition at line 123 of file CullStack.h.

void osg::CullStack::pushModelViewMatrix ( osg::RefMatrix matrix,
Transform::ReferenceFrame  referenceFrame 
)
void osg::CullStack::pushProjectionMatrix ( osg::RefMatrix matrix)
void osg::CullStack::pushReferenceViewPoint ( const osg::Vec3 viewPoint)
inline

Definition at line 152 of file CullStack.h.

void osg::CullStack::pushViewport ( osg::Viewport viewport)
void osg::CullStack::reset ( )
void osg::CullStack::setOccluderList ( const ShadowVolumeOccluderList svol)
inline

Definition at line 45 of file CullStack.h.

Member Data Documentation

CullingSet* osg::CullStack::_back_modelviewCullingStack
protected

Definition at line 197 of file CullStack.h.

unsigned int osg::CullStack::_bbCornerFar
protected

Definition at line 203 of file CullStack.h.

unsigned int osg::CullStack::_bbCornerNear
protected

Definition at line 202 of file CullStack.h.

CullingStack osg::CullStack::_clipspaceCullingStack
protected

Definition at line 192 of file CullStack.h.

unsigned int osg::CullStack::_currentReuseMatrixIndex
protected

Definition at line 209 of file CullStack.h.

EyePointStack osg::CullStack::_eyePointStack
protected

Definition at line 189 of file CullStack.h.

float osg::CullStack::_frustumVolume
protected

Definition at line 200 of file CullStack.h.

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

Definition at line 205 of file CullStack.h.

unsigned int osg::CullStack::_index_modelviewCullingStack
protected

Definition at line 196 of file CullStack.h.

CullingStack osg::CullStack::_modelviewCullingStack
protected

Definition at line 195 of file CullStack.h.

MatrixStack osg::CullStack::_modelviewStack
protected

Definition at line 181 of file CullStack.h.

MatrixStack osg::CullStack::_MVPW_Stack
protected

Definition at line 182 of file CullStack.h.

ShadowVolumeOccluderList osg::CullStack::_occluderList
protected

Definition at line 175 of file CullStack.h.

CullingStack osg::CullStack::_projectionCullingStack
protected

Definition at line 193 of file CullStack.h.

MatrixStack osg::CullStack::_projectionStack
protected

Definition at line 179 of file CullStack.h.

EyePointStack osg::CullStack::_referenceViewPoints
protected

Definition at line 188 of file CullStack.h.

MatrixList osg::CullStack::_reuseMatrixList
protected

Definition at line 208 of file CullStack.h.

EyePointStack osg::CullStack::_viewPointStack
protected

Definition at line 190 of file CullStack.h.

ViewportStack osg::CullStack::_viewportStack
protected

Definition at line 185 of file CullStack.h.


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