15 #ifndef OSGANIMATION_RIGTRANSFORM_SOFTWARE
16 #define OSGANIMATION_RIGTRANSFORM_SOFTWARE 1
18 #include <osgAnimation/Export>
19 #include <osgAnimation/RigTransform>
20 #include <osgAnimation/Bone>
21 #include <osgAnimation/VertexInfluence>
22 #include <osg/observer_ptr>
61 _result.set(0, 0, 0, 0,
71 ptrresult[0] += ptr[0] * weight;
72 ptrresult[1] += ptr[1] * weight;
73 ptrresult[2] += ptr[2] * weight;
75 ptrresult[4] += ptr[4] * weight;
76 ptrresult[5] += ptr[5] * weight;
77 ptrresult[6] += ptr[6] * weight;
79 ptrresult[8] += ptr[8] * weight;
80 ptrresult[9] += ptr[9] * weight;
81 ptrresult[10] += ptr[10] * weight;
83 ptrresult[12] += ptr[12] * weight;
84 ptrresult[13] += ptr[13] * weight;
85 ptrresult[14] += ptr[14] * weight;
91 osg::notify(
osg::WARN) <<
this <<
" RigTransformSoftware::UniqBoneSetVertexSet no bones found" << std::endl;
97 int size = _bones.size();
98 for (
int i = 0; i < size; i++)
100 const Bone* bone = _bones[i].getBone();
103 osg::notify(
osg::WARN) <<
this <<
" RigTransformSoftware::computeMatrixForVertexSet Warning a bone is null, skip it" << std::endl;
109 accummulateMatrix(invBindMatrix, matrix, w);
124 int size = _boneSetVertexSet.size();
125 for (
int i = 0; i < size; i++)
132 int vertexSize = vertexes.size();
133 for (
int j = 0; j < vertexSize; j++)
135 int idx = vertexes[j];
136 dst[idx] = src[idx] * matrix;
144 int size = _boneSetVertexSet.size();
145 for (
int i = 0; i < size; i++)
152 int vertexSize = vertexes.size();
153 for (
int j = 0; j < vertexSize; j++)
155 int idx = vertexes[j];
#define OSGANIMATION_EXPORT
static Matrixd identity(void)
static Vec3f transform3x3(const Vec3f &v, const Matrixd &m)
const osg::Matrix & getInvBindMatrixInSkeletonSpace() const
std::map< std::string, osg::ref_ptr< Bone > > BoneMap
const osg::Matrix & getMatrixInSkeletonSpace() const
std::vector< UniqVertexSetToBoneSet > UniqVertexSetToBoneSetList
OSG_EXPORT std::ostream & notify(const NotifySeverity severity)