void AABB::SetFrom(const Sphere &s) { vec d = DIR_VEC_SCALAR(s.r); minPoint = s.pos - d; maxPoint = s.pos + d; }
bool AABB::Contains(const Sphere &sphere) const { return Contains(sphere.pos - DIR_VEC_SCALAR(sphere.r), sphere.pos + DIR_VEC_SCALAR(sphere.r)); }
void AABB::Enclose(const Sphere &sphere) { vec d = DIR_VEC_SCALAR(sphere.r); Enclose(sphere.pos - d, sphere.pos + d); }
void AABB::Enclose(const Capsule &capsule) { vec d = DIR_VEC_SCALAR(capsule.r); minPoint = Min(minPoint, Min(capsule.l.a, capsule.l.b) - d); maxPoint = Max(maxPoint, Max(capsule.l.a, capsule.l.b) + d); }
void OBB::Scale(const vec ¢erPoint, float scaleFactor) { return Scale(centerPoint, DIR_VEC_SCALAR(scaleFactor)); }