-
If I understand it correctly, the collider expects the leaf nodes to be ordered by the morton code of the box center, which can be different from the center of a triangle. manifold/src/manifold/src/sort.cpp Lines 84 to 113 in 1514c15 @elalish am I misunderstanding something here or is this a bug? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It actually doesn't matter - the bounding boxes are what actually get queried against, and so long as they are unioned properly up the tree, the result will be correct. The Morton code is about sorting such that those unioned bounding boxes tend to stay small, thus keeping the BVH efficient. Using centers does a decent job, and there's way more variance introduced by the z-order curve, so in practice it doesn't matter much. |
Beta Was this translation helpful? Give feedback.
It actually doesn't matter - the bounding boxes are what actually get queried against, and so long as they are unioned properly up the tree, the result will be correct. The Morton code is about sorting such that those unioned bounding boxes tend to stay small, thus keeping the BVH efficient. Using centers does a decent job, and there's way more variance introduced by the z-order curve, so in practice it doesn't matter much.