std::hash specialization for glm::tdualquat

This commit is contained in:
Thom de Villa 2015-07-24 17:58:15 +02:00
parent 5100bd76dc
commit 3b9e90c7b6
2 changed files with 18 additions and 0 deletions

View File

@ -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<T,P> &q) const;
};
template <typename T, glm::precision P>
struct hash<glm::tdualquat<T,P>>
{
GLM_FUNC_DECL size_t operator()(const glm::tdualquat<T,P> &q) const;
};
template <typename T, glm::precision P>
struct hash<glm::tmat2x2<T,P>>
{

View File

@ -108,6 +108,17 @@ namespace std
return seed;
}
template <typename T, glm::precision P>
GLM_FUNC_QUALIFIER size_t
hash<glm::tdualquat<T,P>>::operator()(const glm::tdualquat<T,P> &q) const
{
size_t seed = 0;
hash<glm::tquat<T,P>> hasher;
glm::detail::hash_combine(seed, hasher(q.real));
glm::detail::hash_combine(seed, hasher(q.dual));
return seed;
}
template <typename T, glm::precision P>
GLM_FUNC_QUALIFIER size_t
hash<glm::tmat2x2<T,P>>::operator()(const glm::tmat2x2<T,P> &m) const