namespace geometry {
bool AABB::Overlaps(const Shape &other, Vector &normal) const {
+ // This call reveals the real type of this shape by overloading and the
+ // other one via polymorphism.
if (other.Overlaps(*this, normal)) {
+ // Since the other shape's Overlaps() returns its own surface normal,
+ // it has to be inverted here.
normal *= -1;
return true;
} else {