class OSGUTIL_EXPORT osgUtil::CullVisitor

Basic NodeVisitor implementation for rendering a scene.

Inheritance:


Public Methods

[more] CullVisitor()
[more]virtual ~CullVisitor()
[more]virtual void reset()
[more]virtual void apply(osg::Node&)
[more]virtual void apply(osg::Geode& node)
[more]virtual void apply(osg::Billboard& node)
[more]virtual void apply(osg::LightSource& node)
[more]virtual void apply(osg::Group& node)
[more]virtual void apply(osg::Transform& node)
[more]virtual void apply(osg::Switch& node)
[more]virtual void apply(osg::LOD& node)
[more]virtual void apply(osg::EarthSky& node)
[more]virtual void apply(osg::Impostor& node)
[more]void setCamera(const osg::Camera& camera)
[more]const osg::Camera* getCamera() const
[more]void setEarthSky(const osg::EarthSky* earthSky)
[more]const osg::EarthSky* getEarthSky() const
[more]void setLODBias(const float bias)
[more]const float getLODBias() const
[more]void setImpostorsActive(const bool active)
Switch the creation of Impostors on or off.
[more]const bool getImpostorsActive() const
Get whether impostors are active or not.
[more]void setImpostorPixelErrorThreshold(const float numPixels)
Set the impostor error threshold.
[more]const float getImpostorPixelErrorThreshold() const
Get the impostor error threshold
[more]void setDepthSortImpostorSprites(const bool doDepthSort)
Set whether ImpsotorSprite's should be placed in a depth sorted bin for rendering
[more]const bool setDepthSortImpostorSprites() const
Get whether ImpsotorSprite's are depth sorted bin for rendering
[more]void setNumberOfFrameToKeepImpostorSprites(const int numFrames)
Set the number of frames that an ImpsotorSprite's is kept whilst not being beyond, before being recycled
[more]const int getNumberOfFrameToKeepImpostorSprites() const
Get the number of frames that an ImpsotorSprite's is kept whilst not being beyond, before being recycled
[more]void setTransparencySortMode(TransparencySortMode tsm)
[more]void setCullingMode(CullViewState::CullingMode mode)
Sets the current CullingMode
[more]CullViewState::CullingMode getCullingMode() const
Returns the current CullingMode
[more]void setViewport(osg::Viewport* viewport)
Set the viewport.
[more]const osg::Viewport* getViewport() const
Get the const viewport.
[more]osg::Viewport* getViewport()
Get the viewport.
[more]void pushCullViewState(const osg::Matrix* matrix=NULL)
[more]void popCullViewState()
[more]inline void pushStateSet(const osg::StateSet* ss)
Push state set on the current state group.
[more]inline void popStateSet()
Pop the top state set and hence associated state group.
[more]void setRenderGraph(RenderGraph* rg)
[more]RenderGraph* getRenderGraph()
[more]void setRenderStage(RenderStage* rg)
[more]RenderStage* getRenderStage()
[more]const float getCalculatedNearPlane() const
[more]const float getCalculatedFarPlane() const
[more]void setDetailedCulling(bool detailed)
sets the flag for detailed culling
[more]const bool getDetailedCulling() const
gets the status of detailed culling
[more]void calcClippingDirections() const
calculates unit directions of vectors that are intersections of cameras' clipping planes

Public Members

[more]enum TransparencySortMode

Protected Fields

[more]mutable osg::Vec3 _LeftUp
unit vector of direction along intersection of cameras left and top clipping planes in "global" coordinates
[more]mutable osg::Vec3 _RightUp
unit vector of direction along intersection of cameras right and top clipping planes in "global" coordinates
[more]mutable osg::Vec3 _LeftDown
unit vector of direction along intersection of cameras left and down clipping planes in "global" coordinates
[more]mutable osg::Vec3 _RightDown
unit vector of direction along intersection of cameras right and down clipping planes in "global" coordinates
[more]bool _detailedCulling
[more]osg::ref_ptr<CullViewState> _tvs
[more]osg::ref_ptr<CullViewState> _cvs
[more]osg::ref_ptr<RenderGraph> _rootRenderGraph
[more]RenderGraph* _currentRenderGraph
[more]osg::ref_ptr<RenderStage> _rootRenderStage
[more]RenderBin* _currentRenderBin
[more]std::vector<CullViewState::CullingMode> _cullingModeStack
[more]float _LODBias
[more]float _calculated_znear
[more]float _calculated_zfar
[more]osg::ref_ptr<const osg::Camera> _camera
[more]osg::ref_ptr<const osg::EarthSky> _earthSky
[more]TransparencySortMode _tsm
[more]osg::ref_ptr<osg::Viewport> _viewport
[more]bool _impostorActive
[more]bool _depthSortImpostorSprites
[more]float _impostorPixelErrorThreshold
[more]int _numFramesToKeepImpostorSprites
[more]unsigned int _currentReuseMatrixIndex
[more]unsigned int _currentReuseRenderLeafIndex
[more]osg::ref_ptr<osg::ImpostorSpriteManager> _impostorSpriteManager

