Fixed camera doing ugly moves when restarting race

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4836 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-02-25 00:16:06 +00:00
parent 8e345671a9
commit 2945e55d89
2 changed files with 6 additions and 1 deletions

View File

@ -200,6 +200,7 @@ void Camera::reset()
void Camera::setInitialTransform()
{
m_camera->setPosition( m_kart->getXYZ().toIrrVector() - core::vector3df(0, -25, 50) );
m_camera->setRotation( core::vector3df( 0.0f, 0.0f, 0.0f ) );
} // setInitialTransform
//-----------------------------------------------------------------------------

View File

@ -380,8 +380,12 @@ void Kart::reset()
World::getWorld()->getPhysics()->addKart(this);
}
if(m_camera)
if (m_camera)
{
m_camera->reset();
m_camera->setInitialTransform();
}
// If the controller was replaced (e.g. replaced by end controller),
// restore the original controller.
if(m_saved_controller)