Add aabbox3d::isValid() function to check if MaxEdge > MinEdge

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5820 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2019-05-31 13:31:40 +00:00
parent 294da48122
commit 5c10d53a20
1 changed files with 10 additions and 0 deletions

View File

@ -189,6 +189,16 @@ class aabbox3d
{ t=MinEdge.Z; MinEdge.Z = MaxEdge.Z; MaxEdge.Z=t; }
}
// Check if MaxEdge > MinEdge
bool isValid()
{
if (MinEdge.X > MaxEdge.X) return false;
if (MinEdge.Y > MaxEdge.Y) return false;
if (MinEdge.Z > MaxEdge.Z) return false;
return true;
}
//! Calculates a new interpolated bounding box.
/** d=0 returns other, d=1 returns this, all other values blend between
the two boxes.