Fix shadow casting
authorLukáš Jiřiště <jiriste@icpf.cas.cz>
Wed, 27 Nov 2024 09:08:03 +0000 (10:08 +0100)
committerLukáš Jiřiště <jiriste@icpf.cas.cz>
Wed, 27 Nov 2024 09:08:03 +0000 (10:08 +0100)
commita2872aa31d766d497827b580db546535bc87ccc9
tree6a7b907c7127bc1badb1ee23509b447f2d6b1c0a
parent75525351b229b25cd73d5259126f737709fe0213
Fix shadow casting

The shadows did not work because the obstruction detection used a
function that expects ray with normalized direction vector. But the
obstruction detection did not normalize its ray because the check for
whether the obstruction is between the object and the light was easier.
The fix is normalizing the ray vector and using distance.
src/scene.c