]> git.localhorst.tv Git - sdl-test7.git/blobdiff - src/geometry/Shape.h
added some comments
[sdl-test7.git] / src / geometry / Shape.h
index 79c3485d59e00c86122119285bc1b2d87a6dfe9a..9232a3a671edbc1959bcda0e6c00c89e88a52ca6 100644 (file)
@@ -19,6 +19,9 @@ class AABB;
 class Circle;
 class FakeLens;
 
+/// Base class for all "shapes" (i.e. collision primitives).
+/// This serves as an interface for game::Entity to double dispatch the
+/// collision detection algorithms.
 class Shape {
 
        public:
@@ -31,6 +34,11 @@ class Shape {
                virtual ~Shape(void) { };
 
        public:
+               /// Check if this shape overlaps the given and, if it does, write the
+               /// surface normal into given vector.
+               /// All shapes must override this method to dispatch to the specialized
+               /// version of Overlaps().
+               /// See AABB::Overlaps(const Shape &, Vector &normal) const for details.
                virtual bool Overlaps(const Shape &, Vector &normal) const = 0;
 
                virtual bool Overlaps(const AABB &, Vector &normal) const = 0;