Add in "linear" lWorld to separate time reversable worlds

This commit is contained in:
2022-10-28 12:24:51 +01:00
parent 5f6bd43599
commit 7e790b7153
130 changed files with 827 additions and 980 deletions
+6 -6
View File
@@ -20,11 +20,11 @@ printRotPoint r p =
outsideScreenPolygon :: Configuration -> World -> [Point2]
outsideScreenPolygon cfig w = [tr, tl, bl, br]
where
scRot = rotateV (w ^. cWorld . cwCam . cwcRot)
scRot = rotateV (w ^. cWorld . lWorld . cwCam . cwcRot)
scZoom p
| (w ^. cWorld . cwCam . cwcZoom) /= 0 = (1 / (w ^. cWorld . cwCam . cwcZoom)) *.* p
| (w ^. cWorld . lWorld . cwCam . cwcZoom) /= 0 = (1 / (w ^. cWorld . lWorld . cwCam . cwcZoom)) *.* p
| otherwise = error "Trying to set screen zoom to zero"
scTran p = p +.+ (w ^. cWorld . cwCam . cwcCenter)
scTran p = p +.+ (w ^. cWorld . lWorld . cwCam . cwcCenter)
tr = f 3 3
tl = f (-3) 3
br = f 3 (-3)
@@ -40,10 +40,10 @@ lineOnScreenCone cfig w p1 p2 =
|| any (isJust . uncurry (intersectSegSeg p1 p2)) sps
where
sp' = screenPolygon cfig w
vp = w ^. cWorld . cwCam . cwcViewFrom
vp = w ^. cWorld . lWorld . cwCam . cwcViewFrom
sp
| pointInPolygon vp sp' = sp'
| otherwise = orderPolygon ((w ^. cWorld . cwCam . cwcViewFrom) : sp')
| otherwise = orderPolygon ((w ^. cWorld . lWorld . cwCam . cwcViewFrom) : sp')
sps = zip sp (tail sp ++ [head sp])
pointOnScreen :: Configuration -> World -> Point2 -> Bool
@@ -56,7 +56,7 @@ drawWallFace cfig w wall
where
(x, y) = _wlLine wall
points = extendConeToScreenEdge cfig w sightFrom (x, y)
sightFrom = w ^. cWorld . cwCam . cwcViewFrom
sightFrom = w ^. cWorld . lWorld . cwCam . cwcViewFrom
extendConeToScreenEdge :: Configuration -> World -> Point2 -> (Point2, Point2) -> [Point2]
extendConeToScreenEdge cfig w c (x, y) = orderPolygon $ wallScreenIntersect ++ [x, y] ++ borderPs ++ cornerPs