aboutsummaryrefslogtreecommitdiff
path: root/src/drone.hh
blob: 873bb27ab85c0cb3655928bc0d284d34e1ca15fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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;
	QVector3D pos;
	int id;

public:
	Drone(int id);
	Drone(const QJsonObject &json);
	const QVector<Waypoint> getWaypoints() const;
	void setTo(int frame);
	const QVector3D getPos() const;
	int getId() const;
	const OpenGLMesh *getMesh() const;
};


#endif