chore: minor TerrainModifier::blend optimisation
This commit is contained in:
parent
65bf506f0b
commit
0ca27ed61e
2 changed files with 3 additions and 7 deletions
|
|
@ -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 };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue