Compute teh altitude-agl if the remote end isn't sending it.
This commit is contained in:
parent
429a5067d8
commit
29dcc1ca1e
1 changed files with 8 additions and 1 deletions
|
@ -34,6 +34,7 @@
|
|||
#include <Time/tmp.hxx>
|
||||
#include <Main/fg_props.hxx>
|
||||
#include <Main/globals.hxx>
|
||||
#include <Scenery/scenery.hxx>
|
||||
|
||||
#include "native_fdm.hxx"
|
||||
|
||||
|
@ -346,7 +347,13 @@ void FGNetFDM2Props( FGNetFDM *net, bool net_byte_order ) {
|
|||
net->longitude,
|
||||
net->altitude
|
||||
* SG_METER_TO_FEET );
|
||||
if ( net->agl > -9000 ) {
|
||||
cur_fdm_state->_set_Altitude_AGL( net->agl * SG_METER_TO_FEET );
|
||||
} else {
|
||||
double agl_m
|
||||
= net->altitude - globals->get_scenery()->get_cur_elev();
|
||||
cur_fdm_state->_set_Altitude_AGL( agl_m * SG_METER_TO_FEET );
|
||||
}
|
||||
cur_fdm_state->_set_Euler_Angles( net->phi,
|
||||
net->theta,
|
||||
net->psi );
|
||||
|
|
Loading…
Add table
Reference in a new issue