Recognize and partly handle NiBSParticleNode

actorid
Chris Robinson 12 years ago
parent f4695ec4ac
commit bf8bc989fc

@ -208,7 +208,7 @@ static const RecordFactoryEntry recordFactories [] = {
{ "NiNode", &construct <NiNode >, RC_NiNode },
{ "AvoidNode", &construct <NiNode >, RC_NiNode },
{ "NiBSParticleNode", &construct <NiNode >, RC_NiNode },
{ "NiBSParticleNode", &construct <NiNode >, RC_NiBSParticleNode },
{ "NiBSAnimationNode", &construct <NiNode >, RC_NiBSAnimationNode },
{ "NiBillboardNode", &construct <NiNode >, RC_NiNode },
{ "NiTriShape", &construct <NiTriShape >, RC_NiTriShape },

@ -39,6 +39,7 @@ enum RecordType
RC_NiTriShape,
RC_NiRotatingParticles,
RC_NiAutoNormalParticles,
RC_NiBSParticleNode,
RC_NiCamera,
RC_NiTexturingProperty,
RC_NiMaterialProperty,

@ -469,7 +469,7 @@ class NIFObjectLoader
static void createParticleSystem(const std::string &name, const std::string &group,
Ogre::SceneManager *sceneMgr, ObjectList &objectlist,
const Nif::Node *partnode, int flags, int animflags)
const Nif::Node *partnode, int flags, int partflags)
{
const Nif::NiAutoNormalParticlesData *particledata = NULL;
if(partnode->recType == Nif::RC_NiAutoNormalParticles)
@ -539,7 +539,7 @@ class NIFObjectLoader
static void createObjects(const std::string &name, const std::string &group,
Ogre::SceneManager *sceneMgr, const Nif::Node *node,
ObjectList &objectlist, int flags, int animflags)
ObjectList &objectlist, int flags, int animflags, int partflags)
{
// Do not create objects for the collision shape (includes all children)
if(node->recType == Nif::RC_RootCollisionNode)
@ -552,6 +552,8 @@ class NIFObjectLoader
if(node->recType == Nif::RC_NiBSAnimationNode)
animflags |= node->flags;
else if(node->recType == Nif::RC_NiBSParticleNode)
partflags |= node->flags;
else
flags |= node->flags;
@ -622,7 +624,7 @@ class NIFObjectLoader
if((node->recType == Nif::RC_NiAutoNormalParticles ||
node->recType == Nif::RC_NiRotatingParticles) && !(flags&0x40000000))
{
createParticleSystem(name, group, sceneMgr, objectlist, node, flags, animflags);
createParticleSystem(name, group, sceneMgr, objectlist, node, flags, partflags);
}
const Nif::NiNode *ninode = dynamic_cast<const Nif::NiNode*>(node);
@ -632,7 +634,7 @@ class NIFObjectLoader
for(size_t i = 0;i < children.length();i++)
{
if(!children[i].empty())
createObjects(name, group, sceneMgr, children[i].getPtr(), objectlist, flags, animflags);
createObjects(name, group, sceneMgr, children[i].getPtr(), objectlist, flags, animflags, partflags);
}
}
}
@ -679,7 +681,7 @@ public:
// Create a base skeleton entity if this NIF needs one
createSkelBase(name, group, sceneMgr, node, objectlist);
}
createObjects(name, group, sceneMgr, node, objectlist, flags, 0);
createObjects(name, group, sceneMgr, node, objectlist, flags, 0, 0);
}
};

@ -165,6 +165,7 @@ void NIFSkeletonLoader::buildBones(Ogre::Skeleton *skel, const Nif::Node *node,
node->recType == Nif::RC_RootCollisionNode || /* handled in nifbullet (hopefully) */
node->recType == Nif::RC_NiTriShape || /* Handled in the mesh loader */
node->recType == Nif::RC_NiBSAnimationNode || /* Handled in the object loader */
node->recType == Nif::RC_NiBSParticleNode ||
node->recType == Nif::RC_NiCamera ||
node->recType == Nif::RC_NiAutoNormalParticles ||
node->recType == Nif::RC_NiRotatingParticles

Loading…
Cancel
Save