1
0
Fork 0

Remove legacy ‘axes/lat’ and ‘axes/long’ props.

- only exits to support some legacy joystick hat configs,
  which have been updated to use the goal- properties directly.
This commit is contained in:
James Turner 2016-01-24 12:54:47 -06:00
parent 7b08c621b4
commit 5629cf1a8d
2 changed files with 0 additions and 78 deletions

View file

@ -37,8 +37,6 @@
// Constructor
FGViewMgr::FGViewMgr( void ) :
axis_long(0),
axis_lat(0),
inited(false),
config_list(fgGetNode("/sim", true)->getChildren("view")),
current(0)
@ -101,8 +99,6 @@ FGViewMgr::reinit ()
}
}
typedef double (FGViewMgr::*double_getter)() const;
void
FGViewMgr::bind()
{
@ -116,15 +112,6 @@ FGViewMgr::bind()
_viewNumberProp->setAttribute(SGPropertyNode::ARCHIVE, false);
_viewNumberProp->setAttribute(SGPropertyNode::PRESERVE, true);
_tiedProperties.Tie("axes/long", this,
(double_getter)0, &FGViewMgr::setViewAxisLong);
fgSetArchivable("/sim/current-view/axes/long");
_tiedProperties.Tie("axes/lat", this,
(double_getter)0, &FGViewMgr::setViewAxisLat);
fgSetArchivable("/sim/current-view/axes/lat");
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);
@ -176,7 +163,6 @@ FGViewMgr::update (double dt)
currentView->setTargetZOffset_m(target_z_offs->getDoubleValue());
// Update the current view
do_axes();
currentView->update(dt);
@ -300,59 +286,3 @@ FGViewMgr::setView (int newview)
// on FGViewer, so update() is a no-op.
update(0.0);
}
void
FGViewMgr::setViewAxisLong (double axis)
{
axis_long = axis;
}
void
FGViewMgr::setViewAxisLat (double axis)
{
axis_lat = axis;
}
void
FGViewMgr::do_axes ()
{
// Take no action when hat is centered
if ( ( axis_long < 0.01 ) &&
( axis_long > -0.01 ) &&
( axis_lat < 0.01 ) &&
( axis_lat > -0.01 )
)
return;
double viewDir = 999;
/* Do all the quick and easy cases */
if (axis_long < 0) { // Longitudinal axis forward
if (axis_lat == axis_long)
viewDir = fgGetDouble("/sim/view/config/front-left-direction-deg");
else if (axis_lat == - axis_long)
viewDir = fgGetDouble("/sim/view/config/front-right-direction-deg");
else if (axis_lat == 0)
viewDir = fgGetDouble("/sim/view/config/front-direction-deg");
} else if (axis_long > 0) { // Longitudinal axis backward
if (axis_lat == - axis_long)
viewDir = fgGetDouble("/sim/view/config/back-left-direction-deg");
else if (axis_lat == axis_long)
viewDir = fgGetDouble("/sim/view/config/back-right-direction-deg");
else if (axis_lat == 0)
viewDir = fgGetDouble("/sim/view/config/back-direction-deg");
} else if (axis_long == 0) { // Longitudinal axis neutral
if (axis_lat < 0)
viewDir = fgGetDouble("/sim/view/config/left-direction-deg");
else if (axis_lat > 0)
viewDir = fgGetDouble("/sim/view/config/right-direction-deg");
else return; /* And assertion failure maybe? */
}
// Do all the difficult cases
if ( viewDir > 900 )
viewDir = SGD_RADIANS_TO_DEGREES * atan2 ( -axis_lat, -axis_long );
if ( viewDir < -1 ) viewDir += 360;
get_current_view()->setGoalHeadingOffset_deg(viewDir);
}

View file

@ -81,14 +81,6 @@ public:
private:
simgear::TiedPropertyList _tiedProperties;
double axis_long;
double axis_lat;
void do_axes ();
void setViewAxisLong (double axis);
void setViewAxisLat (double axis);
int getView () const;
void setView (int newview);