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 is rendered in order from the furthest osg::Drawable from the eye to the one nearest the eye.
typedef std::multimap<value_type, MatrixPlanesDrawables> osgUtil::CullVisitor::DistanceMatrixDrawableMap [protected] |
typedef std::vector< osg::ref_ptr<RenderLeaf> > osgUtil::CullVisitor::RenderLeafList [protected] |
| osgUtil::CullVisitor::CullVisitor | ( | ) |
| osgUtil::CullVisitor::CullVisitor | ( | const CullVisitor & | ) |
Copy constructor that does a shallow copy.
| virtual osgUtil::CullVisitor::~CullVisitor | ( | ) | [protected, virtual] |
| void osgUtil::CullVisitor::addDrawable | ( | osg::Drawable * | drawable, | |
| osg::RefMatrix * | matrix | |||
| ) | [inline] |
Add a drawable to current render graph.
References _currentRenderBin, _currentStateGraph, osg::CullStack::_projectionStack, osgUtil::StateGraph::addLeaf(), osgUtil::RenderBin::addStateGraph(), osg::fast_back_stack< T >::back(), createOrReuseRenderLeaf(), and osgUtil::StateGraph::leaves_empty().
| void osgUtil::CullVisitor::addDrawableAndDepth | ( | osg::Drawable * | drawable, | |
| osg::RefMatrix * | matrix, | |||
| float | depth | |||
| ) | [inline] |
Add a drawable and depth to current render graph.
References _currentRenderBin, _currentStateGraph, osg::CullStack::_projectionStack, osgUtil::StateGraph::addLeaf(), osgUtil::RenderBin::addStateGraph(), osg::fast_back_stack< T >::back(), createOrReuseRenderLeaf(), and osgUtil::StateGraph::leaves_empty().
| void osgUtil::CullVisitor::addPositionedAttribute | ( | osg::RefMatrix * | matrix, | |
| const osg::StateAttribute * | attr | |||
| ) | [inline] |
Add an attribute which is positioned relative to the modelview matrix.
References _currentRenderBin, osgUtil::RenderStage::addPositionedAttribute(), and osgUtil::RenderBin::getStage().
| void osgUtil::CullVisitor::addPositionedTextureAttribute | ( | unsigned int | textureUnit, | |
| osg::RefMatrix * | matrix, | |||
| const osg::StateAttribute * | attr | |||
| ) | [inline] |
Add an attribute which is positioned relative to the modelview matrix.
References _currentRenderBin, osgUtil::RenderStage::addPositionedTextureAttribute(), and osgUtil::RenderBin::getStage().
| virtual void osgUtil::CullVisitor::apply | ( | osg::Group & | node | ) | [virtual] |
| virtual void osgUtil::CullVisitor::apply | ( | osg::Transform & | node | ) | [virtual] |
| virtual void osgUtil::CullVisitor::apply | ( | osg::Projection & | node | ) | [virtual] |
| virtual void osgUtil::CullVisitor::apply | ( | osg::Switch & | node | ) | [virtual] |
| virtual void osgUtil::CullVisitor::apply | ( | osg::Geode & | node | ) | [virtual] |
| virtual void osgUtil::CullVisitor::apply | ( | osg::LOD & | node | ) | [virtual] |
| virtual void osgUtil::CullVisitor::apply | ( | osg::ClearNode & | node | ) | [virtual] |
| virtual void osgUtil::CullVisitor::apply | ( | osg::Node & | ) | [virtual] |
| virtual void osgUtil::CullVisitor::apply | ( | osg::Camera & | node | ) | [virtual] |
| virtual void osgUtil::CullVisitor::apply | ( | osg::OccluderNode & | node | ) | [virtual] |
| virtual void osgUtil::CullVisitor::apply | ( | osg::Billboard & | node | ) | [virtual] |
| virtual void osgUtil::CullVisitor::apply | ( | osg::LightSource & | node | ) | [virtual] |
| virtual void osgUtil::CullVisitor::apply | ( | osg::OcclusionQueryNode & | node | ) | [virtual] |
| virtual void osgUtil::CullVisitor::apply | ( | osg::ClipNode & | node | ) | [virtual] |
| virtual void osgUtil::CullVisitor::apply | ( | osg::TexGenNode & | node | ) | [virtual] |
| bool osgUtil::CullVisitor::clampProjectionMatrix | ( | osg::Matrixd & | projection, | |
| value_type & | znear, | |||
| value_type & | zfar | |||
| ) | const [inline] |
Clamp the projection double matrix to computed near and far values, use callback if it exists, otherwise use default CullVisitor implementation.
| bool osgUtil::CullVisitor::clampProjectionMatrix | ( | osg::Matrixf & | projection, | |
| value_type & | znear, | |||
| value_type & | zfar | |||
| ) | const [inline] |
Clamp the projection float matrix to computed near and far values, use callback if it exists, otherwise use default CullVisitor implementation.
| virtual bool osgUtil::CullVisitor::clampProjectionMatrixImplementation | ( | osg::Matrixd & | projection, | |
| double & | znear, | |||
| double & | zfar | |||
| ) | const [virtual] |
CullVisitor's default clamping of the projection double matrix to computed near and far values. Note, do not call this method directly, use clampProjectionMatrix(..) instead, unless you want to bypass the callback.
| virtual bool osgUtil::CullVisitor::clampProjectionMatrixImplementation | ( | osg::Matrixf & | projection, | |
| double & | znear, | |||
| double & | zfar | |||
| ) | const [virtual] |
CullVisitor's default clamping of the projection float matrix to computed near and far values. Note, do not call this method directly, use clampProjectionMatrix(..) instead, unless you want to bypass the callback.
| value_type osgUtil::CullVisitor::computeNearestPointInFrustum | ( | const osg::Matrix & | matrix, | |
| const osg::Polytope::PlaneList & | planes, | |||
| const osg::Drawable & | drawable | |||
| ) |
| void osgUtil::CullVisitor::computeNearPlane | ( | ) |
compute near plane based on the polgon intersection of primtives in near plane candidate list of drawables. Note, you have to set ComputeNearFarMode to COMPUTE_NEAR_FAR_USING_PRIMITIVES to be able to near plane candidate drawables to be recorded by the cull traversal.
| static CullVisitor* osgUtil::CullVisitor::create | ( | ) | [static] |
create a CullVisitor by cloning CullVisitor::prototype().
| RenderLeaf * osgUtil::CullVisitor::createOrReuseRenderLeaf | ( | osg::Drawable * | drawable, | |
| osg::RefMatrix * | projection, | |||
| osg::RefMatrix * | matrix, | |||
| float | depth = 0.0f | |||
| ) | [inline, protected] |
References _currentReuseRenderLeafIndex, _reuseRenderLeafList, osg::NOTICE, osg::notify(), and osgUtil::RenderLeaf::set().
Referenced by addDrawable(), and addDrawableAndDepth().
| value_type osgUtil::CullVisitor::getCalculatedFarPlane | ( | ) | const [inline] |
| value_type osgUtil::CullVisitor::getCalculatedNearPlane | ( | ) | const [inline] |
| osg::Camera* osgUtil::CullVisitor::getCurrentCamera | ( | ) | [inline] |
References osgUtil::RenderStage::getCamera().
| RenderBin* osgUtil::CullVisitor::getCurrentRenderBin | ( | ) | [inline] |
| RenderStage* osgUtil::CullVisitor::getCurrentRenderStage | ( | ) | [inline] |
References osgUtil::RenderBin::getStage().
| StateGraph* osgUtil::CullVisitor::getCurrentStateGraph | ( | ) | [inline] |
| virtual float osgUtil::CullVisitor::getDistanceFromEyePoint | ( | const osg::Vec3 & | pos, | |
| bool | withLODScale | |||
| ) | const [virtual] |
| virtual float osgUtil::CullVisitor::getDistanceToEyePoint | ( | const osg::Vec3 & | pos, | |
| bool | withLODScale | |||
| ) | const [virtual] |
| virtual float osgUtil::CullVisitor::getDistanceToViewPoint | ( | const osg::Vec3 & | pos, | |
| bool | withLODScale | |||
| ) | const [virtual] |
| virtual osg::Vec3 osgUtil::CullVisitor::getEyePoint | ( | ) | const [inline, virtual] |
| const osg::RenderInfo& osgUtil::CullVisitor::getRenderInfo | ( | ) | const [inline] |
| osg::RenderInfo& osgUtil::CullVisitor::getRenderInfo | ( | ) | [inline] |
| RenderStage* osgUtil::CullVisitor::getRenderStage | ( | ) | [inline] |
| StateGraph* osgUtil::CullVisitor::getRootStateGraph | ( | ) | [inline] |
| osg::State* osgUtil::CullVisitor::getState | ( | ) | [inline] |
| const osg::State* osgUtil::CullVisitor::getState | ( | ) | const [inline] |
| virtual osg::Vec3 osgUtil::CullVisitor::getViewPoint | ( | ) | const [inline, virtual] |
| void osgUtil::CullVisitor::handle_cull_callbacks_and_accept | ( | osg::Node & | node, | |
| osg::Node * | acceptNode | |||
| ) | [inline, protected] |
References osg::Node::accept(), and osg::Node::getCullCallback().
| void osgUtil::CullVisitor::handle_cull_callbacks_and_traverse | ( | osg::Node & | node | ) | [inline, protected] |
References osg::Node::getCullCallback().
| osgUtil::CullVisitor::META_NodeVisitor | ( | "osgUtil" | , | |
| "CullVisitor" | ||||
| ) | const [inline] |
Create a shallow copy of the CullVisitor, used by CullVisitor::create() to clone the prototype.
| CullVisitor& osgUtil::CullVisitor::operator= | ( | const CullVisitor & | ) | [inline, protected] |
Prevent unwanted copy operator.
| virtual void osgUtil::CullVisitor::popProjectionMatrix | ( | ) | [virtual] |
Re-implement CullStack's popProjectionMatrix() adding clamping of the projection matrix to the computed near and far.
Reimplemented from osg::CullStack.
| void osgUtil::CullVisitor::popStateSet | ( | ) | [inline] |
Pop the top state set and hence associated state group. Move the current state group to the parent of the popped state group.
References osg::StateSet::getBinName(), osg::StateSet::getRenderBinMode(), and osg::StateSet::useRenderBinDetails().
| static osg::ref_ptr<CullVisitor>& osgUtil::CullVisitor::prototype | ( | ) | [static] |
get the prototype singleton used by CullVisitor::create().
| void osgUtil::CullVisitor::pushStateSet | ( | const osg::StateSet * | ss | ) | [inline] |
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.
References osg::StateSet::getBinName(), osg::StateSet::getBinNumber(), osg::StateSet::getNestRenderBins(), osg::StateSet::getRenderBinMode(), and osg::StateSet::useRenderBinDetails().
| virtual void osgUtil::CullVisitor::reset | ( | ) | [virtual] |
Reimplemented from osg::CullStack.
| void osgUtil::CullVisitor::setCurrentRenderBin | ( | RenderBin * | rb | ) | [inline] |
| void osgUtil::CullVisitor::setRenderInfo | ( | osg::RenderInfo & | renderInfo | ) | [inline] |
| void osgUtil::CullVisitor::setRenderStage | ( | RenderStage * | rg | ) | [inline] |
| void osgUtil::CullVisitor::setState | ( | osg::State * | state | ) | [inline] |
| void osgUtil::CullVisitor::setStateGraph | ( | StateGraph * | rg | ) | [inline] |
| bool osgUtil::CullVisitor::updateCalculatedNearFar | ( | const osg::Matrix & | matrix, | |
| const osg::Drawable & | drawable, | |||
| bool | isBillboard = false | |||
| ) |
| bool osgUtil::CullVisitor::updateCalculatedNearFar | ( | const osg::Matrix & | matrix, | |
| const osg::BoundingBox & | bb | |||
| ) |
| void osgUtil::CullVisitor::updateCalculatedNearFar | ( | const osg::Vec3 & | pos | ) |
value_type osgUtil::CullVisitor::_computed_zfar [protected] |
value_type osgUtil::CullVisitor::_computed_znear [protected] |
RenderBin* osgUtil::CullVisitor::_currentRenderBin [protected] |
Referenced by addDrawable(), addDrawableAndDepth(), addPositionedAttribute(), and addPositionedTextureAttribute().
unsigned int osgUtil::CullVisitor::_currentReuseRenderLeafIndex [protected] |
Referenced by createOrReuseRenderLeaf().
StateGraph* osgUtil::CullVisitor::_currentStateGraph [protected] |
Referenced by addDrawable(), and addDrawableAndDepth().
unsigned int osgUtil::CullVisitor::_numberOfEncloseOverrideRenderBinDetails [protected] |
std::vector<RenderBin*> osgUtil::CullVisitor::_renderBinStack [protected] |
osg::RenderInfo osgUtil::CullVisitor::_renderInfo [protected] |
Referenced by createOrReuseRenderLeaf().
osg::ref_ptr<StateGraph> osgUtil::CullVisitor::_rootStateGraph [protected] |
1.7.1