Add particles for Cast + Hit. Not looking quite right yet.

This commit is contained in:
scrawl 2013-11-11 23:43:28 +01:00
parent 6f3d737498
commit ffdb91bb21
8 changed files with 113 additions and 19 deletions

View file

@ -64,8 +64,8 @@ struct MagicEffect
MEDTstruct mData;
std::string mIcon, mParticle; // Textures
std::string mCasting, mHit, mArea; // Statics
std::string mBolt; // Weapon
std::string mCasting, mHit, mArea; // ESM::Static
std::string mBolt; // ESM::Weapon
std::string mCastSound, mBoltSound, mHitSound, mAreaSound; // Sounds
std::string mDescription;

View file

@ -54,6 +54,7 @@ private:
float mFrequency;
float mPhase;
float mStartTime;
public:
float mStopTime;
public:
@ -468,7 +469,10 @@ class NIFObjectLoader
Ogre::ControllerManager::getSingleton().getFrameTimeSource() :
Ogre::ControllerValueRealPtr());
Ogre::ControllerValueRealPtr dstval(OGRE_NEW UVController::Value(material, uv->data.getPtr()));
Ogre::ControllerFunctionRealPtr func(OGRE_NEW UVController::Function(uv, (animflags&Nif::NiNode::AnimFlag_AutoPlay)));
UVController::Function* function = OGRE_NEW UVController::Function(uv, (animflags&Nif::NiNode::AnimFlag_AutoPlay));
objectlist.mMaxControllerLength = std::max(function->mStopTime, objectlist.mMaxControllerLength);
Ogre::ControllerFunctionRealPtr func(function);
objectlist.mControllers.push_back(Ogre::Controller<Ogre::Real>(srcval, dstval, func));
}
@ -481,7 +485,10 @@ class NIFObjectLoader
Ogre::ControllerManager::getSingleton().getFrameTimeSource() :
Ogre::ControllerValueRealPtr());
Ogre::ControllerValueRealPtr dstval(OGRE_NEW GeomMorpherController::Value(subent, geom->data.getPtr()));
Ogre::ControllerFunctionRealPtr func(OGRE_NEW GeomMorpherController::Function(geom, (animflags&Nif::NiNode::AnimFlag_AutoPlay)));
GeomMorpherController::Function* function = OGRE_NEW GeomMorpherController::Function(geom, (animflags&Nif::NiNode::AnimFlag_AutoPlay));
objectlist.mMaxControllerLength = std::max(function->mStopTime, objectlist.mMaxControllerLength);
Ogre::ControllerFunctionRealPtr func(function);
objectlist.mControllers.push_back(Ogre::Controller<Ogre::Real>(srcval, dstval, func));
}
@ -616,7 +623,11 @@ class NIFObjectLoader
Ogre::ControllerManager::getSingleton().getFrameTimeSource() :
Ogre::ControllerValueRealPtr());
Ogre::ControllerValueRealPtr dstval(OGRE_NEW ParticleSystemController::Value(partsys, partctrl));
Ogre::ControllerFunctionRealPtr func(OGRE_NEW ParticleSystemController::Function(partctrl, (partflags&Nif::NiNode::ParticleFlag_AutoPlay)));
ParticleSystemController::Function* function =
OGRE_NEW ParticleSystemController::Function(partctrl, (partflags&Nif::NiNode::ParticleFlag_AutoPlay));
objectlist.mMaxControllerLength = std::max(function->mStopTime, objectlist.mMaxControllerLength);
Ogre::ControllerFunctionRealPtr func(function);
objectlist.mControllers.push_back(Ogre::Controller<Ogre::Real>(srcval, dstval, func));
}
@ -648,7 +659,10 @@ class NIFObjectLoader
Ogre::ControllerManager::getSingleton().getFrameTimeSource() :
Ogre::ControllerValueRealPtr());
Ogre::ControllerValueRealPtr dstval(OGRE_NEW VisController::Value(trgtbone, vis->data.getPtr()));
Ogre::ControllerFunctionRealPtr func(OGRE_NEW VisController::Function(vis, (animflags&Nif::NiNode::AnimFlag_AutoPlay)));
VisController::Function* function = OGRE_NEW VisController::Function(vis, (animflags&Nif::NiNode::AnimFlag_AutoPlay));
objectlist.mMaxControllerLength = std::max(function->mStopTime, objectlist.mMaxControllerLength);
Ogre::ControllerFunctionRealPtr func(function);
objectlist.mControllers.push_back(Ogre::Controller<Ogre::Real>(srcval, dstval, func));
}
@ -663,7 +677,9 @@ class NIFObjectLoader
Ogre::ControllerManager::getSingleton().getFrameTimeSource() :
Ogre::ControllerValueRealPtr());
Ogre::ControllerValueRealPtr dstval(OGRE_NEW KeyframeController::Value(trgtbone, key->data.getPtr()));
Ogre::ControllerFunctionRealPtr func(OGRE_NEW KeyframeController::Function(key, (animflags&Nif::NiNode::AnimFlag_AutoPlay)));
KeyframeController::Function* function = OGRE_NEW KeyframeController::Function(key, (animflags&Nif::NiNode::AnimFlag_AutoPlay));
objectlist.mMaxControllerLength = std::max(function->mStopTime, objectlist.mMaxControllerLength);
Ogre::ControllerFunctionRealPtr func(function);
objectlist.mControllers.push_back(Ogre::Controller<Ogre::Real>(srcval, dstval, func));
}

View file

@ -45,11 +45,14 @@ struct ObjectList {
std::vector<Ogre::ParticleSystem*> mParticles;
std::vector<Ogre::Light*> mLights;
// The maximum length on any of the controllers. For animations with controllers, but no text keys, consider this the animation length.
float mMaxControllerLength;
std::map<int,TextKeyMap> mTextKeys;
std::vector<Ogre::Controller<Ogre::Real> > mControllers;
ObjectList() : mSkelBase(0)
ObjectList() : mSkelBase(0), mMaxControllerLength(0)
{ }
};