summaryrefslogtreecommitdiff
path: root/scene/resources/surface_tool.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-01-26 22:52:19 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-26 22:52:19 +0100
commit7cf21f296bfe931fb4243f1c16f9f6b5963a9ef4 (patch)
tree7863d50d479f6a2b642d295bb66f6d56032647df /scene/resources/surface_tool.h
parentb2164ee75bc241fef82f1c42a7528f5a1b1c968c (diff)
parentda893c14cf06df4baa144e3e3f4b619e23e7228e (diff)
Merge pull request #68034 from Klowner/surfacetool-generate-normals
Make SurfaceTool.generate_normals() behave consistently with smoothing groups
Diffstat (limited to 'scene/resources/surface_tool.h')
-rw-r--r--scene/resources/surface_tool.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/scene/resources/surface_tool.h b/scene/resources/surface_tool.h
index 25e078d2ff..00438c4a53 100644
--- a/scene/resources/surface_tool.h
+++ b/scene/resources/surface_tool.h
@@ -97,6 +97,21 @@ private:
static _FORCE_INLINE_ uint32_t hash(const Vertex &p_vtx);
};
+ struct SmoothGroupVertex {
+ Vector3 vertex;
+ uint32_t smooth_group = 0;
+ bool operator==(const SmoothGroupVertex &p_vertex) const;
+
+ SmoothGroupVertex(const Vertex &p_vertex) {
+ vertex = p_vertex.vertex;
+ smooth_group = p_vertex.smooth_group;
+ };
+ };
+
+ struct SmoothGroupVertexHasher {
+ static _FORCE_INLINE_ uint32_t hash(const SmoothGroupVertex &p_vtx);
+ };
+
struct TriangleHasher {
static _FORCE_INLINE_ uint32_t hash(const int *p_triangle);
static _FORCE_INLINE_ bool compare(const int *p_lhs, const int *p_rhs);