Skip to content

Commit

Permalink
[FS9] Set ground elevation at own aircraft position
Browse files Browse the repository at this point in the history
  • Loading branch information
emiro85 committed Feb 4, 2022
1 parent 29a9b20 commit 099f726
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/simulator/fscommon/fsuipcimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ namespace BlackSimPlugin::FsCommon
CCoordinateGeodetic position = situation.getPosition();
CLatitude lat(latitudeRaw * latCorrectionFactor, CAngleUnit::deg());
CLongitude lon(longitudeRaw * lonCorrectionFactor, CAngleUnit::deg());
CAltitude groundAltitude(groundAltitudeRaw / 256.0, CLengthUnit::m());
CAltitude groundAltitude(groundAltitudeRaw / 256.0, CAltitude::MeanSeaLevel, CLengthUnit::m());
position.setLatitude(lat);
position.setLongitude(lon);
position.setGeodeticHeight(groundAltitude);
Expand Down Expand Up @@ -531,6 +531,7 @@ namespace BlackSimPlugin::FsCommon
situation.setPressureAltitude(pressureAltitude);
situation.setVelocity({velocityWorld[0], velocityWorld[1], velocityWorld[2], CSpeedUnit::ft_s(), rotationVelocityBody[0],
rotationVelocityBody[1], rotationVelocityBody[2], CAngleUnit::rad(), CTimeUnit::s()});
situation.setGroundElevation(groundAltitude, CAircraftSituation::FromProvider);
aircraft.setSituation(situation);
aircraft.setCG(altitude - groundAltitude); // calculate the CG
} // situation
Expand Down

0 comments on commit 099f726

Please sign in to comment.