osg::CullSettings Class Reference

`#include <CullSettings>`

Inheritance diagram for osg::CullSettings:

## Classes

struct | ClampProjectionMatrixCallback

## Public Types

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

| 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 Attributes

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

## Member Typedef Documentation

## CullingMode

typedef int osg::CullSettings::CullingMode

## InheritanceMask

typedef int osg::CullSettings::InheritanceMask

## Member Enumeration Documentation

## ComputeNearFarMode

enum osg::CullSettings::ComputeNearFarMode

Enumerator
DO_NOT_COMPUTE_NEAR_FAR |
COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES |
COMPUTE_NEAR_FAR_USING_PRIMITIVES |
COMPUTE_NEAR_USING_PRIMITIVES |

## CullingModeValues

enum osg::CullSettings::CullingModeValues

Enumerator
NO_CULLING |
VIEW_FRUSTUM_SIDES_CULLING |
NEAR_PLANE_CULLING |
FAR_PLANE_CULLING |
VIEW_FRUSTUM_CULLING |
SMALL_FEATURE_CULLING |
SHADOW_OCCLUSION_CULLING |
CLUSTER_CULLING |
DEFAULT_CULLING |
ENABLE_ALL_CULLING |

## InheritanceMaskActionOnAttributeSetting

enum osg::CullSettings::InheritanceMaskActionOnAttributeSetting

Enumerator
DISABLE_ASSOCIATED_INHERITANCE_MASK_BIT |
DO_NOT_MODIFY_INHERITANCE_MASK |

## VariablesMask

enum osg::CullSettings::VariablesMask

Enumerator
COMPUTE_NEAR_FAR_MODE |
CULLING_MODE |
LOD_SCALE |
SMALL_FEATURE_CULLING_PIXEL_SIZE |
CLAMP_PROJECTION_MATRIX_CALLBACK |
NEAR_FAR_RATIO |
IMPOSTOR_ACTIVE |
DEPTH_SORT_IMPOSTOR_SPRITES |
IMPOSTOR_PIXEL_ERROR_THRESHOLD |
NUM_FRAMES_TO_KEEP_IMPOSTORS_SPRITES |
CULL_MASK |
CULL_MASK_LEFT |
CULL_MASK_RIGHT |
CLEAR_COLOR |
CLEAR_MASK |
LIGHTING_MODE |
LIGHT |
DRAW_BUFFER |
READ_BUFFER |
NO_VARIABLES |
ALL_VARIABLES |

## Constructor & Destructor Documentation

## CullSettings() [1/3]

osg::CullSettings::CullSettings | ( |  | ) |

inline

References readEnvironmentalVariables(), and setDefaults().

Referenced by CullSettings(), osg::Camera::inheritCullSettings(), inheritCullSettings(), inheritCullSettings(), operator=(), and setCullSettings().

## CullSettings() [2/3]

osg::CullSettings::CullSettings | ( | ArgumentParser & | arguments | ) |

inline

References readCommandLine(), readEnvironmentalVariables(), and setDefaults().

## CullSettings() [3/3]

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

References CullSettings().

## ~CullSettings()

virtual osg::CullSettings::~CullSettings | ( |  | ) |

inline virtual

## Member Function Documentation

## applyMaskAction()

void osg::CullSettings::applyMaskAction | ( | unsigned int | maskBit | ) |

inline

Apply the action, specified by the InheritanceMaskActionOnAttributeSetting, to apply to the inheritance bit mask. This method is called by CullSettings::set*() parameter methods to ensure that CullSettings inheritance mechanisms doesn't overwrite the local parameter settings.

References _inheritanceMask, _inheritanceMaskActionOnAttributeSetting, and DISABLE_ASSOCIATED_INHERITANCE_MASK_BIT.

Referenced by setClampProjectionMatrixCallback(), osg::Camera::setClearColor(), osg::Camera::setClearMask(), setComputeNearFarMode(), setCullingMode(), setCullMask(), setCullMaskLeft(), setCullMaskRight(), setDepthSortImpostorSprites(), osg::Camera::setDrawBuffer(), setImpostorPixelErrorThreshold(), setImpostorsActive(), setLODScale(), setNearFarRatio(), setNumberOfFrameToKeepImpostorSprites(), osg::Camera::setReadBuffer(), and setSmallFeatureCullingPixelSize().

