diff options
author | Camille Mohr-Daurat <pouleyKetchoup@gmail.com> | 2021-09-14 18:51:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 18:51:03 -0700 |
commit | f9c6dc1d9d56b0330d8c5fab28cc91196fca238e (patch) | |
tree | e9acd648a7ca4911bc131a9dae7a55590dafae55 /core | |
parent | cd5a8f8dd4a86b06f6aa898db03a18d5dbd0f94c (diff) | |
parent | 2ca94e51e4d4477709b83b487a4f5b938f24f56b (diff) |
Merge pull request #50404 from nekomatata/clean-convex-hull-decomposition
Clean convex hull decomposition code
Diffstat (limited to 'core')
-rw-r--r-- | core/math/triangle_mesh.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/math/triangle_mesh.h b/core/math/triangle_mesh.h index 463b0dd5c8..2d3b4db4bb 100644 --- a/core/math/triangle_mesh.h +++ b/core/math/triangle_mesh.h @@ -37,11 +37,13 @@ class TriangleMesh : public RefCounted { GDCLASS(TriangleMesh, RefCounted); +public: struct Triangle { Vector3 normal; int indices[3]; }; +private: Vector<Triangle> triangles; Vector<Vector3> vertices; @@ -86,8 +88,8 @@ public: Vector3 get_area_normal(const AABB &p_aabb) const; Vector<Face3> get_faces() const; - Vector<Triangle> get_triangles() const { return triangles; } - Vector<Vector3> get_vertices() const { return vertices; } + const Vector<Triangle> &get_triangles() const { return triangles; } + const Vector<Vector3> &get_vertices() const { return vertices; } void get_indices(Vector<int> *r_triangles_indices) const; void create(const Vector<Vector3> &p_faces); |