Allow KeyFrameControllers on the RootCollisionNode and its children (Bug #1934)

deque
scrawl 10 years ago
parent 3ac04060c1
commit 4d6ebfb496

@ -1063,11 +1063,11 @@ class NIFObjectLoader
static void createObjects(const Nif::NIFFilePtr& nif, const std::string &name, const std::string &group, static void createObjects(const Nif::NIFFilePtr& nif, const std::string &name, const std::string &group,
Ogre::SceneNode *sceneNode, const Nif::Node *node, Ogre::SceneNode *sceneNode, const Nif::Node *node,
ObjectScenePtr scene, int flags, int animflags, int partflags) ObjectScenePtr scene, int flags, int animflags, int partflags, bool isRootCollisionNode=false)
{ {
// Do not create objects for the collision shape (includes all children) // Do not create objects for the collision shape (includes all children)
if(node->recType == Nif::RC_RootCollisionNode) if(node->recType == Nif::RC_RootCollisionNode)
return; isRootCollisionNode = true;
// Marker objects: just skip the entire node branch // Marker objects: just skip the entire node branch
/// \todo don't do this in the editor /// \todo don't do this in the editor
@ -1120,20 +1120,23 @@ class NIFObjectLoader
if(!node->controller.empty()) if(!node->controller.empty())
createNodeControllers(nif, name, node->controller, scene, animflags); createNodeControllers(nif, name, node->controller, scene, animflags);
if(node->recType == Nif::RC_NiCamera) if (!isRootCollisionNode)
{ {
/* Ignored */ if(node->recType == Nif::RC_NiCamera)
} {
/* Ignored */
}
if(node->recType == Nif::RC_NiTriShape && !(flags&0x80000000)) if(node->recType == Nif::RC_NiTriShape && !(flags&0x80000000))
{ {
createEntity(name, group, sceneNode->getCreator(), scene, node, flags, animflags); createEntity(name, group, sceneNode->getCreator(), scene, node, flags, animflags);
} }
if((node->recType == Nif::RC_NiAutoNormalParticles || if((node->recType == Nif::RC_NiAutoNormalParticles ||
node->recType == Nif::RC_NiRotatingParticles) && !(flags&0x40000000)) node->recType == Nif::RC_NiRotatingParticles) && !(flags&0x40000000))
{ {
createParticleSystem(name, group, sceneNode, scene, node, flags, partflags, animflags); createParticleSystem(name, group, sceneNode, scene, node, flags, partflags, animflags);
}
} }
const Nif::NiNode *ninode = dynamic_cast<const Nif::NiNode*>(node); const Nif::NiNode *ninode = dynamic_cast<const Nif::NiNode*>(node);
@ -1143,7 +1146,7 @@ class NIFObjectLoader
for(size_t i = 0;i < children.length();i++) for(size_t i = 0;i < children.length();i++)
{ {
if(!children[i].empty()) if(!children[i].empty())
createObjects(nif, name, group, sceneNode, children[i].getPtr(), scene, flags, animflags, partflags); createObjects(nif, name, group, sceneNode, children[i].getPtr(), scene, flags, animflags, partflags, isRootCollisionNode);
} }
} }
} }

Loading…
Cancel
Save