aboutsummaryrefslogtreecommitdiff
path: root/src/drone_controller.hh
diff options
context:
space:
mode:
authorccolin2020-12-22 16:35:25 +0100
committerccolin2020-12-22 16:35:25 +0100
commitf20a0f978d4b443a5784c496969f338996d85ca2 (patch)
tree4ce5b40ea6cd57b4cd654273f54ea02ef3a4705b /src/drone_controller.hh
parent89a3f9c4020bea4b4f85f32bdc6a2af13ccd5da0 (diff)
drone models (broken) and animation
Diffstat (limited to 'src/drone_controller.hh')
-rw-r--r--src/drone_controller.hh15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/drone_controller.hh b/src/drone_controller.hh
index 4afc2b6..18fc722 100644
--- a/src/drone_controller.hh
+++ b/src/drone_controller.hh
@@ -1,11 +1,19 @@
#ifndef DRONE_CONTROLLER_HH
#define DRONE_CONTROLLER_HH
+#include "opengl_mesh.hh"
+
#include <QJsonObject>
#include <QVector3D>
#include <QTimer>
+template <typename T>
+static T lerp(T a, T b, double factor) {
+ return a + (factor * (b - a));
+}
+
+
struct Waypoint {
int frame;
QVector3D pos;
@@ -16,11 +24,17 @@ struct Waypoint {
class Drone {
+ static OpenGLMesh *mesh;
+ static bool mesh_initialized;
+
QVector<Waypoint> waypoints;
+ int mesh_id;
public:
+ Drone();
Drone(const QJsonObject &json);
const QVector<Waypoint> getWaypoints() const;
+ void setTo(int frame);
};
@@ -36,7 +50,6 @@ class DroneController : public QObject {
public:
DroneController(const QJsonObject &json);
- ~DroneController();
int getDuration() const;
signals: