diff --git a/src/graphics/lod_node.cpp b/src/graphics/lod_node.cpp index c2ee228a3..e3885f171 100644 --- a/src/graphics/lod_node.cpp +++ b/src/graphics/lod_node.cpp @@ -38,12 +38,15 @@ LODNode::~LODNode() void LODNode::render() { - ISceneNode::OnRegisterSceneNode(); + if (isVisible()) + ISceneNode::OnRegisterSceneNode(); //ISceneNode::render(); } void LODNode::OnRegisterSceneNode() { + if (!isVisible()) return; + // TODO: optimize this, there is no need to check every frame scene::ICameraSceneNode* curr_cam = irr_driver->getSceneManager()->getActiveCamera(); diff --git a/src/karts/emergency_animation.cpp b/src/karts/emergency_animation.cpp index 704ae21a8..fd7ee0df5 100644 --- a/src/karts/emergency_animation.cpp +++ b/src/karts/emergency_animation.cpp @@ -88,7 +88,8 @@ void EmergencyAnimation::eliminate() World::getWorld()->getPhysics()->removeKart(m_kart); } m_eliminated = true; - + m_kart_mode = EA_NONE; + m_kart->getNode()->setVisible(false); } // eliminate diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index a356be83a..886d572f2 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -719,6 +719,12 @@ bool Kart::isNearGround() const */ void Kart::update(float dt) { + if (m_eliminated) + { + getNode()->setVisible(false); + return; + } + // Update the position and other data taken from the physics Moveable::update(dt);