diff --git a/include/osgAnimation/RigTransform b/include/osgAnimation/RigTransform index 525d1c271..546957b97 100644 --- a/include/osgAnimation/RigTransform +++ b/include/osgAnimation/RigTransform @@ -15,14 +15,14 @@ #ifndef OSGANIMATION_RIGTRANSFORM #define OSGANIMATION_RIGTRANSFORM 1 -#include +#include namespace osgAnimation { class RigGeometry; - class RigTransform : public osg::Referenced + class RigTransform : public osg::Object { public: RigTransform() {} diff --git a/include/osgAnimation/RigTransformHardware b/include/osgAnimation/RigTransformHardware index f8dd86da2..af983df23 100644 --- a/include/osgAnimation/RigTransformHardware +++ b/include/osgAnimation/RigTransformHardware @@ -30,6 +30,12 @@ namespace osgAnimation class OSGANIMATION_EXPORT RigTransformHardware : public RigTransform { public: + + RigTransformHardware(); + RigTransformHardware(const RigTransformHardware&,const osg::CopyOp&){}; + + META_Object(osgAnimation,RigTransformHardware) + typedef osg::Matrix MatrixType; typedef osgAnimation::Bone BoneType; typedef std::vector > BoneWeightAttribList; @@ -48,7 +54,7 @@ namespace osgAnimation }; typedef std::vector > VertexIndexWeightList; - RigTransformHardware(); + osg::Vec4Array* getVertexAttrib(int index); int getNumVertexAttrib(); diff --git a/include/osgAnimation/RigTransformSoftware b/include/osgAnimation/RigTransformSoftware index ae4debd85..8fdb3ac6c 100644 --- a/include/osgAnimation/RigTransformSoftware +++ b/include/osgAnimation/RigTransformSoftware @@ -30,10 +30,12 @@ namespace osgAnimation class OSGANIMATION_EXPORT RigTransformSoftware : public RigTransform { public: - RigTransformSoftware(); - virtual void operator()(RigGeometry&); + RigTransformSoftware(const RigTransformSoftware&,const osg::CopyOp&){}; + META_Object(osgAnimation,RigTransformSoftware) + + virtual void operator()(RigGeometry&); class BoneWeight { diff --git a/src/osgAnimation/RigGeometry.cpp b/src/osgAnimation/RigGeometry.cpp index 522bad1b7..8829810b1 100644 --- a/src/osgAnimation/RigGeometry.cpp +++ b/src/osgAnimation/RigGeometry.cpp @@ -57,7 +57,8 @@ RigGeometry::RigGeometry() setDataVariance(osg::Object::DYNAMIC); _needToComputeMatrix = true; _matrixFromSkeletonToGeometry = _invMatrixFromSkeletonToGeometry = osg::Matrix::identity(); - + // disable the computation of boundingbox for the rig mesh + setComputeBoundingBoxCallback(new RigComputeBoundingBoxCallback); } @@ -68,9 +69,12 @@ RigGeometry::RigGeometry(const RigGeometry& b, const osg::CopyOp& copyop) : _vertexInfluenceSet(b._vertexInfluenceSet), _vertexInfluenceMap(b._vertexInfluenceMap), _needToComputeMatrix(b._needToComputeMatrix) -{ +{ + // disable the computation of boundingbox for the rig mesh + setComputeBoundingBoxCallback(new RigComputeBoundingBoxCallback); // we dont copy the RigImplementation yet. because the RigImplementation need to be initialized in a valid graph, with a skeleton ... // dont know yet what to do with a clone of a RigGeometry + } @@ -113,8 +117,6 @@ void RigGeometry::computeMatrixFromRootSkeleton() _matrixFromSkeletonToGeometry = mtxList[0] * osg::Matrix::inverse(notRoot); _invMatrixFromSkeletonToGeometry = osg::Matrix::inverse(_matrixFromSkeletonToGeometry); _needToComputeMatrix = false; - // disable the computation of boundingbox for the rig mesh - setComputeBoundingBoxCallback(new RigComputeBoundingBoxCallback); } void RigGeometry::update()