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
for (const auto& object : objects) {
if (!objects[i]->bounding_box(t0, t1, temp_box))
return false;
output_box = surrounding_box(output_box, temp_box);
}
should be
for (const auto& object : objects) {
if (!object.bounding_box(t0, t1, temp_box))
return false;
output_box = surrounding_box(output_box, temp_box);
}
Reviewing this code, I don't understand why this method doesn't ignore false returns, and just return false only if none of the objects has a bounding box.
It looks like it's correct in the source, but not in the html.
as for:
I don't understand why this method doesn't ignore false
returns, and just return false only if none of the objects
has a bounding box
I'm not entirely sure. A return of false for bounding_box means that an aabb isn't defined for that object.
I think returning false is for two reasons
Strictness. An underdefined hittable is not allowed
We don't have a way to combine no aabb and 1 aabb, instead of false you would need to keep track of if temp_box has been defined, if the current hittable has an aabb, and when to combine the two. It's actually a bit complicated
Master branch
'i' was not declared ..
if (!objects[i]->bounding_box(t0, t1, temp_box))
The text was updated successfully, but these errors were encountered: