Fixed camera aiming at incorrect (previous) position when restarting a race.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6107 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-09-21 12:25:17 +00:00
parent 4733fead77
commit b754d9c879

View File

@ -232,6 +232,12 @@ void Camera::setInitialTransform()
{ {
m_camera->setPosition( m_kart->getXYZ().toIrrVector() m_camera->setPosition( m_kart->getXYZ().toIrrVector()
+ core::vector3df(0, 25, -50) ); + core::vector3df(0, 25, -50) );
// Reset the target from the previous target (in case of a restart
// of a race) - otherwise the camera will initially point in the wrong
// direction till smoothMoveCamera has corrected this. Setting target
// to position doesn't make sense, but smoothMoves will adjust the
// value before the first frame is rendered
m_camera->setTarget(m_camera->getPosition());
m_camera->setRotation(core::vector3df(0, 0, 0)); m_camera->setRotation(core::vector3df(0, 0, 0));
m_camera->setRotation( core::vector3df( 0.0f, 0.0f, 0.0f ) ); m_camera->setRotation( core::vector3df( 0.0f, 0.0f, 0.0f ) );
m_camera->setFOV(m_fov); m_camera->setFOV(m_fov);