]> git.localhorst.tv Git - sdl-test7.git/blobdiff - src/geometry/AABB.cpp
added some comments
[sdl-test7.git] / src / geometry / AABB.cpp
index e40c69fc40daab3b0c5245606dd893eb4db98c9e..9ea60b59accbb08c6de4792b395e7a34e9695710 100644 (file)
 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 {