14#ifndef OSGUTIL_CULLVISITOR
15#define OSGUTIL_CULLVISITOR 1
142 if (useRenderBinDetails)
172 if (useRenderBinDetails)
339 if (callback) callback->
run(&node,
this);
346 if (callback) callback->
run(&node,
this);
347 else acceptNode->
accept(*
this);
390 for(osg::Polytope::PlaneList::const_iterator itr=frustum.
getPlaneList().begin();
394 if (result_mask&selector_mask)
_planes.push_back(*itr);
460 _currentRenderBin->getStage()->addPositionedTextureAttribute(textureUnit,matrix,attr);
@ INFO
Definition Notify:35
Vec3f Vec3
Definition Vec3:21
BoundingBoxd BoundingBox
Definition BoundingBox:257
Matrixd Matrix
Definition Matrix:27
std::ostream & notify(void)
Definition Notify:80
RefMatrixd RefMatrix
Definition Matrix:28
The osgUtil library provides general purpose utility classes such as update, cull and draw traverses,...
Definition NodeVisitor:25
Billboard is a derived form of Geode that orients its osg::Drawable children to face the eye point.
Definition Billboard:27
virtual bool run(osg::Object *object, osg::Object *data)
Invoke the callback, first parameter is the Object that the callback is attached to,...
Definition Callback:80
Camera - is a subclass of Transform which represents encapsulates the settings of a Camera.
Definition Camera:45
A Group node for clearing the color and depth buffers.
Definition ClearNode:31
Node for defining the position of ClipPlanes in the scene.
Definition ClipNode:24
ref_ptr< ClampProjectionMatrixCallback > _clampProjectionMatrixCallback
Definition CullSettings:259
A CullStack class which accumulates the current project, modelview matrices and the CullingSet.
Definition CullStack:28
const osg::Vec3 & getViewPointLocal() const
Definition CullStack:163
MatrixStack _projectionStack
Definition CullStack:194
const osg::Vec3 & getEyeLocal() const
Definition CullStack:161
Pure virtual base class for drawable geometry.
Definition Drawable:89
A Geode is a "geometry node", that is, a leaf node on the scene graph that can have "renderable thing...
Definition Geode:29
General group node which maintains a list of children.
Definition Group:29
Leaf Node for defining a light in the scene.
Definition LightSource:25
LOD - Level Of Detail group node which allows switching between children depending on distance from e...
Definition LOD:36
double value_type
Definition Matrixd:30
Base class for all internal nodes in the scene graph.
Definition Node:72
Callback * getCullCallback()
Get cull node callback, called during cull traversal.
Definition Node:293
virtual void accept(NodeVisitor &nv)
Visitor Pattern : calls the apply method of a NodeVisitor with this node's type.
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
void traverse(Node &node)
Method for handling traversal of a nodes.
Definition NodeVisitor:274
virtual Object * clone(const CopyOp &) const =0
Clone an object, with Object* return type.
OccluderNode is a Group node which provides hooks for adding ConvexPlanarOccluders to the scene.
Definition OccluderNode:27
Definition OcclusionQueryNode:110
A Polytope class for representing convex clipping volumes made up of a set of planes.
Definition Polytope:26
ClippingMask getResultMask() const
Definition Polytope:178
PlaneList & getPlaneList()
Definition Polytope:150
unsigned int ClippingMask
Definition Polytope:30
std::vector< Plane > PlaneList
Definition Polytope:31
Projection nodes set up the frustum/orthographic projection used when rendering the scene.
Definition Projection:25
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Base class for providing reference counted objects.
Definition Referenced:44
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Base class for state attributes.
Definition StateAttribute:77
Stores a set of modes and attributes which represent a set of OpenGL state.
Definition StateSet:46
bool getNestRenderBins() const
Get whether associated RenderBin should be nested within parents RenderBin.
Definition StateSet:442
const std::string & getBinName() const
Get the render bin name.
Definition StateSet:430
@ PROTECTED_RENDERBIN_DETAILS
Definition StateSet:401
@ OVERRIDE_RENDERBIN_DETAILS
Definition StateSet:400
bool useRenderBinDetails() const
Get whether the render bin details are set and should be used.
Definition StateSet:412
int getBinNumber() const
Get the render bin number.
Definition StateSet:424
RenderBinMode getRenderBinMode() const
Get the render bin mode.
Definition StateSet:418
Switch is a Group node that allows switching between children.
Definition Switch:27
Node for defining the position of TexGen in the scene.
Definition TexGenNode:24
A Transform is a group node for which all children are transformed by a 4x4 matrix.
Definition Transform:75
Basic NodeVisitor implementation for rendering a scene.
Definition CullVisitor:49
virtual void apply(osg::Camera &node)
void setStateGraph(StateGraph *rg)
Definition CullVisitor:187
RenderLeaf * createOrReuseRenderLeaf(osg::Drawable *drawable, osg::RefMatrix *projection, osg::RefMatrix *matrix, float depth=0.0f)
Definition CullVisitor:463
unsigned int _traversalOrderNumber
Definition CullVisitor:360
Identifier * getIdentifier()
Definition CullVisitor:99
osg::Camera * getCurrentCamera()
Definition CullVisitor:219
virtual void apply(osg::Projection &node)
RenderStage * getCurrentRenderStage()
Definition CullVisitor:214
value_type getCalculatedFarPlane() const
Definition CullVisitor:238
virtual void apply(osg::ClearNode &node)
virtual void apply(osg::Geode &node)
bool updateCalculatedNearFar(const osg::Matrix &matrix, const osg::Drawable &drawable, bool isBillboard=false)
value_type _computed_zfar
Definition CullVisitor:358
static CullVisitor * create()
create a CullVisitor by cloning CullVisitor::prototype().
value_type getCalculatedNearPlane() const
Definition CullVisitor:235
DistanceMatrixDrawableMap _nearPlaneCandidateMap
Definition CullVisitor:418
virtual const osgUtil::CullVisitor * asCullVisitor() const
convert 'const this' into a const osgUtil::CullVisitor pointer if Object is a osgUtil::CullVisitor,...
Definition CullVisitor:68
void computeNearPlane()
compute near plane based on the polgon intersection of primtives in near plane candidate list of draw...
osg::ref_ptr< StateGraph > _rootStateGraph
Definition CullVisitor:350
virtual bool clampProjectionMatrixImplementation(osg::Matrixf &projection, double &znear, double &zfar) const
CullVisitor's default clamping of the projection float matrix to computed near and far values.
virtual void apply(osg::ClipNode &node)
void addDrawable(osg::Drawable *drawable, osg::RefMatrix *matrix)
Add a drawable to current render graph.
Definition CullVisitor:424
void setState(osg::State *state)
Definition CullVisitor:321
virtual void apply(osg::LightSource &node)
virtual void apply(osg::LOD &node)
unsigned int _numberOfEncloseOverrideRenderBinDetails
Definition CullVisitor:369
virtual void apply(osg::TexGenNode &node)
void setCalculatedNearPlane(value_type value)
Definition CullVisitor:234
static osg::ref_ptr< CullVisitor > & prototype()
get the prototype singleton used by CullVisitor::create().
const osg::RenderInfo & getRenderInfo() const
Definition CullVisitor:327
void handle_cull_callbacks_and_traverse(osg::Node &node)
Definition CullVisitor:336
void setRenderInfo(osg::RenderInfo &renderInfo)
Definition CullVisitor:325
osg::RenderInfo _renderInfo
Definition CullVisitor:371
const osg::State * getState() const
Definition CullVisitor:323
virtual void apply(osg::Transform &node)
void setIdentifier(Identifier *identifier)
Definition CullVisitor:98
const Identifier * getIdentifier() const
Definition CullVisitor:100
StateGraph * getCurrentStateGraph()
Definition CullVisitor:198
RenderLeafList _reuseRenderLeafList
Definition CullVisitor:364
void pushStateSet(const osg::StateSet *ss)
Push state set on the current state group.
Definition CullVisitor:135
StateGraph * _currentStateGraph
Definition CullVisitor:351
virtual osg::CullStack * asCullStack()
Convert 'this' into a osg::CullStack pointer if Object is a osg::CullStack, otherwise return 0.
Definition CullVisitor:72
value_type computeNearestPointInFrustum(const osg::Matrix &matrix, const osg::Polytope::PlaneList &planes, const osg::Drawable &drawable)
RenderStage * getRenderStage()
Definition CullVisitor:209
RenderBin * _currentRenderBin
Definition CullVisitor:354
StateGraph * getRootStateGraph()
Definition CullVisitor:193
void addDrawableAndDepth(osg::Drawable *drawable, osg::RefMatrix *matrix, float depth)
Add a drawable and depth to current render graph.
Definition CullVisitor:438
bool clampProjectionMatrix(osg::Matrixf &projection, value_type &znear, value_type &zfar) const
Clamp the projection float matrix to computed near and far values, use callback if it exists,...
Definition CullVisitor:281
virtual osg::Vec3 getViewPoint() const
Get the view point in local coordinates.
Definition CullVisitor:103
virtual void apply(osg::Drawable &drawable)
virtual void apply(osg::Billboard &node)
void setCurrentRenderBin(RenderBin *rb)
Definition CullVisitor:229
bool clampProjectionMatrix(osg::Matrixd &projection, value_type &znear, value_type &zfar) const
Clamp the projection double matrix to computed near and far values, use callback if it exists,...
Definition CullVisitor:301
virtual void apply(osg::Group &node)
bool updateCalculatedNearFar(const osg::Matrix &matrix, const osg::BoundingBox &bb)
void updateCalculatedNearFar(const osg::Vec3 &pos)
virtual void apply(osg::OccluderNode &node)
virtual float getDistanceToEyePoint(const osg::Vec3 &pos, bool withLODScale) const
Get the distance from a point to the eye point, distance value in local coordinate system.
void setRenderStage(RenderStage *rg)
Definition CullVisitor:203
virtual void reset()
Method to call to reset visitor.
virtual bool clampProjectionMatrixImplementation(osg::Matrixd &projection, double &znear, double &zfar) const
CullVisitor's default clamping of the projection double matrix to computed near and far values.
virtual float getDistanceToViewPoint(const osg::Vec3 &pos, bool withLODScale) const
Get the distance from a point to the view point, distance value in local coordinate system.
osg::State * getState()
Definition CullVisitor:322
virtual void apply(osg::OcclusionQueryNode &node)
virtual const osg::CullStack * asCullStack() const
convert 'const this' into a const osg::CullStack pointer if Object is a osg::CullStack,...
Definition CullVisitor:76
osg::Matrix::value_type value_type
Definition CullVisitor:52
void popStateSet()
Pop the top state set and hence associated state group.
Definition CullVisitor:161
virtual osg::Vec3 getEyePoint() const
Get the eye point in local coordinates.
Definition CullVisitor:102
void addPositionedTextureAttribute(unsigned int textureUnit, osg::RefMatrix *matrix, const osg::StateAttribute *attr)
Add an attribute which is positioned relative to the modelview matrix.
Definition CullVisitor:458
value_type computeFurthestPointInFrustum(const osg::Matrix &matrix, const osg::Polytope::PlaneList &planes, const osg::Drawable &drawable)
unsigned int _currentReuseRenderLeafIndex
Definition CullVisitor:365
RenderBin * getCurrentRenderBin()
Definition CullVisitor:224
void handle_cull_callbacks_and_accept(osg::Node &node, osg::Node *acceptNode)
Definition CullVisitor:343
void addPositionedAttribute(osg::RefMatrix *matrix, const osg::StateAttribute *attr)
Add an attribute which is positioned relative to the modelview matrix.
Definition CullVisitor:452
virtual CullVisitor * clone() const
Create a shallow copy of the CullVisitor, used by CullVisitor::create() to clone the prototype.
Definition CullVisitor:82
CullVisitor(const CullVisitor &)
Copy constructor that does a shallow copy.
std::vector< osg::ref_ptr< RenderLeaf > > RenderLeafList
Definition CullVisitor:363
osg::ref_ptr< RenderStage > _rootRenderStage
Definition CullVisitor:353
virtual void popProjectionMatrix()
Re-implement CullStack's popProjectionMatrix() adding clamping of the projection matrix to the comput...
value_type _computed_znear
Definition CullVisitor:357
std::vector< RenderBin * > _renderBinStack
Definition CullVisitor:355
void setCalculatedFarPlane(value_type value)
Definition CullVisitor:237
DistanceMatrixDrawableMap _farPlaneCandidateMap
Definition CullVisitor:419
osg::ref_ptr< Identifier > _identifier
Definition CullVisitor:421
std::multimap< value_type, MatrixPlanesDrawables > DistanceMatrixDrawableMap
Definition CullVisitor:417
virtual void apply(osg::Node &)
META_NodeVisitor(osgUtil, CullVisitor) virtual osgUtil
Convert 'this' into a osgUtil::CullVisitor pointer if Object is a osgUtil::CullVisitor,...
Definition CullVisitor:60
virtual float getDistanceFromEyePoint(const osg::Vec3 &pos, bool withLODScale) const
Get the distance of a point from the eye point, distance value in the eye coordinate system.
virtual void apply(osg::Switch &node)
osg::RenderInfo & getRenderInfo()
Definition CullVisitor:326
Definition CullVisitor:93
virtual ~Identifier()
Definition CullVisitor:95
Identifier()
Definition CullVisitor:94
void set(const osg::Matrix &matrix, const osg::Drawable *drawable, const osg::Polytope &frustum)
Definition CullVisitor:381
osg::Polytope::PlaneList _planes
Definition CullVisitor:414
MatrixPlanesDrawables()
Definition CullVisitor:376
osg::Matrix _matrix
Definition CullVisitor:412
const osg::Drawable * _drawable
Definition CullVisitor:413
MatrixPlanesDrawables(const MatrixPlanesDrawables &mpd)
Definition CullVisitor:399
RenderBin base class.
Definition RenderBin:34
Container class for all data required for rendering of drawables.
Definition RenderLeaf:34
void set(osg::Drawable *drawable, osg::RefMatrix *projection, osg::RefMatrix *modelview, float depth=0.0f, unsigned int traversalOrderNumber=0)
Definition RenderLeaf:51
RenderStage base class.
Definition RenderStage:38
StateGraph - contained in a renderBin, defines the scene to be drawn.
Definition StateGraph:42
#define OSGUTIL_EXPORT
Definition Export:40