1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 10:23:52 +00:00

Implement rudimentary jumping

This commit is contained in:
Chris Robinson 2013-02-20 20:08:04 -08:00
parent bbde0146a7
commit 7fcca180b6

View file

@ -181,10 +181,17 @@ Ogre::Vector3 CharacterController::update(float duration)
const MWWorld::Class &cls = MWWorld::Class::get(mPtr);
const Ogre::Vector3 &vec = cls.getMovementVector(mPtr);
bool onground = world->isOnGround(mPtr);
bool inwater = world->isSwimming(mPtr);
bool isrunning = cls.getStance(mPtr, MWWorld::Class::Run);
speed = cls.getSpeed(mPtr);
// This jump is all kinds of wrong. The speed is incorrect, the state should be set to
// Jump, and X/Y movement should be disallowed except for the initial thrust (which would
// be carried by "physics" until landing).
if(onground)
movement.z += vec.z * (500.0f*duration);
if(std::abs(vec.x/2.0f) > std::abs(vec.y) && speed > 0.0f)
{
if(vec.x > 0.0f)