From: <hik...@us...> - 2010-09-21 12:25:27
|
Revision: 6107 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6107&view=rev Author: hikerstk Date: 2010-09-21 12:25:17 +0000 (Tue, 21 Sep 2010) Log Message: ----------- Fixed camera aiming at incorrect (previous) position when restarting a race. Modified Paths: -------------- main/trunk/src/graphics/camera.cpp Modified: main/trunk/src/graphics/camera.cpp =================================================================== --- main/trunk/src/graphics/camera.cpp 2010-09-21 10:36:40 UTC (rev 6106) +++ main/trunk/src/graphics/camera.cpp 2010-09-21 12:25:17 UTC (rev 6107) @@ -232,6 +232,12 @@ { m_camera->setPosition( m_kart->getXYZ().toIrrVector() + 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.0f, 0.0f, 0.0f ) ); m_camera->setFOV(m_fov); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |