chore: minor TerrainModifier::blend optimisation

This commit is contained in:
Sara Gerretsen 2026-02-26 20:28:09 +01:00
parent 65bf506f0b
commit 0ca27ed61e
2 changed files with 3 additions and 7 deletions

View file

@ -28,12 +28,8 @@ float TerrainModifier::blend(float under, float over) {
float const difference{ under - over };
float const distance{ Math::abs(difference) };
// .25 because we need half of each half of the blend range to be used
float const center_distance{
this->blend_distance == 0.f
? 0.f
: this->blend_distance * 0.25f - distance / this->blend_distance
};
if (center_distance < 0.f) {
float const center_distance{ this->blend_distance == 0.f ? 0.f : this->blend_distance * 0.25f - distance / this->blend_distance };
if (center_distance <= 0.f) {
return over;
}
float const smooth_center_distance{ center_distance * center_distance };