From d23071cae3fac600f38e70583f286c306c0ec3a7 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 20 May 2022 00:17:51 +0200 Subject: Add properties to disable top/bottom cap generation in CylinderMesh --- scene/resources/primitive_meshes.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'scene/resources/primitive_meshes.h') diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h index 3849c92a7b..38cc7db5fe 100644 --- a/scene/resources/primitive_meshes.h +++ b/scene/resources/primitive_meshes.h @@ -183,13 +183,15 @@ private: float height = 2.0; int radial_segments = 64; int rings = 4; + bool cap_top = true; + bool cap_bottom = true; protected: static void _bind_methods(); virtual void _create_mesh_array(Array &p_arr) const override; public: - static void create_mesh_array(Array &p_arr, float top_radius, float bottom_radius, float height, int radial_segments = 64, int rings = 4); + static void create_mesh_array(Array &p_arr, float top_radius, float bottom_radius, float height, int radial_segments = 64, int rings = 4, bool cap_top = true, bool cap_bottom = true); void set_top_radius(const float p_radius); float get_top_radius() const; @@ -206,6 +208,12 @@ public: void set_rings(const int p_rings); int get_rings() const; + void set_cap_top(bool p_cap_top); + bool is_cap_top() const; + + void set_cap_bottom(bool p_cap_bottom); + bool is_cap_bottom() const; + CylinderMesh(); }; -- cgit v1.2.3