export absolute viewer coordinates
This commit is contained in:
parent
b0b4ab5003
commit
df0f0a531f
2 changed files with 11 additions and 0 deletions
|
@ -212,6 +212,9 @@ FGViewMgr::bind ()
|
|||
&FGViewMgr::getNear_m, &FGViewMgr::setNear_m);
|
||||
fgSetArchivable("/sim/current-view/ground-level-nearplane-m");
|
||||
|
||||
fgTie("/sim/current-view/viewer-x-m", this, &FGViewMgr::getViewerPositionX_m);
|
||||
fgTie("/sim/current-view/viewer-y-m", this, &FGViewMgr::getViewerPositionY_m);
|
||||
fgTie("/sim/current-view/viewer-z-m", this, &FGViewMgr::getViewerPositionZ_m);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -229,6 +232,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 +293,7 @@ FGViewMgr::update (double dt)
|
|||
// Update the current view
|
||||
do_axes();
|
||||
view->update(dt);
|
||||
abs_viewer_position = loop_view->getViewPosition();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -147,11 +147,15 @@ private:
|
|||
void setViewAxisLat (double axis);
|
||||
int getView () const;
|
||||
void setView (int newview);
|
||||
double getViewerPositionX_m () const { return abs_viewer_position[0]; }
|
||||
double getViewerPositionY_m () const { return abs_viewer_position[1]; }
|
||||
double getViewerPositionZ_m () const { return abs_viewer_position[2]; }
|
||||
|
||||
SGPropertyNode_ptr view_number;
|
||||
vector<SGPropertyNode_ptr> config_list;
|
||||
typedef vector<SGSharedPtr<FGViewer> > viewer_list;
|
||||
viewer_list views;
|
||||
SGVec3d abs_viewer_position;
|
||||
|
||||
int current;
|
||||
|
||||
|
|
Loading…
Reference in a new issue