[osg-users] Drawable getBoundingBox() question

Rick Irons Rick.Irons at mathworks.com
Mon Jun 13 07:29:45 PDT 2016


Hi Robert,



Thank you for the response.



I am still a little puzzled...shouldn't the code you refer to below set '_boundingBoxComputed' to true in addition to the current behavior of setting ‘_boundingSphereComputed’ to true?  When I compare the OSG 3.0.1 version of the method to the 3.4.0 version the setting of ‘_boundingBoxComputed’ to true has been removed while the setting of ‘_boundingSphereComputed’ to true has been added.  It seems that both are necessary.



Thanks,

Rick





-----Original Message-----
From: osg-users [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Saturday, June 11, 2016 3:07 AM
To: OpenSceneGraph Users <osg-users at lists.openscenegraph.org>
Subject: Re: [osg-users] Drawable getBoundingBox() question



On 10 June 2016 at 23:02, Rick Irons <Rick.Irons at mathworks.com<mailto: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;

        }

_______________________________________________

osg-users mailing list

osg-users at lists.openscenegraph.org<mailto:osg-users at lists.openscenegraph.org>

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160613/ee99c40b/attachment-0003.htm>


More information about the osg-users mailing list