-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathVector3.h
32 lines (29 loc) · 815 Bytes
/
Vector3.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
#ifndef FIXIE_VECTOR3_H
#define FIXIE_VECTOR3_H
#include "Num.h"
namespace Fixie {
class Vector3 {
public:
Vector3(Num x, Num y, Num z);
Vector3();
Num& operator[](const int index);
const Num& operator[](const int index) const;
Vector3 operator+(Vector3 other);
Vector3& operator+=(Vector3 other);
Vector3 operator-(Vector3 other);
Vector3& operator-=(Vector3 other);
Vector3 operator*(Num divisor);
Vector3& operator*=(Num divisor);
Vector3 operator/(Num divisor);
Vector3& operator/=(Num divisor);
Num calcLength() const;
Num calcSquaredLength() const;
void reset();
static Num dot(Vector3 a, Vector3 b);
static Vector3 cross(Vector3 a, Vector3 b);
static Vector3 normalize(Vector3 v);
private:
Num components[3];
};
}
#endif