Space_Partitioning_Octree_BVH icon indicating copy to clipboard operation
Space_Partitioning_Octree_BVH copied to clipboard

Selection bug

Open NMO13 opened this issue 8 years ago • 1 comments

Great project! However, there is a small bug: If you create a BVH with only one face and select it with the mouse, then an exception is thrown. The problem is this line:

this.stack = new BvhTraversalData[bvh.getMaxDepth()*2];

A tree with only a root node has a max depth of 0 => the stack has a size of 0. A fix would be to make the stack slightly bigger:

this.stack = new BvhTraversalData[bvh.getMaxDepth()*2 + 1];

NMO13 avatar Nov 15 '15 16:11 NMO13