You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If r.direction().y() happens to be zero, you'll get t=infinity. This infinity will get passed along, because infinity > infinity is false so the if branch is not taken.
Additionally, if k-r.origin().y() happens to be 0 as well, you'll get 0.0 / 0.0 resulting in a NaN that again gets passed along.
This exists in all three cases of rect, with different axes being the culprit.
Caveat emptor: I bumped into this in my Rust implementation, so some specific details may be slightly different, including in case infinity & NaN semantics are slightly different in C++. But I think this should be applicable.
Offtopic sidenote: wonder if it would be worth it to make the distance be named something else than t, considering some other functions in the book use t or t0, t1 for time
The text was updated successfully, but these errors were encountered:
This reverts commit b0fbca7b0c6c4e77491b1bbebc6ed5fe939d912e.
Removing these primitives, since we will not be using them. This change
also removes the temporary test scene for quads.
Resolves#292Resolves#662Resolves#681Resolves#756Resolves#780
raytracing.github.io/src/TheRestOfYourLife/aarect.h
Lines 124 to 126 in 7b92650
If
r.direction().y()
happens to be zero, you'll gett=infinity
. This infinity will get passed along, becauseinfinity > infinity
isfalse
so theif
branch is not taken.Additionally, if
k-r.origin().y()
happens to be0
as well, you'll get0.0 / 0.0
resulting in aNaN
that again gets passed along.This exists in all three cases of
rect
, with different axes being the culprit.Caveat emptor: I bumped into this in my Rust implementation, so some specific details may be slightly different, including in case infinity & NaN semantics are slightly different in C++. But I think this should be applicable.
Offtopic sidenote: wonder if it would be worth it to make the distance be named something else than
t
, considering some other functions in the book uset
ort0, t1
for timeThe text was updated successfully, but these errors were encountered: