forked from mirror/openmw-tes3mp
Remove redundant and ambiguous NiNode::makeBone()
Ambiguous because a skeleton can have multiple skinned meshes, with their own bone weights/bind matrix each.
This commit is contained in:
parent
aba3c471a9
commit
9b27ec4945
3 changed files with 6 additions and 25 deletions
|
@ -23,13 +23,11 @@ void NiSkinInstance::post(NIFFile *nif)
|
||||||
if(bnum != data->bones.size())
|
if(bnum != data->bones.size())
|
||||||
nif->fail("Mismatch in NiSkinData bone count");
|
nif->fail("Mismatch in NiSkinData bone count");
|
||||||
|
|
||||||
root->makeRootBone(&data->trafo);
|
|
||||||
|
|
||||||
for(size_t i=0; i<bnum; i++)
|
for(size_t i=0; i<bnum; i++)
|
||||||
{
|
{
|
||||||
if(bones[i].empty())
|
if(bones[i].empty())
|
||||||
nif->fail("Oops: Missing bone! Don't know how to handle this.");
|
nif->fail("Oops: Missing bone! Don't know how to handle this.");
|
||||||
bones[i]->makeBone(i, data->bones[i]);
|
bones[i]->setBone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,8 +55,7 @@ public:
|
||||||
|
|
||||||
parent = NULL;
|
parent = NULL;
|
||||||
|
|
||||||
boneTrafo = NULL;
|
isBone = false;
|
||||||
boneIndex = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void post(NIFFile *nif)
|
void post(NIFFile *nif)
|
||||||
|
@ -69,27 +68,11 @@ public:
|
||||||
// NiNodes (or types derived from NiNodes) can be parents.
|
// NiNodes (or types derived from NiNodes) can be parents.
|
||||||
NiNode *parent;
|
NiNode *parent;
|
||||||
|
|
||||||
// Bone transformation. If set, node is a part of a skeleton.
|
bool isBone;
|
||||||
const Transformation *boneTrafo;
|
|
||||||
|
|
||||||
// Bone weight info, from NiSkinData
|
void setBone()
|
||||||
const NiSkinData::BoneInfo *boneInfo;
|
|
||||||
|
|
||||||
// Bone index. If -1, this node is either not a bone, or if
|
|
||||||
// boneTrafo is set it is the root bone in the skeleton.
|
|
||||||
short boneIndex;
|
|
||||||
|
|
||||||
void makeRootBone(const Transformation *tr)
|
|
||||||
{
|
{
|
||||||
boneTrafo = tr;
|
isBone = true;
|
||||||
boneIndex = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void makeBone(short ind, const NiSkinData::BoneInfo &bi)
|
|
||||||
{
|
|
||||||
boneInfo = &bi;
|
|
||||||
boneTrafo = &bi.trafo;
|
|
||||||
boneIndex = ind;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -542,7 +542,7 @@ namespace NifOsg
|
||||||
dataVariance = (nifNode->controller.empty() ? osg::Object::STATIC : osg::Object::DYNAMIC);
|
dataVariance = (nifNode->controller.empty() ? osg::Object::STATIC : osg::Object::DYNAMIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nifNode->boneTrafo || nifNode->boneIndex != -1)
|
if (nifNode->isBone)
|
||||||
dataVariance = osg::Object::DYNAMIC;
|
dataVariance = osg::Object::DYNAMIC;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue