src/proto2/Physics.hh
changeset 180 bfe1077edab3
parent 170 fe74105c07ea
child 181 62e0c2cfb714
equal deleted inserted replaced
179:c600984d0428 180:bfe1077edab3
     1 #ifndef PHYSICS_HH
     1 #ifndef PHYSICS_HH
     2 #define PHYSICS_HH
     2 #define PHYSICS_HH
     3 
     3 
     4 #include <vector>
     4 #include <vector>
     5 #include <queue>
     5 #include <queue>
       
     6 #include <list>
     6 #include <ClanLib/core.h>
     7 #include <ClanLib/core.h>
     7 #include <ClanLib/display.h>
     8 #include <ClanLib/display.h>
     8 
     9 
     9 #include "Vector.hh"
    10 #include "Vector.hh"
    10 #include "Config.hh"
    11 #include "Config.hh"
    35 
    36 
    36     //    Terrain terrain;
    37     //    Terrain terrain;
    37 
    38 
    38 protected:
    39 protected:
    39     //std::vector<PlayerObject*> players;
    40     //std::vector<PlayerObject*> players;
    40     //std::vector<ProjectileObject*> projectiles;
       
    41     std::vector<PhysicsObject*> objects;
    41     std::vector<PhysicsObject*> objects;
    42 
    42 
    43     // Contains connections between signals and slots
    43     // Contains connections between signals and slots
    44     CL_SlotContainer slots;
    44     CL_SlotContainer slots;
    45 
    45 
    60      * Add object to the PhysicsWorld.
    60      * Add object to the PhysicsWorld.
    61      *
    61      *
    62      * @param object Pointer to the PhysicsObject to add.
    62      * @param object Pointer to the PhysicsObject to add.
    63      */
    63      */
    64     void addObject(PhysicsObject *object);
    64     void addObject(PhysicsObject *object);
       
    65     
       
    66     void addProjectile(PhysicsObject *projectile);
    65 
    67 
    66     /**
    68     /**
    67      * Advance one time step in physics simulation.
    69      * Advance one time step in physics simulation.
    68      */
    70      */
    69     void tick();
    71     void tick();
    73      *
    75      *
    74      * @return tick Current simulation tick.
    76      * @return tick Current simulation tick.
    75      */
    77      */
    76     uint32_t getTick();
    78     uint32_t getTick();
    77 
    79 
       
    80 
       
    81     // TODO This should probably be protected or in GameStat or in GameStatee
       
    82     std::list<PhysicsObject*> projectiles;
    78 };
    83 };
    79 
    84 
    80 /**
    85 /**
    81  * PhysicObject class. A basic PhysicsObject class.
    86  * PhysicObject class. A basic PhysicsObject class.
    82  */
    87  */