finer grains
This commit is contained in:
parent
f4809653ab
commit
2383dda0fe
1 changed files with 1 additions and 1 deletions
|
@ -99,7 +99,7 @@ draw state@(State pos@(V2 x y) rot _ _) = do
|
||||||
let rayLength = castRay (fromIntegral w) (fromIntegral h) ddw ddh
|
let rayLength = castRay (fromIntegral w) (fromIntegral h) ddw ddh
|
||||||
in getPixel (fromMaybe 11 rayLength)
|
in getPixel (fromMaybe 11 rayLength)
|
||||||
castRay w h ddw ddh =
|
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))
|
collPos a = (pos + (V2 0 (a * cos (- fov / 2 + ddh * fov / h))
|
||||||
`rotVec` (rot - fov / 2 + ddw * fov / w)))
|
`rotVec` (rot - fov / 2 + ddw * fov / w)))
|
||||||
in foldl (\acc a ->
|
in foldl (\acc a ->
|
||||||
|
|
Loading…
Reference in a new issue