feat: simplified distance modifier blend logic
This commit is contained in:
parent
ed1d045ab1
commit
f6442805af
1 changed files with 2 additions and 6 deletions
|
|
@ -63,12 +63,8 @@ float TerrainModifierDistance::evaluate_at(Vector2 world_coordinate, float befor
|
||||||
float const weight_offset{
|
float const weight_offset{
|
||||||
std::clamp(distance, this->distance_weight_curve->get_min_domain(), this->distance_weight_curve->get_max_domain())
|
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) };
|
float const weight{ this->distance_weight_curve->sample_baked(weight_offset) };
|
||||||
if (weight <= 0.f) {
|
return weight <= 0.f ? before : Math::lerp(before, blend(before, this->distance_height_curve->sample_baked(height_offset) + get_global_position().y), weight);
|
||||||
return before;
|
|
||||||
} else {
|
|
||||||
return Math::lerp(before, blend(before, this->distance_height_curve->sample_baked(height_offset) + get_global_position().y), weight);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PackedStringArray TerrainModifierDistance::get_configuration_warnings() const {
|
PackedStringArray TerrainModifierDistance::get_configuration_warnings() const {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue