diwi / Space_Partitioning_Octree_BVH

Octree/BVH: building and traversal (for fast ray-triangle-intersection)
http://thomasdiewald.com/blog/?p=1488
76 stars 22 forks source link

Selection bug #2

Open NMO13 opened 9 years ago

NMO13 commented 9 years ago

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];

zhanglingfeng911 commented 2 years ago

hello, i want to know how to compile this project?