Closed harrytodorov closed 5 years ago
I was reading through the source code to traverse a bvh tree, when I stumbled upon the fixed stack you're using here. Is there an explanation for it?
My intuition is that you bound it to the maximum depth for a bvh tree you could have? When traversing a bvh tree of depth 64 and you reach a leaf node, at most you would have 64 - 1 elements in the stack.
Ok, I've just read the chapter for traversing a kd-tree and you state it there as well. It's bound to the tree's maximum depth. Nevertheless, it would be good for a future pedantic reader to be pointed to this piece of information :)
I've made a note to add a sentence about that in the next edition. Thanks!
I was reading through the source code to traverse a bvh tree, when I stumbled upon the fixed stack you're using here. Is there an explanation for it?
My intuition is that you bound it to the maximum depth for a bvh tree you could have? When traversing a bvh tree of depth 64 and you reach a leaf node, at most you would have 64 - 1 elements in the stack.