From e70acf4c5190fa7319e1780b451533c9f4d5daf7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 20 May 2014 15:34:12 +0000 Subject: [PATCH] From Pjotr Svetachov, "I stumbled on a little bug with the new drawables. I was distributing points data into different drawables that I used in a LOD later. When simplifying the system to not use geodes anymore I came upon the following bug: If Drawable::getBoundingBox would compute an invalid bounding box (if it was for example empty) it would make a bounding sphere with a infinite radius which counts as a valid sphere in osg. Attached is a small fix." --- include/osg/Drawable | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/osg/Drawable b/include/osg/Drawable index d75d7b4ca..9f14686af 100644 --- a/include/osg/Drawable +++ b/include/osg/Drawable @@ -152,7 +152,11 @@ class OSG_EXPORT Drawable : public Node _boundingSphereComputed = true; } - _boundingSphere.set(_boundingBox.center(), _boundingBox.radius()); + if(_boundingBox.valid()){ + _boundingSphere.set(_boundingBox.center(), _boundingBox.radius()); + } else { + _boundingSphere.init(); + } return _boundingBox; }