bool DiCullNode::IsIn( DiAABB &box ) { if (box.IsNull()) { return false; } if (box.IsInfinite()) { return true; } DiVec3 center = mWorldAABB.GetMaximum().midPoint( mWorldAABB.GetMinimum() ); DiVec3 bmin = box.GetMinimum(); DiVec3 bmax = box.GetMaximum(); bool centre = ( bmax > center && bmin < center ); if (!centre) { return false; } DiVec3 octreeSize = bmax - bmin; DiVec3 nodeSize = mWorldAABB.GetMaximum() - mWorldAABB.GetMinimum(); return nodeSize < octreeSize; }
//----------------------------------------------------------------------- DiPlane::Side DiPlane::getSide (const DiAABB& box) const { if (box.IsNull()) return NO_SIDE; if (box.IsInfinite()) return BOTH_SIDE; return getSide(box.GetCenter(), box.GetHalfSize()); }