- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCVector3.cpp
More file actions
Latest commit
17 lines (12 loc) · 486 Bytes
/
Copy pathCVector3.cpp
File metadata and controls
17 lines (12 loc) · 486 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include"CVector3.h"
// class based on www.gametutorials.com - see license.txt
ostream& operator<<(ostream& s, const CVector3& vec){
s << "(" << vec.x << "" << vec.y << "" << vec.z << ")";
return s;
}
CVector3 operator+(const CVector3& lhs, const CVector3& rhs){
returnCVector3(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z);
}
CVector3 operator-(const CVector3& lhs, const CVector3& rhs){
returnCVector3(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z);
}