1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-13 21:09:39 +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; std::vector<std::pair<std::string, Ogre::Vector3> > movement;
for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();++iter) for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();++iter)
{ {
iter->second.update(duration); Ogre::Vector3 vector = iter->second.update(duration);
Ogre::Vector3 vector = MWWorld::Class::get(iter->first).getMovementVector(iter->first);
if(vector!=Ogre::Vector3::ZERO) if(vector!=Ogre::Vector3::ZERO)
movement.push_back(std::make_pair(iter->first.getRefData().getHandle(), vector)); 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) if(mAnimation)
mAnimation->runAnimation(duration); 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 MWWorld::Ptr &ptr, MWRender::Animation *anim, CharacterState state);
CharacterController(const CharacterController &rhs); CharacterController(const CharacterController &rhs);
void update(float duration); Ogre::Vector3 update(float duration);
void playGroup(const std::string &groupname, int mode, int count); void playGroup(const std::string &groupname, int mode, int count);
void skipAnim(); void skipAnim();