}
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 {