X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Fviewmgr.cxx;h=cb2dfa0531045664b6a76f52b82fba9d2236d072;hb=18d1593c42c2df60d7fb44ace722ca3e8a7fd82c;hp=806d9451a45472b9935a5c3d0f4a772884cff199;hpb=5b76cb5409ff6ffdcf4bca95e506956cd1e4998f;p=flightgear.git diff --git a/src/Main/viewmgr.cxx b/src/Main/viewmgr.cxx index 806d9451a..cb2dfa053 100644 --- a/src/Main/viewmgr.cxx +++ b/src/Main/viewmgr.cxx @@ -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(&abs_viewer_position[0])); + n->tie("viewer-y-m", SGRawValuePointer(&abs_viewer_position[1])); + n->tie("viewer-z-m", SGRawValuePointer(&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