mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-02 05:45:33 +00:00
Store the movement vector in the character controller
This commit is contained in:
parent
40f8e75763
commit
9235fba770
3 changed files with 14 additions and 1 deletions
|
@ -262,6 +262,12 @@ namespace MWMechanics
|
|||
|
||||
if(!paused)
|
||||
{
|
||||
for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();++iter)
|
||||
{
|
||||
Ogre::Vector3 dir = MWWorld::Class::get(iter->first).getMovementVector(iter->first);
|
||||
iter->second.setDirection(dir);
|
||||
}
|
||||
|
||||
std::vector<std::pair<std::string, Ogre::Vector3> > movement;
|
||||
for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();++iter)
|
||||
{
|
||||
|
|
|
@ -123,7 +123,7 @@ Ogre::Vector3 CharacterController::update(float duration)
|
|||
if(mAnimation && !mSkipAnim)
|
||||
mAnimation->runAnimation(duration);
|
||||
mSkipAnim = false;
|
||||
return MWWorld::Class::get(mPtr).getMovementVector(mPtr);
|
||||
return mDirection;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef GAME_MWMECHANICS_CHARACTER_HPP
|
||||
#define GAME_MWMECHANICS_CHARACTER_HPP
|
||||
|
||||
#include <OgreVector3.h>
|
||||
|
||||
#include "../mwworld/ptr.hpp"
|
||||
|
||||
namespace MWRender
|
||||
|
@ -27,6 +29,8 @@ class CharacterController
|
|||
typedef std::deque<std::string> AnimationQueue;
|
||||
AnimationQueue mAnimQueue;
|
||||
|
||||
Ogre::Vector3 mDirection;
|
||||
|
||||
std::string mCurrentGroup;
|
||||
CharacterState mState;
|
||||
bool mSkipAnim;
|
||||
|
@ -46,6 +50,9 @@ public:
|
|||
void playGroup(const std::string &groupname, int mode, int count);
|
||||
void skipAnim();
|
||||
|
||||
void setDirection(const Ogre::Vector3 &dir)
|
||||
{ mDirection = dir; }
|
||||
|
||||
void setState(CharacterState state);
|
||||
CharacterState getState() const
|
||||
{ return mState; }
|
||||
|
|
Loading…
Reference in a new issue