redefined Vector/Matrix

This commit is contained in:
hyzboy 2024-07-01 01:14:17 +08:00
parent a82810d58a
commit 538d19781a
2 changed files with 21 additions and 26 deletions

View File

@ -15,7 +15,10 @@ namespace hgl
using Matrix2f=glm::mat2; using Matrix2f=glm::mat2;
using Matrix3f=glm::mat3; using Matrix3f=glm::mat3;
using Matrix4f=glm::mat4; using Matrix4f=glm::mat4;
using Matrix2x4f=glm::mat2x4;
using Matrix3x4f=glm::mat3x4; using Matrix3x4f=glm::mat3x4;
using Matrix4x2f=glm::mat4x2;
using Matrix4x3f=glm::mat4x3;
constexpr const Matrix2f Identity2f=Matrix2f(1.0f); constexpr const Matrix2f Identity2f=Matrix2f(1.0f);
constexpr const Matrix3f Identity3f=Matrix3f(1.0f); constexpr const Matrix3f Identity3f=Matrix3f(1.0f);

View File

@ -10,37 +10,29 @@
namespace hgl namespace hgl
{ {
using Vector2f=glm::vec2; #define DEF_VECTOR(flag,glm_type) using Vector1##flag=glm::glm_type##1;\
using Vector3f=glm::vec3; using Vector2##flag=glm::glm_type##2;\
using Vector4f=glm::vec4; using Vector3##flag=glm::glm_type##3;\
using Vector4##flag=glm::glm_type##4;
using Vector2d=glm::dvec2; DEF_VECTOR(f,vec)
using Vector3d=glm::dvec3; DEF_VECTOR(d,dvec)
using Vector4d=glm::dvec4; DEF_VECTOR(b,bvec)
using Vector2b=glm::bvec2; DEF_VECTOR(i,ivec)
using Vector3b=glm::bvec3; DEF_VECTOR(u,uvec)
using Vector4b=glm::bvec4;
using Vector2i8=glm::u8vec2; DEF_VECTOR(i8,i8vec)
using Vector3i8=glm::u8vec3; DEF_VECTOR(i16,i16vec)
using Vector4i8=glm::u8vec4; DEF_VECTOR(i32,i32vec)
DEF_VECTOR(i64,i64vec)
using Vector2u8=glm::u8vec2; DEF_VECTOR(u8,u8vec)
using Vector3u8=glm::u8vec3; DEF_VECTOR(u16,u16vec)
using Vector4u8=glm::u8vec4; DEF_VECTOR(u32,u32vec)
DEF_VECTOR(u64,u64vec)
using Vector2u16=glm::u16vec2; #undef DEF_VECTOR
using Vector3u16=glm::u16vec3;
using Vector4u16=glm::u16vec4;
using Vector2i=glm::ivec2;
using Vector3i=glm::ivec3;
using Vector4i=glm::ivec4;
using Vector2u=glm::uvec2;
using Vector3u=glm::uvec3;
using Vector4u=glm::uvec4;
inline bool operator == (const Vector2f &lhs,const Vector2f &rhs) inline bool operator == (const Vector2f &lhs,const Vector2f &rhs)
{ {