diff --git a/doc/api/class_terrain3dregion.rst b/doc/api/class_terrain3dregion.rst index 456c2aa53..3161a45ab 100644 --- a/doc/api/class_terrain3dregion.rst +++ b/doc/api/class_terrain3dregion.rst @@ -64,10 +64,30 @@ Methods +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`calc_height_range`\ (\ ) | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`clear`\ (\ ) | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`dump`\ (\ verbose\: ``bool`` = false\ ) |const| | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Terrain3DRegion` | :ref:`duplicate`\ (\ deep\: ``bool`` = false\ ) | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | ``int`` | :ref:`get_control`\ (\ x\: ``int``, y\: ``int``\ ) |const| | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | ``float`` | :ref:`get_control_angle`\ (\ x\: ``int``, y\: ``int``\ ) |const| | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | ``bool`` | :ref:`get_control_auto`\ (\ x\: ``int``, y\: ``int``\ ) |const| | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | ``int`` | :ref:`get_control_base_id`\ (\ x\: ``int``, y\: ``int``\ ) |const| | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | ``float`` | :ref:`get_control_blend`\ (\ x\: ``int``, y\: ``int``\ ) |const| | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | ``bool`` | :ref:`get_control_hole`\ (\ x\: ``int``, y\: ``int``\ ) |const| | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | ``bool`` | :ref:`get_control_navigation`\ (\ x\: ``int``, y\: ``int``\ ) |const| | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | ``int`` | :ref:`get_control_overlay_id`\ (\ x\: ``int``, y\: ``int``\ ) |const| | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | ``float`` | :ref:`get_control_scale`\ (\ x\: ``int``, y\: ``int``\ ) |const| | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | ``Dictionary`` | :ref:`get_data`\ (\ ) |const| | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | ``Image`` | :ref:`get_map`\ (\ map_type\: :ref:`MapType`\ ) |const| | @@ -80,6 +100,24 @@ Methods +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | Error | :ref:`save`\ (\ path\: ``String`` = "", save_16_bit\: ``bool`` = false\ ) | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_control`\ (\ x\: ``int``, y\: ``int``, control\: ``int``\ ) | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_control_angle`\ (\ x\: ``int``, y\: ``int``, angle\: ``float``\ ) | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_control_auto`\ (\ x\: ``int``, y\: ``int``, auto\: ``bool``\ ) | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_control_base_id`\ (\ x\: ``int``, y\: ``int``, base\: ``int``\ ) | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_control_blend`\ (\ x\: ``int``, y\: ``int``, blend\: ``float``\ ) | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_control_hole`\ (\ x\: ``int``, y\: ``int``, hole\: ``bool``\ ) | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_control_navigation`\ (\ x\: ``int``, y\: ``int``, navigation\: ``bool``\ ) | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_control_overlay_id`\ (\ x\: ``int``, y\: ``int``, overlay\: ``int``\ ) | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_control_scale`\ (\ x\: ``int``, y\: ``int``, scale\: ``float``\ ) | + +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_data`\ (\ data\: ``Dictionary``\ ) | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_map`\ (\ map_type\: :ref:`MapType`, map\: ``Image``\ ) | @@ -402,6 +440,20 @@ Recalculates the height range for this region by looking at every pixel in the h ---- +.. _class_Terrain3DRegion_method_clear: + +.. rst-class:: classref-method + +|void| **clear**\ (\ ) :ref:`🔗` + +.. container:: contribute + + There is currently no description for this method. Please help us by `contributing one `__! + +.. rst-class:: classref-item-separator + +---- + .. _class_Terrain3DRegion_method_dump: .. rst-class:: classref-method @@ -428,6 +480,114 @@ Returns a duplicate copy of this node, with references to the same image maps an ---- +.. _class_Terrain3DRegion_method_get_control: + +.. rst-class:: classref-method + +``int`` **get_control**\ (\ x\: ``int``, y\: ``int``\ ) |const| :ref:`🔗` + +Gets the control ID at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_get_control_angle: + +.. rst-class:: classref-method + +``float`` **get_control_angle**\ (\ x\: ``int``, y\: ``int``\ ) |const| :ref:`🔗` + +Gets the control angle at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_get_control_auto: + +.. rst-class:: classref-method + +``bool`` **get_control_auto**\ (\ x\: ``int``, y\: ``int``\ ) |const| :ref:`🔗` + +Gets if the region uses the auto shader at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_get_control_base_id: + +.. rst-class:: classref-method + +``int`` **get_control_base_id**\ (\ x\: ``int``, y\: ``int``\ ) |const| :ref:`🔗` + +Gets the base texture ID at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_get_control_blend: + +.. rst-class:: classref-method + +``float`` **get_control_blend**\ (\ x\: ``int``, y\: ``int``\ ) |const| :ref:`🔗` + +Gets the blend value at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_get_control_hole: + +.. rst-class:: classref-method + +``bool`` **get_control_hole**\ (\ x\: ``int``, y\: ``int``\ ) |const| :ref:`🔗` + +Gets if the region has a hole at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_get_control_navigation: + +.. rst-class:: classref-method + +``bool`` **get_control_navigation**\ (\ x\: ``int``, y\: ``int``\ ) |const| :ref:`🔗` + +Gets if the region has navigation at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_get_control_overlay_id: + +.. rst-class:: classref-method + +``int`` **get_control_overlay_id**\ (\ x\: ``int``, y\: ``int``\ ) |const| :ref:`🔗` + +Gets the overlay texture ID at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_get_control_scale: + +.. rst-class:: classref-method + +``float`` **get_control_scale**\ (\ x\: ``int``, y\: ``int``\ ) |const| :ref:`🔗` + +Gets the scale at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + .. _class_Terrain3DRegion_method_get_data: .. rst-class:: classref-method @@ -504,6 +664,114 @@ Saves this region to the current file name. ---- +.. _class_Terrain3DRegion_method_set_control: + +.. rst-class:: classref-method + +|void| **set_control**\ (\ x\: ``int``, y\: ``int``, control\: ``int``\ ) :ref:`🔗` + +Sets the regions control value at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_set_control_angle: + +.. rst-class:: classref-method + +|void| **set_control_angle**\ (\ x\: ``int``, y\: ``int``, angle\: ``float``\ ) :ref:`🔗` + +Sets the regions control angle at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_set_control_auto: + +.. rst-class:: classref-method + +|void| **set_control_auto**\ (\ x\: ``int``, y\: ``int``, auto\: ``bool``\ ) :ref:`🔗` + +Sets if the region uses the auto shader at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_set_control_base_id: + +.. rst-class:: classref-method + +|void| **set_control_base_id**\ (\ x\: ``int``, y\: ``int``, base\: ``int``\ ) :ref:`🔗` + +Sets the regions base texture id at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_set_control_blend: + +.. rst-class:: classref-method + +|void| **set_control_blend**\ (\ x\: ``int``, y\: ``int``, blend\: ``float``\ ) :ref:`🔗` + +Sets the regions blend value at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_set_control_hole: + +.. rst-class:: classref-method + +|void| **set_control_hole**\ (\ x\: ``int``, y\: ``int``, hole\: ``bool``\ ) :ref:`🔗` + +Sets if the region has a hole at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_set_control_navigation: + +.. rst-class:: classref-method + +|void| **set_control_navigation**\ (\ x\: ``int``, y\: ``int``, navigation\: ``bool``\ ) :ref:`🔗` + +Sets if the region has navigation at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_set_control_overlay_id: + +.. rst-class:: classref-method + +|void| **set_control_overlay_id**\ (\ x\: ``int``, y\: ``int``, overlay\: ``int``\ ) :ref:`🔗` + +Sets the overlay texture ID at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + +.. _class_Terrain3DRegion_method_set_control_scale: + +.. rst-class:: classref-method + +|void| **set_control_scale**\ (\ x\: ``int``, y\: ``int``, scale\: ``float``\ ) :ref:`🔗` + +Sets the uv scale at the provided pixel position. + +.. rst-class:: classref-item-separator + +---- + .. _class_Terrain3DRegion_method_set_data: .. rst-class:: classref-method @@ -573,6 +841,7 @@ When sculpting the terrain, this is called to provide both a low and high height This validates the map size according to previously loaded maps. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` diff --git a/doc/doc_classes/Terrain3DRegion.xml b/doc/doc_classes/Terrain3DRegion.xml index eb4c1f705..dbc840cc6 100644 --- a/doc/doc_classes/Terrain3DRegion.xml +++ b/doc/doc_classes/Terrain3DRegion.xml @@ -14,6 +14,11 @@ Recalculates the height range for this region by looking at every pixel in the heightmap. + + + + + @@ -29,6 +34,78 @@ - deep - Also make complete duplicates of the maps and multimeshes. + + + + + + Gets the control ID at the provided pixel position. + + + + + + + + Gets the control angle at the provided pixel position. + + + + + + + + Gets if the region uses the auto shader at the provided pixel position. + + + + + + + + Gets the base texture ID at the provided pixel position. + + + + + + + + Gets the blend value at the provided pixel position. + + + + + + + + Gets if the region has a hole at the provided pixel position. + + + + + + + + Gets if the region has navigation at the provided pixel position. + + + + + + + + Gets the overlay texture ID at the provided pixel position. + + + + + + + + Gets the scale at the provided pixel position. + + @@ -72,6 +149,87 @@ - 16-bit - save this region with 16-bit height map instead of 32-bit. This process is lossy. Does not change the bit depth in memory. + + + + + + + Sets the regions control value at the provided pixel position. + + + + + + + + + Sets the regions control angle at the provided pixel position. + + + + + + + + + Sets if the region uses the auto shader at the provided pixel position. + + + + + + + + + Sets the regions base texture id at the provided pixel position. + + + + + + + + + Sets the regions blend value at the provided pixel position. + + + + + + + + + Sets if the region has a hole at the provided pixel position. + + + + + + + + + Sets if the region has navigation at the provided pixel position. + + + + + + + + + Sets the overlay texture ID at the provided pixel position. + + + + + + + + + Sets the uv scale at the provided pixel position. + + diff --git a/src/constants.h b/src/constants.h index b1cc474a3..2aa33893e 100644 --- a/src/constants.h +++ b/src/constants.h @@ -3,6 +3,8 @@ #ifndef CONSTANTS_CLASS_H #define CONSTANTS_CLASS_H +#include + // GDExtension uses the godot namespace, custom modules do not. #if defined(GDEXTENSION) && !defined(GODOT_MODULE) using namespace godot; @@ -137,4 +139,4 @@ struct Vector3Hash { return ret; \ } -#endif // CONSTANTS_CLASS_H \ No newline at end of file +#endif // CONSTANTS_CLASS_H diff --git a/src/terrain_3d_region.cpp b/src/terrain_3d_region.cpp index 14afca1a1..7c2afacf3 100644 --- a/src/terrain_3d_region.cpp +++ b/src/terrain_3d_region.cpp @@ -428,6 +428,121 @@ void Terrain3DRegion::dump(const bool verbose) const { } } +real_t Terrain3DRegion::get_height(const int p_x, const int p_y) const { + return _height_map->get_pixel(p_x, p_y).r; +} + +void Terrain3DRegion::set_height(const int p_x, const int p_y, const real_t p_height) { + _height_map->set_pixel(p_x, p_y, Color(p_height, 0.f, 0.f, 1.f)); + update_height(p_height); +} + +Color Terrain3DRegion::get_color(const int p_x, const int p_y) const { + return _color_map->get_pixel(p_x, p_y); +} + +void Terrain3DRegion::set_color(const int p_x, const int p_y, const Color &p_color) { + _color_map->set_pixel(p_x, p_y, p_color); + _modified = true; +} + +uint32_t Terrain3DRegion::get_control(const int p_x, const int p_y) const { + return as_uint(_control_map->get_pixel(p_x, p_y).r); +} + +void Terrain3DRegion::set_control(const int p_x, const int p_y, uint32_t p_control) { + _control_map->set_pixel(p_x, p_y, Color(as_float(p_control), 0.f, 0.f, 1.f)); + _modified = true; +} + +uint8_t Terrain3DRegion::get_control_base_id(const int p_x, const int p_y) const { + uint32_t control = get_control(p_x, p_y); + return get_base(control); +} + +void Terrain3DRegion::set_control_base_id(const int p_x, const int p_y, const uint8_t p_base) { + uint32_t control = get_control(p_x, p_y); + uint8_t base = CLAMP(p_base, uint8_t(0), uint8_t(31)); + set_control(p_x, p_y, (control & ~(0x1F << 27)) | enc_base(base)); +} + +uint8_t Terrain3DRegion::get_control_overlay_id(const int p_x, const int p_y) const { + uint32_t control = get_control(p_x, p_y); + return get_overlay(control); +} + +void Terrain3DRegion::set_control_overlay_id(const int p_x, const int p_y, const uint8_t p_overlay) { + uint32_t control = get_control(p_x, p_y); + uint8_t overlay = CLAMP(p_overlay, uint8_t(0), uint8_t(31)); + set_control(p_x, p_y, (control & ~(0x1F << 22)) | enc_overlay(overlay)); +} +real_t Terrain3DRegion::get_control_blend(const int p_x, const int p_y) const { + uint32_t control = get_control(p_x, p_y); + return control == UINT32_MAX ? NAN : real_t(get_blend(control)) / 255.f; +} + +void Terrain3DRegion::set_control_blend(const int p_x, const int p_y, const real_t p_blend) { + uint32_t control = get_control(p_x, p_y); + uint8_t blend = uint8_t(CLAMP(Math::round(p_blend * 255.f), 0.f, 255.f)); + set_control(p_x, p_y, (control & ~(0xFF << 14)) | enc_blend(blend)); +} + +real_t Terrain3DRegion::get_control_angle(const int p_x, const int p_y) const { + uint32_t control = get_control(p_x, p_y); + real_t angle = real_t(get_uv_rotation(control)) * 22.5f; + return control == UINT32_MAX ? NAN : angle; +} + +void Terrain3DRegion::set_control_angle(const int p_x, const int p_y, const real_t p_angle) { + uint32_t control = get_control(p_x, p_y); + uint8_t uvrotation = uint8_t(CLAMP(Math::round(p_angle / 22.5f), 0.f, 15.f)); + set_control(p_x, p_y, (control & ~(0xF << 10)) | enc_uv_rotation(uvrotation)); +} + +real_t Terrain3DRegion::get_control_scale(const int p_x, const int p_y) const { + uint32_t control = get_control(p_x, p_y); + std::array scale_values = { 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, -60.0f, -40.0f, -20.0f }; + real_t scale = scale_values[get_uv_scale(control)]; + return control == UINT32_MAX ? NAN : scale; +} + +void Terrain3DRegion::set_control_scale(const int p_x, const int p_y, const real_t p_scale) { + uint32_t control = get_control(p_x, p_y); + std::array scale_align = { 5, 6, 7, 0, 1, 2, 3, 4 }; + uint8_t uvscale = scale_align[uint8_t(CLAMP(Math::round((p_scale + 60.f) / 20.f), 0.f, 7.f))]; + set_control(p_x, p_y, (control & ~(0x7 << 7)) | enc_uv_scale(uvscale)); +} + +bool Terrain3DRegion::get_control_hole(const int p_x, const int p_y) const { + uint32_t control = get_control(p_x, p_y); + return control == UINT32_MAX ? false : is_hole(control); +} + +void Terrain3DRegion::set_control_hole(const int p_x, const int p_y, const bool p_hole) { + uint32_t control = get_control(p_x, p_y); + set_control(p_x, p_y, (control & ~(0x1 << 2)) | enc_hole(p_hole)); +} + +bool Terrain3DRegion::get_control_navigation(const int p_x, const int p_y) const { + uint32_t control = get_control(p_x, p_y); + return control == UINT32_MAX ? false : is_nav(control); +} + +void Terrain3DRegion::set_control_navigation(const int p_x, const int p_y, const bool p_navigation) { + uint32_t control = get_control(p_x, p_y); + set_control(p_x, p_y, (control & ~(0x1 << 1)) | enc_nav(p_navigation)); +} + +bool Terrain3DRegion::get_control_auto(const int p_x, const int p_y) const { + uint32_t control = get_control(p_x, p_y); + return control == UINT32_MAX ? false : is_auto(control); +} + +void Terrain3DRegion::set_control_auto(const int p_x, const int p_y, const bool p_auto) { + uint32_t control = get_control(p_x, p_y); + set_control(p_x, p_y, (control & ~(0x1 << 0)) | enc_auto(p_auto)); +} + ///////////////////// // Protected Functions ///////////////////// @@ -459,6 +574,24 @@ void Terrain3DRegion::_bind_methods() { ClassDB::bind_method(D_METHOD("sanitize_maps"), &Terrain3DRegion::sanitize_maps); ClassDB::bind_method(D_METHOD("sanitize_map", "map_type", "map"), &Terrain3DRegion::sanitize_map); ClassDB::bind_method(D_METHOD("validate_map_size", "map"), &Terrain3DRegion::validate_map_size); + ClassDB::bind_method(D_METHOD("get_control", "x", "y"), &Terrain3DRegion::get_control); + ClassDB::bind_method(D_METHOD("set_control", "x", "y", "control"), &Terrain3DRegion::set_control); + ClassDB::bind_method(D_METHOD("set_control_base_id", "x", "y", "base"), &Terrain3DRegion::set_control_base_id); + ClassDB::bind_method(D_METHOD("get_control_base_id", "x", "y"), &Terrain3DRegion::get_control_base_id); + ClassDB::bind_method(D_METHOD("set_control_overlay_id", "x", "y", "overlay"), &Terrain3DRegion::set_control_overlay_id); + ClassDB::bind_method(D_METHOD("get_control_overlay_id", "x", "y"), &Terrain3DRegion::get_control_overlay_id); + ClassDB::bind_method(D_METHOD("set_control_blend", "x", "y", "blend"), &Terrain3DRegion::set_control_blend); + ClassDB::bind_method(D_METHOD("get_control_blend", "x", "y"), &Terrain3DRegion::get_control_blend); + ClassDB::bind_method(D_METHOD("set_control_angle", "x", "y", "angle"), &Terrain3DRegion::set_control_angle); + ClassDB::bind_method(D_METHOD("get_control_angle", "x", "y"), &Terrain3DRegion::get_control_angle); + ClassDB::bind_method(D_METHOD("set_control_scale", "x", "y", "scale"), &Terrain3DRegion::set_control_scale); + ClassDB::bind_method(D_METHOD("get_control_scale", "x", "y"), &Terrain3DRegion::get_control_scale); + ClassDB::bind_method(D_METHOD("set_control_hole", "x", "y", "hole"), &Terrain3DRegion::set_control_hole); + ClassDB::bind_method(D_METHOD("get_control_hole", "x", "y"), &Terrain3DRegion::get_control_hole); + ClassDB::bind_method(D_METHOD("set_control_navigation", "x", "y", "navigation"), &Terrain3DRegion::set_control_navigation); + ClassDB::bind_method(D_METHOD("get_control_navigation", "x", "y"), &Terrain3DRegion::get_control_navigation); + ClassDB::bind_method(D_METHOD("set_control_auto", "x", "y", "auto"), &Terrain3DRegion::set_control_auto); + ClassDB::bind_method(D_METHOD("get_control_auto", "x", "y"), &Terrain3DRegion::get_control_auto); ClassDB::bind_method(D_METHOD("set_height_range", "range"), &Terrain3DRegion::set_height_range); ClassDB::bind_method(D_METHOD("get_height_range"), &Terrain3DRegion::get_height_range); diff --git a/src/terrain_3d_region.h b/src/terrain_3d_region.h index add98e8e6..5e2eaca6c 100644 --- a/src/terrain_3d_region.h +++ b/src/terrain_3d_region.h @@ -90,6 +90,30 @@ class Terrain3DRegion : public Resource { void update_heights(const Vector2 &p_low_high); void calc_height_range(); + // In Place Map Modification + real_t get_height(const int p_x, const int p_y) const; + void set_height(const int p_x, const int p_y, const real_t p_height); + Color get_color(const int p_x, const int p_y) const; + void set_color(const int p_x, const int p_y, const Color &p_color); + uint32_t get_control(const int p_x, const int p_y) const; + void set_control(const int p_x, const int p_y, uint32_t p_control); + uint8_t get_control_base_id(const int p_x, const int p_y) const; + void set_control_base_id(const int p_x, const int p_y, const uint8_t p_base); + uint8_t get_control_overlay_id(const int p_x, const int p_y) const; + void set_control_overlay_id(const int p_x, const int p_y, const uint8_t p_overlay); + real_t get_control_blend(const int p_x, const int p_y) const; + void set_control_blend(const int p_x, const int p_y, const real_t p_blend); + real_t get_control_angle(const int p_x, const int p_y) const; + void set_control_angle(const int p_x, const int p_y, const real_t p_angle); + real_t get_control_scale(const int p_x, const int p_y) const; + void set_control_scale(const int p_x, const int p_y, const real_t p_scale); + bool get_control_hole(const int p_x, const int p_y) const; + void set_control_hole(const int p_x, const int p_y, const bool p_hole); + bool get_control_navigation(const int p_x, const int p_y) const; + void set_control_navigation(const int p_x, const int p_y, const bool p_navigation); + bool get_control_auto(const int p_x, const int p_y) const; + void set_control_auto(const int p_x, const int p_y, const bool p_auto); + // Instancer void set_instances(const Dictionary &p_instances); Dictionary get_instances() const { return _instances; }