diff options
author | Stijn Buys <ingar@osirion.org> | 2008-02-21 21:01:17 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-02-21 21:01:17 +0000 |
commit | 71b6b902732bfc0c53033d58f91a6b1e70e8371f (patch) | |
tree | 0ff75879667ff985c9d69f8057727f6c805ad8b4 /src/client/camera.cc | |
parent | 8aa04fc836116a58f8ffd1e0c3539b9ea8a94ddf (diff) |
more minor updates
Diffstat (limited to 'src/client/camera.cc')
-rw-r--r-- | src/client/camera.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/client/camera.cc b/src/client/camera.cc index dcf4acf..d9aa16e 100644 --- a/src/client/camera.cc +++ b/src/client/camera.cc @@ -82,7 +82,7 @@ void set_mode(Mode newmode) { case Track: // switch camera to Track mode mode = Track; - yaw_target = core::game()->localplayer()->control->direction(); + yaw_target = core::localcontrol()->direction(); yaw_current = yaw_target; pitch_target = pitch_track; pitch_current = pitch_target; @@ -91,7 +91,7 @@ void set_mode(Mode newmode) { case Free: // switch camera to Free mode mode = Free; - yaw_target = core::game()->localplayer()->control->direction(); + yaw_target = core::localcontrol()->direction(); yaw_current = yaw_target; pitch_target = pitch_track; pitch_current = pitch_target; @@ -112,7 +112,7 @@ void set_mode(Mode newmode) { void next_mode() { - if (!core::game()->localplayer()->control) { + if (!core::localcontrol()) { set_mode(Overview); return; } @@ -133,20 +133,22 @@ void next_mode() void draw(float elapsed) { - if (!core::game()->localplayer()->control) { + if (!core::localcontrol()) { // switch the camera to Overview of the player is not controling anything if (mode != Overview) { set_mode(Overview); + + camera::target = math::Vector3f(0,0,0); } } else { if (mode == Overview) set_mode(Track); - camera::target = core::game()->localplayer()->control->location(); + camera::target = core::localcontrol()->location(); } if (mode == Track) { - yaw_target = core::game()->localplayer()->control->direction(); + yaw_target = core::localcontrol()->direction(); } if ((mode == Free) || (mode == Track)) { |