Closed harrytodorov closed 5 years ago
Normally, you wouldn't. :-)
In this case it's an artifact of pbrt being a literate program; this code fragment is reused in both places leaf nodes are created (the one-primitive case and in the multi-primitive cases.) That way, we don't have to repeatedly implement the little bit of functionality to grab the primitive number, index into the primitives
array, etc...
Going through the building of a BVH, I stumbled upon this line, which was a bit unclear for me. Why would you use a for-loop just add 1 element?