Army ant simulation
V2BLTerrain.h
Go to the documentation of this file.
1 
12 #ifndef V2BLTERRAIN_H_
13 #define V2BLTERRAIN_H_
14 
15 #include "Terrain.h"
16 
17 class V2BLTerrain: public Terrain {
18 public:
19  V2BLTerrain();
20  V2BLTerrain(b2World* world, sf::RenderWindow& window, config::sTerrain terrainParam, int WINDOW_X_PX, double bodyLength=1); // If want to define the dimension relatively to the body length
21  virtual ~V2BLTerrain();
22 
23  /*Default terrain is linear ground of width 2*m_runaway located at m_posY from the top of the window*/
31  void create(b2World* world, sf::RenderWindow& window, config::sTerrain terrainParam, int WINDOW_X_PX, double bodyLength=1);
32  //TODO remove WINDOW_X_PX parameters and deduce it from window with window.getSize().x
33 
38  void createBody(b2World* world);
39 
44  void drawBody(sf::RenderWindow& window);
45 
48 
50  b2Vec2 getTopLeftCorner();
52  b2Vec2 getTopRightCorner();
54  b2Vec2 getBottom();
55 
56 private:
57  double m_bottom=0; //Distance of the truncated bottom of the V from the actual bottom of the V when it's not truncated
58 };
59 
60 #endif /* V2BLTERRAIN_H_ */
b2Vec2 getTopRightCorner()
Definition: V2BLTerrain.cpp:97
void createBody(b2World *world)
Definition: V2BLTerrain.cpp:33
b2Vec2 getBottom()
b2Vec2 getTopLeftCorner()
Definition: V2BLTerrain.cpp:93
Implementation of the Terrain class.
e_terrain_type
Definition: Terrain.h:23
void drawBody(sf::RenderWindow &window)
Definition: V2BLTerrain.cpp:73
e_terrain_type getType()
void create(b2World *world, sf::RenderWindow &window, config::sTerrain terrainParam, int WINDOW_X_PX, double bodyLength=1)
Definition: V2BLTerrain.cpp:26