[11305] more safe code in vmaps and Field class

Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
Ambal 2011-04-02 17:30:17 +03:00
parent 1fea8a321f
commit 43db4eaaa2
5 changed files with 10 additions and 13 deletions

View file

@ -127,7 +127,7 @@ void BIH::subdivide(int left, int right, std::vector<uint32> &tempTree, buildDat
if (right == rightOrig)
{
// all left
if (prevAxis == axis && prevSplit == split) {
if (prevAxis == axis && G3D::fuzzyEq(prevSplit, split)) {
// we are stuck here - create a leaf
stats.updateLeaf(depth, right - left + 1);
createNode(tempTree, nodeIndex, left, right);
@ -146,7 +146,7 @@ void BIH::subdivide(int left, int right, std::vector<uint32> &tempTree, buildDat
else if (left > right)
{
// all right
if (prevAxis == axis && prevSplit == split) {
if (prevAxis == axis && G3D::fuzzyEq(prevSplit, split)) {
// we are stuck here - create a leaf
stats.updateLeaf(depth, right - left + 1);
createNode(tempTree, nodeIndex, left, right);