Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/camera.cc')
-rw-r--r--src/client/camera.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/camera.cc b/src/client/camera.cc
index fa81356..d264ddf 100644
--- a/src/client/camera.cc
+++ b/src/client/camera.cc
@@ -152,10 +152,16 @@ void draw(float elapsed)
if (mode == Overview)
set_mode(Track);
- target.assign(core::localcontrol()->location());
+ target.assign(core::localcontrol()->location());
axis.assign(core::localcontrol()->axis());
+ if (mode == Track) {
+ // make the camera swing while turning
+ yaw_target = 25 * core::localcontrol()->target_direction;
+ pitch_target = pitch_track - 25 * core::localcontrol()->target_pitch;
+ }
+
// adjust direction
d = degrees180f(yaw_current - yaw_target);
yaw_current = degrees360f( yaw_current - d * elapsed);