]> git.mxchange.org Git - flightgear.git/commitdiff
"Fix a bug" in mouse-pans-external view mode.
authorcurt <curt>
Thu, 12 Jul 2001 20:03:37 +0000 (20:03 +0000)
committercurt <curt>
Thu, 12 Jul 2001 20:03:37 +0000 (20:03 +0000)
src/Main/viewer_lookat.cxx

index e45b0f5bb7e7b17686f96cd846a9ab11acef2b04..f39c08bf11337a35da4edd004ee5c01cff064585 100644 (file)
@@ -133,7 +133,26 @@ void FGViewerLookAt::update() {
     sgdVec3 vp;
     sgdSubVec3( vp, abs_view_pos, sc );
     sgSetVec3( view_pos, vp );
-    sgAddVec3( view_pos, pilot_offset );
+
+    sgVec3 tmp_offset;
+    sgCopyVec3( tmp_offset, pilot_offset );
+    SG_LOG( SG_VIEW, SG_DEBUG, "tmp offset = "
+            << tmp_offset[0] << "," << tmp_offset[1] << ","
+            << tmp_offset[2] );
+       
+    //!!!!!!!!!!!!!!!!!!!      
+    // THIS IS THE EXPERIMENTAL VIEWING ANGLE SHIFTER
+    // THE MAJORITY OF THE WORK IS DONE IN GUI.CXX
+    extern float GuiQuat_mat[4][4];
+    sgXformPnt3( tmp_offset, tmp_offset, GuiQuat_mat );
+    SG_LOG( SG_VIEW, SG_DEBUG, "tmp_offset = "
+            << tmp_offset[0] << "," << tmp_offset[1] << ","
+            << tmp_offset[2] );
+       
+    sgAddVec3( view_pos, tmp_offset );
+    // !!!!!!!!!! testing
+       
+    // sgAddVec3( view_pos, pilot_offset );
 
     SG_LOG( SG_VIEW, SG_DEBUG, "sea level radius = " << sea_level_radius );
     SG_LOG( SG_VIEW, SG_DEBUG, "Polar view pos = " << p );
@@ -176,14 +195,6 @@ void FGViewerLookAt::update() {
     //      << world_up[2] << endl;
     
 
-    //!!!!!!!!!!!!!!!!!!!      
-    // THIS IS THE EXPERIMENTAL VIEWING ANGLE SHIFTER
-    // THE MAJORITY OF THE WORK IS DONE IN GUI.CXX
-    // this in gui.cxx for now just testing
-    extern float GuiQuat_mat[4][4];
-    sgPreMultMat4( VIEW, GuiQuat_mat);
-    // !!!!!!!!!! testing      
-
     // Given a vector pointing straight down (-Z), map into onto the
     // local plane representing "horizontal".  This should give us the
     // local direction for moving "south".