1 #ifndef GF_PHYSICS_MODEL_H
2 #define GF_PHYSICS_MODEL_H
10 #ifndef DOXYGEN_SHOULD_SKIP_THIS
68 virtual void update(
float dt)
override;
76 #ifndef DOXYGEN_SHOULD_SKIP_THIS
void clear()
Remove all bodies from the simulation.
PhysicsModel(Vector2f gravity={0.0f, 0.0f})
Constructor.
A physics body.
Definition: PhysicsBody.h:34
constexpr Vector(T x, T y)
Constructor that takes 2 components.
Definition: Vector.h:348
virtual void update(float dt) override
Update the model's state.
A game object that can be updated.
Definition: Model.h:45
void setGravity(Vector2f gravity) noexcept
Set the gravity of the simulation.
Definition: PhysicsModel.h:36
The namespace for gf classes.
Definition: Action.h:34
A model for physics simulation.
Definition: PhysicsModel.h:22
void addBody(PhysicsBody &body)
Add a body to the simulation.
Vector2f getGravity() const noexcept
Get the gravity of the simulation.
Definition: PhysicsModel.h:45
#define GF_API
Definition: Portability.h:35
void removeBody(PhysicsBody &body)
Remove a body from the simulation.