CullVisitor
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGUTIL_CULLVISITOR
#define OSGUTIL_CULLVISITOR 1
#include <map>
#include <vector>
#include <osg/NodeVisitor>
#include <osg/BoundingSphere>
#include <osg/BoundingBox>
#include <osg/Matrix>
#include <osg/Drawable>
#include <osg/StateSet>
#include <osg/State>
#include <osg/ClearNode>
#include <osg/Camera>
#include <osg/Notify>
#include <osg/CullStack>
#include <osgUtil/StateGraph>
#include <osgUtil/RenderStage>
#include <osg/Vec3>
namespace osgUtil {
class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStack
{
public:
typedef osg::Matrix::value_type value_type;
CullVisitor();
CullVisitor(const CullVisitor&);
META_NodeVisitor(osgUtil, CullVisitor)
virtual osgUtil::CullVisitor* asCullVisitor() { return this; }
virtual const osgUtil::CullVisitor* asCullVisitor() const { return this; }
virtual osg::CullStack* asCullStack() { return static_cast<osg::CullStack*>(this); }
virtual const osg::CullStack* asCullStack() const { return static_cast<const osg::CullStack*>(this); }
using osg::NodeVisitor::clone;
virtual CullVisitor* clone() const { return new CullVisitor(*this); }
static osg::ref_ptr<CullVisitor>& prototype();
static CullVisitor* create();
virtual void reset();
struct Identifier : public osg::Referenced
{
Identifier() {}
virtual ~Identifier() {}
};
void setIdentifier(Identifier* identifier) { _identifier = identifier; }
Identifier* getIdentifier() { return _identifier.get(); }
const Identifier* getIdentifier() const { return _identifier.get(); }
virtual osg::Vec3 getEyePoint() const { return getEyeLocal(); }
virtual osg::Vec3 getViewPoint() const { return getViewPointLocal(); }
virtual float getDistanceToEyePoint(const osg::Vec3& pos, bool withLODScale) const;
virtual float getDistanceFromEyePoint(const osg::Vec3& pos, bool withLODScale) const;
virtual float getDistanceToViewPoint(const osg::Vec3& pos, bool withLODScale) const;
virtual void apply(osg::Node&);
virtual void apply(osg::Geode& node);
virtual void apply(osg::Drawable& drawable);
virtual void apply(osg::Billboard& node);
virtual void apply(osg::LightSource& node);
virtual void apply(osg::ClipNode& node);
virtual void apply(osg::TexGenNode& node);
virtual void apply(osg::Group& node);
virtual void apply(osg::Transform& node);
virtual void apply(osg::Projection& node);
virtual void apply(osg::Switch& node);
virtual void apply(osg::LOD& node);
virtual void apply(osg::ClearNode& node);
virtual void apply(osg::Camera& node);
virtual void apply(osg::OccluderNode& node);
virtual void apply(osg::OcclusionQueryNode& node);
inline void pushStateSet(const osg::StateSet* ss)
{
_currentStateGraph = _currentStateGraph->find_or_insert(ss);
bool useRenderBinDetails = (ss->useRenderBinDetails() && !ss->getBinName().empty()) &&
(_numberOfEncloseOverrideRenderBinDetails==0 || (ss->getRenderBinMode()&osg::StateSet::PROTECTED_RENDERBIN_DETAILS)!=0);
if (useRenderBinDetails)
{
_renderBinStack.push_back(_currentRenderBin);
_currentRenderBin = ss->getNestRenderBins() ?
_currentRenderBin->find_or_insert(ss->getBinNumber(),ss->getBinName()) :
_currentRenderBin->getStage()->find_or_insert(ss->getBinNumber(),ss->getBinName());
}
if ((ss->getRenderBinMode()&osg::StateSet::OVERRIDE_RENDERBIN_DETAILS)!=0)
{
++_numberOfEncloseOverrideRenderBinDetails;
}
}
inline void popStateSet()
{
const osg::StateSet* ss = _currentStateGraph->getStateSet();
if ((ss->getRenderBinMode()&osg::StateSet::OVERRIDE_RENDERBIN_DETAILS)!=0)
{
--_numberOfEncloseOverrideRenderBinDetails;
}
bool useRenderBinDetails = (ss->useRenderBinDetails() && !ss->getBinName().empty()) &&
(_numberOfEncloseOverrideRenderBinDetails==0 || (ss->getRenderBinMode()&osg::StateSet::PROTECTED_RENDERBIN_DETAILS)!=0);
if (useRenderBinDetails)
{
if (_renderBinStack.empty())
{
_currentRenderBin = _currentRenderBin->getStage();
}
else
{
_currentRenderBin = _renderBinStack.back();
_renderBinStack.pop_back();
}
}
_currentStateGraph = _currentStateGraph->_parent;
}
inline void setStateGraph(StateGraph* rg)
{
_rootStateGraph = rg;
_currentStateGraph = rg;
}
inline StateGraph* getRootStateGraph()
{
return _rootStateGraph.get();
}
inline StateGraph* getCurrentStateGraph()
{
return _currentStateGraph;
}
inline void setRenderStage(RenderStage* rg)
{
_rootRenderStage = rg;
_currentRenderBin = rg;
}
inline RenderStage* getRenderStage()
{
return _rootRenderStage.get();
}
inline RenderStage* getCurrentRenderStage()
{
return _currentRenderBin->getStage();
}
inline osg::Camera* getCurrentCamera()
{
return getCurrentRenderStage()->getCamera();
}
inline RenderBin* getCurrentRenderBin()
{
return _currentRenderBin;
}
inline void setCurrentRenderBin(RenderBin* rb)
{
_currentRenderBin = rb;
}
void setCalculatedNearPlane(value_type value) { _computed_znear = value; }
inline value_type getCalculatedNearPlane() const { return _computed_znear; }
void setCalculatedFarPlane(value_type value) { _computed_zfar = value; }
inline value_type getCalculatedFarPlane() const { return _computed_zfar; }
value_type computeNearestPointInFrustum(const osg::Matrix& matrix, const osg::Polytope::PlaneList& planes,const osg::Drawable& drawable);
value_type computeFurthestPointInFrustum(const osg::Matrix& matrix, const osg::Polytope::PlaneList& planes,const osg::Drawable& drawable);
bool updateCalculatedNearFar(const osg::Matrix& matrix,const osg::BoundingBox& bb);
bool updateCalculatedNearFar(const osg::Matrix& matrix,const osg::Drawable& drawable, bool isBillboard=false);
void updateCalculatedNearFar(const osg::Vec3& pos);
inline void addDrawable(osg::Drawable* drawable,osg::RefMatrix* matrix);
inline void addDrawableAndDepth(osg::Drawable* drawable,osg::RefMatrix* matrix,float depth);
inline void addPositionedAttribute(osg::RefMatrix* matrix,const osg::StateAttribute* attr);
inline void addPositionedTextureAttribute(unsigned int textureUnit, osg::RefMatrix* matrix,const osg::StateAttribute* attr);
void computeNearPlane();
virtual void popProjectionMatrix();
virtual bool clampProjectionMatrixImplementation(osg::Matrixf& projection, double& znear, double& zfar) const;
virtual bool clampProjectionMatrixImplementation(osg::Matrixd& projection, double& znear, double& zfar) const;
inline bool clampProjectionMatrix(osg::Matrixf& projection, value_type& znear, value_type& zfar) const
{
double zn = znear;
double zf = zfar;
bool result = false;
if (_clampProjectionMatrixCallback.valid()) result = _clampProjectionMatrixCallback->clampProjectionMatrixImplementation(projection, zn, zf);
else result = clampProjectionMatrixImplementation(projection, zn, zf);
if (result)
{
znear = zn;
zfar = zf;
return true;
}
else
return false;
}
inline bool clampProjectionMatrix(osg::Matrixd& projection, value_type& znear, value_type& zfar) const
{
double zn = znear;
double zf = zfar;
bool result = false;
if (_clampProjectionMatrixCallback.valid()) result = _clampProjectionMatrixCallback->clampProjectionMatrixImplementation(projection, zn, zf);
else result = clampProjectionMatrixImplementation(projection, zn, zf);
if (result)
{
znear = zn;
zfar = zf;
return true;
}
else
return false;
}
void setState(osg::State* state) { _renderInfo.setState(state); }
osg::State* getState() { return _renderInfo.getState(); }
const osg::State* getState() const { return _renderInfo.getState(); }
void setRenderInfo(osg::RenderInfo& renderInfo) { _renderInfo = renderInfo; }
osg::RenderInfo& getRenderInfo() { return _renderInfo; }
const osg::RenderInfo& getRenderInfo() const { return _renderInfo; }
protected:
virtual ~CullVisitor();
CullVisitor& operator = (const CullVisitor&) { return *this; }
inline void handle_cull_callbacks_and_traverse(osg::Node& node)
{
osg::Callback* callback = node.getCullCallback();
if (callback) callback->run(&node,this);
else traverse(node);
}
inline void handle_cull_callbacks_and_accept(osg::Node& node,osg::Node* acceptNode)
{
osg::Callback* callback = node.getCullCallback();
if (callback) callback->run(&node,this);
else acceptNode->accept(*this);
}
osg::ref_ptr<StateGraph> _rootStateGraph;
StateGraph* _currentStateGraph;
osg::ref_ptr<RenderStage> _rootRenderStage;
RenderBin* _currentRenderBin;
std::vector<RenderBin*> _renderBinStack;
value_type _computed_znear;
value_type _computed_zfar;
unsigned int _traversalOrderNumber;
typedef std::vector< osg::ref_ptr<RenderLeaf> > RenderLeafList;
RenderLeafList _reuseRenderLeafList;
unsigned int _currentReuseRenderLeafIndex;
inline RenderLeaf* createOrReuseRenderLeaf(osg::Drawable* drawable,osg::RefMatrix* projection,osg::RefMatrix* matrix, float depth=0.0f);
unsigned int _numberOfEncloseOverrideRenderBinDetails;
osg::RenderInfo _renderInfo;
struct MatrixPlanesDrawables
{
MatrixPlanesDrawables():
_drawable(0)
{
}
void set(const osg::Matrix& matrix, const osg::Drawable* drawable, const osg::Polytope& frustum)
{
_matrix = matrix;
_drawable = drawable;
if (!_planes.empty()) _planes.clear();
// create a new list of planes from the active walls of the frustum.
osg::Polytope::ClippingMask result_mask = frustum.getResultMask();
osg::Polytope::ClippingMask selector_mask = 0x1;
for(osg::Polytope::PlaneList::const_iterator itr=frustum.getPlaneList().begin();
itr!=frustum.getPlaneList().end();
++itr)
{
if (result_mask&selector_mask) _planes.push_back(*itr);
selector_mask <<= 1;
}
}
MatrixPlanesDrawables(const MatrixPlanesDrawables& mpd):
_matrix(mpd._matrix),
_drawable(mpd._drawable),
_planes(mpd._planes) {}
MatrixPlanesDrawables& operator = (const MatrixPlanesDrawables& mpd)
{
_matrix = mpd._matrix;
_drawable = mpd._drawable;
_planes = mpd._planes;
return *this;
}
osg::Matrix _matrix;
const osg::Drawable* _drawable;
osg::Polytope::PlaneList _planes;
};
typedef std::multimap<value_type, MatrixPlanesDrawables> DistanceMatrixDrawableMap;
DistanceMatrixDrawableMap _nearPlaneCandidateMap;
DistanceMatrixDrawableMap _farPlaneCandidateMap;
osg::ref_ptr<Identifier> _identifier;
};
inline void CullVisitor::addDrawable(osg::Drawable* drawable,osg::RefMatrix* matrix)
{
if (_currentStateGraph->leaves_empty())
{
// this is first leaf to be added to StateGraph
// and therefore should not already know to current render bin,
// so need to add it.
_currentRenderBin->addStateGraph(_currentStateGraph);
}
//_currentStateGraph->addLeaf(new RenderLeaf(drawable,matrix));
_currentStateGraph->addLeaf(createOrReuseRenderLeaf(drawable,_projectionStack.back().get(),matrix));
}
inline void CullVisitor::addDrawableAndDepth(osg::Drawable* drawable,osg::RefMatrix* matrix,float depth)
{
if (_currentStateGraph->leaves_empty())
{
// this is first leaf to be added to StateGraph
// and therefore should not already know to current render bin,
// so need to add it.
_currentRenderBin->addStateGraph(_currentStateGraph);
}
//_currentStateGraph->addLeaf(new RenderLeaf(drawable,matrix,depth));
_currentStateGraph->addLeaf(createOrReuseRenderLeaf(drawable,_projectionStack.back().get(),matrix,depth));
}
inline void CullVisitor::addPositionedAttribute(osg::RefMatrix* matrix,const osg::StateAttribute* attr)
{
_currentRenderBin->getStage()->addPositionedAttribute(matrix,attr);
}
inline void CullVisitor::addPositionedTextureAttribute(unsigned int textureUnit, osg::RefMatrix* matrix,const osg::StateAttribute* attr)
{
_currentRenderBin->getStage()->addPositionedTextureAttribute(textureUnit,matrix,attr);
}
inline RenderLeaf* CullVisitor::createOrReuseRenderLeaf(osg::Drawable* drawable,osg::RefMatrix* projection,osg::RefMatrix* matrix, float depth)
{
// Skips any already reused renderleaf.
while (_currentReuseRenderLeafIndex<_reuseRenderLeafList.size() &&
_reuseRenderLeafList[_currentReuseRenderLeafIndex]->referenceCount()>1)
{
osg::notify(osg::INFO)<<"CullVisitor:createOrReuseRenderLeaf() skipping multiply referenced entry. _reuseRenderLeafList.size()="<< _reuseRenderLeafList.size()<<" _reuseRenderLeafList["<<_currentReuseRenderLeafIndex<<"]->referenceCount()="<<_reuseRenderLeafList[_currentReuseRenderLeafIndex]->referenceCount()<<std::endl;
++_currentReuseRenderLeafIndex;
}
// If still within list, element must be singularly referenced then return it to be reused.
if (_currentReuseRenderLeafIndex<_reuseRenderLeafList.size())
{
RenderLeaf* renderleaf = _reuseRenderLeafList[_currentReuseRenderLeafIndex++].get();
renderleaf->set(drawable,projection,matrix,depth,_traversalOrderNumber++);
return renderleaf;
}
// Otherwise need to create new renderleaf.
RenderLeaf* renderleaf = new RenderLeaf(drawable,projection,matrix,depth,_traversalOrderNumber++);
_reuseRenderLeafList.push_back(renderleaf);
++_currentReuseRenderLeafIndex;
return renderleaf;
}
}
#endif
BoundingBox
BoundingSphere
Camera
ClearNode
CullStack
Drawable
Matrix
NodeVisitor
Notify
RenderStage
StateGraph
StateSet
State
Vec3
osgUtil::CullVisitor
Definition CullVisitor:49
osgUtil::CullVisitor::~CullVisitor
virtual ~CullVisitor()
osgUtil::CullVisitor::apply
virtual void apply(osg::Camera &node)
osgUtil::CullVisitor::setStateGraph
void setStateGraph(StateGraph *rg)
Definition CullVisitor:187
osgUtil::CullVisitor::createOrReuseRenderLeaf
RenderLeaf * createOrReuseRenderLeaf(osg::Drawable *drawable, osg::RefMatrix *projection, osg::RefMatrix *matrix, float depth=0.0f)
Definition CullVisitor:463
osgUtil::CullVisitor::_traversalOrderNumber
unsigned int _traversalOrderNumber
Definition CullVisitor:360
osgUtil::CullVisitor::getIdentifier
Identifier * getIdentifier()
Definition CullVisitor:99
osgUtil::CullVisitor::getCurrentCamera
osg::Camera * getCurrentCamera()
Definition CullVisitor:219
osgUtil::CullVisitor::apply
virtual void apply(osg::Projection &node)
osgUtil::CullVisitor::getCurrentRenderStage
RenderStage * getCurrentRenderStage()
Definition CullVisitor:214
osgUtil::CullVisitor::getCalculatedFarPlane
value_type getCalculatedFarPlane() const
Definition CullVisitor:238
osgUtil::CullVisitor::apply
virtual void apply(osg::ClearNode &node)
osgUtil::CullVisitor::apply
virtual void apply(osg::Geode &node)
osgUtil::CullVisitor::updateCalculatedNearFar
bool updateCalculatedNearFar(const osg::Matrix &matrix, const osg::Drawable &drawable, bool isBillboard=false)
osgUtil::CullVisitor::_computed_zfar
value_type _computed_zfar
Definition CullVisitor:358
osgUtil::CullVisitor::create
static CullVisitor * create()
osgUtil::CullVisitor::getCalculatedNearPlane
value_type getCalculatedNearPlane() const
Definition CullVisitor:235
osgUtil::CullVisitor::_nearPlaneCandidateMap
DistanceMatrixDrawableMap _nearPlaneCandidateMap
Definition CullVisitor:418
osgUtil::CullVisitor::asCullVisitor
virtual const osgUtil::CullVisitor * asCullVisitor() const
Definition CullVisitor:68
osgUtil::CullVisitor::computeNearPlane
void computeNearPlane()
osgUtil::CullVisitor::_rootStateGraph
osg::ref_ptr< StateGraph > _rootStateGraph
Definition CullVisitor:350
osgUtil::CullVisitor::clampProjectionMatrixImplementation
virtual bool clampProjectionMatrixImplementation(osg::Matrixf &projection, double &znear, double &zfar) const
osgUtil::CullVisitor::apply
virtual void apply(osg::ClipNode &node)
osgUtil::CullVisitor::CullVisitor
CullVisitor()
osgUtil::CullVisitor::addDrawable
void addDrawable(osg::Drawable *drawable, osg::RefMatrix *matrix)
Definition CullVisitor:424
osgUtil::CullVisitor::setState
void setState(osg::State *state)
Definition CullVisitor:321
osgUtil::CullVisitor::apply
virtual void apply(osg::LightSource &node)
osgUtil::CullVisitor::apply
virtual void apply(osg::LOD &node)
osgUtil::CullVisitor::_numberOfEncloseOverrideRenderBinDetails
unsigned int _numberOfEncloseOverrideRenderBinDetails
Definition CullVisitor:369
osgUtil::CullVisitor::apply
virtual void apply(osg::TexGenNode &node)
osgUtil::CullVisitor::setCalculatedNearPlane
void setCalculatedNearPlane(value_type value)
Definition CullVisitor:234
osgUtil::CullVisitor::prototype
static osg::ref_ptr< CullVisitor > & prototype()
osgUtil::CullVisitor::getRenderInfo
const osg::RenderInfo & getRenderInfo() const
Definition CullVisitor:327
osgUtil::CullVisitor::handle_cull_callbacks_and_traverse
void handle_cull_callbacks_and_traverse(osg::Node &node)
Definition CullVisitor:336
osgUtil::CullVisitor::setRenderInfo
void setRenderInfo(osg::RenderInfo &renderInfo)
Definition CullVisitor:325
osgUtil::CullVisitor::_renderInfo
osg::RenderInfo _renderInfo
Definition CullVisitor:371
osgUtil::CullVisitor::getState
const osg::State * getState() const
Definition CullVisitor:323
osgUtil::CullVisitor::apply
virtual void apply(osg::Transform &node)
osgUtil::CullVisitor::setIdentifier
void setIdentifier(Identifier *identifier)
Definition CullVisitor:98
osgUtil::CullVisitor::getIdentifier
const Identifier * getIdentifier() const
Definition CullVisitor:100
osgUtil::CullVisitor::getCurrentStateGraph
StateGraph * getCurrentStateGraph()
Definition CullVisitor:198
osgUtil::CullVisitor::_reuseRenderLeafList
RenderLeafList _reuseRenderLeafList
Definition CullVisitor:364
osgUtil::CullVisitor::pushStateSet
void pushStateSet(const osg::StateSet *ss)
Definition CullVisitor:135
osgUtil::CullVisitor::_currentStateGraph
StateGraph * _currentStateGraph
Definition CullVisitor:351
osgUtil::CullVisitor::asCullStack
virtual osg::CullStack * asCullStack()
Definition CullVisitor:72
osgUtil::CullVisitor::computeNearestPointInFrustum
value_type computeNearestPointInFrustum(const osg::Matrix &matrix, const osg::Polytope::PlaneList &planes, const osg::Drawable &drawable)
osgUtil::CullVisitor::getRenderStage
RenderStage * getRenderStage()
Definition CullVisitor:209
osgUtil::CullVisitor::_currentRenderBin
RenderBin * _currentRenderBin
Definition CullVisitor:354
osgUtil::CullVisitor::getRootStateGraph
StateGraph * getRootStateGraph()
Definition CullVisitor:193
osgUtil::CullVisitor::addDrawableAndDepth
void addDrawableAndDepth(osg::Drawable *drawable, osg::RefMatrix *matrix, float depth)
Definition CullVisitor:438
osgUtil::CullVisitor::clampProjectionMatrix
bool clampProjectionMatrix(osg::Matrixf &projection, value_type &znear, value_type &zfar) const
Definition CullVisitor:281
osgUtil::CullVisitor::getViewPoint
virtual osg::Vec3 getViewPoint() const
Definition CullVisitor:103
osgUtil::CullVisitor::apply
virtual void apply(osg::Drawable &drawable)
osgUtil::CullVisitor::apply
virtual void apply(osg::Billboard &node)
osgUtil::CullVisitor::setCurrentRenderBin
void setCurrentRenderBin(RenderBin *rb)
Definition CullVisitor:229
osgUtil::CullVisitor::clampProjectionMatrix
bool clampProjectionMatrix(osg::Matrixd &projection, value_type &znear, value_type &zfar) const
Definition CullVisitor:301
osgUtil::CullVisitor::apply
virtual void apply(osg::Group &node)
osgUtil::CullVisitor::updateCalculatedNearFar
bool updateCalculatedNearFar(const osg::Matrix &matrix, const osg::BoundingBox &bb)
osgUtil::CullVisitor::updateCalculatedNearFar
void updateCalculatedNearFar(const osg::Vec3 &pos)
osgUtil::CullVisitor::apply
virtual void apply(osg::OccluderNode &node)
osgUtil::CullVisitor::getDistanceToEyePoint
virtual float getDistanceToEyePoint(const osg::Vec3 &pos, bool withLODScale) const
osgUtil::CullVisitor::setRenderStage
void setRenderStage(RenderStage *rg)
Definition CullVisitor:203
osgUtil::CullVisitor::reset
virtual void reset()
osgUtil::CullVisitor::clampProjectionMatrixImplementation
virtual bool clampProjectionMatrixImplementation(osg::Matrixd &projection, double &znear, double &zfar) const
osgUtil::CullVisitor::getDistanceToViewPoint
virtual float getDistanceToViewPoint(const osg::Vec3 &pos, bool withLODScale) const
osgUtil::CullVisitor::getState
osg::State * getState()
Definition CullVisitor:322
osgUtil::CullVisitor::apply
virtual void apply(osg::OcclusionQueryNode &node)
osgUtil::CullVisitor::asCullStack
virtual const osg::CullStack * asCullStack() const
Definition CullVisitor:76
osgUtil::CullVisitor::value_type
osg::Matrix::value_type value_type
Definition CullVisitor:52
osgUtil::CullVisitor::popStateSet
void popStateSet()
Definition CullVisitor:161
osgUtil::CullVisitor::getEyePoint
virtual osg::Vec3 getEyePoint() const
Definition CullVisitor:102
osgUtil::CullVisitor::addPositionedTextureAttribute
void addPositionedTextureAttribute(unsigned int textureUnit, osg::RefMatrix *matrix, const osg::StateAttribute *attr)
Definition CullVisitor:458
osgUtil::CullVisitor::computeFurthestPointInFrustum
value_type computeFurthestPointInFrustum(const osg::Matrix &matrix, const osg::Polytope::PlaneList &planes, const osg::Drawable &drawable)
osgUtil::CullVisitor::_currentReuseRenderLeafIndex
unsigned int _currentReuseRenderLeafIndex
Definition CullVisitor:365
osgUtil::CullVisitor::getCurrentRenderBin
RenderBin * getCurrentRenderBin()
Definition CullVisitor:224
osgUtil::CullVisitor::handle_cull_callbacks_and_accept
void handle_cull_callbacks_and_accept(osg::Node &node, osg::Node *acceptNode)
Definition CullVisitor:343
osgUtil::CullVisitor::addPositionedAttribute
void addPositionedAttribute(osg::RefMatrix *matrix, const osg::StateAttribute *attr)
Definition CullVisitor:452
osgUtil::CullVisitor::clone
virtual CullVisitor * clone() const
Definition CullVisitor:82
osgUtil::CullVisitor::CullVisitor
CullVisitor(const CullVisitor &)
Copy constructor that does a shallow copy.
osgUtil::CullVisitor::RenderLeafList
std::vector< osg::ref_ptr< RenderLeaf > > RenderLeafList
Definition CullVisitor:363
osgUtil::CullVisitor::_rootRenderStage
osg::ref_ptr< RenderStage > _rootRenderStage
Definition CullVisitor:353
osgUtil::CullVisitor::popProjectionMatrix
virtual void popProjectionMatrix()
osgUtil::CullVisitor::_computed_znear
value_type _computed_znear
Definition CullVisitor:357
osgUtil::CullVisitor::_renderBinStack
std::vector< RenderBin * > _renderBinStack
Definition CullVisitor:355
osgUtil::CullVisitor::setCalculatedFarPlane
void setCalculatedFarPlane(value_type value)
Definition CullVisitor:237
osgUtil::CullVisitor::_farPlaneCandidateMap
DistanceMatrixDrawableMap _farPlaneCandidateMap
Definition CullVisitor:419
osgUtil::CullVisitor::_identifier
osg::ref_ptr< Identifier > _identifier
Definition CullVisitor:421
osgUtil::CullVisitor::DistanceMatrixDrawableMap
std::multimap< value_type, MatrixPlanesDrawables > DistanceMatrixDrawableMap
Definition CullVisitor:417
osgUtil::CullVisitor::apply
virtual void apply(osg::Node &)
osgUtil::CullVisitor::META_NodeVisitor
META_NodeVisitor(osgUtil, CullVisitor) virtual osgUtil
Definition CullVisitor:60
osgUtil::CullVisitor::getDistanceFromEyePoint
virtual float getDistanceFromEyePoint(const osg::Vec3 &pos, bool withLODScale) const
osgUtil::CullVisitor::apply
virtual void apply(osg::Switch &node)
osgUtil::CullVisitor::getRenderInfo
osg::RenderInfo & getRenderInfo()
Definition CullVisitor:326
osgUtil::RenderBin
Definition RenderBin:34
osgUtil::RenderLeaf
Definition RenderLeaf:34
osgUtil::RenderLeaf::set
void set(osg::Drawable *drawable, osg::RefMatrix *projection, osg::RefMatrix *modelview, float depth=0.0f, unsigned int traversalOrderNumber=0)
Definition RenderLeaf:51
osgUtil::RenderStage
Definition RenderStage:38
osgUtil::StateGraph
Definition StateGraph:42
osg::Billboard
Definition Billboard:27
osg::Callback
Definition Callback:34
osg::Callback::run
virtual bool run(osg::Object *object, osg::Object *data)
Definition Callback:80
osg::Camera
Definition Camera:45
osg::ClearNode
Definition ClearNode:31
osg::ClipNode
Definition ClipNode:24
osg::CullSettings::_clampProjectionMatrixCallback
ref_ptr< ClampProjectionMatrixCallback > _clampProjectionMatrixCallback
Definition CullSettings:259
osg::CullStack
Definition CullStack:28
osg::CullStack::getViewPointLocal
const osg::Vec3 & getViewPointLocal() const
Definition CullStack:163
osg::CullStack::_projectionStack
MatrixStack _projectionStack
Definition CullStack:194
osg::CullStack::getEyeLocal
const osg::Vec3 & getEyeLocal() const
Definition CullStack:161
osg::Drawable
Definition Drawable:89
osg::Geode
Definition Geode:29
osg::Group
Definition Group:29
osg::LOD
Definition LOD:36
osg::LightSource
Definition LightSource:25
osg::Matrixd
Definition Matrixd:27
osg::Matrixd::value_type
double value_type
Definition Matrixd:30
osg::Matrixf
Definition Matrixf:27
osg::NodeVisitor
Definition NodeVisitor:82
osg::NodeVisitor::traverse
void traverse(Node &node)
Definition NodeVisitor:274
osg::Node
Definition Node:72
osg::Node::getCullCallback
Callback * getCullCallback()
Definition Node:293
osg::Node::accept
virtual void accept(NodeVisitor &nv)
osg::Object::clone
virtual Object * clone(const CopyOp &) const =0
osg::OccluderNode
Definition OccluderNode:27
osg::OcclusionQueryNode
Definition OcclusionQueryNode:110
osg::Polytope
Definition Polytope:26
osg::Polytope::getResultMask
ClippingMask getResultMask() const
Definition Polytope:178
osg::Polytope::getPlaneList
PlaneList & getPlaneList()
Definition Polytope:150
osg::Polytope::ClippingMask
unsigned int ClippingMask
Definition Polytope:30
osg::Polytope::PlaneList
std::vector< Plane > PlaneList
Definition Polytope:31
osg::Projection
Definition Projection:25
osg::Referenced
Definition Referenced:44
osg::RenderInfo
Definition RenderInfo:28
osg::StateAttribute
Definition StateAttribute:77
osg::StateSet
Definition StateSet:46
osg::StateSet::getNestRenderBins
bool getNestRenderBins() const
Definition StateSet:442
osg::StateSet::getBinName
const std::string & getBinName() const
Definition StateSet:430
osg::StateSet::PROTECTED_RENDERBIN_DETAILS
@ PROTECTED_RENDERBIN_DETAILS
Definition StateSet:401
osg::StateSet::OVERRIDE_RENDERBIN_DETAILS
@ OVERRIDE_RENDERBIN_DETAILS
Definition StateSet:400
osg::StateSet::useRenderBinDetails
bool useRenderBinDetails() const
Definition StateSet:412
osg::StateSet::getBinNumber
int getBinNumber() const
Definition StateSet:424
osg::StateSet::getRenderBinMode
RenderBinMode getRenderBinMode() const
Definition StateSet:418
osg::State
Definition State:80
osg::Switch
Definition Switch:27
osg::TexGenNode
Definition TexGenNode:24
osg::Transform
Definition Transform:75
osg::ref_ptr
Definition ref_ptr:32
osgUtil
Definition NodeVisitor:25
osg::INFO
@ INFO
Definition Notify:35
osg::Vec3
Vec3f Vec3
Definition Vec3:21
osg::BoundingBox
BoundingBoxd BoundingBox
Definition BoundingBox:257
osg::Matrix
Matrixd Matrix
Definition Matrix:27
osg::notify
std::ostream & notify(void)
Definition Notify:80
osg::RefMatrix
RefMatrixd RefMatrix
Definition Matrix:28
OSGUTIL_EXPORT
#define OSGUTIL_EXPORT
Definition osgUtil/Export:40
osgUtil::CullVisitor::Identifier
Definition CullVisitor:93
osgUtil::CullVisitor::Identifier::~Identifier
virtual ~Identifier()
Definition CullVisitor:95
osgUtil::CullVisitor::Identifier::Identifier
Identifier()
Definition CullVisitor:94
osgUtil::CullVisitor::MatrixPlanesDrawables::set
void set(const osg::Matrix &matrix, const osg::Drawable *drawable, const osg::Polytope &frustum)
Definition CullVisitor:381
osgUtil::CullVisitor::MatrixPlanesDrawables::_planes
osg::Polytope::PlaneList _planes
Definition CullVisitor:414
osgUtil::CullVisitor::MatrixPlanesDrawables::MatrixPlanesDrawables
MatrixPlanesDrawables()
Definition CullVisitor:376
osgUtil::CullVisitor::MatrixPlanesDrawables::_matrix
osg::Matrix _matrix
Definition CullVisitor:412
osgUtil::CullVisitor::MatrixPlanesDrawables::_drawable
const osg::Drawable * _drawable
Definition CullVisitor:413
osgUtil::CullVisitor::MatrixPlanesDrawables::MatrixPlanesDrawables
MatrixPlanesDrawables(const MatrixPlanesDrawables &mpd)
Definition CullVisitor:399