forked from teamnwah/openmw-tes3coop
Add a jump state
Currently unused
This commit is contained in:
parent
ff0099fa6e
commit
e4341525c8
2 changed files with 6 additions and 1 deletions
|
@ -68,6 +68,8 @@ static const struct {
|
||||||
{ CharState_SwimRunLeft, "swimrunleft" },
|
{ CharState_SwimRunLeft, "swimrunleft" },
|
||||||
{ CharState_SwimRunRight, "swimrunright" },
|
{ CharState_SwimRunRight, "swimrunright" },
|
||||||
|
|
||||||
|
{ CharState_Jump, "jump" },
|
||||||
|
|
||||||
{ CharState_Death1, "death1" },
|
{ CharState_Death1, "death1" },
|
||||||
{ CharState_Death2, "death2" },
|
{ CharState_Death2, "death2" },
|
||||||
{ CharState_Death3, "death3" },
|
{ CharState_Death3, "death3" },
|
||||||
|
@ -170,11 +172,12 @@ void CharacterController::markerEvent(float time, const std::string &evt)
|
||||||
|
|
||||||
Ogre::Vector3 CharacterController::update(float duration)
|
Ogre::Vector3 CharacterController::update(float duration)
|
||||||
{
|
{
|
||||||
|
const MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
const MWWorld::Class &cls = MWWorld::Class::get(mPtr);
|
const MWWorld::Class &cls = MWWorld::Class::get(mPtr);
|
||||||
const Ogre::Vector3 &vec = cls.getMovementVector(mPtr);
|
const Ogre::Vector3 &vec = cls.getMovementVector(mPtr);
|
||||||
const float speed = cls.getSpeed(mPtr);
|
const float speed = cls.getSpeed(mPtr);
|
||||||
|
|
||||||
bool inwater = MWBase::Environment::get().getWorld()->isSwimming(mPtr);
|
bool inwater = world->isSwimming(mPtr);
|
||||||
bool isrunning = cls.getStance(mPtr, MWWorld::Class::Run);
|
bool isrunning = cls.getStance(mPtr, MWWorld::Class::Run);
|
||||||
|
|
||||||
if(std::abs(vec.x/2.0f) > std::abs(vec.y))
|
if(std::abs(vec.x/2.0f) > std::abs(vec.y))
|
||||||
|
|
|
@ -45,6 +45,8 @@ enum CharacterState {
|
||||||
CharState_SwimRunLeft,
|
CharState_SwimRunLeft,
|
||||||
CharState_SwimRunRight,
|
CharState_SwimRunRight,
|
||||||
|
|
||||||
|
CharState_Jump,
|
||||||
|
|
||||||
/* Death states must be last! */
|
/* Death states must be last! */
|
||||||
CharState_Death1,
|
CharState_Death1,
|
||||||
CharState_Death2,
|
CharState_Death2,
|
||||||
|
|
Loading…
Reference in a new issue