-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathVector4.h
52 lines (45 loc) · 1.2 KB
/
Vector4.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
#ifndef VECTOR4_H_
#define VECTOR4_H_
namespace Engine
{
struct Vector2;
struct Vector3;
struct Vector4
{
public:
union
{
struct
{
float X;
float Y;
float Z;
float W;
};
float XYZW[4];
};
Vector4(void);
Vector4(float x, float y, float z, float w);
Vector4(const Vector2 &vector2);
Vector4(const Vector3 &vector3);
float GetLength(void) const;
float GetLengthSquared(void) const;
void Normalize(void);
Vector4 operator+(const Vector4 &other) const;
Vector4 operator+=(const Vector4 &other);
Vector4 operator-(const Vector4 &other) const;
Vector4 operator-=(const Vector4 &other);
Vector4 operator*(float scalar) const;
Vector4 operator*=(float scalar);
float operator*(const Vector4 &other) const;
bool operator<(const Vector4 &other) const;
bool operator<=(const Vector4 &other) const;
bool operator>(const Vector4 &other) const;
bool operator>=(const Vector4 &other) const;
bool operator==(const Vector4 &other) const;
bool operator!=(const Vector4 &other) const;
static float Dot(const Vector4 &left, const Vector4 &right);
static Vector4 Normalize(const Vector4 &vector);
};
}
#endif