From caa97b9fc4f25e0db64ff38fbd8c3c4d49ceef4a Mon Sep 17 00:00:00 2001 From: talha Date: Sat, 26 Oct 2024 23:51:07 +0500 Subject: Simplified Vec2 operator overloads --- source/math.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/math.h b/source/math.h index d682ae3..7deb0bc 100755 --- a/source/math.h +++ b/source/math.h @@ -34,7 +34,7 @@ union Vec2 { }; r32 data[2]; - Vec2 operator+(const r32& scaler) const { + Vec2 operator+(r32 scaler) { Vec2 res; res.x = this->x + scaler; res.y = this->y + scaler; @@ -42,7 +42,7 @@ union Vec2 { return res; } - Vec2 operator+(const Vec2& v) const { + Vec2 operator+(Vec2 v) { Vec2 res; res.x = this->x + v.x; res.y = this->y + v.y; @@ -50,7 +50,7 @@ union Vec2 { return res; } - Vec2 operator-(const r32& scaler) const { + Vec2 operator-(r32 scaler) { Vec2 res; res.x = this->x - scaler; res.y = this->y - scaler; @@ -58,7 +58,7 @@ union Vec2 { return res; } - Vec2 operator-(const Vec2& v) const { + Vec2 operator-(Vec2 v) { Vec2 res; res.x = this->x - v.x; res.y = this->y - v.y; @@ -66,7 +66,7 @@ union Vec2 { return res; } - Vec2 operator*(r32 scaler) const { + Vec2 operator*(r32 scaler) { Vec2 res; res.x = this->x * scaler; res.y = this->y * scaler; @@ -74,7 +74,7 @@ union Vec2 { return res; } - Vec2 operator*(const Vec2& v) const { + Vec2 operator*(Vec2 v) { Vec2 res; res.x = this->x * v.x; res.y = this->y * v.y; -- cgit v1.2.3