|
|
| VStepper (b2World *world, sf::RenderWindow &window, config::sTerrain terrainParam, int WINDOW_X_PX, double bodyLength=1) |
| |
| void | create (b2World *world, sf::RenderWindow &window, config::sTerrain terrainParam, int WINDOW_X_PX, double bodyLength=1) |
| |
| void | createBody (b2World *world) |
| |
| void | drawBody (sf::RenderWindow &window) |
| |
| e_terrain_type | getType () |
| |
|
| Terrain (b2World *world, sf::RenderWindow &window, config::sTerrain terrainParam, int WINDOW_X_PX, double bodyLength=1) |
| |
| virtual b2Vec2 | getTopLeftCorner () |
| |
| virtual b2Vec2 | getTopRightCorner () |
| |
| virtual b2Vec2 | getBottom () |
| |
| double | getVLength () |
| |
| b2Body * | getBody () |
| |
| const double | getScale () |
| |
|
|
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 13 of file VStepper.h.
◆ create()
| void VStepper::create |
( |
b2World * |
world, |
|
|
sf::RenderWindow & |
window, |
|
|
config::sTerrain |
terrainParam, |
|
|
int |
WINDOW_X_PX, |
|
|
double |
bodyLength = 1 |
|
) |
| |
|
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 from Terrain.
Definition at line 26 of file VStepper.cpp.
◆ createBody()
| void VStepper::createBody |
( |
b2World * |
world | ) |
|
|
virtual |
Create the Box2D static body of the terrain
- Parameters
-
| world | is a pointer on the Box2D world |
Reimplemented from Terrain.
Definition at line 33 of file VStepper.cpp.
◆ drawBody()
| void VStepper::drawBody |
( |
sf::RenderWindow & |
window | ) |
|
|
virtual |
Draw the body on the window using the SFML library
- Parameters
-
| window | is the SFML window where the terrain will be drawn |
Reimplemented from Terrain.
Definition at line 78 of file VStepper.cpp.
◆ getType()
- Returns
- the type of the terrain. Can be DEFAULT, V_TERRAIN, V2BL_TERRAIN, RAMP, BOX or V_STEPPER
Reimplemented from Terrain.
Definition at line 101 of file VStepper.cpp.
The documentation for this class was generated from the following files: