aboutsummaryrefslogtreecommitdiff
path: root/src/drone_controller.hh
diff options
context:
space:
mode:
authorccolin2021-01-02 01:10:54 +0100
committerccolin2021-01-02 01:10:54 +0100
commit861d505606d612bc328534dba3257e9ef9a1c269 (patch)
tree7ed7653ac0ec687317464b3518134b2244804a5a /src/drone_controller.hh
parent87f8c49cffe8a994c62c08cdb207e03ed4e0b6b8 (diff)
add basic collision detection
Diffstat (limited to 'src/drone_controller.hh')
-rw-r--r--src/drone_controller.hh10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/drone_controller.hh b/src/drone_controller.hh
index 18fc722..93930a1 100644
--- a/src/drone_controller.hh
+++ b/src/drone_controller.hh
@@ -29,12 +29,16 @@ class Drone {
QVector<Waypoint> waypoints;
int mesh_id;
+ QVector3D pos;
+ int id;
public:
- Drone();
+ Drone(int id);
Drone(const QJsonObject &json);
const QVector<Waypoint> getWaypoints() const;
void setTo(int frame);
+ QVector3D getPos() const;
+ int getId() const;
};
@@ -48,6 +52,8 @@ class DroneController : public QObject {
QTimer timer;
bool paused = true;
+ static bool collides(const Drone &a, const Drone &b, double radius);
+
public:
DroneController(const QJsonObject &json);
int getDuration() const;
@@ -56,6 +62,7 @@ signals:
void frameChanged(int frame);
void playing();
void pausing();
+ void collision(int idA, int idB, int frame);
private slots:
void step();
@@ -66,6 +73,7 @@ public slots:
void suspend();
void resume();
void seek(int frame);
+ void computeCollisions(double sphere_radius);
};