Simplify analyser machines somewhat
This commit is contained in:
@@ -58,14 +58,14 @@ outsideScreenPolygon cfig w = [tr, tl, bl, br]
|
||||
-- towards the center of sight
|
||||
lineOnScreenCone :: Config -> World -> Point2 -> Point2 -> Bool
|
||||
lineOnScreenCone cfig w p1 p2 =
|
||||
pointInPolygon p1 sp
|
||||
|| pointInPolygon p2 sp
|
||||
pointInPoly p1 sp
|
||||
|| pointInPoly p2 sp
|
||||
|| any (isJust . uncurry (intersectSegSeg p1 p2)) sps
|
||||
where
|
||||
sp' = screenPolygon cfig (w ^. wCam)
|
||||
vp = w ^. wCam . camViewFrom
|
||||
sp
|
||||
| pointInPolygon vp sp' = sp'
|
||||
| pointInPoly vp sp' = sp'
|
||||
| otherwise = orderPolygon ((w ^. wCam . camViewFrom) : sp')
|
||||
sps = zip sp (tail sp ++ [head sp])
|
||||
|
||||
@@ -446,7 +446,7 @@ drawPathing cfig w =
|
||||
|
||||
edgeToPic :: [Point2] -> PathEdge -> Picture
|
||||
edgeToPic poly pe
|
||||
| not (pointInPolygon sp poly) && not (pointInPolygon ep poly) = mempty
|
||||
| not (pointInPoly sp poly) && not (pointInPoly ep poly) = mempty
|
||||
| otherwise = drawPathEdge pe
|
||||
where
|
||||
sp = _peStart pe
|
||||
|
||||
Reference in New Issue
Block a user