Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2015-02-28 22:52:22 +0000
committerStijn Buys <ingar@osirion.org>2015-02-28 22:52:22 +0000
commitb656bec7d70e9ebb4bd809c32178a083e339f96e (patch)
tree653732d3264f9733e810329ffa55793346117cbb
parent9a5af746d505625d49130d74da61a59af8cda4a4 (diff)
Disable mouse control while the camera is in freelook.
-rw-r--r--src/client/input.cc21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/client/input.cc b/src/client/input.cc
index 85d8526..a779ec8 100644
--- a/src/client/input.cc
+++ b/src/client/input.cc
@@ -1043,19 +1043,14 @@ void frame()
{
case render::Camera::Track:
case render::Camera::Cockpit:
- if (mouse_control)
- {
- local_direction = 0.0f;
- local_pitch = 0.0f;
-
- // enable autopilot override
- local_controlflags = local_controlflags | core::EntityControlable::ControlFlagOverride;
- } else
- {
- // disable autopilot override
- local_controlflags = local_controlflags & ~core::EntityControlable::ControlFlagOverride;
- }
+
+ // disable local control
+ local_direction = 0.0f;
+ local_pitch = 0.0f;
+ // disable autopilot override
+ local_controlflags = local_controlflags & ~core::EntityControlable::ControlFlagOverride;
+
render::camera().set_freelook_direction(180.0f * mouse_direction);
render::camera().set_freelook_pitch(90.0f * mouse_pitch);
@@ -1067,7 +1062,7 @@ void frame()
render::camera().set_freelook_direction(180.0f * mouse_direction);
render::camera().set_freelook_pitch(90.0f * mouse_pitch);
-
+
// disable autopilot override
local_controlflags = local_controlflags & ~core::EntityControlable::ControlFlagOverride;
break;