Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/camera.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/render/camera.cc b/src/render/camera.cc
index ba9c367..881d9ae 100644
--- a/src/render/camera.cc
+++ b/src/render/camera.cc
@@ -263,7 +263,12 @@ void Camera::frame(float seconds)
float cosangle; // cosine of an angle
float angle; // angle in radians
math::Vector3f n; // normal of a plane
+
+ // freelook target
+ target_axis.change_direction(90 * target_direction);
+ target_axis.change_pitch(90 * target_pitch);
+ // rotate scene axis towards target axis
n.assign(math::crossproduct(camera_scene_axis.forward(), target_axis.forward()));
if (!(n.length() < MIN_DELTA)) {
n.normalize();
@@ -324,6 +329,10 @@ void Camera::frame(float seconds)
} else if (mode() == Cockpit) {
+ // freelook target
+ target_axis.change_direction(90 * target_direction);
+ target_axis.change_pitch(90 * target_pitch);
+
camera_scene_axis.assign(target_axis);
if (core::localcontrol()->model()) {