diff options
Diffstat (limited to '')
-rw-r--r-- | external/include/glm/gtx/type_trait.hpp | 211 |
1 files changed, 22 insertions, 189 deletions
diff --git a/external/include/glm/gtx/type_trait.hpp b/external/include/glm/gtx/type_trait.hpp index 0207a06..637bbd1 100644 --- a/external/include/glm/gtx/type_trait.hpp +++ b/external/include/glm/gtx/type_trait.hpp @@ -6,25 +6,18 @@ /// @defgroup gtx_type_trait GLM_GTX_type_trait /// @ingroup gtx /// -/// @brief Defines traits for each type. +/// Include <glm/gtx/type_trait.hpp> to use the features of this extension. /// -/// <glm/gtx/type_trait.hpp> need to be included to use these functionalities. +/// Defines traits for each type. #pragma once +#ifndef GLM_ENABLE_EXPERIMENTAL +# error "GLM: GLM_GTX_type_trait is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." +#endif + // Dependency: -#include "../detail/type_vec2.hpp" -#include "../detail/type_vec3.hpp" -#include "../detail/type_vec4.hpp" -#include "../detail/type_mat2x2.hpp" -#include "../detail/type_mat2x3.hpp" -#include "../detail/type_mat2x4.hpp" -#include "../detail/type_mat3x2.hpp" -#include "../detail/type_mat3x3.hpp" -#include "../detail/type_mat3x4.hpp" -#include "../detail/type_mat4x2.hpp" -#include "../detail/type_mat4x3.hpp" -#include "../detail/type_mat4x4.hpp" +#include "../detail/qualifier.hpp" #include "../gtc/quaternion.hpp" #include "../gtx/dual_quaternion.hpp" @@ -37,7 +30,7 @@ namespace glm /// @addtogroup gtx_type_trait /// @{ - template <template <typename, precision> class genType, typename T, precision P> + template<typename T> struct type { static bool const is_vec = false; @@ -48,202 +41,42 @@ namespace glm static length_t const rows = 0; }; - template <typename T, precision P> - struct type<tvec1, T, P> - { - static bool const is_vec = true; - static bool const is_mat = false; - static bool const is_quat = false; - enum - { - components = 1 - }; - }; - - template <typename T, precision P> - struct type<tvec2, T, P> - { - static bool const is_vec = true; - static bool const is_mat = false; - static bool const is_quat = false; - enum - { - components = 2 - }; - }; - - template <typename T, precision P> - struct type<tvec3, T, P> - { - static bool const is_vec = true; - static bool const is_mat = false; - static bool const is_quat = false; - enum - { - components = 3 - }; - }; - - template <typename T, precision P> - struct type<tvec4, T, P> + template<length_t L, typename T, qualifier Q> + struct type<vec<L, T, Q> > { static bool const is_vec = true; static bool const is_mat = false; static bool const is_quat = false; - enum - { - components = 4 - }; - }; - - template <typename T, precision P> - struct type<tmat2x2, T, P> - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - enum - { - components = 2, - cols = 2, - rows = 2 - }; - }; - - template <typename T, precision P> - struct type<tmat2x3, T, P> - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - enum - { - components = 2, - cols = 2, - rows = 3 - }; - }; - - template <typename T, precision P> - struct type<tmat2x4, T, P> - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - enum - { - components = 2, - cols = 2, - rows = 4 - }; - }; - - template <typename T, precision P> - struct type<tmat3x2, T, P> - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - enum - { - components = 3, - cols = 3, - rows = 2 - }; - }; - - template <typename T, precision P> - struct type<tmat3x3, T, P> - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - enum - { - components = 3, - cols = 3, - rows = 3 - }; - }; - - template <typename T, precision P> - struct type<tmat3x4, T, P> - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - enum - { - components = 3, - cols = 3, - rows = 4 - }; - }; - - template <typename T, precision P> - struct type<tmat4x2, T, P> - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - enum - { - components = 4, - cols = 4, - rows = 2 - }; - }; - - template <typename T, precision P> - struct type<tmat4x3, T, P> - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - enum - { - components = 4, - cols = 4, - rows = 3 - }; + static length_t const components = L; }; - template <typename T, precision P> - struct type<tmat4x4, T, P> + template<length_t C, length_t R, typename T, qualifier Q> + struct type<mat<C, R, T, Q> > { static bool const is_vec = false; static bool const is_mat = true; static bool const is_quat = false; - enum - { - components = 4, - cols = 4, - rows = 4 - }; + static length_t const components = C; + static length_t const cols = C; + static length_t const rows = R; }; - template <typename T, precision P> - struct type<tquat, T, P> + template<typename T, qualifier Q> + struct type<tquat<T, Q> > { static bool const is_vec = false; static bool const is_mat = false; static bool const is_quat = true; - enum - { - components = 4 - }; + static length_t const components = 4; }; - template <typename T, precision P> - struct type<tdualquat, T, P> + template<typename T, qualifier Q> + struct type<tdualquat<T, Q> > { static bool const is_vec = false; static bool const is_mat = false; static bool const is_quat = true; - enum - { - components = 8 - }; + static length_t const components = 8; }; /// @} |