Cleanup, improve auto wall rotate

This commit is contained in:
2026-03-24 11:28:11 +00:00
parent be2f7160ba
commit 32f1740577
25 changed files with 226 additions and 252 deletions
+12 -16
View File
@@ -10,6 +10,7 @@ import Dodge.LightSource
import Dodge.Placement.Instance.LightSource
import Dodge.PlacementSpot
import Geometry
import Shape
triggerSwitchSPic :: Color -> Color -> PlacementSpot -> Placement
triggerSwitchSPic c1 c2 ps = psPtCont ps (PutTrigger False) $
@@ -19,7 +20,8 @@ triggerSwitchSPic c1 c2 ps = psPtCont ps (PutTrigger False) $
ps
( PutButton
( makeSwitch
c1 c2
c1
c2
(SetTrigger True $ trigid tp)
(SetTrigger False $ trigid tp)
)
@@ -50,14 +52,7 @@ triggerSwitch col ps = psPtCont ps (PutTrigger False) $
Just $
pContID
ps
( PutButton
( makeSwitch
col
col
(SetTrigger True $ trigid tp)
(SetTrigger False $ trigid tp)
)
)
(PutButton (makeSwitch col col (SetTrigger True $ trigid tp) (SetTrigger False $ trigid tp)))
(const Nothing)
where
trigid tp = fromJust $ _plMID tp
@@ -65,14 +60,14 @@ triggerSwitch col ps = psPtCont ps (PutTrigger False) $
putLitButOnPos :: Color -> PlacementSpot -> (Placement -> Maybe Placement) -> Placement
putLitButOnPos col theps subpl =
plSpot .~ theps $
mntLSOn aShape (Just col) ls 0 (V3 0 (-40) 40) $
\plmnt ->
mntLSOn shp ls 0 (V3 0 (-40) 40) $
\pmnt ->
jps0'
(PutButton (makeButton col (changeLight . fromJust $ _plMID plmnt)){_btPos = V2 0 (-1), _btRot = pi})
(PutButton (makeButton col (changeLight $ pmnt ^?! plMID . _Just) & btPos .~ V2 0 (-1) & btRot .~ pi))
subpl
<&> plSpot
.~ _plSpot plmnt
<&> plSpot .~ _plSpot pmnt
where
shp = fmap (fmap $ colorSH col) aShape
changeLight = SetLSCol (V3 0 0.5 0)
ls = lsColPosRad (V3 0.5 0 0) (V3 0 0 50) 50
@@ -107,7 +102,7 @@ putLitButOnPosExtTrig' col thePS cnt =
psPtCont thePS (PutTrigger False) $
\tp -> Just $
plSpot .~ _plSpot tp $
mntLSOn aShape (Just col) ls 0 (V3 0 (-40) 40) $
mntLSOn shp ls 0 (V3 0 (-40) 40) $
\plmnt ->
jps0'
( PutButton
@@ -118,8 +113,9 @@ putLitButOnPosExtTrig' col thePS cnt =
)
(cnt tp plmnt)
<&> plSpot
.~ _plSpot plmnt
.~ _plSpot plmnt
where
shp = fmap (fmap $ colorSH col) aShape
trigid tp = fromJust $ _plMID tp
oneff = SetTrigger True
changeLight = SetLSCol (V3 0 0.5 0)