- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCVector2.cpp
More file actions
Latest commit
21 lines (17 loc) · 450 Bytes
/
Copy pathCVector2.cpp
File metadata and controls
21 lines (17 loc) · 450 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include"CVector2.h"
// class based on www.gametutorials.com - see license.txt
const CVector2 operator*(float num, const CVector2& rhs){
returnCVector2(rhs.x * num, rhs.y * num);
}
ostream& operator<<(ostream& s, const CVector2& vec){
s << "(" << vec.x << "" << vec.y << ")";
return s;
}
intCVector2::maxComponentAbs(){
if (fabsf(x) > fabsf(y)){
returnX_COMPONENT;
}
else {
returnY_COMPONENT;
}
}