Updates NEWS file for 0.9.0 release.
Added default computeBound() implementation to osg::Drawable which uses a PrimtiveFunctor to compute the bounding box in a generic way, that will work for all Drawable subclasses that implement the accept(PrimitiveFunctor&).
This commit is contained in:
@@ -124,7 +124,31 @@ class SG_EXPORT BoundingBox
|
||||
|
||||
/** If the vertex is out-with the box expand to encompass vertex.
|
||||
If this box is empty then move set this box's min max to vertex. */
|
||||
void expandBy(const Vec3& v);
|
||||
inline void expandBy(const Vec3& v)
|
||||
{
|
||||
if(v.x()<_min.x()) _min.x() = v.x();
|
||||
if(v.x()>_max.x()) _max.x() = v.x();
|
||||
|
||||
if(v.y()<_min.y()) _min.y() = v.y();
|
||||
if(v.y()>_max.y()) _max.y() = v.y();
|
||||
|
||||
if(v.z()<_min.z()) _min.z() = v.z();
|
||||
if(v.z()>_max.z()) _max.z() = v.z();
|
||||
}
|
||||
|
||||
/** If the vertex is out-with the box expand to encompass vertex.
|
||||
If this box is empty then move set this box's min max to vertex. */
|
||||
inline void expandBy(float x,float y,float z)
|
||||
{
|
||||
if(x<_min.x()) _min.x() = x;
|
||||
if(x>_max.x()) _max.x() = x;
|
||||
|
||||
if(y<_min.y()) _min.y() = y;
|
||||
if(y>_max.y()) _max.y() = y;
|
||||
|
||||
if(x<_min.z()) _min.z() = x;
|
||||
if(x>_max.z()) _max.z() = x;
|
||||
}
|
||||
|
||||
/** If incoming box is out-with the box expand to encompass incoming box.
|
||||
If this box is empty then move set this box to incoming box. */
|
||||
|
||||
@@ -292,7 +292,7 @@ class SG_EXPORT Drawable : public Object
|
||||
|
||||
/** compute the bounding box of the drawable. Method must be
|
||||
implemented by subclasses.*/
|
||||
virtual const bool computeBound() const = 0;
|
||||
virtual const bool computeBound() const;
|
||||
|
||||
void addParent(osg::Node* node);
|
||||
void removeParent(osg::Node* node);
|
||||
|
||||
@@ -103,7 +103,7 @@ class SG_EXPORT Geometry : public Drawable
|
||||
|
||||
virtual ~Geometry();
|
||||
|
||||
virtual const bool computeBound() const;
|
||||
//virtual const bool computeBound() const;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user