]> git.mxchange.org Git - flightgear.git/commitdiff
Jim Wilson:
authorehofman <ehofman>
Fri, 9 May 2003 08:31:14 +0000 (08:31 +0000)
committerehofman <ehofman>
Fri, 9 May 2003 08:31:14 +0000 (08:31 +0000)
What is actually happening is the camera is pointing to the right place (try zooming in),  but the camera is also travelling up and down with the nose and it should be staying more steady (in sync with the CG altitude).

Attached is a fix for this. There is still something a little funky going on with the camera, but this solves the biggest problem.  You will note that I deleted an unecessary reference to scenery.hxx in the patch.

src/Main/viewer.cxx

index 16a035f9a4c6e912c3264e066405a61f95359f6d..1f6c1d450006198e338014844447d331be0817cb 100644 (file)
 #include <simgear/math/point3d.hxx>
 #include <simgear/math/polar3d.hxx>
 #include <simgear/math/sg_geodesy.hxx>
-
-#include <Scenery/scenery.hxx>
-
+#include <simgear/scene/model/location.hxx>
 #include <simgear/math/vector.hxx>
+
 #include <Main/globals.hxx>
+#include <Scenery/scenery.hxx>
 #include <Model/acmodel.hxx>
 #include <Model/placement.hxx>
 
@@ -655,10 +655,13 @@ FGViewer::recalcLookAt ()
   sgAddVec3( eye_pos, eye_pos, position_offset );
 
   // add target offsets to at_position...
-  sgSetVec3(target_position_offset, _target_z_offset_m,  _target_x_offset_m, _target_y_offset_m );
+  sgSetVec3(target_position_offset, _target_z_offset_m,  _target_x_offset_m,
+                                    _target_y_offset_m );
   sgXformVec3(target_position_offset, target_position_offset, ATLOCAL);
   sgAddVec3( at_pos, at_pos, target_position_offset);
 
+  sgAddVec3( eye_pos, eye_pos, target_position_offset);
+
   // Make the VIEW matrix for a "LOOKAT".
   sgMakeLookAtMat4( VIEW, eye_pos, at_pos, _view_up );