Commit before attempting to fix placement shifting bug

This commit is contained in:
2022-03-04 13:13:21 +00:00
parent 2961923534
commit d219f42640
4 changed files with 55 additions and 6 deletions
@@ -80,6 +80,15 @@ vShape wallpos (V3 x y z) =
mntLS :: (Point2 -> Point3 -> Shape) -> Point2 -> Point3 -> Placement
mntLS shp wallp lampp = mntLSOn shp Nothing defaultLS wallp lampp (const Nothing)
mntLSCol :: (Point2 -> Point3 -> Shape) -> Color -> Point2 -> Point3 -> Placement
mntLSCol shp col wallp lampp = mntLSOn shp (Just col) defaultLS wallp lampp (const Nothing)
mntLSLampCol :: (Point2 -> Point3 -> Shape) -> Color -> Point2 -> Point3 -> Placement
mntLSLampCol shp (V4 x y z _) wallp lampp = mntLSOn shp Nothing (defaultLS & lsParam . lsCol .~ col)
wallp lampp (const Nothing)
where
col = V3 x y z
mntLSCond :: (Point2 -> Point3 -> Shape)
-> (RoomPos -> Room -> Maybe (PlacementSpot,RoomPos))
-> Placement
+1 -1
View File
@@ -9,7 +9,7 @@ import Control.Lens
shiftPSBy :: (Point2,Float) -> PlacementSpot -> PlacementSpot
shiftPSBy (pos,rot) ps = ps
& psPos %~ shiftPointBy (pos,rot)
& psRot %~ (+ rot)
& psRot +~ rot
shiftPlacement :: (Point2,Float) -> Placement -> Placement
shiftPlacement shift plmnt = case plmnt of
Placement {} -> plmnt & plSpot %~ shiftPSBy shift