From c0ed7a57377eb2a0b18f792ff959e20df3c8f6fb Mon Sep 17 00:00:00 2001 From: hikerstk Date: Thu, 15 Jan 2009 23:53:47 +0000 Subject: [PATCH] Fixed balls starting to vibrate on the spot. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2935 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/items/bowling.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/items/bowling.cpp b/src/items/bowling.cpp index df3b49661..ad0a2f96f 100644 --- a/src/items/bowling.cpp +++ b/src/items/bowling.cpp @@ -50,7 +50,9 @@ Bowling::Bowling(Kart *kart) : Flyable(kart, POWERUP_BOWLING, 50.0f /* mass */) new btSphereShape(0.5f*m_extend.getY()), -70.0f /*gravity*/, true /*rotates*/); - + // Even if the ball is fired backwards, m_speed must be positive, + // otherwise the ball can start to vibrate when enery is added. + m_speed = fabsf(m_speed); // Do not adjust the z velociy depending on height above terrain, since // this would disable gravity. setAdjustZVelocity(false);