diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/camera.cc | 4 | ||||
-rw-r--r-- | src/client/camera.h | 3 | ||||
-rw-r--r-- | src/client/view.cc | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/client/camera.cc b/src/client/camera.cc index d264ddf..e2dbacf 100644 --- a/src/client/camera.cc +++ b/src/client/camera.cc @@ -25,6 +25,7 @@ namespace camera // gameworld coordinates of the camera target math::Vector3f target; math::Vector3f eye; +math::Axis axis; // target yaw, angle in XZ plane, positive is looking left float yaw_target; @@ -130,7 +131,6 @@ void next_mode() void draw(float elapsed) { math::Matrix4f matrix; - math::Axis axis; float d = 0; @@ -158,7 +158,7 @@ void draw(float elapsed) if (mode == Track) { // make the camera swing while turning - yaw_target = 25 * core::localcontrol()->target_direction; + yaw_target = -25.0f * core::localcontrol()->target_direction; pitch_target = pitch_track - 25 * core::localcontrol()->target_pitch; } diff --git a/src/client/camera.h b/src/client/camera.h index 2a79fda..25e179d 100644 --- a/src/client/camera.h +++ b/src/client/camera.h @@ -47,6 +47,9 @@ namespace camera /// gameworld coordinates of the camera eye extern math::Vector3f eye; + /// global camera axis coordinate system + extern math::Axis axis; + /// current camera mode extern Mode mode; diff --git a/src/client/view.cc b/src/client/view.cc index 39cd351..6f5ceca 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::eye, camera::target, seconds); // draw the world + render::draw(camera::axis, camera::eye, camera::target, seconds); // draw the world } |