From bb16c32bde58cba70e4877aa2d3ebd04332eb575 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Tue, 4 Jan 2022 13:35:02 +0100 Subject: linux compile and imgs --- umath/vec2.h | 64 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'umath/vec2.h') diff --git a/umath/vec2.h b/umath/vec2.h index ee72143..248dcc1 100644 --- a/umath/vec2.h +++ b/umath/vec2.h @@ -1,33 +1,33 @@ -#ifndef VEC2_H -#define VEC2_H - -class vec2 { - public: - float x; - float y; - - vec2() : x(0), y(0) {}; - vec2(float x, float y) : x(x), y(y) {}; - - vec2(const vec2 &oth) { x = oth.x; y = oth.y; }; - vec2(vec2 &oth) { x = oth.x; y = oth.y; }; - - vec2 operator+(const vec2 &rhs) { - return vec2 { x + rhs.x, y + rhs.y }; - } - vec2 operator-(const vec2 &rhs) { - return vec2 { x - rhs.x, y - rhs.y }; - } - vec2 operator*(const float m) { - return vec2 { x * m, y * m }; - } - vec2 operator/(const float m) { - return vec2 { x / m, y / m }; - } - vec2 operator+=(vec2 oth) { x += oth.x; y += oth.y; } - vec2 operator-=(vec2 oth) { x -= oth.x; y -= oth.y; } - vec2 operator*=(float m) { x *= m; y *= m; } - vec2 operator/=(float m) { x /= m; y /= m; } -}; - +#ifndef VEC2_H +#define VEC2_H + +class vec2 { + public: + float x; + float y; + + vec2() : x(0), y(0) {}; + vec2(float x, float y) : x(x), y(y) {}; + + vec2(const vec2 &oth) { x = oth.x; y = oth.y; }; + vec2(vec2 &oth) { x = oth.x; y = oth.y; }; + + vec2 operator+(const vec2 &rhs) { + return vec2 { x + rhs.x, y + rhs.y }; + } + vec2 operator-(const vec2 &rhs) { + return vec2 { x - rhs.x, y - rhs.y }; + } + vec2 operator*(const float m) { + return vec2 { x * m, y * m }; + } + vec2 operator/(const float m) { + return vec2 { x / m, y / m }; + } + vec2 operator+=(vec2 oth) { x += oth.x; y += oth.y; } + vec2 operator-=(vec2 oth) { x -= oth.x; y -= oth.y; } + vec2 operator*=(float m) { x *= m; y *= m; } + vec2 operator/=(float m) { x /= m; y /= m; } +}; + #endif \ No newline at end of file -- cgit v1.2.3-54-g00ecf