Enhance the feature to hide race GUI so that it now also hides karts; useful to take track screenshot

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7586 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-02-02 23:33:13 +00:00
parent ecbe9c8bf3
commit 958cd865fe
2 changed files with 9 additions and 5 deletions

View File

@ -177,6 +177,12 @@ void InputManager::handleStaticAction(int key, int value)
{
RaceGUIBase* gui = World::getWorld()->getRaceGUI();
if (gui != NULL) gui->m_enabled = !gui->m_enabled;
const int count = World::getWorld()->getNumKarts();
for (int n=0; n<count; n++)
{
World::getWorld()->getKart(n)->getNode()->setVisible(gui->m_enabled);
}
}
else
{

View File

@ -1176,11 +1176,9 @@ void Kart::updatePhysics(float dt)
}
// 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);
btVector3 velocity = m_body->getAngularVelocity();
velocity.setX(0);
velocity.setZ(0);
m_body->setAngularVelocity(velocity);
}