mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Updated meshoptimizer.
This commit is contained in:
23
3rdparty/meshoptimizer/src/simplifier.cpp
vendored
23
3rdparty/meshoptimizer/src/simplifier.cpp
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user