&View::set_aspect_ratio_multiplier,
false);
+ _tiedProperties.Tie("ground-level-nearplane-m", this,
+ &View::getNear_m, &View::setNear_m, false);
+ fgSetArchivable("/sim/current-view/ground-level-nearplane-m");
+
+
+ _tiedProperties.Tie("viewer-lon-deg", this, &View::getLon_deg);
+ _tiedProperties.Tie("viewer-lat-deg", this, &View::getLat_deg);
+ _tiedProperties.Tie("viewer-elev-ft", this, &View::getElev_ft);
+
// expose various quaternions under the debug/ subtree
_tiedProperties.Tie("debug/orientation-w", this, &View::getOrientation_w);
_tiedProperties.Tie("debug/orientation-x", this, &View::getOrientation_x);
return flightgear::CameraGroup::getDefault()->getMasterAspectRatio();
}
+double View::getLon_deg() const
+{
+ return _position.getLongitudeDeg();
+}
+
+double View::getLat_deg() const
+{
+ return _position.getLatitudeDeg();
+}
+
+double View::getElev_ft() const
+{
+ return _position.getElevationFt();
+}
+
View::PositionAttitudeProperties::PositionAttitudeProperties()
{
}
double getOrOffset_y() const;
double getOrOffset_z() const;
+ double getLon_deg() const;
+ double getLat_deg() const;
+ double getElev_ft() const;
+
//////////////////////////////////////////////////////////////////
// private data //
//////////////////////////////////////////////////////////////////
(double_getter)0, &FGViewMgr::setViewAxisLat);
fgSetArchivable("/sim/current-view/axes/lat");
- _tiedProperties.Tie("ground-level-nearplane-m", this,
- &FGViewMgr::getNear_m, &FGViewMgr::setNear_m);
- fgSetArchivable("/sim/current-view/ground-level-nearplane-m");
-
- _tiedProperties.Tie("viewer-lon-deg", this, &FGViewMgr::getViewLon_deg);
- _tiedProperties.Tie("viewer-lat-deg", this, &FGViewMgr::getViewLat_deg);
- _tiedProperties.Tie("viewer-elev-ft", this, &FGViewMgr::getViewElev_ft);
-
-
current_x_offs = fgGetNode("/sim/current-view/x-offset-m", true);
current_y_offs = fgGetNode("/sim/current-view/y-offset-m", true);
current_z_offs = fgGetNode("/sim/current-view/z-offset-m", true);
update(0.0);
}
-double
-FGViewMgr::getNear_m () const
-{
- const flightgear::View * view = get_current_view();
- return (view == 0 ? 0.5f : view->getNear_m());
-}
-
-void
-FGViewMgr::setNear_m (double near_m)
-{
- flightgear::View * view = get_current_view();
- if (view != 0)
- view->setNear_m(near_m);
-}
-
void
FGViewMgr::setViewAxisLong (double axis)
{
axis_lat = axis;
}
-double
-FGViewMgr::getViewLon_deg() const
-{
- const flightgear::View* view = get_current_view();
- return (view != NULL) ? view->getPosition().getLongitudeDeg() : 0.0;
-}
-
-double
-FGViewMgr::getViewLat_deg() const
-{
- const flightgear::View* view = get_current_view();
- return (view != NULL) ? view->getPosition().getLatitudeDeg() : 0.0;
-}
-
-double
-FGViewMgr::getViewElev_ft() const
-{
- const flightgear::View* view = get_current_view();
- return (view != NULL) ? view->getPosition().getElevationFt() : 0.0;
-}
-
void
FGViewMgr::do_axes ()
{
double getViewTargetZOffset_m () const;
void setViewTargetZOffset_m (double z);
- double getNear_m () const;
- void setNear_m (double near_m);
void setViewAxisLong (double axis);
void setViewAxisLat (double axis);
int getView () const;
void setView (int newview);
- double getViewLon_deg() const;
- double getViewLat_deg() const;
- double getViewElev_ft() const;
-
bool inited;
std::vector<SGPropertyNode_ptr> config_list;
SGPropertyNode_ptr _viewNumberProp;
typedef std::vector<flightgear::ViewPtr> viewer_list;
viewer_list views;
- SGVec3d abs_viewer_position;
int current;