Make torque be away from zero always, so shake is a sure thing.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4780 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -578,7 +578,11 @@ void Kart::handleExplosion(const Vec3& pos, bool direct_hit)
|
||||
m_uprightConstraint->setDisableTime(10.0f);
|
||||
getVehicle()->getRigidBody()->applyCentralImpulse(diff);
|
||||
|
||||
btVector3 torque(sign_c * float(rand()%32) * 5.0f, sign_d * float(rand()%32) * 5.0f, sign_e * float(rand()%32) * 5.0f);
|
||||
float torqueX = sign_c * (20.0f + float(rand()%32) * 5.0f);
|
||||
float torqueY = sign_d * (20.0f + float(rand()%32) * 5.0f);
|
||||
float torqueZ = sign_e * (20.0f + float(rand()%32) * 5.0f);
|
||||
|
||||
btVector3 torque(torqueX, torqueY, torqueZ);
|
||||
getVehicle()->getRigidBody()->applyTorqueImpulse(torque);
|
||||
|
||||
m_stars_effect->showFor(6.0f);
|
||||
|
||||
Reference in New Issue
Block a user