m2-ar-projet/src/drone.hh

40 lines
651 B
C++

#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;
QVector3D pos;
int id;
double speed = 0;
public:
Drone(int id);
Drone(const QJsonObject &json);
const QVector<Waypoint> getWaypoints() const;
void setTo(int frame);
const QVector3D getPos() const;
int getId() const;
double getSpeed() const;
const OpenGLMesh *getMesh() const;
};
#endif