You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Clean convex hull decomposition code
Remove unnecessary conversion between triangle data and vertex data whenever possible.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user