From db8b66203d8af0cfe6156915d0b91e5da36ca878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Garc=C3=ADa=20Li=C3=B1=C3=A1n?= Date: Wed, 28 Jul 2021 10:47:00 +0200 Subject: [PATCH] WS 3.0: Apply the TERRAIN_BIT nodemask to all geodes --- simgear/scene/tgdb/VPBTechnique.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/simgear/scene/tgdb/VPBTechnique.cxx b/simgear/scene/tgdb/VPBTechnique.cxx index d6aab3f9..7cae7154 100644 --- a/simgear/scene/tgdb/VPBTechnique.cxx +++ b/simgear/scene/tgdb/VPBTechnique.cxx @@ -46,9 +46,9 @@ #include #include #include +#include #include #include -#include #include "VPBTechnique.hxx" #include "TreeBin.hxx" @@ -807,12 +807,14 @@ void VPBTechnique::generateGeometry(BufferData& buffer, Locator* masterLocator, osg::ref_ptr landEffect = makeEffect(landEffectProp, true, _options); buffer._landGeode->setEffect(landEffect.get()); + buffer._landGeode->setNodeMask(SG_NODEMASK_TERRAIN_BIT); buffer._waterGeometry = new osg::Geometry; buffer._waterGeode->addDrawable(buffer._waterGeometry.get()); osg::ref_ptr waterEffect = makeEffect(waterEffectProp, true, _options); buffer._waterGeode->setEffect(waterEffect.get()); + buffer._waterGeode->setNodeMask(SG_NODEMASK_TERRAIN_BIT); unsigned int numRows = 20; unsigned int numColumns = 20; @@ -1594,6 +1596,7 @@ void VPBTechnique::applyTrees(BufferData& buffer, Locator* masterLocator) 0.0, osg::Vec3d(1.0, 0.0, 0.0)); osg::Group* trees = createForest(randomForest, R_vert, _options, 1); + trees->setNodeMask(SG_NODEMASK_TERRAIN_BIT); buffer._transform->addChild(trees); } @@ -1686,7 +1689,7 @@ void VPBTechnique::applyLineFeatures(BufferData& buffer, Locator* masterLocator) geode->setMaterial(mat); geode->setEffect(mat->get_one_effect(0)); - geode->setNodeMask( ~(simgear::CASTSHADOW_BIT | simgear::MODELLIGHT_BIT) ); + geode->setNodeMask(SG_NODEMASK_TERRAIN_BIT); buffer._transform->addChild(geode); } } @@ -1875,7 +1878,7 @@ void VPBTechnique::applyAreaFeatures(BufferData& buffer, Locator* masterLocator) geode->setMaterial(mat); geode->setEffect(mat->get_one_effect(0)); - geode->setNodeMask( ~(simgear::CASTSHADOW_BIT | simgear::MODELLIGHT_BIT) ); + geode->setNodeMask(SG_NODEMASK_TERRAIN_BIT); buffer._transform->addChild(geode); } } @@ -2051,7 +2054,7 @@ void VPBTechnique::applyCoastline(BufferData& buffer, Locator* masterLocator) geode->setMaterial(mat); geode->setEffect(mat->get_one_effect(0)); - geode->setNodeMask( ~(simgear::CASTSHADOW_BIT | simgear::MODELLIGHT_BIT) ); + geode->setNodeMask(SG_NODEMASK_TERRAIN_BIT); buffer._transform->addChild(geode); }