diff --git a/glm/gtx/hash.hpp b/glm/gtx/hash.hpp index 31e86dc6..cd44028c 100644 --- a/glm/gtx/hash.hpp +++ b/glm/gtx/hash.hpp @@ -53,6 +53,7 @@ #include "../gtc/vec1.hpp" #include "../gtc/quaternion.hpp" +#include "../gtx/dual_quaternion.hpp" #include "../mat2x2.hpp" #include "../mat2x3.hpp" @@ -98,6 +99,12 @@ namespace std GLM_FUNC_DECL size_t operator()(const glm::tquat &q) const; }; + template + struct hash> + { + GLM_FUNC_DECL size_t operator()(const glm::tdualquat &q) const; + }; + template struct hash> { diff --git a/glm/gtx/hash.inl b/glm/gtx/hash.inl index 2b77cccc..bba2c1ed 100644 --- a/glm/gtx/hash.inl +++ b/glm/gtx/hash.inl @@ -108,6 +108,17 @@ namespace std return seed; } + template + GLM_FUNC_QUALIFIER size_t + hash>::operator()(const glm::tdualquat &q) const + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(q.real)); + glm::detail::hash_combine(seed, hasher(q.dual)); + return seed; + } + template GLM_FUNC_QUALIFIER size_t hash>::operator()(const glm::tmat2x2 &m) const