Protected Methods

[more] CullVisitor(const CullVisitor&)
prevent unwanted copy construction
[more]CullVisitor& operator = (const CullVisitor&)
prevent unwanted copy operator
[more]inline osg::Matrix* getCurrentMatrix()
[more]inline osg::Matrix* getInverseCurrentMatrix()
[more]inline const osg::Vec3& getEyeLocal() const
[more]inline const osg::Vec3& getCenterLocal() const
[more]inline const osg::Vec3& getLookVectorLocal() const
[more]inline bool isCulled(const osg::BoundingSphere& sp, CullViewState::CullingMode& mode) const
[more]inline const bool isCulled(const osg::BoundingBox& bb, const CullViewState::CullingMode mode) const
[more]void updateCalculatedNearFar(const osg::BoundingBox& bb)
[more]void updateCalculatedNearFar(const osg::Vec3& pos)
[more]void updateCalculatedNearFar(osg::Drawable* pDrawable)
updates near and far clipping values for case of detailed culling
[more]double calculateZNear(const osg::Vec3& position, const osg::Vec3& eye, const osg::Vec3& look)
calculates near for "global" vertex in scene
[more]inline void addDrawable(osg::Drawable* drawable, osg::Matrix* matrix)
Add a drawable to current render graph
[more]inline void addDrawableAndDepth(osg::Drawable* drawable, osg::Matrix* matrix, const float depth)
Add a drawable and depth to current render graph
[more]inline void addLight(osg::Light* light, osg::Matrix* matrix)
Add a light to current render graph
[more]osg::ImpostorSprite* createImpostorSprite(osg::Impostor& node)
create an impostor sprite by setting up a pre-rendering stage to generate the impostor texture.
[more]inline osg::Matrix* createOrReuseMatrix()
[more]inline RenderLeaf* createOrReuseRenderLeaf(osg::Drawable* drawable, osg::Matrix* matrix, float depth=0.0f)

Protected Members

[more]typedef std::vector< osg::ref_ptr<CullViewState> > CullViewStateStack CullViewStateStack _viewStateStack
[more]typedef std::vector< osg::ref_ptr<osg::Matrix> > MatrixList MatrixList _reuseMatrixList
[more]typedef std::vector< osg::ref_ptr<RenderLeaf> > RenderLeafList RenderLeafList _reuseRenderLeafList


Documentation

Basic NodeVisitor implementation for rendering a scene. This visitor traverses the scene graph, collecting transparent and opaque osg::Drawables into a depth sorted transparent bin and a state sorted opaque bin. The opaque bin is rendered first, and then the transparent bin in rendered in order from the furthest osg::Drawable from the eye to the one nearest the eye.
o CullVisitor()

ovirtual ~CullVisitor()

ovirtual void reset()

ovirtual void apply(osg::Node&)

ovirtual void apply(osg::Geode& node)

ovirtual void apply(osg::Billboard& node)

ovirtual void apply(osg::LightSource& node)

ovirtual void apply(osg::Group& node)

ovirtual void apply(osg::Transform& node)

ovirtual void apply(osg::Switch& node)

ovirtual void apply(osg::LOD& node)

ovirtual void apply(osg::EarthSky& node)

ovirtual void apply(osg::Impostor& node)

ovoid setCamera(const osg::Camera& camera)

oconst osg::Camera* getCamera() const

ovoid setEarthSky(const osg::EarthSky* earthSky)

oconst osg::EarthSky* getEarthSky() const

ovoid setLODBias(const float bias)

oconst float getLODBias() const

ovoid setImpostorsActive(const bool active)
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.

oconst bool getImpostorsActive() const
Get whether impostors are active or not.

ovoid setImpostorPixelErrorThreshold(const float numPixels)
Set the impostor error threshold. Used in calculation of whether impostors remain valid.

oconst float getImpostorPixelErrorThreshold() const
Get the impostor error threshold

ovoid setDepthSortImpostorSprites(const bool doDepthSort)
Set whether ImpsotorSprite's should be placed in a depth sorted bin for rendering

oconst bool setDepthSortImpostorSprites() const
Get whether ImpsotorSprite's are depth sorted bin for rendering

ovoid setNumberOfFrameToKeepImpostorSprites(const int numFrames)
Set the number of frames that an ImpsotorSprite's is kept whilst not being beyond, before being recycled

oconst int getNumberOfFrameToKeepImpostorSprites() const
Get the number of frames that an ImpsotorSprite's is kept whilst not being beyond, before being recycled

oenum TransparencySortMode

o LOOK_VECTOR_DISTANCE

o OBJECT_EYE_POINT_DISTANCE

ovoid setTransparencySortMode(TransparencySortMode tsm)

ovoid setCullingMode(CullViewState::CullingMode mode)
Sets the current CullingMode

oCullViewState::CullingMode getCullingMode() const
Returns the current CullingMode

