49 lines
897 B
C
49 lines
897 B
C
|
#pragma once
|
||
|
|
||
|
class float_vec2
|
||
|
{
|
||
|
public:
|
||
|
float x, y;
|
||
|
float_vec2 operator+(float_vec2 vec)
|
||
|
{
|
||
|
return { x + vec.x, y + vec.y };
|
||
|
}
|
||
|
float_vec2 operator*(float v)
|
||
|
{
|
||
|
return { x * v, y * v };
|
||
|
}
|
||
|
float_vec2 operator*(float_vec2 vec)
|
||
|
{
|
||
|
return { x * vec.x, y * vec.y };
|
||
|
}
|
||
|
float_vec2 operator-(float_vec2 vec)
|
||
|
{
|
||
|
return { x - vec.x, y - vec.y };
|
||
|
}
|
||
|
float_vec2 operator-(float v)
|
||
|
{
|
||
|
return { x - v, y - v };
|
||
|
}
|
||
|
};
|
||
|
|
||
|
class int_vec2
|
||
|
{
|
||
|
public:
|
||
|
int x, y;
|
||
|
int_vec2 operator+(int_vec2 vec)
|
||
|
{
|
||
|
return { x + vec.x, y + vec.y };
|
||
|
}
|
||
|
int_vec2 operator*(int v)
|
||
|
{
|
||
|
return { x * v, y * v };
|
||
|
}
|
||
|
int_vec2 operator*(int_vec2 vec)
|
||
|
{
|
||
|
return { x * vec.x, y * vec.y };
|
||
|
}
|
||
|
int_vec2 operator-(int_vec2 vec)
|
||
|
{
|
||
|
return { x - vec.x, y - vec.y };
|
||
|
}
|
||
|
};
|