From 15445f182cdd513d91cd2d01d2980ed9945c52fb Mon Sep 17 00:00:00 2001 From: hikerstk Date: Wed, 15 Feb 2012 05:27:27 +0000 Subject: [PATCH] Adjust start position of camera (for initial camera movement) properly, which especially fixes its position in reverse mode. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/reverse_mode@10851 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/graphics/camera.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/graphics/camera.cpp b/src/graphics/camera.cpp index 62550fcb5..97130b037 100644 --- a/src/graphics/camera.cpp +++ b/src/graphics/camera.cpp @@ -256,8 +256,9 @@ void Camera::reset() */ void Camera::setInitialTransform() { - m_camera->setPosition( m_kart->getXYZ().toIrrVector() - + core::vector3df(0, 25, -50) ); + Vec3 start_offset(0, 25, -50); + Vec3 xx = m_kart->getTrans()(start_offset); + m_camera->setPosition( xx.toIrrVector()); // 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