1 #ifndef PHYSICS_MANAGER_HPP 2 #define PHYSICS_MANAGER_HPP 4 #include <Box2D/Box2D.h> 25 static std::shared_ptr<b2World>
GetWorld();
PhysicsManager()
Constructs a PhysicsManager.
Definition: PhysicsManager.cpp:5
void shutdown()
Shuts down the physics manager.
Definition: PhysicsManager.cpp:18
static PhysicsManager & instance()
The singleton instance of the PhysicsManager.
Definition: PhysicsManager.cpp:9
void init()
Initializes the physics manager.
Definition: PhysicsManager.cpp:14
std::shared_ptr< b2World > world
The Box2D world of this physics manager.
Definition: PhysicsManager.hpp:50
This class manages the physics of our game as a singleton.
Definition: PhysicsManager.hpp:10
static std::shared_ptr< b2World > GetWorld()
Gets the Box2D world of the physics manager.
Definition: PhysicsManager.cpp:20
PhysicsManager & operator=(const PhysicsManager &)=delete
Stop the compiler from generating methods to copy the object.
~PhysicsManager()
Destructs a PhysicsManager.
Definition: PhysicsManager.cpp:6
void Step()
Initiates a step of the physics simulation for all physics objects in the world.
Definition: PhysicsManager.cpp:26
static void SetGravity(float x, float y)
Sets the gravity of this physics manager.
Definition: PhysicsManager.cpp:22