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."
This commit is contained in:
Robert Osfield 2014-05-20 15:34:12 +00:00
parent 8346f0ebe1
commit e70acf4c51

View File

@ -152,7 +152,11 @@ class OSG_EXPORT Drawable : public Node
_boundingSphereComputed = true; _boundingSphereComputed = true;
} }
if(_boundingBox.valid()){
_boundingSphere.set(_boundingBox.center(), _boundingBox.radius()); _boundingSphere.set(_boundingBox.center(), _boundingBox.radius());
} else {
_boundingSphere.init();
}
return _boundingBox; return _boundingBox;
} }