| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | #pragma once |
| 14 | |
| 15 | #ifndef GLM_ENABLE_EXPERIMENTAL |
| 16 | # error "GLM: GLM_GTX_hash 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." |
| 17 | #endif |
| 18 | |
| 19 | #include <functional> |
| 20 | |
| 21 | #include "../vec2.hpp" |
| 22 | #include "../vec3.hpp" |
| 23 | #include "../vec4.hpp" |
| 24 | #include "../gtc/vec1.hpp" |
| 25 | |
| 26 | #include "../gtc/quaternion.hpp" |
| 27 | #include "../gtx/dual_quaternion.hpp" |
| 28 | |
| 29 | #include "../mat2x2.hpp" |
| 30 | #include "../mat2x3.hpp" |
| 31 | #include "../mat2x4.hpp" |
| 32 | |
| 33 | #include "../mat3x2.hpp" |
| 34 | #include "../mat3x3.hpp" |
| 35 | #include "../mat3x4.hpp" |
| 36 | |
| 37 | #include "../mat4x2.hpp" |
| 38 | #include "../mat4x3.hpp" |
| 39 | #include "../mat4x4.hpp" |
| 40 | |
| 41 | #if !GLM_HAS_CXX11_STL |
| 42 | # error "GLM_GTX_hash requires C++11 standard library support" |
| 43 | #endif |
| 44 | |
| 45 | namespace std |
| 46 | { |
| 47 | template<typename T, glm::qualifier Q> |
| 48 | struct hash<glm::vec<1, T,Q> > |
| 49 | { |
| 50 | GLM_FUNC_DECL size_t operator()(glm::vec<1, T, Q> const& v) const; |
| 51 | }; |
| 52 | |
| 53 | template<typename T, glm::qualifier Q> |
| 54 | struct hash<glm::vec<2, T,Q> > |
| 55 | { |
| 56 | GLM_FUNC_DECL size_t operator()(glm::vec<2, T, Q> const& v) const; |
| 57 | }; |
| 58 | |
| 59 | template<typename T, glm::qualifier Q> |
| 60 | struct hash<glm::vec<3, T,Q> > |
| 61 | { |
| 62 | GLM_FUNC_DECL size_t operator()(glm::vec<3, T, Q> const& v) const; |
| 63 | }; |
| 64 | |
| 65 | template<typename T, glm::qualifier Q> |
| 66 | struct hash<glm::vec<4, T,Q> > |
| 67 | { |
| 68 | GLM_FUNC_DECL size_t operator()(glm::vec<4, T, Q> const& v) const; |
| 69 | }; |
| 70 | |
| 71 | template<typename T, glm::qualifier Q> |
| 72 | struct hash<glm::tquat<T,Q>> |
| 73 | { |
| 74 | GLM_FUNC_DECL size_t operator()(glm::tquat<T, Q> const& q) const; |
| 75 | }; |
| 76 | |
| 77 | template<typename T, glm::qualifier Q> |
| 78 | struct hash<glm::tdualquat<T,Q> > |
| 79 | { |
| 80 | GLM_FUNC_DECL size_t operator()(glm::tdualquat<T,Q> const& q) const; |
| 81 | }; |
| 82 | |
| 83 | template<typename T, glm::qualifier Q> |
| 84 | struct hash<glm::mat<2, 2, T,Q> > |
| 85 | { |
| 86 | GLM_FUNC_DECL size_t operator()(glm::mat<2, 2, T,Q> const& m) const; |
| 87 | }; |
| 88 | |
| 89 | template<typename T, glm::qualifier Q> |
| 90 | struct hash<glm::mat<2, 3, T,Q> > |
| 91 | { |
| 92 | GLM_FUNC_DECL size_t operator()(glm::mat<2, 3, T,Q> const& m) const; |
| 93 | }; |
| 94 | |
| 95 | template<typename T, glm::qualifier Q> |
| 96 | struct hash<glm::mat<2, 4, T,Q> > |
| 97 | { |
| 98 | GLM_FUNC_DECL size_t operator()(glm::mat<2, 4, T,Q> const& m) const; |
| 99 | }; |
| 100 | |
| 101 | template<typename T, glm::qualifier Q> |
| 102 | struct hash<glm::mat<3, 2, T,Q> > |
| 103 | { |
| 104 | GLM_FUNC_DECL size_t operator()(glm::mat<3, 2, T,Q> const& m) const; |
| 105 | }; |
| 106 | |
| 107 | template<typename T, glm::qualifier Q> |
| 108 | struct hash<glm::mat<3, 3, T,Q> > |
| 109 | { |
| 110 | GLM_FUNC_DECL size_t operator()(glm::mat<3, 3, T,Q> const& m) const; |
| 111 | }; |
| 112 | |
| 113 | template<typename T, glm::qualifier Q> |
| 114 | struct hash<glm::mat<3, 4, T,Q> > |
| 115 | { |
| 116 | GLM_FUNC_DECL size_t operator()(glm::mat<3, 4, T,Q> const& m) const; |
| 117 | }; |
| 118 | |
| 119 | template<typename T, glm::qualifier Q> |
| 120 | struct hash<glm::mat<4, 2, T,Q> > |
| 121 | { |
| 122 | GLM_FUNC_DECL size_t operator()(glm::mat<4, 2, T,Q> const& m) const; |
| 123 | }; |
| 124 | |
| 125 | template<typename T, glm::qualifier Q> |
| 126 | struct hash<glm::mat<4, 3, T,Q> > |
| 127 | { |
| 128 | GLM_FUNC_DECL size_t operator()(glm::mat<4, 3, T,Q> const& m) const; |
| 129 | }; |
| 130 | |
| 131 | template<typename T, glm::qualifier Q> |
| 132 | struct hash<glm::mat<4, 4, T,Q> > |
| 133 | { |
| 134 | GLM_FUNC_DECL size_t operator()(glm::mat<4, 4, T,Q> const& m) const; |
| 135 | }; |
| 136 | } |
| 137 | |
| 138 | #include "hash.inl" |