From 23206e96a20cc2c3fcf351fd099ec3122779173e Mon Sep 17 00:00:00 2001 From: "maihd.dev" Date: Thu, 6 Jun 2024 19:54:06 +0700 Subject: [PATCH] update changelogs --- changelogs/CHANGELOGS_v0.7.0-dev.md | 3 ++- include/vectormath/vectormath_operators.h | 31 +++++++++++++++-------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/changelogs/CHANGELOGS_v0.7.0-dev.md b/changelogs/CHANGELOGS_v0.7.0-dev.md index a3b3e42..d26b93e 100644 --- a/changelogs/CHANGELOGS_v0.7.0-dev.md +++ b/changelogs/CHANGELOGS_v0.7.0-dev.md @@ -5,4 +5,5 @@ - Add vecx_zero - Add system name or perspective/ortho/frustum, only support right handed now - Remove ++/-- operators -- Update matrix fields name rowx -> vx, support both row/col major, but now only have col-major functions \ No newline at end of file +- Update matrix fields name rowx -> vx, support both row/col major, but now only have col-major functions +- Remove mat4_div_mat4 and its operator overloading \ No newline at end of file diff --git a/include/vectormath/vectormath_operators.h b/include/vectormath/vectormath_operators.h index 6c5ff8c..5758b72 100644 --- a/include/vectormath/vectormath_operators.h +++ b/include/vectormath/vectormath_operators.h @@ -465,12 +465,14 @@ __forceinline mat4 operator-(mat4 m) } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4 operator+(mat4 m) { return m; } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4 operator+(mat4 a, mat4 b) { return mat4_new( @@ -482,6 +484,7 @@ __forceinline mat4 operator+(mat4 a, mat4 b) } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4 operator+(mat4 a, float b) { return mat4_new( @@ -493,6 +496,7 @@ __forceinline mat4 operator+(mat4 a, float b) } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4 operator+(float a, mat4 b) { return mat4_new( @@ -504,6 +508,7 @@ __forceinline mat4 operator+(float a, mat4 b) } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4 operator-(mat4 a, mat4 b) { return mat4_new( @@ -515,6 +520,7 @@ __forceinline mat4 operator-(mat4 a, mat4 b) } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4 operator-(mat4 a, float b) { return mat4_new( @@ -526,6 +532,7 @@ __forceinline mat4 operator-(mat4 a, float b) } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4 operator-(float a, mat4 b) { return mat4_new( @@ -537,53 +544,49 @@ __forceinline mat4 operator-(float a, mat4 b) } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4 operator*(mat4 a, mat4 b) { return mat4_mul(a, b); } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline vec2 operator*(mat4 a, vec2 b) { return mat4_mul_vec2(a, b); } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline vec3 operator*(mat4 a, vec3 b) { return mat4_mul_vec3(a, b); } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline vec4 operator*(mat4 a, vec4 b) { return mat4_mul_vec4(a, b); } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4 operator*(mat4 a, float b) { return mat4_mul1(a, b); } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4 operator*(float a, mat4 b) { return mat4_mul1(b, a); } -__forceinline mat4 operator/(mat4 a, mat4 b) -{ - return mat4_new( - a.col0 / b.col0, - a.col1 / b.col1, - a.col2 / b.col2, - a.col3 / b.col3 - ); -} - - +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4 operator/(mat4 a, float b) { return mat4_new( @@ -595,6 +598,7 @@ __forceinline mat4 operator/(mat4 a, float b) } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4 operator/(float a, mat4 b) { return mat4_new( @@ -606,6 +610,7 @@ __forceinline mat4 operator/(float a, mat4 b) } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4& operator+=(mat4& a, mat4 b) { return (a = a + b); @@ -618,6 +623,7 @@ __forceinline mat4& operator+=(mat4& a, float b) } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4& operator-=(mat4& a, mat4 b) { return (a = a - b); @@ -630,6 +636,7 @@ __forceinline mat4& operator-=(mat4& a, float b) } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline mat4& operator*=(mat4& a, mat4 b) { return (a = a * b); @@ -648,12 +655,14 @@ __forceinline mat4& operator/=(mat4& a, float b) } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline bool operator==(mat4 a, mat4 b) { return mat4_equal(a, b); } +// @todo: expr to use `const mat4&` instead of `mat4` __forceinline bool operator!=(mat4 a, mat4 b) { return mat4_not_equal(a, b);