diff options
Diffstat (limited to 'src/components/physics_body.h')
| -rw-r--r-- | src/components/physics_body.h | 20 |
1 files changed, 20 insertions, 0 deletions
| diff --git a/src/components/physics_body.h b/src/components/physics_body.h new file mode 100644 index 0000000..079cc51 --- /dev/null +++ b/src/components/physics_body.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | #ifndef PHYSICS_BODY_H | ||
| 2 | #define PHYSICS_BODY_H | ||
| 3 | |||
| 4 | #include "entity.h" | ||
| 5 | #include <utility> | ||
| 6 | |||
| 7 | class Game; | ||
| 8 | |||
| 9 | class PhysicsBodyComponent : public Component { | ||
| 10 | public: | ||
| 11 | void receive(Game& game, Entity& entity, const Message& msg); | ||
| 12 | void tick(Game& game, Entity& entity, double dt); | ||
| 13 | void detectCollision(Game& game, Entity& entity, Entity& collider, std::pair<double, double> old_position); | ||
| 14 | |||
| 15 | protected: | ||
| 16 | std::pair<double, double> velocity; | ||
| 17 | std::pair<double, double> accel; | ||
| 18 | }; | ||
| 19 | |||
| 20 | #endif | ||
