![]() |
HeadBall
1.0
A game
|
Convert the units from Box2D units to SFML units and vice-versa. More...
Functions | |
| template<class T > | |
| constexpr T | pixelsToMeters (const T &x) |
| Convert the unit from pixels to meters. More... | |
| template<class T > | |
| constexpr T | metersToPixels (const T &x) |
| Convert the unit from meters to pixels. More... | |
| template<class T > | |
| constexpr T | degToRad (const T &x) |
| Convert the unit from degrees to radians. More... | |
| template<class T > | |
| constexpr T | radToDeg (const T &x) |
| Convert the unit from radians to degrees. More... | |
Variables | |
| const float | PPM = 30.0f |
| const float | PI = 3.1415 |
Convert the units from Box2D units to SFML units and vice-versa.
This namespace is used for easier conversion of units from the box2d units to SFML units and vice-versa. SFML uses pixels for position and degree for angle whereas box2d uses SI units (meters and radian).
|
constexpr |
Convert the unit from degrees to radians.
| T |
| x |
|
constexpr |
Convert the unit from meters to pixels.
| T |
| x |
|
constexpr |
Convert the unit from pixels to meters.
| T |
| x |
|
constexpr |
Convert the unit from radians to degrees.
| T |
| x |
| const float Converter::PI = 3.1415 |
| const float Converter::PPM = 30.0f |