aboutsummaryrefslogtreecommitdiff
path: root/extension/src/MapMesh.hpp
diff options
context:
space:
mode:
author ClarkeCode <clarke.john.robert@gmail.com>2023-04-27 22:13:52 +0200
committer ClarkeCode <clarke.john.robert@gmail.com>2023-04-27 22:13:52 +0200
commit0b273743b480874281a8987c72b2f1b666bc289a (patch)
tree3f5d5a6316ac66407e61c8a56fe732cdf06209e5 /extension/src/MapMesh.hpp
parent98dd680a641a2cbe0f1f93202a5beffdfd35c9f7 (diff)
parent10053cf259c55ee45803268a844edf1011d8a16b (diff)
Merge branch 'main' of github.com:OpenVic2Project/OpenVic2 into goods
Diffstat (limited to 'extension/src/MapMesh.hpp')
-rw-r--r--extension/src/MapMesh.hpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/extension/src/MapMesh.hpp b/extension/src/MapMesh.hpp
new file mode 100644
index 0000000..d8727cf
--- /dev/null
+++ b/extension/src/MapMesh.hpp
@@ -0,0 +1,34 @@
+#pragma once
+
+#include <godot_cpp/classes/primitive_mesh.hpp>
+
+namespace OpenVic2 {
+ class MapMesh : public godot::PrimitiveMesh {
+ GDCLASS(MapMesh, godot::PrimitiveMesh)
+
+ float aspect_ratio = 2.0f, repeat_proportion = 0.5f;
+ int 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 int divisions);
+ int get_subdivide_width() const;
+
+ void set_subdivide_depth(const int divisions);
+ int 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;
+ };
+}