|
|
b2Body * | m_groundBody |
| |
|
double | m_bodyLength |
| |
|
double | m_M_TO_PX |
| |
|
double | m_width |
| |
|
double | m_height |
| |
|
double | m_runaway |
| |
|
double | m_angle |
| |
|
double | m_posY =2.5 |
| |
|
config::sTerrain | m_terrainParam |
| |
Definition at line 25 of file Terrain.h.
◆ create()
| void Terrain::create |
( |
b2World * |
world, |
|
|
sf::RenderWindow & |
window, |
|
|
config::sTerrain |
terrainParam, |
|
|
int |
WINDOW_X_PX, |
|
|
double |
bodyLength |
|
) |
| |
|
virtual |
The function create MUST be called if the terrain object has been created via the default constructor (ex when created dynamically with new), otherwise no need to use it
- Parameters
-
| world | is a pointer on the Box2D world object |
| window | is the SFML window |
| terrainParam | are the terrain parameters (cf Config.h) |
| WINDOW_X_PX | is the x-size of the window. it is used to calculate the scale to convert from meters to pixels |
| bodylength | is the size of a robot. it is used to convert the dimension from body length to m |
Reimplemented in Ramp, V2BLTerrain, Vterrain, BoxTerrain, and VStepper.
Definition at line 38 of file Terrain.cpp.
◆ createBody()
| void Terrain::createBody |
( |
b2World * |
world | ) |
|
|
virtual |
◆ drawBody()
| void Terrain::drawBody |
( |
sf::RenderWindow & |
window | ) |
|
|
virtual |
◆ getBody()
| b2Body * Terrain::getBody |
( |
| ) |
|
- Returns
- a pointer on the Box2D body of the terrain
Definition at line 84 of file Terrain.cpp.
◆ getBottom()
| b2Vec2 Terrain::getBottom |
( |
| ) |
|
|
virtual |
◆ getScale()
| const double Terrain::getScale |
( |
| ) |
|
As the terrain is the first thing that has to be created in the world, this method allow to obtain a right scale factor to do the conversion between the real dimensions and the simulated ones based on and adapted to the terrain dimensions
- Returns
- the scale to do the conversion from real dimensions (m) to simulated ones (pixels)
Definition at line 88 of file Terrain.cpp.
◆ getTopLeftCorner()
| b2Vec2 Terrain::getTopLeftCorner |
( |
| ) |
|
|
virtual |
◆ getTopRightCorner()
| b2Vec2 Terrain::getTopRightCorner |
( |
| ) |
|
|
virtual |
- Returns
- the position of the Top right corner of the V in the box2D world coordinates [m]
Reimplemented in Ramp, V2BLTerrain, and Vterrain.
Definition at line 97 of file Terrain.cpp.
◆ getType()
◆ getVLength()
| double Terrain::getVLength |
( |
| ) |
|
|
inline |
- Returns
- the length of the V when it makes sense, 0 otherwise [m]
Definition at line 67 of file Terrain.h.
The documentation for this class was generated from the following files: