Added handling of Drawables added directly to scene graph without Geode decorating them.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14386 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
parent
23ae292fe2
commit
e65d03bf27
@ -36,17 +36,14 @@ public:
|
||||
|
||||
void getBase(osg::Polytope& polytope, float margin=0.1) const;
|
||||
|
||||
void apply(osg::Node& node);
|
||||
void apply(osg::Drawable& drawable);
|
||||
|
||||
void apply(osg::Transform& transform);
|
||||
|
||||
void apply(osg::Geode& geode);
|
||||
|
||||
inline void pushMatrix(osg::Matrix& matrix) { _matrixStack.push_back(matrix); }
|
||||
|
||||
inline void popMatrix() { _matrixStack.pop_back(); }
|
||||
|
||||
void applyDrawable(osg::Drawable* drawable);
|
||||
|
||||
void applyBoundingBox(const osg::BoundingBox&);
|
||||
|
||||
|
@ -48,11 +48,6 @@ void ComputeBoundsVisitor::getBase(osg::Polytope& polytope, float margin) const
|
||||
polytope.add( osg::Plane(0.0, 0.0, 1.0, -(_bb.zMin()-delta)) );
|
||||
}
|
||||
|
||||
void ComputeBoundsVisitor::apply(osg::Node& node)
|
||||
{
|
||||
traverse(node);
|
||||
}
|
||||
|
||||
void ComputeBoundsVisitor::apply(osg::Transform& transform)
|
||||
{
|
||||
osg::Matrix matrix;
|
||||
@ -67,17 +62,9 @@ void ComputeBoundsVisitor::apply(osg::Transform& transform)
|
||||
popMatrix();
|
||||
}
|
||||
|
||||
void ComputeBoundsVisitor::apply(osg::Geode& geode)
|
||||
void ComputeBoundsVisitor::apply(osg::Drawable& drawable)
|
||||
{
|
||||
for(unsigned int i=0; i<geode.getNumDrawables(); ++i)
|
||||
{
|
||||
applyDrawable(geode.getDrawable(i));
|
||||
}
|
||||
}
|
||||
|
||||
void ComputeBoundsVisitor::applyDrawable(osg::Drawable* drawable)
|
||||
{
|
||||
applyBoundingBox(drawable->getBoundingBox());
|
||||
applyBoundingBox(drawable.getBoundingBox());
|
||||
}
|
||||
|
||||
void ComputeBoundsVisitor::applyBoundingBox(const osg::BoundingBox& bbox)
|
||||
|
Loading…
Reference in New Issue
Block a user