Simplify clouds

This commit is contained in:
2025-12-02 21:28:10 +00:00
parent 5dbb67349b
commit 984a114310
+4 -4
View File
@@ -808,10 +808,10 @@ updateCloud w c
springVels = foldl' (clClSpringVel c) (_clVel c) (clsNearPoint oldPos2 w) springVels = foldl' (clClSpringVel c) (_clVel c) (clsNearPoint oldPos2 w)
oldPos@(V3 _ _ opz) = _clPos c oldPos@(V3 _ _ opz) = _clPos c
oldPos2 = stripZ oldPos oldPos2 = stripZ oldPos
newPos@(V3 _ _ npz) = oldPos +.+.+ newVel newPos@(V3 _ _ npz) = oldPos + newVel
newPos2 = stripZ newPos newPos2 = stripZ newPos
hitWl = bouncePoint (const True) 1 oldPos2 newPos2 w hitWl = bouncePoint (const True) 1 oldPos2 newPos2 w
finalPos = addZ (max 1 $ min 90 npz) $ maybe newPos2 fst hitWl finalPos = addZ (min 90 npz) $ maybe newPos2 fst hitWl
finalVel = addZ nvz $ maybe newVel2 snd hitWl finalVel = addZ nvz $ maybe newVel2 snd hitWl
updateDust :: World -> Dust -> Maybe Dust updateDust :: World -> Dust -> Maybe Dust
@@ -831,11 +831,11 @@ updateDust w c
newPos@(V3 _ _ npz) = oldPos + v newPos@(V3 _ _ npz) = oldPos + v
newPos2 = stripZ newPos newPos2 = stripZ newPos
hitWl = bouncePoint (const True) 1 oldPos2 newPos2 w hitWl = bouncePoint (const True) 1 oldPos2 newPos2 w
finalpos = addZ (max 1 $ min 90 npz) $ maybe newPos2 fst hitWl finalpos = addZ (max 1 npz) $ maybe newPos2 fst hitWl
clClSpringVel :: Cloud -> Point3 -> Cloud -> Point3 clClSpringVel :: Cloud -> Point3 -> Cloud -> Point3
clClSpringVel a v b clClSpringVel a v b
| dist3 pa pb < radDist = v +.+.+ 0.1 *.*.* normalizeV3 (pa -.-.- pb) | dist3 pa pb < radDist = v + 0.1 *^ normalizeV3 (pa - pb)
| otherwise = v | otherwise = v
where where
pa = _clPos a pa = _clPos a