diff options
author | reduz <reduzio@gmail.com> | 2022-05-19 17:00:06 +0200 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2022-05-20 22:40:38 +0200 |
commit | 45af29da8095af16729955117a165d23e77cd740 (patch) | |
tree | 0436c59187702466a73d05caf9688a58e5935afd /scene/resources/concave_polygon_shape_3d.h | |
parent | 410893ad0fb6f0d7d774b6529581d886defd6cf0 (diff) |
Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
Diffstat (limited to 'scene/resources/concave_polygon_shape_3d.h')
-rw-r--r-- | scene/resources/concave_polygon_shape_3d.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scene/resources/concave_polygon_shape_3d.h b/scene/resources/concave_polygon_shape_3d.h index 5337deb5fb..4711e38468 100644 --- a/scene/resources/concave_polygon_shape_3d.h +++ b/scene/resources/concave_polygon_shape_3d.h @@ -42,12 +42,12 @@ class ConcavePolygonShape3D : public Shape3D { struct DrawEdge { Vector3 a; Vector3 b; - bool operator<(const DrawEdge &p_edge) const { - if (a == p_edge.a) { - return b < p_edge.b; - } else { - return a < p_edge.a; - } + static uint32_t hash(const DrawEdge &p_edge) { + uint32_t h = hash_djb2_one_32(HashMapHasherDefault::hash(p_edge.a)); + return hash_djb2_one_32(HashMapHasherDefault::hash(p_edge.b), h); + } + bool operator==(const DrawEdge &p_edge) const { + return (a == p_edge.a && b == p_edge.b); } DrawEdge(const Vector3 &p_a = Vector3(), const Vector3 &p_b = Vector3()) { |