forked from bardia16/CPS_Android_HW
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmovement.h
38 lines (32 loc) · 915 Bytes
/
movement.h
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
38
#ifndef MOVEMENT_H
#define MOVEMENT_H
#include <QObject>
#include <QVector>
#include <QVector3D>
#define min_acceleration 0
#define min_velocity 0
class Movement : public QObject
{
Q_OBJECT
public:
explicit Movement(QObject *parent = nullptr);
void addAcceleration(double x, double y);
void addAngleChange(double alpha);
qreal calculateDistanceTraveled() const;
qreal calculateDistanceTraveledX() const;
qreal calculateDistanceTraveledY() const;
QVector<QVector3D> accelerations;
QVector<double> angleChanges;
void setStartPosition(qreal x, qreal y);
void setStartAngle(qreal angle);
QVector3D getCurrentPosition() const;
double getCurrentAngle() const;
QString getDirection() const;
void findDirection();
private:
QVector3D startPosition;
qreal sampleInterval;
double currentAngle;
QString currentDirection;
};
#endif // MOVEMENT_H