void AABB::Enclose(const Sphere &sphere) { Enclose(sphere.pos - float3(sphere.r,sphere.r,sphere.r)); Enclose(sphere.pos + float3(sphere.r,sphere.r,sphere.r)); }
void AABB::Enclose(const Triangle &triangle) { Enclose(triangle.a); Enclose(triangle.b); Enclose(triangle.c); }
void AABB::Enclose(const AABB &aabb) { Enclose(aabb.minPoint); Enclose(aabb.maxPoint); }
void AABB::Enclose(const OBB &obb) { for(int i = 0; i < 8; ++i) Enclose(obb.CornerPoint(i)); }
void AABB::Enclose(const Polyhedron &polyhedron) { for(int i = 0; i < polyhedron.NumVertices(); ++i) Enclose(polyhedron.Vertex(i)); }
void AABB::Enclose(const LineSegment &lineSegment) { Enclose(lineSegment.a); Enclose(lineSegment.b); }
void AABB::Enclose(const Frustum &frustum) { for(int i = 0; i < 8; ++i) Enclose(frustum.CornerPoint(i)); }
void Sphere::Enclose(const LineSegment &lineSegment) { ///@todo This might not be very optimal at all. Perhaps better to enclose the farthest point first. Enclose(lineSegment.a); Enclose(lineSegment.b); }
void Sphere::Enclose(const OBB &obb) { ///@todo This might not be very optimal at all. Perhaps better to enclose the farthest point first. for(int i = 0; i < 8; ++i) Enclose(obb.CornerPoint(i)); }
void Sphere::Enclose(const Polyhedron &polyhedron) { Enclose(polyhedron.VertexArrayPtr(), polyhedron.NumVertices()); }
void AABB::Enclose(const Sphere &sphere) { vec d = POINT_VEC_SCALAR(sphere.r); Enclose(sphere.pos - d); Enclose(sphere.pos + d); }