aboutsummaryrefslogtreecommitdiff
path: root/src/drone.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/drone.hh')
-rw-r--r--src/drone.hh37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/drone.hh b/src/drone.hh
new file mode 100644
index 0000000..6c43cc1
--- /dev/null
+++ b/src/drone.hh
@@ -0,0 +1,37 @@
+#ifndef DRONE_HH
+#define DRONE_HH
+
+#include "opengl_mesh.hh"
+#include "waypoint.hh"
+
+#include <QVector>
+#include <QVector3D>
+#include <QJsonObject>
+
+
+template <typename T>
+static T lerp(T a, T b, double factor) {
+ return a + (factor * (b - a));
+}
+
+
+class Drone {
+ static OpenGLMesh *mesh;
+ static bool mesh_initialized;
+
+ QVector<Waypoint> waypoints;
+ int mesh_id;
+ QVector3D pos;
+ int id;
+
+public:
+ Drone(int id);
+ Drone(const QJsonObject &json);
+ const QVector<Waypoint> getWaypoints() const;
+ void setTo(int frame);
+ QVector3D getPos() const;
+ int getId() const;
+};
+
+
+#endif