-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVector3D.cpp
More file actions
58 lines (45 loc) · 766 Bytes
/
Vector3D.cpp
File metadata and controls
58 lines (45 loc) · 766 Bytes
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
58
#include "Vector3D.h"
namespace QtGameEngine
{
namespace Math
{
Vector3D::Vector3D(double x, double y, double z)
{
setX(x);
setY(y);
setZ(z);
}
Vector3D operator +(Vector3D& a, Vector3D& b)
{
return Vector3D(a.getX()+b.getX(), a.getY()+b.getY(), a.getZ()+b.getZ());
}
Vector3D operator -(Vector3D& a, Vector3D& b)
{
return Vector3D(a.getX()-b.getX(), a.getY()-b.getY(), a.getZ()-b.getZ());
}
double Vector3D::getX()
{
return x;
}
double Vector3D::getY()
{
return y;
}
double Vector3D::getZ()
{
return z;
}
void Vector3D::setX(double x)
{
this->x = x;
}
void Vector3D::setY(double y)
{
this->y = y;
}
void Vector3D::setZ(double z)
{
this->z = z;
}
}
}