Added support for serailizing and scripting BoundingBox and BoundingSphere objects

This commit is contained in:
Robert Osfield
2014-02-10 16:44:13 +00:00
parent 3dcca431a9
commit 31e98b51df
15 changed files with 405 additions and 53 deletions

View File

@@ -16,6 +16,8 @@
#include <osg/Object>
#include <osg/UserDataContainer>
#include <osg/BoundingBox>
#include <osg/BoundingSphere>
namespace osg {
@@ -65,6 +67,10 @@ class ValueObject : public Object
virtual void apply(const osg::Plane& /*value*/) {}
virtual void apply(const osg::Matrixf& /*value*/) {}
virtual void apply(const osg::Matrixd& /*value*/) {}
virtual void apply(const osg::BoundingBoxf& /*value*/) {}
virtual void apply(const osg::BoundingBoxd& /*value*/) {}
virtual void apply(const osg::BoundingSpheref& /*value*/) {}
virtual void apply(const osg::BoundingSphered& /*value*/) {}
};
class SetValueVisitor
@@ -91,6 +97,10 @@ class ValueObject : public Object
virtual void apply(osg::Plane& /*value*/) {}
virtual void apply(osg::Matrixf& /*value*/) {}
virtual void apply(osg::Matrixd& /*value*/) {}
virtual void apply(osg::BoundingBoxf& /*value*/) {}
virtual void apply(osg::BoundingBoxd& /*value*/) {}
virtual void apply(osg::BoundingSpheref& /*value*/) {}
virtual void apply(osg::BoundingSphered& /*value*/) {}
};
virtual bool get(GetValueVisitor& /*gvv*/) const { return false; }
@@ -168,6 +178,10 @@ META_ValueObject(Quat, QuatValueObject)
META_ValueObject(Plane, PlaneValueObject)
META_ValueObject(Matrixf, MatrixfValueObject)
META_ValueObject(Matrixd, MatrixdValueObject)
META_ValueObject(BoundingBoxf, BoundingBoxfValueObject)
META_ValueObject(BoundingBoxd, BoundingBoxdValueObject)
META_ValueObject(BoundingSpheref, BoundingSpherefValueObject)
META_ValueObject(BoundingSphered, BoundingSpheredValueObject)
/** provide implementation of osg::Object::getUserValue(..) template*/
template<typename T>