Added type to identify matrix, vector and quaternion at compile time
This commit is contained in:
parent
fa18ca7c2e
commit
d23d909e6d
@ -42,4 +42,12 @@ namespace glm
|
|||||||
simd,
|
simd,
|
||||||
defaultp = highp
|
defaultp = highp
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename T, precision P, template <typename, precision> class genType>
|
||||||
|
struct type
|
||||||
|
{
|
||||||
|
static bool const is_vec = false;
|
||||||
|
static bool const is_mat = false;
|
||||||
|
static bool const is_quat = false;
|
||||||
|
};
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
@ -222,6 +222,16 @@ namespace glm
|
|||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL bool operator!=(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
|
GLM_FUNC_DECL bool operator!=(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
struct type<T, P, tmat2x2>
|
||||||
|
{
|
||||||
|
static bool const is_vec = false;
|
||||||
|
static bool const is_mat = true;
|
||||||
|
static bool const is_quat = false;
|
||||||
|
};
|
||||||
} //namespace glm
|
} //namespace glm
|
||||||
|
|
||||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||||
|
@ -199,6 +199,16 @@ namespace glm
|
|||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL bool operator!=(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
|
GLM_FUNC_DECL bool operator!=(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
struct type<T, P, tmat2x3>
|
||||||
|
{
|
||||||
|
static bool const is_vec = false;
|
||||||
|
static bool const is_mat = true;
|
||||||
|
static bool const is_quat = false;
|
||||||
|
};
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|
||||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||||
|
@ -201,6 +201,16 @@ namespace glm
|
|||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL bool operator!=(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
|
GLM_FUNC_DECL bool operator!=(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
struct type<T, P, tmat2x4>
|
||||||
|
{
|
||||||
|
static bool const is_vec = false;
|
||||||
|
static bool const is_mat = true;
|
||||||
|
static bool const is_quat = false;
|
||||||
|
};
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|
||||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||||
|
@ -206,6 +206,16 @@ namespace glm
|
|||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL bool operator!=(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
|
GLM_FUNC_DECL bool operator!=(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
struct type<T, P, tmat3x2>
|
||||||
|
{
|
||||||
|
static bool const is_vec = false;
|
||||||
|
static bool const is_mat = true;
|
||||||
|
static bool const is_quat = false;
|
||||||
|
};
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|
||||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||||
|
@ -229,6 +229,16 @@ namespace glm
|
|||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL bool operator!=(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
|
GLM_FUNC_DECL bool operator!=(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
struct type<T, P, tmat3x3>
|
||||||
|
{
|
||||||
|
static bool const is_vec = false;
|
||||||
|
static bool const is_mat = true;
|
||||||
|
static bool const is_quat = false;
|
||||||
|
};
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|
||||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||||
|
@ -206,6 +206,16 @@ namespace glm
|
|||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL bool operator!=(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2);
|
GLM_FUNC_DECL bool operator!=(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2);
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
struct type<T, P, tmat3x4>
|
||||||
|
{
|
||||||
|
static bool const is_vec = false;
|
||||||
|
static bool const is_mat = true;
|
||||||
|
static bool const is_quat = false;
|
||||||
|
};
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|
||||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||||
|
@ -211,6 +211,16 @@ namespace glm
|
|||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL bool operator!=(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
|
GLM_FUNC_DECL bool operator!=(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
struct type<T, P, tmat4x2>
|
||||||
|
{
|
||||||
|
static bool const is_vec = false;
|
||||||
|
static bool const is_mat = true;
|
||||||
|
static bool const is_quat = false;
|
||||||
|
};
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|
||||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||||
|
@ -211,6 +211,16 @@ namespace glm
|
|||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL bool operator!=(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2);
|
GLM_FUNC_DECL bool operator!=(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2);
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
struct type<T, P, tmat4x3>
|
||||||
|
{
|
||||||
|
static bool const is_vec = false;
|
||||||
|
static bool const is_mat = true;
|
||||||
|
static bool const is_quat = false;
|
||||||
|
};
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|
||||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||||
|
@ -234,6 +234,16 @@ namespace glm
|
|||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL bool operator!=(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
|
GLM_FUNC_DECL bool operator!=(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
struct type<T, P, tmat4x4>
|
||||||
|
{
|
||||||
|
static bool const is_vec = false;
|
||||||
|
static bool const is_mat = true;
|
||||||
|
static bool const is_quat = false;
|
||||||
|
};
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|
||||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||||
|
@ -309,6 +309,16 @@ namespace glm
|
|||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL bool operator!=(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
GLM_FUNC_DECL bool operator!=(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
struct type<T, P, tvec1>
|
||||||
|
{
|
||||||
|
static bool const is_vec = true;
|
||||||
|
static bool const is_mat = false;
|
||||||
|
static bool const is_quat = false;
|
||||||
|
};
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|
||||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||||
|
@ -398,6 +398,16 @@ namespace glm
|
|||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL bool operator!=(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
|
GLM_FUNC_DECL bool operator!=(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
struct type<T, P, tvec2>
|
||||||
|
{
|
||||||
|
static bool const is_vec = true;
|
||||||
|
static bool const is_mat = false;
|
||||||
|
static bool const is_quat = false;
|
||||||
|
};
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|
||||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||||
|
@ -417,6 +417,16 @@ namespace glm
|
|||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL bool operator!=(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
|
GLM_FUNC_DECL bool operator!=(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
struct type<T, P, tvec3>
|
||||||
|
{
|
||||||
|
static bool const is_vec = true;
|
||||||
|
static bool const is_mat = false;
|
||||||
|
static bool const is_quat = false;
|
||||||
|
};
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|
||||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||||
|
@ -522,6 +522,16 @@ namespace detail
|
|||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL bool operator!=(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
GLM_FUNC_DECL bool operator!=(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
struct type<T, P, tvec4>
|
||||||
|
{
|
||||||
|
static bool const is_vec = true;
|
||||||
|
static bool const is_mat = false;
|
||||||
|
static bool const is_quat = false;
|
||||||
|
};
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
|
||||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||||
|
@ -374,6 +374,16 @@ namespace glm
|
|||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_DECL tvec4<bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y);
|
GLM_FUNC_DECL tvec4<bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y);
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
struct type<T, P, tquat>
|
||||||
|
{
|
||||||
|
static bool const is_vec = false;
|
||||||
|
static bool const is_mat = false;
|
||||||
|
static bool const is_quat = true;
|
||||||
|
};
|
||||||
} //namespace glm
|
} //namespace glm
|
||||||
|
|
||||||
#include "quaternion.inl"
|
#include "quaternion.inl"
|
||||||
|
@ -292,6 +292,16 @@ namespace glm
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
// -- Is type --
|
||||||
|
|
||||||
|
template <typename T, precision P, template <typename, precision> class genType>
|
||||||
|
struct type<T, P, tdualquat>
|
||||||
|
{
|
||||||
|
static bool is_vec = false;
|
||||||
|
static bool is_mat = false;
|
||||||
|
static bool is_quat = true;
|
||||||
|
};
|
||||||
} //namespace glm
|
} //namespace glm
|
||||||
|
|
||||||
#include "dual_quaternion.inl"
|
#include "dual_quaternion.inl"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user