aboutsummaryrefslogtreecommitdiff
path: root/src/drone_controller.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/drone_controller.hh')
-rw-r--r--src/drone_controller.hh57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/drone_controller.hh b/src/drone_controller.hh
new file mode 100644
index 0000000..484cd57
--- /dev/null
+++ b/src/drone_controller.hh
@@ -0,0 +1,57 @@
+#ifndef DRONE_CONTROLLER_HH
+#define DRONE_CONTROLLER_HH
+
+#include <QJsonObject>
+#include <QVector3D>
+#include <QTimer>
+
+
+struct Waypoint {
+ int frame;
+ QVector3D pos;
+
+ Waypoint(unsigned frame, QVector3D pos);
+ Waypoint(const QJsonObject &json);
+};
+
+
+class Drone {
+ QVector<Waypoint> waypoints;
+
+public:
+ Drone(const QJsonObject &json);
+ const QVector<Waypoint> getWaypoints() const;
+};
+
+
+class DroneController : public QObject {
+ Q_OBJECT
+
+ int framerate;
+ int frame = 0;
+ int duration = 0;
+ QVector<Drone> drones;
+ QTimer timer;
+ bool paused = true;
+
+public:
+ DroneController(const QJsonObject &json);
+ ~DroneController();
+ int getDuration() const;
+
+signals:
+ void frameChanged(int frame);
+
+private slots:
+ void step();
+
+public slots:
+ void play();
+ void pause();
+ void suspend();
+ void resume();
+ void seek(int frame);
+};
+
+
+#endif