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>2013-10-15 19:57:27 +0000
committerStijn Buys <ingar@osirion.org>2013-10-15 19:57:27 +0000
commitce62661012a167d48bd6117940a551355eb6773b (patch)
tree67fa5c937559e16e367f069007e825548ad57573 /src/client/input.cc
parentaabb379d84afab3679acc6dc4472d886dae88f39 (diff)
Added ship autopilot, removed entity_controlflags, added goto ui button.
Diffstat (limited to 'src/client/input.cc')
-rw-r--r--src/client/input.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/client/input.cc b/src/client/input.cc
index fcf33f8..fed76c9 100644
--- a/src/client/input.cc
+++ b/src/client/input.cc
@@ -889,19 +889,26 @@ void frame()
if ((render::Camera::mode() == render::Camera::Track) || (render::Camera::mode() == render::Camera::Cockpit)) {
- //local_direction = mouse_direction * math::absf(mouse_direction);
- //local_pitch = mouse_pitch * math::absf(mouse_pitch);
local_direction = mouse_direction;
local_pitch = mouse_pitch;
+
+ // enable autopilot override
+ local_controlflags = local_controlflags | core::EntityControlable::ControlFlagOverride;
} else if (render::Camera::mode() == render::Camera::Free) {
- // squared values to smoothen camera movement
+
render::Camera::set_direction(-mouse_direction * math::absf(mouse_direction));
render::Camera::set_pitch(-mouse_pitch * math::absf(mouse_pitch));
+
+ // disable autopilot override
+ local_controlflags = local_controlflags & ~core::EntityControlable::ControlFlagOverride;
}
+ } else {
+ // disable autopilot override
+ local_controlflags = local_controlflags & ~core::EntityControlable::ControlFlagOverride;
}
-
+
math::clamp(local_direction, -1.0f, 1.0f);
math::clamp(local_pitch, -1.0f, 1.0f);
math::clamp(local_roll, -1.0f, 1.0f);
@@ -929,7 +936,7 @@ void frame()
local_vstrafe = 0.0f;
local_strafe = 0.0f;
local_afterburner = 0.0f;
- local_controlflags = 0;
+ local_controlflags = core::EntityControlable::ControlFlagNone;
render::Camera::set_direction(0.0f);
render::Camera::set_pitch(0.0f);