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 |
#pragma once
#include "GameEngine.h"
namespace Machiel
{
class Vector3
{
public:
// constructoren
Vector3();
Vector3(float x, float y, float z);
// destructor
~Vector3();
tstring ToString();
// operatoren:
// +, -, *
// +=, -=, *=
// ==, !=
// copy constructor en assignment operator moeten
// public zijn (ofwel defaults, ofwel zelf
// geschreven)
Vector3(const Vector3& p);
Vector3& operator=(const Vector3& p);
Vector3 operator+(const Vector3& p);
Vector3 operator-(const Vector3& p);
Vector3 operator*(const Vector3& p);
Vector3& operator+=(const Vector3& p);
Vector3& operator-=(const Vector3& p);
Vector3& operator*=(const Vector3& p);
bool operator==(const Vector3& p);
bool operator!=(const Vector3& p);
private:
float m_x,m_y,m_z;
friend tstringstream& operator<<(tstringstream& stream, Vector3& vector3);
friend tstring operator+(tstring string, Vector3& vector3);
friend Vector3 operator*(int n, Vector3& vector3);
};
}
|