Separate out concrete part of world

This commit is contained in:
2022-07-25 12:10:50 +01:00
parent 3354d108be
commit b2efbd2b3e
134 changed files with 933 additions and 930 deletions
+3 -3
View File
@@ -13,15 +13,15 @@ import Control.Lens
findBoundDists :: Configuration -> World -> (Float,Float,Float,Float)
findBoundDists cfig w
| debugOn Bound_box_screen cfig = (hh,-hh,hw,-hw)
| otherwise = fromMaybe (0,0,0,0) $ farWallDistDirection (_cameraCenter w) w
| otherwise = fromMaybe (0,0,0,0) $ farWallDistDirection (_cameraCenter (_cWorld w)) w
where
hw = halfWidth cfig
hh = halfHeight cfig
updateBounds :: Universe -> Universe
updateBounds uv = uv
& uvWorld . boundDist .~ bdists
& uvWorld . boundBox .~ map ( (+.+ _cameraCenter w) . rotateV (_cameraRot w) ) (rectNSWE n s w' e)
& uvWorld . cWorld . boundDist .~ bdists
& uvWorld . cWorld . boundBox .~ map ( (+.+ _cameraCenter (_cWorld w)) . rotateV (_cameraRot (_cWorld w)) ) (rectNSWE n s w' e)
where
w = _uvWorld uv
cfig = _uvConfig uv