mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
Implement WalkLeft and WalkRight character states
This commit is contained in:
parent
a7b07ee5cf
commit
68779375b2
@ -273,7 +273,14 @@ namespace MWMechanics
|
||||
|
||||
if(dir.length() >= 0.1f)
|
||||
{
|
||||
if(dir.y < 0.0f)
|
||||
if(std::abs(dir.x/2.0f) > std::abs(dir.y))
|
||||
{
|
||||
if(dir.x > 0.0f)
|
||||
newstate = CharState_WalkRight;
|
||||
else if(dir.x < 0.0f)
|
||||
newstate = CharState_WalkLeft;
|
||||
}
|
||||
else if(dir.y < 0.0f)
|
||||
newstate = CharState_WalkBack;
|
||||
else
|
||||
newstate = CharState_WalkForward;
|
||||
|
@ -41,6 +41,8 @@ static const struct {
|
||||
|
||||
{ CharState_WalkForward, "walkforward", Ogre::Vector3(0.0f, 1.0f, 0.0f) },
|
||||
{ CharState_WalkBack, "walkback", Ogre::Vector3(0.0f, 1.0f, 0.0f) },
|
||||
{ CharState_WalkLeft, "walkleft", Ogre::Vector3(1.0f, 0.0f, 0.0f) },
|
||||
{ CharState_WalkRight, "walkright", Ogre::Vector3(1.0f, 0.0f, 0.0f) },
|
||||
|
||||
{ CharState_Dead, "death1", Ogre::Vector3(1.0f, 1.0f, 0.0f) },
|
||||
};
|
||||
|
@ -19,6 +19,8 @@ enum CharacterState {
|
||||
|
||||
CharState_WalkForward,
|
||||
CharState_WalkBack,
|
||||
CharState_WalkLeft,
|
||||
CharState_WalkRight,
|
||||
|
||||
CharState_Dead
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user