diff --git a/3rdparty/meshoptimizer/src/simplifier.cpp b/3rdparty/meshoptimizer/src/simplifier.cpp index e8d24f485..19acddf26 100644 --- a/3rdparty/meshoptimizer/src/simplifier.cpp +++ b/3rdparty/meshoptimizer/src/simplifier.cpp @@ -86,26 +86,10 @@ struct PositionHasher size_t hash(unsigned int index) const { - // MurmurHash2 - const unsigned int m = 0x5bd1e995; - const int r = 24; - - unsigned int h = 0; const unsigned int* key = reinterpret_cast(vertex_positions + index * vertex_stride_float); - for (size_t i = 0; i < 3; ++i) - { - unsigned int k = key[i]; - - k *= m; - k ^= k >> r; - k *= m; - - h *= m; - h ^= k; - } - - return h; + // Optimized Spatial Hashing for Collision Detection of Deformable Objects + return (key[0] * 73856093) ^ (key[1] * 19349663) ^ (key[2] * 83492791); } bool equal(unsigned int lhs, unsigned int rhs) const @@ -421,7 +405,8 @@ struct Collapse unsigned int v0; unsigned int v1; - union { + union + { unsigned int bidi; float error; unsigned int errorui; diff --git a/3rdparty/meshoptimizer/src/vertexfilter.cpp b/3rdparty/meshoptimizer/src/vertexfilter.cpp index 341e74ce4..9681651d4 100644 --- a/3rdparty/meshoptimizer/src/vertexfilter.cpp +++ b/3rdparty/meshoptimizer/src/vertexfilter.cpp @@ -143,7 +143,8 @@ static void decodeFilterExp(unsigned int* data, size_t count) int m = int(v << 8) >> 8; int e = int(v) >> 24; - union { + union + { float f; unsigned int ui; } u;