const correctness stuff

This commit is contained in:
2026-03-11 13:32:25 -04:00
parent 06c2ca306a
commit d26c7ee348
31 changed files with 55 additions and 24 deletions

View File

@ -14,7 +14,7 @@ public:
vec2(double _x, double _y);
vec2(const vec2 &rhs);
vec2& operator=(const vec2 &rhs);
bool operator==(vec2 rhs);
bool operator==(const vec2 rhs) const;
vec2 operator+(vec2 rhs) const;
vec2 operator-(vec2 rhs) const;
@ -56,7 +56,7 @@ public:
mat2(const vec2 _col1, const vec2 _col2);
mat2& operator=(const mat2 rhs);
bool operator==(const mat2 rhs);
bool operator==(const mat2 rhs) const;
mat2 operator+(mat2 rhs) const;
mat2 operator-(mat2 rhs) const;

View File

@ -14,7 +14,7 @@ public:
vec2f(float _x, float _y);
vec2f(const vec2f &rhs);
vec2f& operator=(const vec2f &rhs);
bool operator==(vec2f rhs);
bool operator==(const vec2f rhs) const;
vec2f operator+(vec2f rhs) const;
vec2f operator-(vec2f rhs) const;
@ -56,7 +56,7 @@ public:
mat2f(const vec2f _col1, const vec2f _col2);
mat2f& operator=(const mat2f rhs);
bool operator==(const mat2f rhs);
bool operator==(const mat2f rhs) const;
mat2f operator+(mat2f rhs) const;
mat2f operator-(mat2f rhs) const;

View File

@ -0,0 +1,31 @@
#ifndef __AMSMATHUTIL25_VEC2I_HPP__
#define __AMSMATHUTIL25_VEC2I_HPP__
namespace ams
{
class vec2i
{
public:
int x;
int y;
vec2i();
vec2i(float _x, float _y);
vec2i(const vec2i &rhs);
vec2i& operator=(const vec2i &rhs);
bool operator==(const vec2i rhs) const;
vec2i operator+(vec2i rhs) const;
vec2i operator-(vec2i rhs) const;
vec2i operator*(float rhs) const;
vec2i operator/(float rhs) const;
friend vec2i operator-(vec2i rhs);
float& operator[](int ind);
const float& operator[](int ind) const;
};
};

View File

@ -19,7 +19,7 @@ public:
vec3(double _x, double _y, double _z);
vec3(const vec3 &rhs);
vec3& operator=(const vec3 &rhs);
bool operator==(vec3 rhs);
bool operator==(const vec3 rhs) const;
vec3 operator+(vec3 rhs) const;
vec3 operator-(vec3 rhs) const;
@ -60,7 +60,7 @@ public:
mat3(const vec3 _col1, const vec3 _col2, const vec3 _col3);
mat3& operator=(const mat3 rhs);
bool operator==(const mat3 rhs);
bool operator==(const mat3 rhs) const;
mat3 operator+(mat3 rhs) const;
mat3 operator-(mat3 rhs) const;

View File

@ -19,7 +19,7 @@ public:
vec3f(float _x, float _y, float _z);
vec3f(const vec3f &rhs);
vec3f& operator=(const vec3f &rhs);
bool operator==(vec3f rhs);
bool operator==(const vec3f rhs) const;
vec3f operator+(vec3f rhs) const;
vec3f operator-(vec3f rhs) const;
@ -60,7 +60,7 @@ public:
mat3f(const vec3f _col1, const vec3f _col2, const vec3f _col3);
mat3f& operator=(const mat3f rhs);
bool operator==(const mat3f rhs);
bool operator==(const mat3f rhs) const;
mat3f operator+(mat3f rhs) const;
mat3f operator-(mat3f rhs) const;

View File

@ -19,7 +19,7 @@ public:
vec4(double _x, double _y, double _z, double _w);
vec4(const vec4 &rhs);
vec4& operator=(const vec4 &rhs);
bool operator==(vec4 rhs);
bool operator==(const vec4 rhs) const;
vec4 operator+(vec4 rhs) const;
vec4 operator-(vec4 rhs) const;
@ -62,7 +62,7 @@ public:
mat4(const vec4 _col1, const vec4 _col2, const vec4 _col3, const vec4 _col4);
mat4& operator=(const mat4 rhs);
bool operator==(const mat4 rhs);
bool operator==(const mat4 rhs) const;
mat4 operator+(mat4 rhs) const;
mat4 operator-(mat4 rhs) const;

View File

@ -19,7 +19,7 @@ public:
vec4f(float _x, float _y, float _z, float _w);
vec4f(const vec4f &rhs);
vec4f& operator=(const vec4f &rhs);
bool operator==(vec4f rhs);
bool operator==(const vec4f rhs) const;
vec4f operator+(vec4f rhs) const;
vec4f operator-(vec4f rhs) const;
@ -62,7 +62,7 @@ public:
mat4f(const vec4f _col1, const vec4f _col2, const vec4f _col3, const vec4f _col4);
mat4f& operator=(const mat4f rhs);
bool operator==(const mat4f rhs);
bool operator==(const mat4f rhs) const;
mat4f operator+(mat4f rhs) const;
mat4f operator-(mat4f rhs) const;