From e65d03bf27010c1e134bbe699205d98ca2a0851d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 28 Jul 2014 16:19:44 +0000 Subject: [PATCH] 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 --- include/osg/ComputeBoundsVisitor | 5 +---- src/osg/ComputeBoundsVisitor.cpp | 17 ++--------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/include/osg/ComputeBoundsVisitor b/include/osg/ComputeBoundsVisitor index c5b2cd6a8..f94f9043b 100644 --- a/include/osg/ComputeBoundsVisitor +++ b/include/osg/ComputeBoundsVisitor @@ -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&); diff --git a/src/osg/ComputeBoundsVisitor.cpp b/src/osg/ComputeBoundsVisitor.cpp index d7108aed0..9dd73796a 100644 --- a/src/osg/ComputeBoundsVisitor.cpp +++ b/src/osg/ComputeBoundsVisitor.cpp @@ -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; igetBoundingBox()); + applyBoundingBox(drawable.getBoundingBox()); } void ComputeBoundsVisitor::applyBoundingBox(const osg::BoundingBox& bbox)