summaryrefslogtreecommitdiffstats
path: root/src/render/WindModifiers.cpp
diff options
context:
space:
mode:
authorRoman Masanin <36927roma@gmail.com>2020-11-01 20:35:46 +0100
committerRoman Masanin <36927roma@gmail.com>2020-11-01 20:35:46 +0100
commit55c43466100e4e79af95500f64513c49d7242877 (patch)
tree2376e54398c53697c07bd6809b9648d561516881 /src/render/WindModifiers.cpp
parentFix build and use enum in ProcessPlayerMood (diff)
parentfixed KYFC (diff)
downloadre3-55c43466100e4e79af95500f64513c49d7242877.tar
re3-55c43466100e4e79af95500f64513c49d7242877.tar.gz
re3-55c43466100e4e79af95500f64513c49d7242877.tar.bz2
re3-55c43466100e4e79af95500f64513c49d7242877.tar.lz
re3-55c43466100e4e79af95500f64513c49d7242877.tar.xz
re3-55c43466100e4e79af95500f64513c49d7242877.tar.zst
re3-55c43466100e4e79af95500f64513c49d7242877.zip
Diffstat (limited to 'src/render/WindModifiers.cpp')
-rw-r--r--src/render/WindModifiers.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/render/WindModifiers.cpp b/src/render/WindModifiers.cpp
index b72e362e..3bd6ac9c 100644
--- a/src/render/WindModifiers.cpp
+++ b/src/render/WindModifiers.cpp
@@ -33,8 +33,9 @@ CWindModifiers::FindWindModifier(CVector pos, float *x, float *y)
float dist = (pos - Array[i].m_pos).Magnitude();
if (dist < MAX_FADE_DIST) {
float distFade = dist < MIN_FADE_DIST ? 1.0f : 1.0f - (dist - MIN_FADE_DIST) / (MAX_FADE_DIST - MIN_FADE_DIST);
- float heightFade = distFade * ((1.0f - zDist / MAX_HEIGHT_DIST) / 2.0f);
- dir = (pos - Array[i].m_pos) * heightFade / dist;
+ float heightFade = 1.0f - zDist / MAX_HEIGHT_DIST;
+ float fade = distFade * heightFade * 0.5f;
+ dir = (pos - Array[i].m_pos) * fade / dist;
bWasWindModifierFound = true;
}
}