ovoid setViewport(osg::Viewport* viewport)
Set the viewport. Used to enable the CullVisitor can make decision such as based on viewport dimensions.

oconst osg::Viewport* getViewport() const
Get the const viewport.

oosg::Viewport* getViewport()
Get the viewport.

ovoid pushCullViewState(const osg::Matrix* matrix=NULL)

ovoid popCullViewState()

oinline void pushStateSet(const osg::StateSet* ss)
Push state set on the current state group. If the state exists in a child state group of the current state group then move the current state group to that child. Otherwise, create a new state group for the state set, add it to the current state group then move the current state group pointer to the new state group.

oinline void popStateSet()
Pop the top state set and hence associated state group. Move the current state group to the parent of the popped state group.

ovoid setRenderGraph(RenderGraph* rg)

oRenderGraph* getRenderGraph()

ovoid setRenderStage(RenderStage* rg)

oRenderStage* getRenderStage()

oconst float getCalculatedNearPlane() const

oconst float getCalculatedFarPlane() const

ovoid setDetailedCulling(bool detailed)
sets the flag for detailed culling

oconst bool getDetailedCulling() const
gets the status of detailed culling

ovoid calcClippingDirections() const
calculates unit directions of vectors that are intersections of cameras' clipping planes

o CullVisitor(const CullVisitor&)
prevent unwanted copy construction

oCullVisitor& operator = (const CullVisitor&)
prevent unwanted copy operator

oinline osg::Matrix* getCurrentMatrix()

oinline osg::Matrix* getInverseCurrentMatrix()

oinline const osg::Vec3& getEyeLocal() const

oinline const osg::Vec3& getCenterLocal() const

oinline const osg::Vec3& getLookVectorLocal() const

oinline bool isCulled(const osg::BoundingSphere& sp, CullViewState::CullingMode& mode) const

oinline const bool isCulled(const osg::BoundingBox& bb, const CullViewState::CullingMode mode) const

ovoid updateCalculatedNearFar(const osg::BoundingBox& bb)

ovoid updateCalculatedNearFar(const osg::Vec3& pos)

ovoid updateCalculatedNearFar(osg::Drawable* pDrawable)
updates near and far clipping values for case of detailed culling

odouble calculateZNear(const osg::Vec3& position, const osg::Vec3& eye, const osg::Vec3& look)
calculates near for "global" vertex in scene

omutable osg::Vec3 _LeftUp
unit vector of direction along intersection of cameras left and top clipping planes in "global" coordinates

omutable osg::Vec3 _RightUp
unit vector of direction along intersection of cameras right and top clipping planes in "global" coordinates

omutable osg::Vec3 _LeftDown
unit vector of direction along intersection of cameras left and down clipping planes in "global" coordinates

omutable osg::Vec3 _RightDown
unit vector of direction along intersection of cameras right and down clipping planes in "global" coordinates

oinline void addDrawable(osg::Drawable* drawable, osg::Matrix* matrix)
Add a drawable to current render graph

oinline void addDrawableAndDepth(osg::Drawable* drawable, osg::Matrix* matrix, const float depth)
Add a drawable and depth to current render graph

oinline void addLight(osg::Light* light, osg::Matrix* matrix)
Add a light to current render graph

oosg::ImpostorSprite* createImpostorSprite(osg::Impostor& node)
create an impostor sprite by setting up a pre-rendering stage to generate the impostor texture.

obool _detailedCulling

otypedef std::vector< osg::ref_ptr<CullViewState> > CullViewStateStack CullViewStateStack _viewStateStack

oosg::ref_ptr<CullViewState> _tvs

oosg::ref_ptr<CullViewState> _cvs

oosg::ref_ptr<RenderGraph> _rootRenderGraph

oRenderGraph* _currentRenderGraph

oosg::ref_ptr<RenderStage> _rootRenderStage

oRenderBin* _currentRenderBin

ostd::vector<CullViewState::CullingMode> _cullingModeStack

ofloat _LODBias

ofloat _calculated_znear

ofloat _calculated_zfar

oosg::ref_ptr<const osg::Camera> _camera

oosg::ref_ptr<const osg::EarthSky> _earthSky

oTransparencySortMode _tsm

oosg::ref_ptr<osg::Viewport> _viewport

obool _impostorActive

obool _depthSortImpostorSprites

ofloat _impostorPixelErrorThreshold

oint _numFramesToKeepImpostorSprites

otypedef std::vector< osg::ref_ptr<osg::Matrix> > MatrixList MatrixList _reuseMatrixList

ounsigned int _currentReuseMatrixIndex

oinline osg::Matrix* createOrReuseMatrix()

otypedef std::vector< osg::ref_ptr<RenderLeaf> > RenderLeafList RenderLeafList _reuseRenderLeafList

ounsigned int _currentReuseRenderLeafIndex

oinline RenderLeaf* createOrReuseRenderLeaf(osg::Drawable* drawable, osg::Matrix* matrix, float depth=0.0f)

oosg::ref_ptr<osg::ImpostorSpriteManager> _impostorSpriteManager


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.