From d0f713e03dc980542a3f258e73d40482e57b6fb2 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Thu, 15 Jan 2009 22:36:42 +0000 Subject: [PATCH] Added code to simplify finding good final positions for the camera (though it involves setting a breakpoint etc, so it's only for developers). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2932 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/camera.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/camera.cpp b/src/camera.cpp index 487711398..88b5d7f2a 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -227,6 +227,23 @@ void Camera::finalCamera(float dt) Coord coord(m_xyz, m_hpr); m_context->setCamera(&coord.toSgCoord()); } +#undef TEST_END_CAMERA_POSITION +#ifdef TEST_END_CAMERA_POSITION + else + { + // This code is helpful when tweaking the final camera position: + // Just set a breakpoint here, change the values for x,y,z,h,p,r, + // and then keep on running, and you can see what the final position + // looks like. When happy, just put these value as + // camera-final-position and camera-final-hpr in the .track file. + static float x=5,y=20,z=3,h=180,p=-10,r=0.0f; + Vec3 xyz(x,y,z); + Vec3 hpr(DEGREE_TO_RAD(h),DEGREE_TO_RAD(p),DEGREE_TO_RAD(r)); + Coord coord(xyz, hpr); + m_context->setCamera(&coord.toSgCoord()); + } +#endif + } // finalCamera //-----------------------------------------------------------------------------