Hack solution to path graph space leak: evaluate all edge obstacles
This commit is contained in:
@@ -209,11 +209,12 @@ drawPathBetween u = concat $ do
|
||||
let nodepos = (`getNodePos` w)
|
||||
nodelist = makePathBetween sp ep w
|
||||
return . setLayer DebugLayer $
|
||||
color rose (foldMap (arrowPath . mapMaybe nodepos) nodelist)
|
||||
--color rose (foldMap (arrowPath . mapMaybe nodepos) nodelist)
|
||||
color rose (foldMap (arrowPath . map nodepos) nodelist)
|
||||
<> drawCrossCol green sp
|
||||
<> drawCrossCol cyan ep
|
||||
<> foldMap (color green . arrow sp) (nodepos =<< walkableNodeNear w sp)
|
||||
<> foldMap (color cyan . flip arrow ep) (nodepos =<< walkableNodeNear w ep)
|
||||
<> foldMap (color green . arrow sp) (nodepos <$> walkableNodeNear w sp)
|
||||
<> foldMap (color cyan . flip arrow ep) (nodepos <$> walkableNodeNear w ep)
|
||||
<> foldMap (color orange . arrow sp) (pointTowardsImpulse sp ep w)
|
||||
where
|
||||
w = u ^. uvWorld
|
||||
@@ -403,14 +404,11 @@ drawWlIDs w = setLayer FixedCoordLayer $ foldMap f (w ^. cWorld . lWorld . walls
|
||||
drawPathing :: Config -> World -> Picture
|
||||
drawPathing cfig w = setLayer DebugLayer $ ifoldMap f $ w ^. cWorld . incGraph
|
||||
where
|
||||
inodes = w ^. cWorld . incNode
|
||||
--f i = foldMap (g i)
|
||||
--g i (j,se) = edgeToPic (screenPolygon cfig (w ^.wCam))
|
||||
-- (inodes ^?! ix i) (inodes ^?! ix j) (se ^. seObstacles)
|
||||
inode i = w ^?! cWorld . incNode . ix i
|
||||
f :: Int -> IM.IntMap SimpleEdge -> Picture
|
||||
f i = ifoldMap (g i)
|
||||
g i j se = edgeToPic (screenPolygon cfig (w ^.wCam))
|
||||
(inodes ^?! ix i) (inodes ^?! ix j) (se ^. seObstacles)
|
||||
(inode i) (inode j) (se ^. seObstacles)
|
||||
|
||||
edgeToPic :: [Point2] -> Point2 -> Point2 -> S.Set EdgeObstacle -> Picture
|
||||
edgeToPic poly sp ep pe
|
||||
|
||||
Reference in New Issue
Block a user