Align terrain movement snowline parameters with shader and add polar land ice threshold

This commit is contained in:
bart
2026-11-08 20:59:53 +01:00
parent 72234a23a8
commit 73acd61c82
3 changed files with 17 additions and 4 deletions
+13 -2
View File
@@ -12,8 +12,9 @@ TerrainMovementConfig::TerrainMovementConfig()
snowHeightKm(3.1f),
polarSnowLineEnabled(true),
polarSnowLineBaseKm(2.5f),
polarSnowFactorStart(0.88f),
polarSnowFactorEnd(0.98f),
polarSnowFactorStart(0.40f),
polarSnowFactorEnd(0.85f),
polarLandIceThreshold(0.72f),
uphillSlopeMultiplier(4.0f),
downhillSlopeBonusMultiplier(2.0f),
minStepCost(0.25f),
@@ -77,6 +78,9 @@ bool TerrainMovementManager::loadConfig(const QString &filePath)
if (root.hasChild("polar_snow_factor_end")) {
m_config.polarSnowFactorEnd = root["polar_snow_factor_end"].asFloat(0.85f);
}
if (root.hasChild("polar_land_ice_threshold")) {
m_config.polarLandIceThreshold = root["polar_land_ice_threshold"].asFloat(0.72f);
}
if (root.hasChild("uphill_slope_multiplier")) {
m_config.uphillSlopeMultiplier = root["uphill_slope_multiplier"].asFloat(4.0f);
@@ -164,6 +168,13 @@ QString TerrainMovementManager::getTerrainType(int tx, int ty, Matrix2D<TerrainP
return "sneeuw";
}
}
if (distFromCenter >= m_config.polarLandIceThreshold) {
float tIce = std::max(0.0f, std::min(1.0f, (distFromCenter - m_config.polarLandIceThreshold) / 0.20f));
float polarLandIce = tIce * tIce * (3.0f - 2.0f * tIce);
if (polarLandIce > 0.5f) {
return "sneeuw";
}
}
}
// 4. Rocky mountain