2020-06-20 16:17:49 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
struct vec2_16_t
|
|
|
|
{
|
|
|
|
int16_t x, y;
|
|
|
|
};
|
|
|
|
|
2021-03-20 11:47:51 +00:00
|
|
|
struct vec2_t
|
2020-06-20 16:17:49 +00:00
|
|
|
{
|
|
|
|
int32_t x, y;
|
2021-03-20 11:47:51 +00:00
|
|
|
|
|
|
|
vec2_t() = default;
|
|
|
|
vec2_t(const vec2_t&) = default;
|
|
|
|
vec2_t(int x_, int y_) : x(x_), y(y_) {}
|
|
|
|
vec2_t operator+(const vec2_t& other) const { return { x + other.x, y + other.y }; }
|
|
|
|
vec2_t operator-(const vec2_t& other) const { return { x - other.x, y - other.y }; }
|
|
|
|
vec2_t& operator+=(const vec2_t& other) { x += other.x; y += other.y; return *this; };
|
|
|
|
vec2_t& operator-=(const vec2_t& other) { x -= other.x; y -= other.y; return *this; };
|
2020-06-20 16:17:49 +00:00
|
|
|
};
|
|
|
|
|
2021-03-20 11:47:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
2020-06-20 16:17:49 +00:00
|
|
|
struct vec2f_t
|
|
|
|
{
|
|
|
|
float x, y;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct vec3_t
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int32_t x, y, z;
|
|
|
|
};
|
|
|
|
vec2_t vec2;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
struct vec3_16_t
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int16_t x, y, z;
|
|
|
|
};
|
|
|
|
vec2_16_t vec2;
|
|
|
|
};
|
|
|
|
};
|
2020-09-08 16:39:47 +00:00
|
|
|
#endif
|