mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Clean up Hash Functions
Clean up and do fixes to hash functions and newly introduced murmur3 hashes in #61934 * Clean up usage of murmur3 * Fixed usages of binary murmur3 on floats (this is invalid) * Changed DJB2 to use xor (which seems to be better)
This commit is contained in:
@@ -74,9 +74,9 @@ private:
|
||||
|
||||
struct Vector3Hasher {
|
||||
_ALWAYS_INLINE_ uint32_t hash(const Vector3 &p_vec3) const {
|
||||
uint32_t h = hash_djb2_one_float(p_vec3.x);
|
||||
h = hash_djb2_one_float(p_vec3.y, h);
|
||||
h = hash_djb2_one_float(p_vec3.z, h);
|
||||
uint32_t h = hash_murmur3_one_float(p_vec3.x);
|
||||
h = hash_murmur3_one_float(p_vec3.y, h);
|
||||
h = hash_murmur3_one_float(p_vec3.z, h);
|
||||
return h;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user