Further work on Bound class/Node::getBound() and Drawable::getBound() and usage in OSG codebase
This commit is contained in:
@@ -271,12 +271,13 @@ class OSG_EXPORT CullingSet : public Referenced
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef OSG_USE_BOUND
|
||||
inline bool isCulled(const Bound& bound)
|
||||
{
|
||||
if (bound.bb) return isCulled(*bound.bb);
|
||||
else return isCulled(*bound.bs);
|
||||
}
|
||||
|
||||
#endif
|
||||
inline void pushCurrentMask()
|
||||
{
|
||||
_frustum.pushCurrentMask();
|
||||
|
||||
@@ -128,6 +128,20 @@ class OSG_EXPORT Drawable : public Node
|
||||
/** Set the initial bounding volume to use when computing the overall bounding volume.*/
|
||||
const BoundingBox& getInitialBound() const { return _initialBound; }
|
||||
|
||||
#ifdef OSG_USE_BOUND
|
||||
virtual Bound getBound() const
|
||||
{
|
||||
if(!_boundingSphereComputed) getBoundingBox();
|
||||
return Bound(_boundingSphere, _boundingBox);
|
||||
}
|
||||
#else
|
||||
inline const BoundingSphere& getBound() const
|
||||
{
|
||||
if(!_boundingSphereComputed) getBoundingBox();
|
||||
return _boundingSphere;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Get BoundingBox of Drawable.
|
||||
* If the BoundingBox is not up to date then its updated via an internal call to computeBond().
|
||||
*/
|
||||
|
||||
@@ -437,7 +437,7 @@ class OSG_EXPORT Node : public Object
|
||||
/** Get the bounding sphere of node.
|
||||
Using lazy evaluation computes the bounding sphere if it is 'dirty'.*/
|
||||
#ifdef OSG_USE_BOUND
|
||||
inline Bound getBound() const
|
||||
virtual Bound getBound() const
|
||||
{
|
||||
if(!_boundingSphereComputed)
|
||||
{
|
||||
@@ -452,7 +452,7 @@ class OSG_EXPORT Node : public Object
|
||||
return Bound(_boundingSphere);
|
||||
}
|
||||
#else
|
||||
inline BoundingSphere getBound() const
|
||||
inline const BoundingSphere& getBound() const
|
||||
{
|
||||
if(!_boundingSphereComputed)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user