feat: simplified distance modifier blend logic

This commit is contained in:
Sara Gerretsen 2026-02-22 23:40:29 +01:00
parent ed1d045ab1
commit f6442805af

View file

@ -63,12 +63,8 @@ float TerrainModifierDistance::evaluate_at(Vector2 world_coordinate, float befor
float const weight_offset{
std::clamp(distance, this->distance_weight_curve->get_min_domain(), this->distance_weight_curve->get_max_domain())
};
float weight{ this->distance_weight_curve->sample_baked(weight_offset) };
if (weight <= 0.f) {
return before;
} else {
return Math::lerp(before, blend(before, this->distance_height_curve->sample_baked(height_offset) + get_global_position().y), weight);
}
float const weight{ this->distance_weight_curve->sample_baked(weight_offset) };
return weight <= 0.f ? before : Math::lerp(before, blend(before, this->distance_height_curve->sample_baked(height_offset) + get_global_position().y), weight);
}
PackedStringArray TerrainModifierDistance::get_configuration_warnings() const {