Minor: make fly mode easier to use by preventing kart from rolling when turning
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6780 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
cb194bb2b6
commit
09eaaebd64
@ -1142,6 +1142,14 @@ void Kart::updatePhysics(float dt)
|
|||||||
//float orientation = getHeading();
|
//float orientation = getHeading();
|
||||||
//m_body->applyCentralImpulse(btVector3(-60.0f*sin(orientation), 0.0, -60.0f*cos(orientation)));
|
//m_body->applyCentralImpulse(btVector3(-60.0f*sin(orientation), 0.0, -60.0f*cos(orientation)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dampen any roll while flying, makes the kart hard to control
|
||||||
|
btVector3 velocity = m_body->getAngularVelocity();
|
||||||
|
const float z = velocity.z();
|
||||||
|
if (z > 0.1f) velocity.setZ(z - 0.1f);
|
||||||
|
else if (z < -0.1f) velocity.setZ(z + 0.1f);
|
||||||
|
else velocity.setZ(0);
|
||||||
|
m_body->setAngularVelocity(velocity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user