mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 07:23:51 +00:00
Fix VisController in ascended sleeper's death animation
This commit is contained in:
parent
da34f8bda1
commit
305a471c5a
1 changed files with 19 additions and 19 deletions
|
@ -311,25 +311,26 @@ public:
|
||||||
|
|
||||||
static void setVisible(Ogre::Node *node, int vis)
|
static void setVisible(Ogre::Node *node, int vis)
|
||||||
{
|
{
|
||||||
|
// Skinned meshes are attached to the scene node, not the bone.
|
||||||
|
// We use the Node's user data to connect it with the mesh.
|
||||||
|
Ogre::Any customData = node->getUserObjectBindings().getUserAny();
|
||||||
|
|
||||||
|
if (!customData.isEmpty())
|
||||||
|
Ogre::any_cast<Ogre::MovableObject*>(customData)->setVisible(vis);
|
||||||
|
|
||||||
|
Ogre::TagPoint *tag = dynamic_cast<Ogre::TagPoint*>(node);
|
||||||
|
if(tag != NULL)
|
||||||
|
{
|
||||||
|
Ogre::MovableObject *obj = tag->getChildObject();
|
||||||
|
if(obj != NULL)
|
||||||
|
obj->setVisible(vis);
|
||||||
|
}
|
||||||
|
|
||||||
Ogre::Node::ChildNodeIterator iter = node->getChildIterator();
|
Ogre::Node::ChildNodeIterator iter = node->getChildIterator();
|
||||||
while(iter.hasMoreElements())
|
while(iter.hasMoreElements())
|
||||||
{
|
{
|
||||||
node = iter.getNext();
|
node = iter.getNext();
|
||||||
setVisible(node, vis);
|
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();
|
|
||||||
if (!customData.isEmpty())
|
|
||||||
Ogre::any_cast<Ogre::MovableObject*>(customData)->setVisible(vis);
|
|
||||||
|
|
||||||
Ogre::TagPoint *tag = dynamic_cast<Ogre::TagPoint*>(node);
|
|
||||||
if(tag != NULL)
|
|
||||||
{
|
|
||||||
Ogre::MovableObject *obj = tag->getChildObject();
|
|
||||||
if(obj != NULL)
|
|
||||||
obj->setVisible(vis);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -622,15 +623,14 @@ class NIFObjectLoader
|
||||||
scene->mEntities.push_back(entity);
|
scene->mEntities.push_back(entity);
|
||||||
if(scene->mSkelBase)
|
if(scene->mSkelBase)
|
||||||
{
|
{
|
||||||
|
int trgtid = NIFSkeletonLoader::lookupOgreBoneHandle(name, shape->recIndex);
|
||||||
|
Ogre::Bone *trgtbone = scene->mSkelBase->getSkeleton()->getBone(trgtid);
|
||||||
|
trgtbone->getUserObjectBindings().setUserAny(Ogre::Any(static_cast<Ogre::MovableObject*>(entity)));
|
||||||
|
|
||||||
if(entity->hasSkeleton())
|
if(entity->hasSkeleton())
|
||||||
entity->shareSkeletonInstanceWith(scene->mSkelBase);
|
entity->shareSkeletonInstanceWith(scene->mSkelBase);
|
||||||
else
|
else
|
||||||
{
|
|
||||||
int trgtid = NIFSkeletonLoader::lookupOgreBoneHandle(name, shape->recIndex);
|
|
||||||
Ogre::Bone *trgtbone = scene->mSkelBase->getSkeleton()->getBone(trgtid);
|
|
||||||
trgtbone->getUserObjectBindings().setUserAny(Ogre::Any(static_cast<Ogre::MovableObject*>(entity)));
|
|
||||||
scene->mSkelBase->attachObjectToBone(trgtbone->getName(), entity);
|
scene->mSkelBase->attachObjectToBone(trgtbone->getName(), entity);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Nif::ControllerPtr ctrl = node->controller;
|
Nif::ControllerPtr ctrl = node->controller;
|
||||||
|
|
Loading…
Reference in a new issue