mirror of
https://github.com/g-truc/glm.git
synced 2024-11-26 02:04:35 +00:00
parent
a40974fb86
commit
b6618171dd
@ -214,7 +214,11 @@
|
|||||||
#include "./gtx/functions.hpp"
|
#include "./gtx/functions.hpp"
|
||||||
#include "./gtx/gradient_paint.hpp"
|
#include "./gtx/gradient_paint.hpp"
|
||||||
#include "./gtx/handed_coordinate_space.hpp"
|
#include "./gtx/handed_coordinate_space.hpp"
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
#include "./gtx/hash.hpp"
|
#include "./gtx/hash.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "./gtx/integer.hpp"
|
#include "./gtx/integer.hpp"
|
||||||
#include "./gtx/intersect.hpp"
|
#include "./gtx/intersect.hpp"
|
||||||
#include "./gtx/io.hpp"
|
#include "./gtx/io.hpp"
|
||||||
|
@ -40,11 +40,11 @@
|
|||||||
#include "../mat4x3.hpp"
|
#include "../mat4x3.hpp"
|
||||||
#include "../mat4x4.hpp"
|
#include "../mat4x4.hpp"
|
||||||
|
|
||||||
#if !GLM_HAS_CXX11_STL
|
#if __cplusplus >= 201103L
|
||||||
#pragma message("GLM_GTX_hash requires C++11 standard library support")
|
#pragma message("GLM_GTX_hash requires C++11 standard library support")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0 && GLM_LANG & GLM_LANG_CXX11
|
#if GLM_LANG & GLM_LANG_CXX11
|
||||||
#define GLM_GTX_hash 1
|
#define GLM_GTX_hash 1
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ namespace std
|
|||||||
GLM_FUNC_QUALIFIER size_t hash<glm::tdualquat<T, Q> >::operator()(glm::tdualquat<T, Q> const& q) const GLM_NOEXCEPT
|
GLM_FUNC_QUALIFIER size_t hash<glm::tdualquat<T, Q> >::operator()(glm::tdualquat<T, Q> const& q) const GLM_NOEXCEPT
|
||||||
{
|
{
|
||||||
size_t seed = 0;
|
size_t seed = 0;
|
||||||
hash<glm::qua<T, Q>> hasher;
|
hash<glm::qua<T, Q> > hasher;
|
||||||
glm::detail::hash_combine(seed, hasher(q.real));
|
glm::detail::hash_combine(seed, hasher(q.real));
|
||||||
glm::detail::hash_combine(seed, hasher(q.dual));
|
glm::detail::hash_combine(seed, hasher(q.dual));
|
||||||
return seed;
|
return seed;
|
||||||
@ -78,7 +78,7 @@ namespace std
|
|||||||
GLM_FUNC_QUALIFIER size_t hash<glm::mat<2, 2, T, Q> >::operator()(glm::mat<2, 2, T, Q> const& m) const GLM_NOEXCEPT
|
GLM_FUNC_QUALIFIER size_t hash<glm::mat<2, 2, T, Q> >::operator()(glm::mat<2, 2, T, Q> const& m) const GLM_NOEXCEPT
|
||||||
{
|
{
|
||||||
size_t seed = 0;
|
size_t seed = 0;
|
||||||
hash<glm::vec<2, T, Q>> hasher;
|
hash<glm::vec<2, T, Q> > hasher;
|
||||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||||
return seed;
|
return seed;
|
||||||
@ -88,7 +88,7 @@ namespace std
|
|||||||
GLM_FUNC_QUALIFIER size_t hash<glm::mat<2, 3, T, Q> >::operator()(glm::mat<2, 3, T, Q> const& m) const GLM_NOEXCEPT
|
GLM_FUNC_QUALIFIER size_t hash<glm::mat<2, 3, T, Q> >::operator()(glm::mat<2, 3, T, Q> const& m) const GLM_NOEXCEPT
|
||||||
{
|
{
|
||||||
size_t seed = 0;
|
size_t seed = 0;
|
||||||
hash<glm::vec<3, T, Q>> hasher;
|
hash<glm::vec<3, T, Q> > hasher;
|
||||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||||
return seed;
|
return seed;
|
||||||
@ -98,7 +98,7 @@ namespace std
|
|||||||
GLM_FUNC_QUALIFIER size_t hash<glm::mat<2, 4, T, Q> >::operator()(glm::mat<2, 4, T, Q> const& m) const GLM_NOEXCEPT
|
GLM_FUNC_QUALIFIER size_t hash<glm::mat<2, 4, T, Q> >::operator()(glm::mat<2, 4, T, Q> const& m) const GLM_NOEXCEPT
|
||||||
{
|
{
|
||||||
size_t seed = 0;
|
size_t seed = 0;
|
||||||
hash<glm::vec<4, T, Q>> hasher;
|
hash<glm::vec<4, T, Q> > hasher;
|
||||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||||
return seed;
|
return seed;
|
||||||
@ -108,7 +108,7 @@ namespace std
|
|||||||
GLM_FUNC_QUALIFIER size_t hash<glm::mat<3, 2, T, Q> >::operator()(glm::mat<3, 2, T, Q> const& m) const GLM_NOEXCEPT
|
GLM_FUNC_QUALIFIER size_t hash<glm::mat<3, 2, T, Q> >::operator()(glm::mat<3, 2, T, Q> const& m) const GLM_NOEXCEPT
|
||||||
{
|
{
|
||||||
size_t seed = 0;
|
size_t seed = 0;
|
||||||
hash<glm::vec<2, T, Q>> hasher;
|
hash<glm::vec<2, T, Q> > hasher;
|
||||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[2]));
|
glm::detail::hash_combine(seed, hasher(m[2]));
|
||||||
@ -119,7 +119,7 @@ namespace std
|
|||||||
GLM_FUNC_QUALIFIER size_t hash<glm::mat<3, 3, T, Q> >::operator()(glm::mat<3, 3, T, Q> const& m) const GLM_NOEXCEPT
|
GLM_FUNC_QUALIFIER size_t hash<glm::mat<3, 3, T, Q> >::operator()(glm::mat<3, 3, T, Q> const& m) const GLM_NOEXCEPT
|
||||||
{
|
{
|
||||||
size_t seed = 0;
|
size_t seed = 0;
|
||||||
hash<glm::vec<3, T, Q>> hasher;
|
hash<glm::vec<3, T, Q> > hasher;
|
||||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[2]));
|
glm::detail::hash_combine(seed, hasher(m[2]));
|
||||||
@ -130,7 +130,7 @@ namespace std
|
|||||||
GLM_FUNC_QUALIFIER size_t hash<glm::mat<3, 4, T, Q> >::operator()(glm::mat<3, 4, T, Q> const& m) const GLM_NOEXCEPT
|
GLM_FUNC_QUALIFIER size_t hash<glm::mat<3, 4, T, Q> >::operator()(glm::mat<3, 4, T, Q> const& m) const GLM_NOEXCEPT
|
||||||
{
|
{
|
||||||
size_t seed = 0;
|
size_t seed = 0;
|
||||||
hash<glm::vec<4, T, Q>> hasher;
|
hash<glm::vec<4, T, Q> > hasher;
|
||||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[2]));
|
glm::detail::hash_combine(seed, hasher(m[2]));
|
||||||
@ -141,7 +141,7 @@ namespace std
|
|||||||
GLM_FUNC_QUALIFIER size_t hash<glm::mat<4, 2, T,Q> >::operator()(glm::mat<4, 2, T,Q> const& m) const GLM_NOEXCEPT
|
GLM_FUNC_QUALIFIER size_t hash<glm::mat<4, 2, T,Q> >::operator()(glm::mat<4, 2, T,Q> const& m) const GLM_NOEXCEPT
|
||||||
{
|
{
|
||||||
size_t seed = 0;
|
size_t seed = 0;
|
||||||
hash<glm::vec<2, T, Q>> hasher;
|
hash<glm::vec<2, T, Q> > hasher;
|
||||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[2]));
|
glm::detail::hash_combine(seed, hasher(m[2]));
|
||||||
@ -153,7 +153,7 @@ namespace std
|
|||||||
GLM_FUNC_QUALIFIER size_t hash<glm::mat<4, 3, T,Q> >::operator()(glm::mat<4, 3, T,Q> const& m) const GLM_NOEXCEPT
|
GLM_FUNC_QUALIFIER size_t hash<glm::mat<4, 3, T,Q> >::operator()(glm::mat<4, 3, T,Q> const& m) const GLM_NOEXCEPT
|
||||||
{
|
{
|
||||||
size_t seed = 0;
|
size_t seed = 0;
|
||||||
hash<glm::vec<3, T, Q>> hasher;
|
hash<glm::vec<3, T, Q> > hasher;
|
||||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[2]));
|
glm::detail::hash_combine(seed, hasher(m[2]));
|
||||||
@ -165,7 +165,7 @@ namespace std
|
|||||||
GLM_FUNC_QUALIFIER size_t hash<glm::mat<4, 4, T,Q> >::operator()(glm::mat<4, 4, T, Q> const& m) const GLM_NOEXCEPT
|
GLM_FUNC_QUALIFIER size_t hash<glm::mat<4, 4, T,Q> >::operator()(glm::mat<4, 4, T, Q> const& m) const GLM_NOEXCEPT
|
||||||
{
|
{
|
||||||
size_t seed = 0;
|
size_t seed = 0;
|
||||||
hash<glm::vec<4, T, Q>> hasher;
|
hash<glm::vec<4, T, Q> > hasher;
|
||||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||||
glm::detail::hash_combine(seed, hasher(m[2]));
|
glm::detail::hash_combine(seed, hasher(m[2]));
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
#if __cplusplus >= 201103L
|
||||||
#define GLM_ENABLE_EXPERIMENTAL
|
#define GLM_ENABLE_EXPERIMENTAL
|
||||||
#include <glm/gtx/hash.hpp>
|
#include <glm/gtx/hash.hpp>
|
||||||
|
|
||||||
#if defined(GLM_GTX_hash) && GLM_LANG & GLM_LANG_CXX11
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
int test_compile()
|
int test_compile()
|
||||||
@ -46,16 +46,23 @@ int test_compile()
|
|||||||
|
|
||||||
return Error > 0 ? 0 : 1;
|
return Error > 0 ? 0 : 1;
|
||||||
}
|
}
|
||||||
#endif//GLM_LANG& GLM_LANG_CXX11
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int Error = 0;
|
int Error = 0;
|
||||||
|
|
||||||
#if defined(GLM_GTX_hash)
|
|
||||||
Error += test_compile();
|
Error += test_compile();
|
||||||
#endif//
|
|
||||||
|
|
||||||
return Error;
|
return Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif// __cplusplus >= 201103L
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
#include <glm/gtx/transform.hpp>
|
#include <glm/gtx/transform.hpp>
|
||||||
#include <glm/gtx/quaternion.hpp>
|
#include <glm/gtx/quaternion.hpp>
|
||||||
#include <glm/gtx/compatibility.hpp>
|
#include <glm/gtx/compatibility.hpp>
|
||||||
#include <glm/ext.hpp>
|
|
||||||
|
|
||||||
int test_quat_fastMix()
|
int test_quat_fastMix()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user