Rolbacked RigGeometry with the hackyfix (I just add the compute boundcallback in the copy consturctor)
Modified headers of RigTransforms to comply with osg metamodel
This commit is contained in:
committed by
Robert Osfield
parent
4c149bd2e7
commit
c8a7ce4e52
@@ -15,14 +15,14 @@
|
||||
#ifndef OSGANIMATION_RIGTRANSFORM
|
||||
#define OSGANIMATION_RIGTRANSFORM 1
|
||||
|
||||
#include <osg/Referenced>
|
||||
#include <osg/Object>
|
||||
|
||||
namespace osgAnimation
|
||||
{
|
||||
|
||||
class RigGeometry;
|
||||
|
||||
class RigTransform : public osg::Referenced
|
||||
class RigTransform : public osg::Object
|
||||
{
|
||||
public:
|
||||
RigTransform() {}
|
||||
|
||||
@@ -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<osg::ref_ptr<osg::Vec4Array> > BoneWeightAttribList;
|
||||
@@ -48,7 +54,7 @@ namespace osgAnimation
|
||||
};
|
||||
typedef std::vector<std::vector<IndexWeightEntry> > VertexIndexWeightList;
|
||||
|
||||
RigTransformHardware();
|
||||
|
||||
|
||||
osg::Vec4Array* getVertexAttrib(int index);
|
||||
int getNumVertexAttrib();
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user