|
|
|
@ -644,7 +644,7 @@ void NIFLoader::handleNiTriShape(NiTriShape *shape, int flags, BoundsFinder &bou
|
|
|
|
|
it != boneList.end(); it++)
|
|
|
|
|
{
|
|
|
|
|
//get the bone from bones array of skindata
|
|
|
|
|
bonePtr = skel->getBone(shape->skin->bones[boneIndex].name.toString());
|
|
|
|
|
bonePtr = mSkel->getBone(shape->skin->bones[boneIndex].name.toString());
|
|
|
|
|
|
|
|
|
|
// final_vector = old_vector + old_rotation*new_vector*old_scale
|
|
|
|
|
vecPos = bonePtr->_getDerivedPosition() +
|
|
|
|
@ -767,7 +767,7 @@ void NIFLoader::handleNode(Nif::Node *node, int flags,
|
|
|
|
|
//FIXME: "Bip01" isn't every time the root bone
|
|
|
|
|
if (node->name == "Bip01" || node->name == "Root Bone") //root node, create a skeleton
|
|
|
|
|
{
|
|
|
|
|
skel = SkeletonManager::getSingleton().create(getSkeletonName(), resourceGroup, true);
|
|
|
|
|
mSkel = SkeletonManager::getSingleton().create(getSkeletonName(), resourceGroup, true);
|
|
|
|
|
|
|
|
|
|
/*if (node->extra->recType == RC_NiTextKeyExtraData )
|
|
|
|
|
{
|
|
|
|
@ -776,16 +776,16 @@ void NIFLoader::handleNode(Nif::Node *node, int flags,
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!skel.isNull()) //if there is a skeleton
|
|
|
|
|
if (!mSkel.isNull()) //if there is a skeleton
|
|
|
|
|
{
|
|
|
|
|
std::string name = node->name.toString();
|
|
|
|
|
//if (isBeast && isChest)
|
|
|
|
|
// std::cout << "NAME: " << name << "\n";
|
|
|
|
|
// Quick-n-dirty workaround for the fact that several
|
|
|
|
|
// bones may have the same name.
|
|
|
|
|
if(!skel->hasBone(name))
|
|
|
|
|
if(!mSkel->hasBone(name))
|
|
|
|
|
{
|
|
|
|
|
bone = skel->createBone(name);
|
|
|
|
|
bone = mSkel->createBone(name);
|
|
|
|
|
|
|
|
|
|
if (parentBone)
|
|
|
|
|
parentBone->addChild(bone);
|
|
|
|
@ -1017,7 +1017,7 @@ void NIFLoader::loadResource(Resource *resource)
|
|
|
|
|
//cout << "THISNAME: " << ptr->getName() << "\n";
|
|
|
|
|
//cout << "RESOURCE:"<< resource->getName();
|
|
|
|
|
mesh = 0;
|
|
|
|
|
skel.setNull();
|
|
|
|
|
mSkel.setNull();
|
|
|
|
|
|
|
|
|
|
// Set up the VFS if it hasn't been done already
|
|
|
|
|
if (!vfs) vfs = new OgreVFS(resourceGroup);
|
|
|
|
|