Browse Source

tutorial: fix input tutorial speed.

legacy
Sam Hocevar 8 years ago
parent
commit
d01f29d483
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      doc/tutorial/07_input.cpp

+ 5
- 5
doc/tutorial/07_input.cpp View File

@@ -117,9 +117,9 @@ public:
if (m_joystick) if (m_joystick)
{ {
if (lol::abs(m_controller->GetAxisValue(AXIS_PITCH)) > 0.2f) if (lol::abs(m_controller->GetAxisValue(AXIS_PITCH)) > 0.2f)
m_pitch_angle += m_controller->GetAxisValue(AXIS_PITCH) * seconds * 100;
m_pitch_angle += m_controller->GetAxisValue(AXIS_PITCH) * seconds;
if (lol::abs(m_controller->GetAxisValue(AXIS_YAW)) > 0.2f) if (lol::abs(m_controller->GetAxisValue(AXIS_YAW)) > 0.2f)
m_yaw_angle += m_controller->GetAxisValue(AXIS_YAW) * seconds * 100;
m_yaw_angle += m_controller->GetAxisValue(AXIS_YAW) * seconds;
} }


/* Handle mouse */ /* Handle mouse */
@@ -128,14 +128,14 @@ public:
if (m_controller->IsKeyPressed(KEY_DRAG_MESH)) if (m_controller->IsKeyPressed(KEY_DRAG_MESH))
{ {
InputDevice::CaptureMouse(true); InputDevice::CaptureMouse(true);
m_pitch_angle -= m_controller->GetAxisValue(AXIS_DRAG_PITCH) * seconds * 100;
m_yaw_angle += m_controller->GetAxisValue(AXIS_DRAG_YAW) * seconds * 100;
m_pitch_angle -= m_controller->GetAxisValue(AXIS_DRAG_PITCH) * seconds * 0.1f;
m_yaw_angle += m_controller->GetAxisValue(AXIS_DRAG_YAW) * seconds * 0.1f;
} }
else else
{ {
InputDevice::CaptureMouse(false); InputDevice::CaptureMouse(false);
if (m_autorot) if (m_autorot)
m_yaw_angle += seconds * 20;
m_yaw_angle += seconds * 0.2f;
} }


m_text->SetText(String::format( m_text->SetText(String::format(


Loading…
Cancel
Save