-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvector.h
57 lines (46 loc) · 1.1 KB
/
vector.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
#ifndef VECTOR_H_
#define VECTOR_H_
#include <math.h>
/*
*
* Geometric vector relatex classes
*
*/
namespace BE {
class Vector2 {
/*
*
* 2D vecfloator
*
*/
public:
float x, y;
Vector2() {};
Vector2(const float &x1, const float &y1);
Vector2(const Vector2 &v);
Vector2 &operator*(const Vector2 &v);
~Vector2() {};
void normalize();
};
class Vector3 {
/*
*
* 3D vecor
*
*/
public:
int foo;
float x, y, z;
Vector3() {};
Vector3(const float &x1, const float &y1, const float &z1);
Vector3(const Vector3 &v);
Vector3 &operator=(const Vector3 &v);
Vector3 operator*(const Vector3 &v) const;
Vector3 operator+(const Vector3 &v) const;
Vector3 operator/(const float &f) const;
~Vector3() {};
void normalize();
enum {DIVISION_BY_ZERO};
};
}
#endif /*VECTOR_H_*/