aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/MapMesh.hpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-11-08 23:24:21 +0100
committer hop311 <hop3114@gmail.com>2023-11-16 00:24:28 +0100
commitbc0b3c61ae0b742da304cada451fba1df72bb0ad (patch)
tree047968e7ea8189ad8391dcabbd09fee1d8cdc30c /extension/src/openvic-extension/classes/MapMesh.hpp
parent72d893d55d26ae9dc6739a853d1773b3cb286123 (diff)
GUI elements -> Godot UI nodes generator
Diffstat (limited to 'extension/src/openvic-extension/classes/MapMesh.hpp')
-rw-r--r--extension/src/openvic-extension/classes/MapMesh.hpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/extension/src/openvic-extension/classes/MapMesh.hpp b/extension/src/openvic-extension/classes/MapMesh.hpp
new file mode 100644
index 0000000..38b208c
--- /dev/null
+++ b/extension/src/openvic-extension/classes/MapMesh.hpp
@@ -0,0 +1,34 @@
+#pragma once
+
+#include <godot_cpp/classes/primitive_mesh.hpp>
+
+namespace OpenVic {
+ class MapMesh : public godot::PrimitiveMesh {
+ GDCLASS(MapMesh, godot::PrimitiveMesh)
+
+ float aspect_ratio = 2.0f, repeat_proportion = 0.5f;
+ int32_t subdivide_w = 0, subdivide_d = 0;
+
+ protected:
+ static void _bind_methods();
+ void _request_update();
+
+ public:
+ void set_aspect_ratio(const float ratio);
+ float get_aspect_ratio() const;
+
+ void set_repeat_proportion(const float proportion);
+ float get_repeat_proportion() const;
+
+ void set_subdivide_width(const int32_t divisions);
+ int32_t get_subdivide_width() const;
+
+ void set_subdivide_depth(const int32_t divisions);
+ int32_t get_subdivide_depth() const;
+
+ godot::AABB get_core_aabb() const;
+ bool is_valid_uv_coord(godot::Vector2 const& uv) const;
+
+ godot::Array _create_mesh_array() const override;
+ };
+}