16#ifndef OSGANIMATION_RIGTRANSFORM_SOFTWARE
17#define OSGANIMATION_RIGTRANSFORM_SOFTWARE 1
49 inline const float &
getWeight()
const {
return second; }
51 inline const unsigned int &
getBoneID()
const {
return first; }
54 if (second > b1.second)
return true;
55 if (second < b1.second)
return false;
56 return (first > b1.first);
87 ptrresult[0] += ptr[0] * weight;
88 ptrresult[1] += ptr[1] * weight;
89 ptrresult[2] += ptr[2] * weight;
91 ptrresult[4] += ptr[4] * weight;
92 ptrresult[5] += ptr[5] * weight;
93 ptrresult[6] += ptr[6] * weight;
95 ptrresult[8] += ptr[8] * weight;
96 ptrresult[9] += ptr[9] * weight;
97 ptrresult[10] += ptr[10] * weight;
99 ptrresult[12] += ptr[12] * weight;
100 ptrresult[13] += ptr[13] * weight;
101 ptrresult[14] += ptr[14] * weight;
107 osg::notify(
osg::WARN) <<
this <<
" RigTransformSoftware::VertexGroup no bones found" << std::endl;
115 const Bone* bone = bwit->getBonePtr();
118 osg::notify(
osg::WARN) <<
this <<
" RigTransformSoftware::computeMatrixForVertexSet Warning a bone is null, skip it" << std::endl;
146 for(IndexList::const_iterator vertIDit=vertices.begin(); vertIDit!=vertices.end(); ++vertIDit)
148 dst[*vertIDit] = src[*vertIDit] * matrix;
164 for(IndexList::const_iterator vertIDit=vertices.begin(); vertIDit!=vertices.end(); ++vertIDit)
@ WARN
Definition Notify:33
Matrixd Matrix
Definition Matrix:27
std::ostream & notify(void)
Definition Notify:80
The osgAnimation library provides general purpose utility classes for animation.
Definition Action:34
std::vector< unsigned int > IndexList
Definition VertexInfluence:38
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
static Vec3f transform3x3(const Vec3f &v, const Matrixd &m)
apply a 3x3 transform of v*M[0..2,0..2].
Definition Matrixd:665
value_type * ptr()
Definition Matrixd:92
double value_type
Definition Matrixd:30
static Matrixd identity(void)
Definition Matrixd:444
Smart pointer for observed objects, that automatically set pointers to them to null when they are del...
Definition observer_ptr:39
const osg::Matrix & getInvBindMatrixInSkeletonSpace() const
Definition Bone:46
const osg::Matrix & getMatrixInSkeletonSpace() const
Definition Bone:45
Definition RigGeometry:50
RigTransform()
Definition RigTransform:28
bool _needInit
Definition RigTransformSoftware:173
void compute(const osg::Matrix &transform, const osg::Matrix &invTransform, const V *src, V *dst)
Definition RigTransformSoftware:136
std::map< std::string, bool > _invalidInfluence
Definition RigTransformSoftware:177
void buildMinimumUpdateSet(const RigGeometry &rig)
std::pair< unsigned int, float > LocalBoneIDWeight
Definition RigTransformSoftware:43
virtual bool init(RigGeometry &)
virtual bool prepareData(RigGeometry &)
to call manually when a skeleton is reacheable from the rig in order to prepare technic data before r...
std::vector< BonePtrWeight > BonePtrWeightList
Definition RigTransformSoftware:65
META_Object(osgAnimation, RigTransformSoftware) virtual void operator()(RigGeometry &)
void computeNormal(const osg::Matrix &transform, const osg::Matrix &invTransform, const V *src, V *dst)
Definition RigTransformSoftware:155
std::vector< VertexGroup > VertexGroupList
Definition RigTransformSoftware:179
VertexGroupList _uniqVertexGroupList
Definition RigTransformSoftware:180
RigTransformSoftware(const RigTransformSoftware &rts, const osg::CopyOp ©op)
void setBoneID(unsigned int b)
Definition RigTransformSoftware:52
osg::observer_ptr< Bone > _boneptr
Definition RigTransformSoftware:62
BonePtrWeight(const BonePtrWeight &bw2)
Definition RigTransformSoftware:48
BonePtrWeight(unsigned int id, float weight, Bone *bone=0)
Definition RigTransformSoftware:47
void setBonePtr(Bone *b)
Definition RigTransformSoftware:60
const float & getWeight() const
Definition RigTransformSoftware:49
const Bone * getBonePtr() const
set Bone pointer
Definition RigTransformSoftware:59
const unsigned int & getBoneID() const
Definition RigTransformSoftware:51
void setWeight(float b)
Definition RigTransformSoftware:50
map a set of boneinfluence to a list of vertex indices sharing this set
Definition RigTransformSoftware:69
BonePtrWeightList _boneweights
Definition RigTransformSoftware:130
IndexList & getVertices()
Definition RigTransformSoftware:73
osg::Matrix _result
Definition RigTransformSoftware:132
const osg::Matrix & getMatrix() const
Definition RigTransformSoftware:128
void accummulateMatrix(const osg::Matrix &invBindMatrix, const osg::Matrix &matrix, osg::Matrix::value_type weight)
Definition RigTransformSoftware:82
IndexList _vertexes
Definition RigTransformSoftware:131
BonePtrWeightList & getBoneWeights()
Definition RigTransformSoftware:71
void computeMatrixForVertexSet()
Definition RigTransformSoftware:103
void resetMatrix()
Definition RigTransformSoftware:75
#define OSGANIMATION_EXPORT
Definition Export:40