src/PhysicsWorld.hh
changeset 408 e6cfc44266af
parent 300 417183866f35
child 409 1a03ff151abc
--- a/src/PhysicsWorld.hh	Tue Jan 20 23:24:04 2009 +0200
+++ b/src/PhysicsWorld.hh	Tue Jan 20 23:30:18 2009 +0200
@@ -18,36 +18,44 @@
 #include "Config.hh"
 
 /**
-* PhysicsWorld class. PhysicsWorld contains PhysicsObjects that are
-* simulated in the PhysicsWorld.
+* PhysicsWorld class. PhysicsWorld contains a number of PhysicsObjects that are simulated forward in time using
+* the physics tick rate
 */
-class PhysicsWorld : public Terrain {
+class PhysicsWorld {
     friend class PhysicsObject;
 
-private:
+// XXX: needs some fixing up, move Terrain methods
+public:   
+    /** The world's terrain */
+    Terrain &terrain;
 
+protected:
+    /** List of simulated objects*/
+    std::list<PhysicsObject*> objects;
     
-protected:
-    std::list<PhysicsObject*> objects;
+    /** Size of simulation area */
+    Vector dimensions;
 
-    // Contains connections between signals and slots
+    /** Gravity vector */
+    Vector gravity;
+    
+    /** Physics simulation ticks */
+    Timer tick_timer;
+    
     CL_SlotContainer slots;
 
-    Vector dimensions;
-    Vector gravity;
-
 public:
-    // Someone is going to kill me for this
-    Timer tick_timer;
-
-    PhysicsWorld(Vector gravity, Vector dimensions);
+    /**
+     * Construct a world with the given configuration. 
+     */
+    PhysicsWorld (Vector gravity, Vector dimensions, Terrain &terrain);
 
     /**
      * Add object to the PhysicsWorld.
      *
      * @param object Pointer to the PhysicsObject to add.
      */
-    void addPhysicsObject(PhysicsObject *object);
+    void addPhysicsObject (PhysicsObject *object);
     
     /**
      * Remove the object from the PhysicsWorld.