Improve line zoning
This commit is contained in:
@@ -121,7 +121,7 @@ wallShadowsToDraw w = filter (fromMaybe True . (^? blVisible))
|
||||
-- towards the center of sight
|
||||
lineOnScreenCone :: World -> Point2 -> Point2 -> Bool
|
||||
lineOnScreenCone w p1 p2 = errorPointInPolygon 8 p1 sp || errorPointInPolygon 9 p2 sp
|
||||
|| any (isJust . uncurry (intersectSegSeg' p1 p2)) sps
|
||||
|| any (isJust . uncurry (intersectSegSeg p1 p2)) sps
|
||||
where
|
||||
sp' = screenPolygon w
|
||||
vp = _cameraViewFrom w
|
||||
@@ -132,7 +132,7 @@ lineOnScreenCone w p1 p2 = errorPointInPolygon 8 p1 sp || errorPointInPolygon 9
|
||||
|
||||
lineOnScreen :: World -> Point2 -> Point2 -> Bool
|
||||
lineOnScreen w p1 p2 = errorPointInPolygon 8 p1 sp || errorPointInPolygon 9 p2 sp
|
||||
|| any (isJust . uncurry (intersectSegSeg' p1 p2)) sps
|
||||
|| any (isJust . uncurry (intersectSegSeg p1 p2)) sps
|
||||
where
|
||||
sp = screenPolygon w
|
||||
sps = zip sp (tail sp ++ [head sp])
|
||||
@@ -160,7 +160,7 @@ extendConeToScreenEdge w c (x,y) = orderPolygon $ wallScreenIntersect ++ [x,y] +
|
||||
where
|
||||
borderPs = mapMaybe (intersectLinefromScreen w c) [x,y]
|
||||
cornerPs = filter (pointIsInCone c (x,y)) $ screenPolygon w
|
||||
wallScreenIntersect = mapMaybe (uncurry $ intersectSegSeg' y ((2*.*y) -.- x))
|
||||
wallScreenIntersect = mapMaybe (uncurry $ intersectSegSeg y ((2*.*y) -.- x))
|
||||
. makeLoopPairs $ screenPolygon w
|
||||
|
||||
rectangleSolid :: Float -> Float -> Picture
|
||||
|
||||
Reference in New Issue
Block a user