1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 06:53:52 +00:00

Fix VisController in ascended sleeper's death animation

This commit is contained in:
scrawl 2014-01-31 01:17:51 +01:00
parent da34f8bda1
commit 305a471c5a

View file

@ -311,15 +311,10 @@ public:
static void setVisible(Ogre::Node *node, int vis) static void setVisible(Ogre::Node *node, int vis)
{ {
Ogre::Node::ChildNodeIterator iter = node->getChildIterator(); // Skinned meshes are attached to the scene node, not the bone.
while(iter.hasMoreElements()) // We use the Node's user data to connect it with the mesh.
{
node = iter.getNext();
setVisible(node, vis);
// Skinned meshes and particle systems are attached to the scene node, not the bone.
// We use the Node's user data to connect it with the mesh / particle system.
Ogre::Any customData = node->getUserObjectBindings().getUserAny(); Ogre::Any customData = node->getUserObjectBindings().getUserAny();
if (!customData.isEmpty()) if (!customData.isEmpty())
Ogre::any_cast<Ogre::MovableObject*>(customData)->setVisible(vis); Ogre::any_cast<Ogre::MovableObject*>(customData)->setVisible(vis);
@ -330,6 +325,12 @@ public:
if(obj != NULL) if(obj != NULL)
obj->setVisible(vis); obj->setVisible(vis);
} }
Ogre::Node::ChildNodeIterator iter = node->getChildIterator();
while(iter.hasMoreElements())
{
node = iter.getNext();
setVisible(node, vis);
} }
} }
@ -621,17 +622,16 @@ class NIFObjectLoader
scene->mEntities.push_back(entity); scene->mEntities.push_back(entity);
if(scene->mSkelBase) if(scene->mSkelBase)
{
if(entity->hasSkeleton())
entity->shareSkeletonInstanceWith(scene->mSkelBase);
else
{ {
int trgtid = NIFSkeletonLoader::lookupOgreBoneHandle(name, shape->recIndex); int trgtid = NIFSkeletonLoader::lookupOgreBoneHandle(name, shape->recIndex);
Ogre::Bone *trgtbone = scene->mSkelBase->getSkeleton()->getBone(trgtid); Ogre::Bone *trgtbone = scene->mSkelBase->getSkeleton()->getBone(trgtid);
trgtbone->getUserObjectBindings().setUserAny(Ogre::Any(static_cast<Ogre::MovableObject*>(entity))); trgtbone->getUserObjectBindings().setUserAny(Ogre::Any(static_cast<Ogre::MovableObject*>(entity)));
if(entity->hasSkeleton())
entity->shareSkeletonInstanceWith(scene->mSkelBase);
else
scene->mSkelBase->attachObjectToBone(trgtbone->getName(), entity); scene->mSkelBase->attachObjectToBone(trgtbone->getName(), entity);
} }
}
Nif::ControllerPtr ctrl = node->controller; Nif::ControllerPtr ctrl = node->controller;
while(!ctrl.empty()) while(!ctrl.empty())