Make wall points for shadows use matrix uniform transformation

This commit is contained in:
jgk
2021-02-27 02:36:52 +01:00
parent 33ebc1556d
commit 4a85177522
2 changed files with 11 additions and 6 deletions
+5 -4
View File
@@ -563,11 +563,12 @@ wallsForGloom' :: World -> [(Point2,Point2)]
wallsForGloom' w = map (wallPairBack . _wlLine) $ filter (not . _wlIsSeeThrough)
$ IM.elems $ wallsNearZones (zoneOfDoubleScreen w) w
where wallPairBack (x:y:_) = (ss $ x +.+ n,ss $ y+.+ n)
-- where wallPairBack (x:y:_) = (ss $ x +.+ n,ss $ y+.+ n)
where wallPairBack (x:y:_) = (x +.+ n,y+.+ n)
where n = 15 *.* (normalizeV $ vNormal $ y -.- x)
ss' v = rotateV (0 - _cameraRot w) (v -.- _cameraPos w)
ss'' (a,b) = (a*2*zoom / _windowX w,b*2*zoom / _windowY w)
ss = ss'' . ss'
-- ss' v = rotateV (0 - _cameraRot w) (v -.- _cameraPos w)
-- ss'' (a,b) = (a*2*zoom / _windowX w,b*2*zoom / _windowY w)
-- ss = ss'' . ss'
-- the ss transformation would possibly be better done using a matrix in the
-- shader
zoom = _cameraZoom w