From 1bc9a625da6689e95a106e838b81dd82e2eb69e8 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Mon, 5 Aug 2024 01:24:53 +0800 Subject: [PATCH] to support GLM_FORCE_AVX2 --- inc/hgl/math/Matrix.h | 4 ++-- inc/hgl/math/Vector.h | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/inc/hgl/math/Matrix.h b/inc/hgl/math/Matrix.h index f21f457..a08f3e3 100644 --- a/inc/hgl/math/Matrix.h +++ b/inc/hgl/math/Matrix.h @@ -14,10 +14,10 @@ namespace hgl { using Quatf=glm::quat; - constexpr const Quatf IdentityQuatf=Quatf(1,0,0,0); + const Quatf IdentityQuatf(1,0,0,0); //w,x,y,z #define DEFINE_MATRIX(num) using Matrix##num##f=glm::mat##num; \ - constexpr const Matrix##num##f Identity##num##f=Matrix##num##f(1.0f); \ + const Matrix##num##f Identity##num##f=Matrix##num##f(1.0f); \ inline bool IsIdentityMatrix(const Matrix##num##f &m){return(hgl_cmp(m,Identity##num##f)==0);} \ inline int FastMatrixComp(const Matrix##num##f &m1,const Matrix##num##f &m2){return hgl_cmp(m1,m2);} diff --git a/inc/hgl/math/Vector.h b/inc/hgl/math/Vector.h index 426a5a4..a2a3bf0 100644 --- a/inc/hgl/math/Vector.h +++ b/inc/hgl/math/Vector.h @@ -15,10 +15,10 @@ namespace hgl X,Y,Z }; -#define DEF_VECTOR(flag,glm_type) using Vector1##flag=glm::glm_type##1; constexpr const Vector1##flag ZeroVector1##flag=Vector1##flag(0); constexpr const Vector1##flag OneVector1##flag=Vector1##flag(1);\ - using Vector2##flag=glm::glm_type##2; constexpr const Vector2##flag ZeroVector2##flag=Vector2##flag(0,0); constexpr const Vector2##flag OneVector2##flag=Vector2##flag(1,1);\ - using Vector3##flag=glm::glm_type##3; constexpr const Vector3##flag ZeroVector3##flag=Vector3##flag(0,0,0); constexpr const Vector3##flag OneVector3##flag=Vector3##flag(1,1,1);\ - using Vector4##flag=glm::glm_type##4; constexpr const Vector4##flag ZeroVector4##flag=Vector4##flag(0,0,0,0); constexpr const Vector4##flag OneVector4##flag=Vector4##flag(1,1,1,1); +#define DEF_VECTOR(flag,glm_type) using Vector1##flag=glm::glm_type##1; const Vector1##flag ZeroVector1##flag=Vector1##flag(0); const Vector1##flag OneVector1##flag=Vector1##flag(1);\ + using Vector2##flag=glm::glm_type##2; const Vector2##flag ZeroVector2##flag=Vector2##flag(0,0); const Vector2##flag OneVector2##flag=Vector2##flag(1,1);\ + using Vector3##flag=glm::glm_type##3; const Vector3##flag ZeroVector3##flag=Vector3##flag(0,0,0); const Vector3##flag OneVector3##flag=Vector3##flag(1,1,1);\ + using Vector4##flag=glm::glm_type##4; const Vector4##flag ZeroVector4##flag=Vector4##flag(0,0,0,0); const Vector4##flag OneVector4##flag=Vector4##flag(1,1,1,1); DEF_VECTOR(f,vec) DEF_VECTOR(d,dvec) @@ -41,9 +41,9 @@ namespace hgl namespace AxisVector { - constexpr const Vector3f X=Vector3f(1,0,0); - constexpr const Vector3f Y=Vector3f(0,1,0); - constexpr const Vector3f Z=Vector3f(0,0,1); + const Vector3f X=Vector3f(1,0,0); + const Vector3f Y=Vector3f(0,1,0); + const Vector3f Z=Vector3f(0,0,1); }; inline const Vector3f GetAxisVector(const AXIS &axis)