brandonpelfrey / SimpleOctree

A simple octree with good commenting for learning how octrees work.
MIT License
252 stars 74 forks source link

Bug close points #3

Closed seb776 closed 9 years ago

seb776 commented 9 years ago

I think I found an error:

line 106 children[getOctantContainingPoint(oldPoint->getPosition())]->insert(oldPoint); children[getOctantContainingPoint(point->getPosition())]->insert(point);

Sometimes the two octants are equal so the oldPoint is overwritten. It arrives when the distance between the two points is less than the halfDimension.

Am I wrong ?

seb776 commented 9 years ago

Mistake from me, sorry for this.

ghost commented 5 years ago

发现两个bug: 1、data存储为指针的形式,容易造成内存泄漏。此外,你好像一直没有释放内存??? 2、如果某数据超出根节点的范围,那么插入该数据时,程序将陷入递归死循环,直到栈溢出导致程序崩溃。。。