[osg-users] Drawable getBoundingBox() question
Robert Osfield
robert.osfield at gmail.com
Sat Jun 11 00:07:25 PDT 2016
On 10 June 2016 at 23:02, Rick Irons <Rick.Irons at mathworks.com> wrote:
> Shouldn’t the inlined getBoundingBox() method in include/osg/Drawable set
> _boundingBoxComputed to ‘true’ or am I missing something?
The later :-)
>From git master:
/** Get BoundingBox of Drawable.
* If the BoundingBox is not up to date then its updated via
an internal call to computeBond().
*/
inline const BoundingBox& getBoundingBox() const
{
if(!_boundingSphereComputed)
{
_boundingBox = _initialBound;
if (_computeBoundCallback.valid())
_boundingBox.expandBy(_computeBoundCallback->computeBound(*this));
else
_boundingBox.expandBy(computeBoundingBox());
if(_boundingBox.valid()){
_boundingSphere.set(_boundingBox.center(),
_boundingBox.radius());
} else {
_boundingSphere.init();
}
_boundingSphereComputed = true;
}
return _boundingBox;
}
More information about the osg-users
mailing list