From 2d47ff8c02a4ee88270634289381140f8ac1617e Mon Sep 17 00:00:00 2001 From: Hop311 Date: Wed, 5 Apr 2023 18:38:40 +0100 Subject: Custom map mesh that fixes UV issue --- extension/src/MapMesh.hpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 extension/src/MapMesh.hpp (limited to 'extension/src/MapMesh.hpp') diff --git a/extension/src/MapMesh.hpp b/extension/src/MapMesh.hpp new file mode 100644 index 0000000..5427894 --- /dev/null +++ b/extension/src/MapMesh.hpp @@ -0,0 +1,33 @@ +#pragma once + +#include + +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; + + godot::Array _create_mesh_array() const override; + }; +} -- cgit v1.2.3-56-ga3b1