1
0
Fork 0

WS30: Add property controlling splitting water mesh

This commit is contained in:
Stuart Buchanan 2022-02-01 16:48:54 +00:00
parent 13fab25b6f
commit 8bbb30225f

View file

@ -283,6 +283,7 @@ public:
setupPropertyListener(elevationMeshNode, "lod-range-factor"); setupPropertyListener(elevationMeshNode, "lod-range-factor");
setupPropertyListener(elevationMeshNode, "sample-ratio"); setupPropertyListener(elevationMeshNode, "sample-ratio");
setupPropertyListener(elevationMeshNode, "vertical-scale"); setupPropertyListener(elevationMeshNode, "vertical-scale");
setupPropertyListener(elevationMeshNode, "separate-water-mesh");
// We also need to set the maximum range based on the LOD ranges // We also need to set the maximum range based on the LOD ranges
SGPropertyNode_ptr lodNode = fgGetNode(lod_node_path, true); SGPropertyNode_ptr lodNode = fgGetNode(lod_node_path, true);
@ -307,6 +308,7 @@ public:
virtual void valueChanged(SGPropertyNode * node) virtual void valueChanged(SGPropertyNode * node)
{ {
float f = node->getFloatValue(); float f = node->getFloatValue();
bool b = node->getBoolValue();
std::string name(node->getNameString()); std::string name(node->getNameString());
if (name == "constraint-gap-m") { if (name == "constraint-gap-m") {
@ -315,6 +317,8 @@ public:
SGSceneFeatures::instance()->setVPBSampleRatio(f); SGSceneFeatures::instance()->setVPBSampleRatio(f);
} else if (name == "vertical-scale") { } else if (name == "vertical-scale") {
SGSceneFeatures::instance()->setVPBVerticalScale(f); SGSceneFeatures::instance()->setVPBVerticalScale(f);
} else if (name == "separate-water-mesh") {
SGSceneFeatures::instance()->setVPBSeparateWaterMesh(b);
} else { } else {
SG_LOG(SG_TERRAIN, SG_ALERT, "Unexpected property in listener " << node->getPath()); SG_LOG(SG_TERRAIN, SG_ALERT, "Unexpected property in listener " << node->getPath());
} }