summaryrefslogtreecommitdiff
path: root/scene/resources/primitive_meshes.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/primitive_meshes.h')
-rw-r--r--scene/resources/primitive_meshes.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h
index ec124e379f..64eefd2c07 100644
--- a/scene/resources/primitive_meshes.h
+++ b/scene/resources/primitive_meshes.h
@@ -351,6 +351,38 @@ public:
};
/**
+ Big donut
+*/
+class TorusMesh : public PrimitiveMesh {
+ GDCLASS(TorusMesh, PrimitiveMesh);
+
+private:
+ float inner_radius = 0.5;
+ float outer_radius = 1.0;
+ int rings = 64;
+ int ring_segments = 32;
+
+protected:
+ static void _bind_methods();
+ virtual void _create_mesh_array(Array &p_arr) const override;
+
+public:
+ void set_inner_radius(const float p_inner_radius);
+ float get_inner_radius() const;
+
+ void set_outer_radius(const float p_outer_radius);
+ float get_outer_radius() const;
+
+ void set_rings(const int p_rings);
+ int get_rings() const;
+
+ void set_ring_segments(const int p_ring_segments);
+ int get_ring_segments() const;
+
+ TorusMesh();
+};
+
+/**
A single point for use in particle systems
*/