Fix bug in the placement of mounted lightsources when shifted

This commit is contained in:
2022-03-04 17:59:42 +00:00
parent d219f42640
commit 8fa6bbfe29
4 changed files with 17 additions and 39 deletions
+5 -7
View File
@@ -150,7 +150,7 @@ spNoID :: PlacementSpot -> PSType -> Placement
spNoID ps pst = Placement ps pst Nothing (const Nothing)
pContID :: PlacementSpot -> PSType -> (Int -> Maybe Placement) -> Placement
pContID ps pt = Placement ps pt Nothing . intPlPlPl
pContID ps pt = Placement ps pt Nothing . contToIDCont
psPtCont :: PlacementSpot -> PSType -> (Placement -> Maybe Placement) -> Placement
psPtCont ps pt = Placement ps pt Nothing
@@ -183,19 +183,16 @@ jsps0J :: PSType -> Placement -> Maybe Placement
jsps0J pst plm = Just $ Placement (PS (V2 0 0) 0) pst Nothing $ \_ -> Just plm
ps0 :: PSType -> (Int -> Maybe Placement) -> Placement
ps0 pst = Placement (PS (V2 0 0) 0) pst Nothing . intPlPlPl
ps0 pst = Placement (PS (V2 0 0) 0) pst Nothing . contToIDCont
pt0 :: PSType -> (Placement -> Maybe Placement) -> Placement
pt0 pst = Placement (PS (V2 0 0) 0) pst Nothing
contToIDCont :: (Int -> Maybe Placement) -> Placement -> Maybe Placement
contToIDCont f plmnt = f $ fromJust (_plMID plmnt)
intPlPlPl :: (Int -> Maybe Placement) -> Placement -> Maybe Placement
intPlPlPl f = f . fromJust . _plMID
contToIDCont f = f . fromJust . _plMID
jps0 :: PSType -> (Int -> Maybe Placement) -> Maybe Placement
jps0 pst = Just . Placement (PS (V2 0 0) 0) pst Nothing . intPlPlPl
jps0 pst = Just . Placement (PS (V2 0 0) 0) pst Nothing . contToIDCont
jps0PushPS :: PSType -> (Int -> Maybe Placement) -> Maybe Placement
jps0PushPS pst f = Just . Placement (PS (V2 0 0) 0) pst Nothing
@@ -209,6 +206,7 @@ psj ps pst plmnt = Placement ps pst Nothing (const $ Just plmnt)
ps0jPushPS :: PSType -> Placement -> Placement
ps0jPushPS pst plmnt = Placement (PS (V2 0 0) 0) pst Nothing (\p -> Just $ plmnt & plSpot .~ _plSpot p)
--ps0jPushPS pst plmnt = Placement (PS (V2 0 0) 0) pst Nothing (\p -> Just $ plmnt)
addPlmnt :: Placement -> Placement -> Placement
addPlmnt pl pl2 = case pl2 of