## getClampProjectionMatrixCallback() [1/2]

ClampProjectionMatrixCallback * osg::CullSettings::getClampProjectionMatrixCallback | ( |  | ) |

inline

get the non const ClampProjectionMatrixCallback.

References _clampProjectionMatrixCallback.

## getClampProjectionMatrixCallback() [2/2]

const ClampProjectionMatrixCallback * osg::CullSettings::getClampProjectionMatrixCallback | ( |  | ) | const

inline

get the const ClampProjectionMatrixCallback.

References _clampProjectionMatrixCallback.

## getComputeNearFarMode()

ComputeNearFarMode osg::CullSettings::getComputeNearFarMode | ( |  | ) | const

inline

References _computeNearFar.

## getCullingMode()

CullingMode osg::CullSettings::getCullingMode | ( |  | ) | const

inline

Returns the current CullingMode.

References _cullingMode.

## getCullMask()

osg::Node::NodeMask osg::CullSettings::getCullMask | ( |  | ) | const

inline

References _cullMask.

## getCullMaskLeft()

osg::Node::NodeMask osg::CullSettings::getCullMaskLeft | ( |  | ) | const

inline

References _cullMaskLeft.

## getCullMaskRight()

osg::Node::NodeMask osg::CullSettings::getCullMaskRight | ( |  | ) | const

inline

References _cullMaskRight.

## getDepthSortImpostorSprites()

bool osg::CullSettings::getDepthSortImpostorSprites | ( |  | ) | const

inline

Get whether ImpostorSprite's are depth sorted bin for rendering.

References _depthSortImpostorSprites.

## getImpostorPixelErrorThreshold()

float osg::CullSettings::getImpostorPixelErrorThreshold | ( |  | ) | const

inline

Get the impostor error threshold.

References _impostorPixelErrorThreshold.

## getImpostorsActive()

bool osg::CullSettings::getImpostorsActive | ( |  | ) | const

inline

Get whether impostors are active or not.

References _impostorActive.

## getInheritanceMask()

InheritanceMask osg::CullSettings::getInheritanceMask | ( |  | ) | const

inline

Get the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object.

References _inheritanceMask.

## getInheritanceMaskActionOnAttributeSetting()

InheritanceMaskActionOnAttributeSetting osg::CullSettings::getInheritanceMaskActionOnAttributeSetting | ( |  | ) | const

inline

References _inheritanceMaskActionOnAttributeSetting.

## getLODScale()

float osg::CullSettings::getLODScale | ( |  | ) | const

inline

Get the LOD bias.

References _LODScale.

## getNearFarRatio()

double osg::CullSettings::getNearFarRatio | ( |  | ) | const

inline

References _nearFarRatio.

## getNumberOfFrameToKeepImpostorSprites()

int osg::CullSettings::getNumberOfFrameToKeepImpostorSprites | ( |  | ) | const

inline

Get the number of frames that an ImpostorSprite is kept whilst not being beyond, before being recycled.

References _numFramesToKeepImpostorSprites.

## getSmallFeatureCullingPixelSize()

float osg::CullSettings::getSmallFeatureCullingPixelSize | ( |  | ) | const

inline

Get the Small Feature Culling Pixel Size.

References _smallFeatureCullingPixelSize.

## inheritCullSettings() [1/2]

virtual void osg::CullSettings::inheritCullSettings | ( | const CullSettings & | settings | ) |

inline virtual

Inherit the local cull settings variable from specified CullSettings object, according to the inheritance mask.

Reimplemented in osgUtil::SceneView.

References _inheritanceMask, CullSettings(), and inheritCullSettings().

Referenced by inheritCullSettings().

## inheritCullSettings() [2/2]

virtual void osg::CullSettings::inheritCullSettings | ( | const CullSettings & | settings,
|  | unsigned int | inheritanceMask )

virtual

Inherit the local cull settings variable from specified CullSettings object, according to the inheritance mask.

Reimplemented in osg::Camera, and osgUtil::SceneView.

References CullSettings().

## operator=()

CullSettings & osg::CullSettings::operator= | ( | const CullSettings & | settings | ) |

