diff options
Diffstat (limited to 'indra/llmath')
-rw-r--r-- | indra/llmath/lloctree.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index c4e230b492..bced84cb1c 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -331,6 +331,16 @@ public: //push center in direction of data LLOctreeNode<T>::pushCenter(center, size, data); + // handle case where floating point number gets too small + if( llabs(center.mdV[0] - getCenter().mdV[0]) < F_APPROXIMATELY_ZERO && + llabs(center.mdV[1] - getCenter().mdV[1]) < F_APPROXIMATELY_ZERO && + llabs(center.mdV[2] - getCenter().mdV[2]) < F_APPROXIMATELY_ZERO) + { + mData.insert(data); + BaseType::insert(data); + return true; + } + #if LL_OCTREE_PARANOIA_CHECK if (getChildCount() == 8) { |