total removal of the old path
This commit is contained in:
@@ -69,14 +69,8 @@ namespace osgAnimation
|
||||
void setNeedToComputeMatrix(bool state) { _needToComputeMatrix = state;}
|
||||
bool getNeedToComputeMatrix() const { return _needToComputeMatrix;}
|
||||
|
||||
|
||||
// this build the internal database about vertex influence and bones
|
||||
void buildVertexInfluenceSet();
|
||||
inline const VertexInfluenceSet& getVertexInfluenceSet() const { return _vertexInfluenceSet;}
|
||||
|
||||
void computeMatrixFromRootSkeleton();
|
||||
|
||||
|
||||
// set implementation of rig method
|
||||
inline RigTransform* getRigTransformImplementation() { return _rigTransformImplementation.get(); }
|
||||
inline void setRigTransformImplementation(RigTransform* rig) { _rigTransformImplementation = rig; }
|
||||
@@ -87,7 +81,6 @@ namespace osgAnimation
|
||||
const osg::Matrix& getMatrixFromSkeletonToGeometry() const;
|
||||
const osg::Matrix& getInvMatrixFromSkeletonToGeometry() const;
|
||||
|
||||
|
||||
inline osg::Geometry* getSourceGeometry() { return _geometry.get(); }
|
||||
inline const osg::Geometry* getSourceGeometry() const { return _geometry.get(); }
|
||||
inline void setSourceGeometry(osg::Geometry* geometry) { _geometry = geometry; }
|
||||
@@ -112,7 +105,6 @@ namespace osgAnimation
|
||||
osg::ref_ptr<osg::Geometry> _geometry;
|
||||
osg::ref_ptr<RigTransform> _rigTransformImplementation;
|
||||
|
||||
VertexInfluenceSet _vertexInfluenceSet;
|
||||
osg::ref_ptr<VertexInfluenceMap> _vertexInfluenceMap;
|
||||
|
||||
osg::Matrix _matrixFromSkeletonToGeometry;
|
||||
|
||||
@@ -67,62 +67,6 @@ namespace osgAnimation
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
// this class manage VertexInfluence database by mesh
|
||||
// reference bones per vertex ...
|
||||
class OSGANIMATION_EXPORT VertexInfluenceSet
|
||||
{
|
||||
public:
|
||||
typedef std::vector<BoneInfluenceList> BoneToVertexList;
|
||||
|
||||
class BoneWeight
|
||||
{
|
||||
public:
|
||||
BoneWeight(const std::string& name, float weight) : _boneName(name), _weight(weight) {}
|
||||
BoneWeight(const BoneWeight &bw2) : _boneName(bw2._boneName), _weight(bw2._weight) {}
|
||||
const std::string& getBoneName() const { return _boneName; }
|
||||
float getWeight() const { return _weight; }
|
||||
void setWeight(float weight) { _weight = weight; }
|
||||
bool operator==(const BoneWeight& b) const { return (_boneName == b.getBoneName() && _weight == b.getWeight()); }
|
||||
|
||||
protected:
|
||||
std::string _boneName;
|
||||
float _weight;
|
||||
};
|
||||
|
||||
typedef std::vector<BoneWeight> BoneWeightList;
|
||||
typedef std::vector<BoneWeightList> VertIDToBoneWeightList;
|
||||
|
||||
class VertexGroup
|
||||
{
|
||||
public:
|
||||
// set Influences of the VertexGroup
|
||||
void setBones(BoneWeightList& bones) { _bones = bones;}
|
||||
const BoneWeightList& getBones() const { return _bones;}
|
||||
// set Vertex Indices of the VertexGroup
|
||||
std::vector<unsigned int>& getVertexes() { return _vertexes;}
|
||||
const std::vector<unsigned int>& getVertexes() const { return _vertexes;}
|
||||
protected:
|
||||
std::vector<unsigned int> _vertexes;
|
||||
BoneWeightList _bones; // here we could limit matrix operation by caching (weight * matrix)
|
||||
};
|
||||
|
||||
typedef std::vector<VertexGroup> UniqVertexGroupList;
|
||||
/** construct a vector of unique VertexGroups and their influences**/
|
||||
void buildUniqVertexGroupList();
|
||||
/** return a list of unique VertexGroups and their influences**/
|
||||
const UniqVertexGroupList& getUniqVertexGroupList() const { return _uniqVertexSetToBoneSet;}
|
||||
void addVertexInfluence(const BoneInfluenceList& v);
|
||||
void buildVertex2BoneList(unsigned int numvertices);
|
||||
void clear();
|
||||
|
||||
const VertIDToBoneWeightList& getVertexToBoneList() const;
|
||||
protected:
|
||||
BoneToVertexList _bone2Vertexes;
|
||||
VertIDToBoneWeightList _vertex2Bones;
|
||||
UniqVertexGroupList _uniqVertexSetToBoneSet;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user