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:
parent
ecbe9c8bf3
commit
958cd865fe
@ -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
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user