Added camera-at-side-of-kart debug mode.

This commit is contained in:
hiker 2015-07-24 11:00:13 +10:00
parent 2f51406e3d
commit 672314fbe2
2 changed files with 16 additions and 1 deletions

View File

@ -548,6 +548,14 @@ void Camera::update(float dt)
// - the kart should not be visible, but it works)
m_camera->setNearValue(27.0);
}
else if (UserConfigParams::m_camera_debug==5)
{
core::vector3df xyz = m_kart->getXYZ().toIrrVector();
Vec3 offset(3, 0, 0);
offset = m_kart->getTrans()(offset);
m_camera->setTarget(xyz);
m_camera->setPosition(offset.toIrrVector());
}
// Update the first person camera
else if (UserConfigParams::m_camera_debug == 3)
{

View File

@ -98,6 +98,7 @@ enum DebugMenuCommand
DEBUG_GUI_CAM_TOP,
DEBUG_GUI_CAM_WHEEL,
DEBUG_GUI_CAM_BEHIND_KART,
DEBUG_GUI_CAM_SIDE_OF_KART,
DEBUG_GUI_CAM_NORMAL,
DEBUG_GUI_CAM_SMOOTH,
DEBUG_GUI_CAM_ATTACH,
@ -251,8 +252,9 @@ bool onEvent(const SEvent &event)
sub->addItem(L"Toggle GUI", DEBUG_GUI_TOGGLE);
sub->addItem(L"Hide karts", DEBUG_GUI_HIDE_KARTS);
sub->addItem(L"Top view", DEBUG_GUI_CAM_TOP);
sub->addItem(L"Wheel view", DEBUG_GUI_CAM_WHEEL);
sub->addItem(L"Behind wheel view", DEBUG_GUI_CAM_WHEEL);
sub->addItem(L"Behind kart view", DEBUG_GUI_CAM_BEHIND_KART);
sub->addItem(L"Side of kart view", DEBUG_GUI_CAM_SIDE_OF_KART);
sub->addItem(L"First person view", DEBUG_GUI_CAM_FREE);
sub->addItem(L"Normal view", DEBUG_GUI_CAM_NORMAL);
sub->addItem(L"Toggle smooth camera", DEBUG_GUI_CAM_SMOOTH);
@ -527,6 +529,11 @@ bool onEvent(const SEvent &event)
UserConfigParams::m_camera_debug = 4;
irr_driver->getDevice()->getCursorControl()->setVisible(true);
}
else if (cmdID == DEBUG_GUI_CAM_SIDE_OF_KART)
{
UserConfigParams::m_camera_debug = 5;
irr_driver->getDevice()->getCursorControl()->setVisible(true);
}
else if (cmdID == DEBUG_GUI_CAM_FREE)
{
UserConfigParams::m_camera_debug = 3;