Platformer
Platformer
|
This class manages the physics of our game as a singleton. More...
#include <PhysicsManager.hpp>
Public Member Functions | |
void | init () |
Initializes the physics manager. | |
void | shutdown () |
Shuts down the physics manager. | |
void | Step () |
Initiates a step of the physics simulation for all physics objects in the world. | |
PhysicsManager (const PhysicsManager &)=delete | |
Stop the compiler from generating methods to copy the object. | |
PhysicsManager & | operator= (const PhysicsManager &)=delete |
Stop the compiler from generating methods to copy the object. | |
Static Public Member Functions | |
static PhysicsManager & | instance () |
The singleton instance of the PhysicsManager. | |
static std::shared_ptr< b2World > | GetWorld () |
Gets the Box2D world of the physics manager. More... | |
static void | SetGravity (float x, float y) |
Sets the gravity of this physics manager. More... | |
Private Member Functions | |
PhysicsManager () | |
Constructs a PhysicsManager. | |
~PhysicsManager () | |
Destructs a PhysicsManager. | |
Private Attributes | |
std::shared_ptr< b2World > | world |
The Box2D world of this physics manager. | |
This class manages the physics of our game as a singleton.
|
static |
Gets the Box2D world of the physics manager.
|
static |
Sets the gravity of this physics manager.
x | The x value of the gravity (normally this is 0) |
y | The y value of the gravity (earth gravity is -9.8) |