From b8ddf517f4495219da7675d81bed59a378e2d78a Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Thu, 14 Jan 2021 11:32:07 +0000 Subject: [PATCH] WS3.0 Add OBJECT STG entries as elevation constraints Note this is for OBJECT only (e.g. airports), not OBJECT_STATIC or OBJECT_SHARED --- simgear/scene/tgdb/ReaderWriterSTG.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/simgear/scene/tgdb/ReaderWriterSTG.cxx b/simgear/scene/tgdb/ReaderWriterSTG.cxx index b9a0cb95..f7be485e 100644 --- a/simgear/scene/tgdb/ReaderWriterSTG.cxx +++ b/simgear/scene/tgdb/ReaderWriterSTG.cxx @@ -53,6 +53,8 @@ #include #include #include +#include + #include @@ -673,6 +675,11 @@ struct ReaderWriterSTG::_ModelBin { << stgObject._token << " '" << stgObject._name << "'"); continue; } + + // Add the OBJECT to the elevation constraints of the terrain so the terrain + // doesn't poke through the airport + simgear::VPBTechnique::addElevationConstraint(node, terrainGroup); + terrainGroup->addChild(node.get()); } } else if (_foundBase) {