Turn shapeObject's vertices into a stream

This commit is contained in:
2022-06-27 17:47:03 +01:00
parent 8d5800d806
commit 673e9b11fc
7 changed files with 47 additions and 38 deletions
+1 -1
View File
@@ -12,5 +12,5 @@ data ForegroundShape = ForegroundShape
, _fsRad :: Float -- This should probably be a bounding box
, _fsSPic :: SPic
}
deriving (Eq,Show,Ord)
deriving ()
makeLenses ''ForegroundShape
+8 -8
View File
@@ -45,14 +45,14 @@ initialAnoTree = OnwardList
, AnRoom slowDoorRoom
-- , AnRoom $ roomCCrits 10
, AnTree firstBreather
-- , AnTree $ telRoomLev 1 >>= rToOnward "telRoomLev" . pure . cleatOnward
-- ]
--
--extraAnoList :: [Annotation]
--extraAnoList =
---- , (SpecificRoom . return . tToBTree $ treePost [corridor,corridor,cleatOnward corridor])
-- [ AnRoom $ roomCCrits 10
-- , AnRoom $ roomCCrits 10
, AnTree $ telRoomLev 1 >>= rToOnward "telRoomLev" . pure . cleatOnward
]
extraAnoList :: [Annotation]
extraAnoList =
-- , (SpecificRoom . return . tToBTree $ treePost [corridor,corridor,cleatOnward corridor])
[ AnRoom $ roomCCrits 10
, AnRoom $ roomCCrits 10
, AnTree $ tToBTree "spawners" <$> spawnerRoom
, AnRoom pistolerRoom
, AnRoom doubleCorridorBarrels
+5 -5
View File
@@ -125,14 +125,14 @@ putShape sh = PutForeground $ defaultForeground
& fsRad .~ radBounds bnds
& fsSPic .~ noPic (uncurryV translateSHf (-m) $ sh)
where
bnds = shapeBounds sh
bnds = (0,0,0,0) -- shapeBounds sh
m = midBounds bnds
shapePoints :: Shape -> Stream (Of Point2) Identity ()
shapePoints = S.each . concatMap (map (stripZ . _svPos) . _shVs)
--shapePoints :: Shape -> Stream (Of Point2) Identity ()
--shapePoints = S.each . concatMap (map (stripZ . _svPos) . _shVs)
shapeBounds :: Shape -> (Float,Float,Float,Float)
shapeBounds = fromMaybe (0,0,0,0) . boundPoints . shapePoints
--shapeBounds :: Shape -> (Float,Float,Float,Float)
--shapeBounds = fromMaybe (0,0,0,0) . boundPoints . shapePoints
midBounds :: (Float,Float,Float,Float) -> Point2
midBounds (n,s,e,w) = V2 ((n + s)/2) ((e + w)/2)