Refactor more collisions to use streaming

This commit is contained in:
2022-06-24 13:58:08 +01:00
parent 78f211a129
commit b467a7dd91
3 changed files with 19 additions and 17 deletions
+3 -2
View File
@@ -232,8 +232,9 @@ farWallDistDirection p w = runIdentity $ L.purely S.fold_ ((,,,)
)
$ S.map f vps
where
f q = rotateV (negate $ _cameraRot w)
$ runIdentity (L.purely S.fold_ (collidePointWallsL p q) (S.filter wlIsOpaque $ wallsAlongLineStream p q w)) -.- p
f q = runIdentity (S.fold_ findPoint q (rotateV (negate $ _cameraRot w) . (-.- p)) (wls q))
wls q = S.filter wlIsOpaque $ wallsAlongLineStream p q w
findPoint q = fromMaybe q . uncurry (intersectSegSeg p q) . _wlLine
vps = streamViewpoints p w