diff options
author | Hop311 <hop3114@gmail.com> | 2023-03-30 23:50:50 +0200 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2023-04-14 17:16:02 +0200 |
commit | c0d76b78d3762e6eec3ed1c62618be84c5b7559b (patch) | |
tree | acfcbeedd5a47136acdf883e791a297200b7d1b8 /extension/src/MapMesh.hpp | |
parent | 1f04a7827ae377372cb491ff0257a47d0d4c2967 (diff) |
Add terrain map
With Directional movement using WASD
With Directional movement using arrow keys
With Click-Drag movement using middle mouse button
With Province identifiers
With Province shape loading
With Province rendering
With Province selection
With Province overview panel
With Color lookup texture
Diffstat (limited to 'extension/src/MapMesh.hpp')
-rw-r--r-- | extension/src/MapMesh.hpp | 34 |
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; + }; +} |