-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVector3D.h
36 lines (28 loc) · 999 Bytes
/
Vector3D.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
#pragma once
#include <string>
#include <cmath>
#define PI 3.14159265358979323846
class Vector3D {
public:
float x, y, z;
Vector3D();
Vector3D(float x, float y, float z);
Vector3D(float x);
Vector3D operator+(const Vector3D& other) const;
Vector3D operator-(const Vector3D& other) const;
Vector3D operator*(float scalar) const;
Vector3D operator/(float scalar) const;
float length() const;
Vector3D normalize() const;
Vector3D normalizeRange(float min, float max) const;
float dot(const Vector3D& other = Vector3D(0, 0, 0)) const;
float distance(const Vector3D& other = Vector3D(0, 0, 0)) const;
Vector3D rotate(const Vector3D& rot = Vector3D(0, 0, 0)) const;
Vector3D deg() const;
Vector3D rad() const;
float angle(const Vector3D& other = Vector3D(0, 0, 0)) const;
bool operator==(const Vector3D& other) const;
bool operator!=(const Vector3D& other) const;
std::string toString() const;
};
void bindVector3D();