-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vector2.h
65 lines (38 loc) · 988 Bytes
/
Vector2.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef VECTOR2_H
#define VECTOR2_H
#include <iostream>
#include "SFML/Graphics.hpp"
template<class T>
class Vector2 final
{
public:
T x;
T y;
Vector2();
Vector2(T x);
Vector2(T x, T y);
template<class U>
explicit Vector2<T>(const Vector2<U>& vector);
sf::Vector2<float> ConverttoSF();
Vector2<T> add(Vector2<T>);
Vector2<T> sub(Vector2<T>);
Vector2<T> divide(int);
Vector2<T> mult(int);
float dist(Vector2<T>);
Vector2<T> setMag(float);
Vector2<T> limit(int);
Vector2<T> normalize();
float getAngle();
float crossProduct(Vector2<T>);
Vector2<T> setDir(float);
float getLength();
Vector2<T>& operator=(const Vector2<T>& Vector2Obj);
Vector2<T> operator+(const Vector2<T>& Right);
Vector2<T> operator-(const Vector2<T>& Right);
bool operator!=(const Vector2<T> &obj);
bool operator==(const Vector2<T> &obj);
};
typedef Vector2<int> Vector2i;
typedef Vector2<unsigned int> Vector2u;
typedef Vector2<float> Vector2f;
#endif /* VECTOR2_H */