From 958cd865fe4e7661d5cf5c869dd3b4c3e7cfe03b Mon Sep 17 00:00:00 2001 From: auria Date: Wed, 2 Feb 2011 23:33:13 +0000 Subject: [PATCH] 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 --- src/input/input_manager.cpp | 6 ++++++ src/karts/kart.cpp | 8 +++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/input/input_manager.cpp b/src/input/input_manager.cpp index 9a5fa9284..231b0e800 100644 --- a/src/input/input_manager.cpp +++ b/src/input/input_manager.cpp @@ -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; ngetKart(n)->getNode()->setVisible(gui->m_enabled); + } } else { diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index dd4cada77..4c846412c 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -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); }