inline

References CullSettings(), and setCullSettings().

## readCommandLine()

void osg::CullSettings::readCommandLine | ( | ArgumentParser & | arguments | ) |

read the commandline arguments.

Referenced by CullSettings().

## readEnvironmentalVariables()

void osg::CullSettings::readEnvironmentalVariables | ( |  | ) |

read the environmental variables.

Referenced by CullSettings(), and CullSettings().

## setClampProjectionMatrixCallback()

void osg::CullSettings::setClampProjectionMatrixCallback | ( | ClampProjectionMatrixCallback * | cpmc | ) |

inline

set the ClampProjectionMatrixCallback.

References _clampProjectionMatrixCallback, applyMaskAction(), and CLAMP_PROJECTION_MATRIX_CALLBACK.

## setComputeNearFarMode()

void osg::CullSettings::setComputeNearFarMode | ( | ComputeNearFarMode | cnfm | ) |

inline

References _computeNearFar, applyMaskAction(), and COMPUTE_NEAR_FAR_MODE.

## setCullingMode()

void osg::CullSettings::setCullingMode | ( | CullingMode | mode | ) |

inline

Set the culling mode for the CullVisitor to use.

References _cullingMode, applyMaskAction(), and CULLING_MODE.

## setCullMask()

void osg::CullSettings::setCullMask | ( | osg::Node::NodeMask | nm | ) |

inline

References _cullMask, applyMaskAction(), and CULL_MASK.

## setCullMaskLeft()

void osg::CullSettings::setCullMaskLeft | ( | osg::Node::NodeMask | nm | ) |

inline

References _cullMaskLeft, applyMaskAction(), and CULL_MASK_LEFT.

## setCullMaskRight()

void osg::CullSettings::setCullMaskRight | ( | osg::Node::NodeMask | nm | ) |

inline

References _cullMaskRight, applyMaskAction(), and CULL_MASK_RIGHT.

## setCullSettings()

void osg::CullSettings::setCullSettings | ( | const CullSettings & | settings | ) |

Set the local cull settings values from specified CullSettings object.

References CullSettings().

Referenced by operator=().

## setDefaults()

virtual void osg::CullSettings::setDefaults | ( |  | ) |

virtual

Reimplemented in osgUtil::SceneView.

Referenced by CullSettings(), and CullSettings().

## setDepthSortImpostorSprites()

void osg::CullSettings::setDepthSortImpostorSprites | ( | bool | doDepthSort | ) |

inline

Set whether ImpostorSprite's should be placed in a depth sorted bin for rendering.

References _depthSortImpostorSprites, applyMaskAction(), and DEPTH_SORT_IMPOSTOR_SPRITES.

## setImpostorPixelErrorThreshold()

void osg::CullSettings::setImpostorPixelErrorThreshold | ( | float | numPixels | ) |

inline

Set the impostor error threshold. Used in calculation of whether impostors remain valid.

References _impostorPixelErrorThreshold, applyMaskAction(), and IMPOSTOR_PIXEL_ERROR_THRESHOLD.

## setImpostorsActive()

void osg::CullSettings::setImpostorsActive | ( | bool | active | ) |

inline

Switch the creation of Impostors on or off. Setting active to false forces the CullVisitor to use the Impostor LOD children for rendering. Setting active to true forces the CullVisitor to create the appropriate pre-rendering stages which render to the ImpostorSprite's texture.

References _impostorActive, applyMaskAction(), and IMPOSTOR_ACTIVE.

## setInheritanceMask()

void osg::CullSettings::setInheritanceMask | ( | InheritanceMask | mask | ) |

inline

Set the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object.

References _inheritanceMask.

## setInheritanceMaskActionOnAttributeSetting()

void osg::CullSettings::setInheritanceMaskActionOnAttributeSetting | ( | InheritanceMaskActionOnAttributeSetting | action | ) |

inline

References _inheritanceMaskActionOnAttributeSetting.

## setLODScale()

void osg::CullSettings::setLODScale | ( | float | scale | ) |

inline

Set the LOD bias for the CullVisitor to use.

References _LODScale, applyMaskAction(), and LOD_SCALE.

## setNearFarRatio()

