1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-21 11:39:41 +00:00

Fixing errors

This commit is contained in:
Jason Hooks 2012-03-05 17:46:29 -05:00
parent a81ecb5f65
commit 9848b67174
3 changed files with 10 additions and 9 deletions

View file

@ -331,7 +331,7 @@ namespace MWRender{
} }
} }
bool Animation::timeIndex( float time, std::vector<float>& times, int & i, int & j, float & x ){ bool Animation::timeIndex( float time, std::vector<float> & times, int & i, int & j, float & x ){
int count; int count;
if ( (count = times.size()) > 0 ) if ( (count = times.size()) > 0 )
{ {
@ -427,19 +427,19 @@ namespace MWRender{
float x; float x;
float x2; float x2;
std::vector<Ogre::Quaternion>& quats = iter->getQuat(); std::vector<Ogre::Quaternion> & quats = iter->getQuat();
std::vector<float>& ttime = iter->gettTime(); std::vector<float> & ttime = iter->gettTime();
std::vector<float>& rtime = iter->getrTime(); std::vector<float> & rtime = iter->getrTime();
int rindexJ = rindexI[slot]; int rindexJ = rindexI[slot];
timeIndex(time, rtime, rindexI[slot], rindexJ, x2); timeIndex(time, rtime, rindexI[slot], rindexJ, x2);
int tindexJ = tindexI[slot]; int tindexJ = tindexI[slot];
std::vector<Ogre::Vector3>& translist1 = iter->getTranslist1(); std::vector<Ogre::Vector3> & translist1 = iter->getTranslist1();
timeIndex(time, ttime, tindexI[slot], tindexJ, x); timeIndex(time, ttime, tindexI[slot], tindexJ, x);

View file

@ -28,8 +28,7 @@ class Animation{
MWWorld::Environment& mEnvironment; MWWorld::Environment& mEnvironment;
std::map<Nif::NiSkinData::BoneInfoCopy*, PosAndRot> vecRotPos; std::map<Nif::NiSkinData::BoneInfoCopy*, PosAndRot> vecRotPos;
static std::map<std::string, int> mUniqueIDs; static std::map<std::string, int> mUniqueIDs;
float oldHund;
bool samePlace;
std::vector<std::vector<Nif::NiTriShapeCopy>* > shapeparts; //All the NiTriShape data that we need for animating an npc std::vector<std::vector<Nif::NiTriShapeCopy>* > shapeparts; //All the NiTriShape data that we need for animating an npc
@ -57,11 +56,11 @@ class Animation{
Ogre::Entity* base; Ogre::Entity* base;
void handleShapes(std::vector<Nif::NiTriShapeCopy>* allshapes, Ogre::Entity* creaturemodel, Ogre::SkeletonInstance *skel); void handleShapes(std::vector<Nif::NiTriShapeCopy>* allshapes, Ogre::Entity* creaturemodel, Ogre::SkeletonInstance *skel);
void handleAnimationTransforms(); void handleAnimationTransforms();
bool timeIndex( float time, std::vector<float>& times, int & i, int & j, float & x ); bool timeIndex( float time, std::vector<float> & times, int & i, int & j, float & x );
std::string getUniqueID(std::string mesh); std::string getUniqueID(std::string mesh);
public: public:
Animation(MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend): mRend(_rend), mEnvironment(_env), animate(0), oldHund(0){}; Animation(MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend): mRend(_rend), mEnvironment(_env), animate(0){};
virtual void runAnimation(float timepassed) = 0; virtual void runAnimation(float timepassed) = 0;
void startScript(std::string groupname, int mode, int loops); void startScript(std::string groupname, int mode, int loops);
void stopScript(); void stopScript();

View file

@ -1328,6 +1328,8 @@ void NIFLoader::loadResource(Resource *resource)
(*iter)->addBoneAssignment(vba); (*iter)->addBoneAssignment(vba);
} }
//Don't link on npc parts to eliminate redundant skeletons
//Will have to be changed later slightly for robes/skirts
if(triname == "") if(triname == "")
mesh->_notifySkeleton(mSkel); mesh->_notifySkeleton(mSkel);
} }