diff options
author | Stijn Buys <ingar@osirion.org> | 2008-04-28 19:28:09 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-04-28 19:28:09 +0000 |
commit | e2b18c44a6ae38bb84f717c86988a80da137c3e7 (patch) | |
tree | 12df7f3bf3e7b290d282b58831a6a2511de717ba /src/client/camera.cc | |
parent | e63cce2346dec6f34efd6daf5fde50bd2b1c45d3 (diff) |
improved camera in tracking mode
Diffstat (limited to 'src/client/camera.cc')
-rw-r--r-- | src/client/camera.cc | 8 |
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); |