summary refs log tree commit diff stats
path: root/src/components/physics_body.h
blob: 079cc51d50324a7c70c39e08e9a660b60e89c6c2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef PHYSICS_BODY_H
#define PHYSICS_BODY_H

#include "entity.h"
#include <utility>

class Game;

class PhysicsBodyComponent : public Component {
  public:
    void receive(Game& game, Entity& entity, const Message& msg);
    void tick(Game& game, Entity& entity, double dt);
    void detectCollision(Game& game, Entity& entity, Entity& collider, std::pair<double, double> old_position);
    
  protected:    
    std::pair<double, double> velocity;
    std::pair<double, double> accel;
};

#endif