void osg::CullSettings::setNearFarRatio | ( | double | ratio | ) |

inline

References _nearFarRatio, applyMaskAction(), and NEAR_FAR_RATIO.

## setNumberOfFrameToKeepImpostorSprites()

void osg::CullSettings::setNumberOfFrameToKeepImpostorSprites | ( | int | numFrames | ) |

inline

Set the number of frames that an ImpostorSprite is kept whilst not being beyond, before being recycled.

References _numFramesToKeepImpostorSprites, applyMaskAction(), and NUM_FRAMES_TO_KEEP_IMPOSTORS_SPRITES.

## setSmallFeatureCullingPixelSize()

void osg::CullSettings::setSmallFeatureCullingPixelSize | ( | float | value | ) |

inline

Threshold at which small features are culled.

Parameters

  value | Bounding volume size in screen space. Default is 2.0.

References _smallFeatureCullingPixelSize, applyMaskAction(), and SMALL_FEATURE_CULLING_PIXEL_SIZE.

## write()

void osg::CullSettings::write | ( | std::ostream & | out | ) |

Write out internal settings of CullSettings.

## Member Data Documentation

## _clampProjectionMatrixCallback

ref_ptr<ClampProjectionMatrixCallback> osg::CullSettings::_clampProjectionMatrixCallback

protected

Referenced by osgUtil::CullVisitor::clampProjectionMatrix(), osgUtil::CullVisitor::clampProjectionMatrix(), getClampProjectionMatrixCallback(), getClampProjectionMatrixCallback(), and setClampProjectionMatrixCallback().

## _computeNearFar

ComputeNearFarMode osg::CullSettings::_computeNearFar

protected

Referenced by getComputeNearFarMode(), and setComputeNearFarMode().

## _cullingMode

CullingMode osg::CullSettings::_cullingMode

protected

Referenced by getCullingMode(), and setCullingMode().

## _cullMask

Node::NodeMask osg::CullSettings::_cullMask

protected

Referenced by getCullMask(), and setCullMask().

## _cullMaskLeft

Node::NodeMask osg::CullSettings::_cullMaskLeft

protected

Referenced by getCullMaskLeft(), and setCullMaskLeft().

## _cullMaskRight

Node::NodeMask osg::CullSettings::_cullMaskRight

protected

Referenced by getCullMaskRight(), and setCullMaskRight().

## _depthSortImpostorSprites

bool osg::CullSettings::_depthSortImpostorSprites

protected

Referenced by getDepthSortImpostorSprites(), and setDepthSortImpostorSprites().

## _impostorActive

bool osg::CullSettings::_impostorActive

protected

Referenced by getImpostorsActive(), and setImpostorsActive().

## _impostorPixelErrorThreshold

float osg::CullSettings::_impostorPixelErrorThreshold

protected

Referenced by getImpostorPixelErrorThreshold(), and setImpostorPixelErrorThreshold().

## _inheritanceMask

InheritanceMask osg::CullSettings::_inheritanceMask

protected

Referenced by applyMaskAction(), getInheritanceMask(), inheritCullSettings(), osgUtil::SceneView::inheritCullSettings(), and setInheritanceMask().

## _inheritanceMaskActionOnAttributeSetting

InheritanceMaskActionOnAttributeSetting osg::CullSettings::_inheritanceMaskActionOnAttributeSetting

protected

Referenced by applyMaskAction(), getInheritanceMaskActionOnAttributeSetting(), and setInheritanceMaskActionOnAttributeSetting().

## _LODScale

float osg::CullSettings::_LODScale

protected

Referenced by getLODScale(), and setLODScale().

## _nearFarRatio

double osg::CullSettings::_nearFarRatio

protected

Referenced by getNearFarRatio(), and setNearFarRatio().

## _numFramesToKeepImpostorSprites

int osg::CullSettings::_numFramesToKeepImpostorSprites

protected

Referenced by getNumberOfFrameToKeepImpostorSprites(), and setNumberOfFrameToKeepImpostorSprites().

## _smallFeatureCullingPixelSize

float osg::CullSettings::_smallFeatureCullingPixelSize

protected

Referenced by getSmallFeatureCullingPixelSize(), and setSmallFeatureCullingPixelSize().

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

- CullSettings