forked from JakobHeller/NatureInspiredComputing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Speed.h
43 lines (33 loc) · 891 Bytes
/
Speed.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
39
40
41
42
43
#ifndef __Speed_H__
#define __Speed_H__
class CSpeed
{
public:
CSpeed();
CSpeed(double velocity, double angle);
double Velocity() const;
void SetVelocity(double v);
void IncreaseVelocity(double v);
double Angle() const;
void SetAngle(double a);
void IncreaseAngle(double a);
double Left() const;
double Right() const;
void SetComponents(double left, double right);
void SetAngularComponents(double v, double a);
void Limit();
CSpeed operator+(CSpeed other);
CSpeed operator-(CSpeed other);
CSpeed operator*(double factor);
CSpeed operator/(double factor);
CSpeed& operator+=(CSpeed other);
CSpeed& operator-=(CSpeed other);
CSpeed& operator*=(double factor);
CSpeed& operator/=(double factor);
bool operator<(const CSpeed& other) const;
private:
double m_Velocity;
double m_Angle;
bool m_VelocityFlipped;
};
#endif