Attenuate roll and pitch, trying to reduce the "boat shake" look in jumps.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5093 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
mbjornstk
2010-03-28 18:04:59 +00:00
parent f730753d3e
commit 85bf15763d

View File

@@ -686,7 +686,9 @@ void Kart::update(float dt)
// As side effect steering becames a bit less responsive (any wheel on air), but not too bad.
if(!isOnGround()) {
btVector3 speed = m_body->getAngularVelocity();
speed.setY(speed.getY() * 0.25f); // Progressive attenuation
speed.setX(speed.getX() * 0.95f);
speed.setY(speed.getY() * 0.25f); // or 0.0f for sharp neutralization of yaw
speed.setZ(speed.getZ() * 0.95f);
m_body->setAngularVelocity(speed);
// This one keeps the kart pointing "100% as launched" instead,
// like in ski jump sports, too boring but also works.