Exemplo n.º 1
0
        public IBoundingBox GetBoundingBox()
        {
            if (_boundingSphereComputed)
            {
                return(_boundingBox);
            }

            _boundingBox = _initialBoundingBox;

            _boundingBox.ExpandBy(null != ComputeBoundingBoxCallback
                ? ComputeBoundingBoxCallback(this)
                : ComputeBoundingBox());

            if (_boundingBox.Valid())
            {
                _boundingSphere.Set(_boundingBox.Center, _boundingBox.Radius);
            }
            else
            {
                _boundingSphere.Init();
            }

            _boundingSphereComputed = true;

            return(_boundingBox);
        }