Partially implement grenades down chasms

This commit is contained in:
2025-08-04 09:39:04 +01:00
parent 2a93b7f733
commit a68013b934
6 changed files with 103 additions and 79 deletions
+2 -2
View File
@@ -24,10 +24,10 @@ updateDebrisChunk w db = (w, mdb)
np = sp + sv
cdb = case collide3WallsFloor sp np w of
(p,Nothing) -> db & dbPos .~ p
& dbVel -~ V3 0 0 1
& dbVel -~ V3 0 0 0.5
& dbRot %~ dospin
(p,Just (n,_)) -> db & dbPos .~ p + (0.0001 * normalize n)
& dbVel .~ (0.7 * reflectInNormal n sv) - V3 0 0 1
& dbVel .~ (0.7 * reflectInNormal n sv) - V3 0 0 0.5
dospin = (_dbSpin db *)
mdb = do
guard (np ^. _z > -1000)