mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00: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:
parent
8e3d9a23aa
commit
141c375581
40 changed files with 391 additions and 236 deletions
|
|
@ -70,9 +70,9 @@ class GodotArea2D : public GodotCollisionObject2D {
|
|||
|
||||
static uint32_t hash(const BodyKey &p_key) {
|
||||
uint32_t h = hash_one_uint64(p_key.rid.get_id());
|
||||
h = hash_djb2_one_64(p_key.instance_id, h);
|
||||
h = hash_djb2_one_32(p_key.area_shape, h);
|
||||
return hash_djb2_one_32(p_key.body_shape, h);
|
||||
h = hash_murmur3_one_64(p_key.instance_id, h);
|
||||
h = hash_murmur3_one_32(p_key.area_shape, h);
|
||||
return hash_fmix32(hash_murmur3_one_32(p_key.body_shape, h));
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ bool operator==(const BodyKey &p_key) const {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue