Renamed Rect to Rectf
[supertux.git] / src / supertux / moving_object.hpp
index 2020348..7642ac5 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <stdint.h>
 
-#include "math/rect.hpp"
+#include "math/rectf.hpp"
 #include "supertux/collision_hit.hpp"
 #include "supertux/game_object.hpp"
 
@@ -30,41 +30,44 @@ enum CollisionGroup {
   /** Objects in DISABLED group are not tested for collisions */
   COLGROUP_DISABLED = 0,
 
-  /** "default" is moving object. MovingObjects get tested against all
-      other objects and against other movingobjects */
+  /** Tested against:
+      - tiles + attributes
+      - static obstacles
+      - touchables
+      - other moving objects
+      and it counts as an obstacle during static collision phase.
+
+      Use for kinematic moving objects like platforms and rocks. */
+  COLGROUP_MOVING_STATIC,
+
+  /** Tested against:
+      - tiles + attributes
+      - static obstacles
+      - touchables
+      - other moving objects
+
+      Use for ordinary objects. */
   COLGROUP_MOVING,
 
-  /** a Moving object, that is not tested against other MovingObjects
-      (or other MovingOnlyStatic objects), but is tested against all
-      other objects. */
+  /** Tested against:
+      - tiles + attributes
+      - static obstacles
+
+      Use for interactive particles and decoration. */
   COLGROUP_MOVING_ONLY_STATIC,
 
-  /** TODO write docu :-/ */
-  COLGROUP_MOVING_STATIC,
+  /** Tested against:
+      - moving objects
+      and it counts as an obstacle during static collision phase.
 
-  /** 
-   * Doesn't move and isn't explicitly checked for collisions with
-   * other objects (but other objects might check with this) The
-   * difference to COLGROUP_TOUCHABLE is that we can do multiple
-   * collision response tests in a row which is needed for static object
-   * that tux walks on. The results for collisions with STATIC objects
-   * are also sorted by time (so that the first hit gets handled first).
-   * 
-   * Use this for static obstacles 
-   */
+      Use for static obstacles that Tux walks on. */
   COLGROUP_STATIC,
 
-  /** Isn't explicitly checked for collisions with other objects. But
-      other objects might check with this object.  Difference to
-      COLGROUP_STATIC is that collisions with this object are only
-      tested once and collision response is typically not handled
-   
-      Use this for touchable things like spikes/areas or collectibles
-      like coins */
-  COLGROUP_TOUCHABLE,
-
-  /** Should be used for tilemaps */
-  COLGROUP_TILEMAP
+  /** Tested against:
+      - moving objects
+
+      Use for triggers like spikes/areas or collectibles like coins. */
+  COLGROUP_TOUCHABLE
 };
 
 /** Base class for all dynamic/moving game objects. This class
@@ -107,7 +110,7 @@ public:
   }
 
   /** returns the bounding box of the Object */
-  const Rect& get_bbox() const
+  const Rectf& get_bbox() const
   {
     return bbox;
   }
@@ -161,7 +164,7 @@ protected:
 
   /** The bounding box of the object (as used for collision detection,
       this isn't necessarily the bounding box for graphics) */
-  Rect bbox;
+  Rectf bbox;
 
   /** The movement that will happen till next frame */
   Vector movement;
@@ -175,7 +178,7 @@ private:
       
       This field holds the currently anticipated destination of the object
       during collision detection */
-  Rect dest;
+  Rectf dest;
 };
 
 #endif