Updated meshoptimizer.

This commit is contained in:
Бранимир Караџић
2020-05-22 20:55:56 -07:00
parent ab6997f420
commit 5a863ea47d
2 changed files with 6 additions and 20 deletions

View File

@@ -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<const unsigned int*>(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;