bool Plane::Intersects(const Polyhedron &polyhedron) const { if (polyhedron.NumVertices() == 0) return false; bool sign = IsOnPositiveSide(polyhedron.Vertex(0)); for(int i = 1; i < polyhedron.NumVertices(); ++i) if (sign != IsOnPositiveSide(polyhedron.Vertex(i))) return true; return false; }
bool Sphere::Contains(const Polyhedron &polyhedron) const { assume(polyhedron.IsClosed()); for(int i = 0; i < polyhedron.NumVertices(); ++i) if (!Contains(polyhedron.Vertex(i))) return false; return true; }
void AABB::Enclose(const Polyhedron &polyhedron) { for(int i = 0; i < polyhedron.NumVertices(); ++i) Enclose(polyhedron.Vertex(i)); }