finer grains

This commit is contained in:
nek0 2018-10-26 02:14:13 +02:00
parent f4809653ab
commit 2383dda0fe

View file

@ -99,7 +99,7 @@ draw state@(State pos@(V2 x y) rot _ _) = do
let rayLength = castRay (fromIntegral w) (fromIntegral h) ddw ddh
in getPixel (fromMaybe 11 rayLength)
castRay w h ddw ddh =
let iter = [0, 0.05 .. 10]
let iter = [0, 0.01 .. 10]
collPos a = (pos + (V2 0 (a * cos (- fov / 2 + ddh * fov / h))
`rotVec` (rot - fov / 2 + ddw * fov / w)))
in foldl (\acc a ->