Refactor flash lighting, improve laser scope lighting

This commit is contained in:
jgk
2021-03-23 19:36:59 +01:00
parent 3e2eaeece2
commit 021ff857fc
4 changed files with 25 additions and 39 deletions
+4
View File
@@ -171,6 +171,10 @@ canSeeFireVisionAll i j w = (not $ or $ fmap ($ (wallsAlongLine (_crPos icr) (_c
-- where hitPoint w = myIntersectSegSeg p1 p2 (_wlLine w !! 0) (_wlLine w !! 1)
-- hitWalls = filter (\w -> Nothing /= hitPoint w) (IM.elems ws)
wallNormal :: Wall -> Point2
wallNormal wl = normalizeV . vNormal $ a -.- b
where (a:b:_) = _wlLine wl
wallsOnLine :: Point2 -> Point2 -> IM.IntMap Wall -> [Wall]
wallsOnLine p1 p2 ws = hitWalls
where hitPoint w = intersectSegSeg' p1 p2 (_wlLine w !! 0) (_wlLine w !! 1)