1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-20 21:09:40 +00:00

Continually add bits of input velocity to inertia when falling

This commit is contained in:
Chris Robinson 2013-08-20 02:10:18 -07:00
parent cf6e3ab933
commit a17997a973

View file

@ -142,13 +142,12 @@ namespace MWWorld
else
{
velocity = Ogre::Quaternion(Ogre::Radian(-refpos.rot[2]), Ogre::Vector3::UNIT_Z) * movement;
if(physicActor->getOnGround())
inertia = velocity;
else
if(!physicActor->getOnGround())
{
inertia = physicActor->getInertialForce();
velocity += inertia;
// If falling, add part of the incoming velocity with the current inertia
velocity = velocity*time + physicActor->getInertialForce();
}
inertia = velocity;
if(!(movement.z > 0.0f))
{
@ -214,7 +213,7 @@ namespace MWWorld
physicActor->setInertialForce(Ogre::Vector3(0.0f));
else
{
inertia.z -= time*627.2f;
inertia.z += time*-627.2f;
physicActor->setInertialForce(inertia);
}
physicActor->setOnGround(isOnGround);