1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-02 03:15:35 +00:00

Return a movement vector from the character controller update

This commit is contained in:
Chris Robinson 2013-01-16 18:56:13 -08:00
parent daad8d9859
commit 685f219560
3 changed files with 4 additions and 4 deletions

View file

@ -265,8 +265,7 @@ namespace MWMechanics
std::vector<std::pair<std::string, Ogre::Vector3> > movement;
for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();++iter)
{
iter->second.update(duration);
Ogre::Vector3 vector = MWWorld::Class::get(iter->first).getMovementVector(iter->first);
Ogre::Vector3 vector = iter->second.update(duration);
if(vector!=Ogre::Vector3::ZERO)
movement.push_back(std::make_pair(iter->first.getRefData().getHandle(), vector));
}

View file

@ -69,10 +69,11 @@ void CharacterController::markerEvent(const std::string &evt)
}
void CharacterController::update(float duration)
Ogre::Vector3 CharacterController::update(float duration)
{
if(mAnimation)
mAnimation->runAnimation(duration);
return MWWorld::Class::get(mPtr).getMovementVector(mPtr);
}

View file

@ -33,7 +33,7 @@ public:
CharacterController(const MWWorld::Ptr &ptr, MWRender::Animation *anim, CharacterState state);
CharacterController(const CharacterController &rhs);
void update(float duration);
Ogre::Vector3 update(float duration);
void playGroup(const std::string &groupname, int mode, int count);
void skipAnim();