1
0
Fork 0

WS3.0: Buld airports at 0 elevation.

Previously the center of the airport was defined with the correct
elevation, but the runways etc. were built at 0 elevation.

This makes everything at 0 elevation so we can set the elevation
in the STG file for the moment.
This commit is contained in:
Stuart Buchanan 2020-11-15 11:20:41 +00:00
parent f0b24af3f1
commit 566428d5b9

View file

@ -95,12 +95,14 @@ osgDB::ReaderWriter::ReadResult AirportBuilder::readNode(const std::string& file
SG_LOG( SG_GENERAL, SG_DEBUG, "Pavements : " << airport->numPavements()); SG_LOG( SG_GENERAL, SG_DEBUG, "Pavements : " << airport->numPavements());
SG_LOG( SG_GENERAL, SG_DEBUG, "Line Features : " << airport->numLineFeatures()); SG_LOG( SG_GENERAL, SG_DEBUG, "Line Features : " << airport->numLineFeatures());
const SGVec3f center = SGVec3f::fromGeod(airport->geod()); const SGGeod zeroAltitudeCenter = SGGeod::fromDegM(airport->getLongitude(), airport->getLatitude(), 0.0f);
const SGVec3f center = SGVec3f::fromGeod(zeroAltitudeCenter);
// Create a matrix operation that will center the airport facing the z axis // Create a matrix operation that will center the airport facing the z axis
// We cannot also perform the translate to the center of the airport as we // We cannot also perform the translate to the center of the airport as we
// hit floating point precision issues, so we do that separately. // hit floating point precision issues, so we do that separately.
osg::Matrixd mat = osg::Matrix(toOsg(SGQuatd::fromLonLat(airport->geod()))); osg::Matrixd mat = osg::Matrix(toOsg(SGQuatd::fromLonLat(zeroAltitudeCenter)));
mat.preMultRotate(osg::Quat(0.0, 1.0, 0.0, 0.0)); mat.preMultRotate(osg::Quat(0.0, 1.0, 0.0, 0.0));
std::vector<osg::Node*> nodeList; std::vector<osg::Node*> nodeList;