From f20a0f978d4b443a5784c496969f338996d85ca2 Mon Sep 17 00:00:00 2001 From: ccolin Date: Tue, 22 Dec 2020 16:35:25 +0100 Subject: drone models (broken) and animation --- src/drone_controller.hh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/drone_controller.hh') 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 #include #include +template +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 waypoints; + int mesh_id; public: + Drone(); Drone(const QJsonObject &json); const QVector getWaypoints() const; + void setTo(int frame); }; @@ -36,7 +50,6 @@ class DroneController : public QObject { public: DroneController(const QJsonObject &json); - ~DroneController(); int getDuration() const; signals: -- cgit v1.2.3-70-g09d2