#include <PhysicsEngine.hpp>
A class to handle all collisions and gravity interactions between IPhysicsComponents .
◆ PhysicsEngine()
| PhysicsEngine::PhysicsEngine |
( |
| ) |
|
Construct a new Physics Engine object
◆ ~PhysicsEngine()
| PhysicsEngine::~PhysicsEngine |
( |
| ) |
|
Destroy the Physics Engine object
◆ AddComponent()
◆ SetGravity()
| void PhysicsEngine::SetGravity |
( |
float |
newGravity | ) |
|
Change gravity to the new value.
- Parameters
-
| newGravity | the new value for acceleration due to gravity |
◆ Update()
| void PhysicsEngine::Update |
( |
| ) |
|
Update all IPhysicsComponents. Resolve collisions between Components all at once. TODO: scale by deltaTime: the Engine-calculated difference between update calls using SDL_GetTicks()
◆ m_components
Collection of all physics components
◆ m_gravity
| float PhysicsEngine::m_gravity = 2.0f |
|
private |
The acceleration due to gravity in the game. This can safely change during runtime
The documentation for this class was generated from the following files: