diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/camera.cc | 8 | ||||
-rw-r--r-- | src/client/view.cc | 2 |
2 files changed, 8 insertions, 2 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); diff --git a/src/client/view.cc b/src/client/view.cc index e8ec5e8..39cd351 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -268,7 +268,7 @@ void frame(float seconds) camera::draw(seconds); // draw the current camera transformation - render::draw(camera::target, seconds); // draw the world + render::draw(camera::eye, camera::target, seconds); // draw the world } |