1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-01 23:45:31 +00:00

Pass the movement vector in as a parameter to CharacterController::update

This commit is contained in:
Chris Robinson 2013-03-30 18:37:40 -07:00
parent 63af72c315
commit af65ecd841
4 changed files with 8 additions and 8 deletions

View file

@ -56,7 +56,10 @@ void Activators::update(float duration, bool paused)
if(!paused)
{
for(PtrControllerMap::iterator iter(mActivators.begin());iter != mActivators.end();++iter)
iter->second.update(duration);
{
Ogre::Vector3 movement(0.0f);
iter->second.update(duration, movement);
}
}
}

View file

@ -266,7 +266,8 @@ namespace MWMechanics
for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();++iter)
{
Ogre::Vector3 movement = iter->second.update(duration);
Ogre::Vector3 movement(0.0f);
iter->second.update(duration, movement);
mMovement.push_back(std::make_pair(iter->first, movement));
}
MWBase::Environment::get().getWorld()->doPhysics(mMovement, duration);

View file

@ -168,10 +168,8 @@ void CharacterController::markerEvent(float time, const std::string &evt)
}
Ogre::Vector3 CharacterController::update(float duration)
void CharacterController::update(float duration, Ogre::Vector3 &movement)
{
Ogre::Vector3 movement(0.0f);
float speed = 0.0f;
if(!(getState() >= CharState_Death1))
{
@ -240,8 +238,6 @@ Ogre::Vector3 CharacterController::update(float duration)
movement += mAnimation->runAnimation(duration);
}
mSkipAnim = false;
return movement;
}

View file

@ -87,7 +87,7 @@ public:
void updatePtr(const MWWorld::Ptr &ptr);
Ogre::Vector3 update(float duration);
void update(float duration, Ogre::Vector3 &movement);
void playGroup(const std::string &groupname, int mode, int count);
void skipAnim();