Added new command line flag to enable debug debug camera (showing the view from high above
the kart down). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5286 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
61df686924
commit
200aa4ca36
@ -247,6 +247,9 @@ namespace UserConfigParams
|
||||
/** If the kart sizes should be printed at startup. */
|
||||
PARAM_PREFIX bool m_print_kart_sizes PARAM_DEFAULT( false );
|
||||
|
||||
/** Special debug camera being high over the kart. */
|
||||
PARAM_PREFIX bool m_camera_debug PARAM_DEFAULT( false );
|
||||
|
||||
/** Verbosity level for debug messages. Note that error and important warnings
|
||||
* must always be printed. */
|
||||
PARAM_PREFIX int m_verbosity PARAM_DEFAULT( 0 );
|
||||
|
@ -205,17 +205,6 @@ void Camera::smoothMoveCamera(float dt, const Vec3 &wanted_position,
|
||||
{
|
||||
sfx_manager->positionListener(current_position, current_target - current_position);
|
||||
}
|
||||
|
||||
// The following settings give a debug camera which shows the track from
|
||||
// high above the kart straight down.
|
||||
#undef DEBUG_CAMERA
|
||||
#ifdef DEBUG_CAMERA
|
||||
core::vector3df xyz = m_kart->getXYZ().toIrrVector();
|
||||
xyz = core::vector3df(17.5, 0, 0);
|
||||
m_camera->setTarget(xyz);
|
||||
xyz.Y = xyz.Y+30;
|
||||
m_camera->setPosition(xyz);
|
||||
#endif
|
||||
} // smoothMoveCamera
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -255,6 +244,17 @@ void Camera::computeNormalCameraPosition(Vec3 *wanted_position,
|
||||
*/
|
||||
void Camera::update(float dt)
|
||||
{
|
||||
// The following settings give a debug camera which shows the track from
|
||||
// high above the kart straight down.
|
||||
if(UserConfigParams::m_camera_debug)
|
||||
{
|
||||
core::vector3df xyz = m_kart->getXYZ().toIrrVector();
|
||||
m_camera->setTarget(xyz);
|
||||
xyz.Y = xyz.Y+30;
|
||||
m_camera->setPosition(xyz);
|
||||
return;
|
||||
}
|
||||
|
||||
Vec3 wanted_position;
|
||||
Vec3 wanted_target = m_kart->getXYZ();
|
||||
// Each case should set wanted_position and wanted_target according to
|
||||
|
@ -245,6 +245,10 @@ int handleCmdLine(int argc, char **argv)
|
||||
{
|
||||
UserConfigParams::m_track_debug=1;
|
||||
}
|
||||
else if(!strcmp(argv[i], "--camera-debug"))
|
||||
{
|
||||
UserConfigParams::m_camera_debug=1;
|
||||
}
|
||||
else if(!strcmp(argv[i], "--kartsize-debug"))
|
||||
{
|
||||
UserConfigParams::m_print_kart_sizes=true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user