]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/viewmgr.cxx
Merge branch 'jt/runway' into next
[flightgear.git] / src / Main / viewmgr.cxx
index 806d9451a45472b9935a5c3d0f4a772884cff199..cb2dfa0531045664b6a76f52b82fba9d2236d072 100644 (file)
@@ -212,6 +212,10 @@ FGViewMgr::bind ()
        &FGViewMgr::getNear_m, &FGViewMgr::setNear_m);
   fgSetArchivable("/sim/current-view/ground-level-nearplane-m");
 
+  SGPropertyNode *n = fgGetNode("/sim/current-view", true);
+  n->tie("viewer-x-m", SGRawValuePointer<double>(&abs_viewer_position[0]));
+  n->tie("viewer-y-m", SGRawValuePointer<double>(&abs_viewer_position[1]));
+  n->tie("viewer-z-m", SGRawValuePointer<double>(&abs_viewer_position[2]));
 }
 
 void
@@ -229,6 +233,9 @@ FGViewMgr::unbind ()
   fgUntie("/sim/current-view/axes/long");
   fgUntie("/sim/current-view/axes/lat");
   fgUntie("/sim/current-view/ground-level-nearplane-m");
+  fgUntie("/sim/current-view/viewer-x-m");
+  fgUntie("/sim/current-view/viewer-y-m");
+  fgUntie("/sim/current-view/viewer-z-m");
 }
 
 void
@@ -287,6 +294,7 @@ FGViewMgr::update (double dt)
   // Update the current view
   do_axes();
   view->update(dt);
+  abs_viewer_position = loop_view->getViewPosition();
 }
 
 void