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
+8 -8
View File
@@ -19,9 +19,9 @@ fixedSizePicAt pic p w =
. scale theScale theScale
$ pic
where
campos = w ^. cWorld . cwCam . cwcViewFrom
campos = w ^. cWorld . lWorld . cwCam . cwcViewFrom
v = p -.- campos
theScale = 1 / (w ^. cWorld . cwCam . cwcZoom)
theScale = 1 / (w ^. cWorld . lWorld . cwCam . cwcZoom)
(V2 x y) = campos +.+ v
fixedSizePicClamp ::
@@ -41,11 +41,11 @@ fixedSizePicClamp xbord ybord pic p cfig w =
. scale theScale theScale
$ pic
where
r = negate $ w ^. cWorld . cwCam . cwcRot
z = w ^. cWorld . cwCam . cwcZoom
campos = w ^. cWorld . cwCam . cwcViewFrom
r = negate $ w ^. cWorld . lWorld . cwCam . cwcRot
z = w ^. cWorld . lWorld . cwCam . cwcZoom
campos = w ^. cWorld . lWorld . cwCam . cwcViewFrom
v = p -.- campos
theScale = 1 / (w ^. cWorld . cwCam . cwcZoom)
theScale = 1 / (w ^. cWorld . lWorld . cwCam . cwcZoom)
(V2 x y) = campos +.+ rotateV (negate r) (V2 xr' yr')
(V2 xr yr) = rotateV r v
xr' = absClamp ((halfWidth cfig - fromIntegral xbord) / z) xr
@@ -75,8 +75,8 @@ fixedSizePicClampArrow xbord ybord pic p cfig w =
Nothing -> blank
Just bp -> thickLine 5 [bp, fromMaybe p windowPoint]
(V2 x y) = fromMaybe p borderPoint
campos = w ^. cWorld . cwCam . cwcCenter
theScale = 1 / (w ^. cWorld . cwCam . cwcZoom)
campos = w ^. cWorld . lWorld . cwCam . cwcCenter
theScale = 1 / (w ^. cWorld . lWorld . cwCam . cwcZoom)
absClamp ::
-- | clamping value, assumed positive