Fixed #612 - camera staying behind after falling

To fix it, I copied what happens in explosion animation: reset the camera to
normal when the animation gets removed (destroyed).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11118 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
wardje 2012-04-13 13:14:59 +00:00
parent eabc8bc8af
commit 03c8fc70fd
2 changed files with 7 additions and 4 deletions

View File

@ -64,15 +64,15 @@ public:
virtual void setPosition (int p);
virtual void finishedRace (float time);
virtual bool isPlayerController() const {return true;}
virtual bool isNetworkController() const { return false; }
virtual bool isNetworkController() const { return false; }
virtual void reset ();
void resetInputState ();
virtual void crashed (const AbstractKart *k) {}
virtual void crashed (const Material *m) {}
virtual void crashed (const AbstractKart *k) {}
virtual void crashed (const Material *m) {}
// ------------------------------------------------------------------------
/** Callback whenever a new lap is triggered. Used by the AI
* to trigger a recomputation of the way to use. */
virtual void newLap(int lap) {}
virtual void newLap(int lap) {}
};
#endif

View File

@ -79,6 +79,9 @@ RescueAnimation::~RescueAnimation()
m_kart->getBody()->setLinearVelocity(btVector3(0,0,0));
m_kart->getBody()->setAngularVelocity(btVector3(0,0,0));
World::getWorld()->getPhysics()->addKart(m_kart);
if (m_kart->getCamera() &&
m_kart->getCamera()->getMode() != Camera::CM_FINAL)
m_kart->getCamera()->setMode(Camera::CM_NORMAL);
}
} // ~RescueAnimation