mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
[FS9] Set ground elevation at own aircraft position
This commit is contained in:
@@ -501,7 +501,7 @@ namespace BlackSimPlugin::FsCommon
|
|||||||
CCoordinateGeodetic position = situation.getPosition();
|
CCoordinateGeodetic position = situation.getPosition();
|
||||||
CLatitude lat(latitudeRaw * latCorrectionFactor, CAngleUnit::deg());
|
CLatitude lat(latitudeRaw * latCorrectionFactor, CAngleUnit::deg());
|
||||||
CLongitude lon(longitudeRaw * lonCorrectionFactor, 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.setLatitude(lat);
|
||||||
position.setLongitude(lon);
|
position.setLongitude(lon);
|
||||||
position.setGeodeticHeight(groundAltitude);
|
position.setGeodeticHeight(groundAltitude);
|
||||||
@@ -531,6 +531,7 @@ namespace BlackSimPlugin::FsCommon
|
|||||||
situation.setPressureAltitude(pressureAltitude);
|
situation.setPressureAltitude(pressureAltitude);
|
||||||
situation.setVelocity({velocityWorld[0], velocityWorld[1], velocityWorld[2], CSpeedUnit::ft_s(), rotationVelocityBody[0],
|
situation.setVelocity({velocityWorld[0], velocityWorld[1], velocityWorld[2], CSpeedUnit::ft_s(), rotationVelocityBody[0],
|
||||||
rotationVelocityBody[1], rotationVelocityBody[2], CAngleUnit::rad(), CTimeUnit::s()});
|
rotationVelocityBody[1], rotationVelocityBody[2], CAngleUnit::rad(), CTimeUnit::s()});
|
||||||
|
situation.setGroundElevation(groundAltitude, CAircraftSituation::FromProvider);
|
||||||
aircraft.setSituation(situation);
|
aircraft.setSituation(situation);
|
||||||
aircraft.setCG(altitude - groundAltitude); // calculate the CG
|
aircraft.setCG(altitude - groundAltitude); // calculate the CG
|
||||||
} // situation
|
} // situation
|
||||||
|
|||||||
Reference in New Issue
Block a user