summaryrefslogtreecommitdiff
path: root/modules/gridmap/doc_classes/GridMap.xml
diff options
context:
space:
mode:
authorMicky <micheledevita2@gmail.com>2022-08-20 18:39:05 +0200
committerMicky <micheledevita2@gmail.com>2022-09-05 18:08:39 +0200
commit694190a354c1634caaff5cbd7357de345a334c01 (patch)
tree3caa05876de5bd4ac51860434ba4665ddd34d75e /modules/gridmap/doc_classes/GridMap.xml
parent90801a415314f29eb5c590f85a7751443e54b83a (diff)
Rename TileMap/GridMap.`world_to_map` and opposite to `local_to_map`
For both TileMap and GridMap: - `world_to_map` -> `local_to_map` - `map_to_world` -> `map_to_local` Also changes any mention of "world" in this context to "local" to avoid future confusion. Finally, updates the docs of both methods for consistency. In particular, adding a note on how to convert the returned values from local to global coordinates and vice versa.
Diffstat (limited to 'modules/gridmap/doc_classes/GridMap.xml')
-rw-r--r--modules/gridmap/doc_classes/GridMap.xml21
1 files changed, 10 insertions, 11 deletions
diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml
index 6717f23057..5548006834 100644
--- a/modules/gridmap/doc_classes/GridMap.xml
+++ b/modules/gridmap/doc_classes/GridMap.xml
@@ -84,7 +84,7 @@
<method name="get_meshes" qualifiers="const">
<return type="Array" />
<description>
- Returns an array of [Transform3D] and [Mesh] references corresponding to the non-empty cells in the grid. The transforms are specified in world space.
+ Returns an array of [Transform3D] and [Mesh] references corresponding to the non-empty cells in the grid. The transforms are specified in local space.
</description>
</method>
<method name="get_navigation_layer_value" qualifiers="const">
@@ -114,6 +114,13 @@
Returns an array of all cells with the given item index specified in [code]item[/code].
</description>
</method>
+ <method name="local_to_map" qualifiers="const">
+ <return type="Vector3i" />
+ <param index="0" name="local_position" type="Vector3" />
+ <description>
+ Returns the map coordinates of the cell containing the given [param local_position]. If [param local_position] is in global coordinates, consider using [method Node3D.to_local] before passing it to this method. See also [method map_to_local].
+ </description>
+ </method>
<method name="make_baked_meshes">
<return type="void" />
<param index="0" name="gen_lightmap_uv" type="bool" default="false" />
@@ -121,11 +128,11 @@
<description>
</description>
</method>
- <method name="map_to_world" qualifiers="const">
+ <method name="map_to_local" qualifiers="const">
<return type="Vector3" />
<param index="0" name="map_position" type="Vector3i" />
<description>
- Returns the position of a grid cell in the GridMap's local coordinate space.
+ Returns the position of a grid cell in the GridMap's local coordinate space. To convert the returned value into global coordinates, use [method Node3D.to_global]. See also [method map_to_local].
</description>
</method>
<method name="resource_changed">
@@ -169,14 +176,6 @@
Based on [code]value[/code], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [code]layer_number[/code] between 1 and 32.
</description>
</method>
- <method name="world_to_map" qualifiers="const">
- <return type="Vector3i" />
- <param index="0" name="world_position" type="Vector3" />
- <description>
- Returns the coordinates of the grid cell containing the given point.
- [code]pos[/code] should be in the GridMap's local coordinate space.
- </description>
- </method>
</methods>
<members>
<member name="bake_navigation" type="bool" setter="set_bake_navigation" getter="is_baking_navigation" default="false">