]> git.localhorst.tv Git - sdl-test8.git/blobdiff - src/shape/AABB.cpp
some comments
[sdl-test8.git] / src / shape / AABB.cpp
index 75007ecbd5b42d3e62e53dbc84130995f7975098..71844e8c178d7e57d8c6987c16458d70231bc0a7 100644 (file)
@@ -17,12 +17,16 @@ void AABB::Translate(const Vector &delta) {
 }
 
 void AABB::Rotate(Scalar delta) {
-
+       // by definition AABBs cannot rotate
 }
 
 
 bool AABB::CheckCollision(const Shape &other, Ray &na) const {
+       // This call reveals the real type of this shape by overloading and the
+       // other one via polymorphism.
        if (other.CheckCollision(*this, na)) {
+               // Since the other shape's collision check returns its own surface
+               // normal, it has to be inverted here.
                na.Direction() *= -1;
                return true;
        } else {