Add indicator light to switch doors

This commit is contained in:
2021-11-16 12:57:13 +00:00
parent a7f2b5f3ea
commit f530952612
9 changed files with 117 additions and 20 deletions
+23
View File
@@ -0,0 +1,23 @@
module Dodge.PlacementSpot where
import Dodge.LevelGen.Data
import Geometry
-- TODO rename to any unused link facing out
anyLnkOutPS :: PlacementSpot
anyLnkOutPS = PSLnk f (const id) Nothing
where
f (UnusedLink p a) = Just $ PS p a
f _ = Nothing
fstLnkOut :: PlacementSpot
fstLnkOut = PSLnk f (const id) Nothing
where
f (OutLink 0 p a) = Just $ PS p a
f _ = Nothing
anyLnkInPS :: Float -- ^ amount to shift inward
-> PlacementSpot
anyLnkInPS x = PSLnk f (const id) Nothing
where
f (UnusedLink v a) = Just $ PS (v -.- x *.* unitVectorAtAngle (a + 0.5 * pi)) (a+ pi)
f _ = Nothing