-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVec2.h
More file actions
30 lines (24 loc) · 668 Bytes
/
Vec2.h
File metadata and controls
30 lines (24 loc) · 668 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
#pragma once
class Vec2
{
public:
float x;
float y;
Vec2();
Vec2(float xin, float yin);
bool operator == (const Vec2& rhs) const;
bool operator != (const Vec2& rhs) const;
Vec2 operator + (const Vec2& rhs) const;
Vec2 operator - (const Vec2& rhs) const;
Vec2 operator * (const Vec2& rhs) const;
Vec2 operator * (const float value) const;
Vec2 operator / (const Vec2& rhs) const;
Vec2 operator += (const Vec2& rhs);
Vec2 operator -= (const Vec2& rhs);
Vec2 operator *= (const Vec2& rhs);
Vec2 operator *= (const float value);
Vec2 operator /= (const float value);
float magnitude() const;
float dist(const Vec2 rhs) const;
Vec2 normalize();
};