Revert "Simplify clouds"

This reverts commit bd50262ca4.
This commit is contained in:
2025-12-02 21:26:28 +00:00
parent 5d0fc10372
commit 5dbb67349b
5 changed files with 50 additions and 33 deletions
+9 -7
View File
@@ -14,7 +14,7 @@ import Data.Maybe
import Data.Monoid
import Dodge.Base
import Dodge.Bullet
--import Dodge.Cloud
import Dodge.Cloud
import Dodge.CrGroupUpdate
import Dodge.Creature.Mass
import Dodge.Creature.Radius
@@ -802,15 +802,17 @@ updateCloud w c
& clTimer -~ 1
)
where
newVel = 0.95 *^ (springVels & _z +~ 0.02)
newVel@(V3 _ _ nvz) = (0.95 *^ springVels) + V3 0 0 (0.01 * vertVel)
newVel2 = stripZ newVel
vertVel = min 5 $ clAlt c - opz
springVels = foldl' (clClSpringVel c) (_clVel c) (clsNearPoint oldPos2 w)
oldPos = _clPos c
oldPos@(V3 _ _ opz) = _clPos c
oldPos2 = stripZ oldPos
newPos@(V3 _ _ npz) = oldPos + newVel
newPos@(V3 _ _ npz) = oldPos +.+.+ newVel
newPos2 = stripZ newPos
hitWl = bouncePoint (const True) 1 oldPos2 newPos2 w
finalPos = addZ (max 1 $ min 90 npz) $ maybe newPos2 fst hitWl
finalVel = newVel & _xy %~ maybe id (const . snd) hitWl
finalVel = addZ nvz $ maybe newVel2 snd hitWl
updateDust :: World -> Dust -> Maybe Dust
updateDust w c
@@ -833,12 +835,12 @@ updateDust w c
clClSpringVel :: Cloud -> Point3 -> Cloud -> Point3
clClSpringVel a v b
| dist3 pa pb < radDist = v + 0.1 *^ normalize (pa - pb)
| dist3 pa pb < radDist = v +.+.+ 0.1 *.*.* normalizeV3 (pa -.-.- pb)
| otherwise = v
where
pa = _clPos a
pb = _clPos b
radDist = 8
radDist = 10
--radDist = (_clRad a + _clRad b) / 2