class_gridmap.rst 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/modules/gridmap/doc_classes/GridMap.xml.
  6. .. _class_GridMap:
  7. GridMap
  8. =======
  9. **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Node for 3D tile-based maps.
  11. Description
  12. -----------
  13. GridMap lets you place meshes on a grid interactively. It works both from the editor and from scripts, which can help you create in-game level editors.
  14. GridMaps use a :ref:`MeshLibrary<class_MeshLibrary>` which contains a list of tiles. Each tile is a mesh with materials plus optional collision and navigation shapes.
  15. A GridMap contains a collection of cells. Each grid cell refers to a tile in the :ref:`MeshLibrary<class_MeshLibrary>`. All cells in the map have the same dimensions.
  16. Internally, a GridMap is split into a sparse collection of octants for efficient rendering and physics processing. Every octant has the same dimensions and can contain several cells.
  17. \ **Note:** GridMap doesn't extend :ref:`VisualInstance3D<class_VisualInstance3D>` and therefore can't be hidden or cull masked based on :ref:`VisualInstance3D.layers<class_VisualInstance3D_property_layers>`. If you make a light not affect the first layer, the whole GridMap won't be lit by the light in question.
  18. Tutorials
  19. ---------
  20. - :doc:`Using gridmaps <../tutorials/3d/using_gridmaps>`
  21. - `3D Platformer Demo <https://godotengine.org/asset-library/asset/125>`__
  22. - `3D Kinematic Character Demo <https://godotengine.org/asset-library/asset/126>`__
  23. Properties
  24. ----------
  25. +-----------------------------------------------+--------------------------------------------------------------------+----------------------+
  26. | :ref:`bool<class_bool>` | :ref:`bake_navigation<class_GridMap_property_bake_navigation>` | ``false`` |
  27. +-----------------------------------------------+--------------------------------------------------------------------+----------------------+
  28. | :ref:`bool<class_bool>` | :ref:`cell_center_x<class_GridMap_property_cell_center_x>` | ``true`` |
  29. +-----------------------------------------------+--------------------------------------------------------------------+----------------------+
  30. | :ref:`bool<class_bool>` | :ref:`cell_center_y<class_GridMap_property_cell_center_y>` | ``true`` |
  31. +-----------------------------------------------+--------------------------------------------------------------------+----------------------+
  32. | :ref:`bool<class_bool>` | :ref:`cell_center_z<class_GridMap_property_cell_center_z>` | ``true`` |
  33. +-----------------------------------------------+--------------------------------------------------------------------+----------------------+
  34. | :ref:`int<class_int>` | :ref:`cell_octant_size<class_GridMap_property_cell_octant_size>` | ``8`` |
  35. +-----------------------------------------------+--------------------------------------------------------------------+----------------------+
  36. | :ref:`float<class_float>` | :ref:`cell_scale<class_GridMap_property_cell_scale>` | ``1.0`` |
  37. +-----------------------------------------------+--------------------------------------------------------------------+----------------------+
  38. | :ref:`Vector3<class_Vector3>` | :ref:`cell_size<class_GridMap_property_cell_size>` | ``Vector3(2, 2, 2)`` |
  39. +-----------------------------------------------+--------------------------------------------------------------------+----------------------+
  40. | :ref:`int<class_int>` | :ref:`collision_layer<class_GridMap_property_collision_layer>` | ``1`` |
  41. +-----------------------------------------------+--------------------------------------------------------------------+----------------------+
  42. | :ref:`int<class_int>` | :ref:`collision_mask<class_GridMap_property_collision_mask>` | ``1`` |
  43. +-----------------------------------------------+--------------------------------------------------------------------+----------------------+
  44. | :ref:`MeshLibrary<class_MeshLibrary>` | :ref:`mesh_library<class_GridMap_property_mesh_library>` | |
  45. +-----------------------------------------------+--------------------------------------------------------------------+----------------------+
  46. | :ref:`int<class_int>` | :ref:`navigation_layers<class_GridMap_property_navigation_layers>` | ``1`` |
  47. +-----------------------------------------------+--------------------------------------------------------------------+----------------------+
  48. | :ref:`PhysicsMaterial<class_PhysicsMaterial>` | :ref:`physics_material<class_GridMap_property_physics_material>` | |
  49. +-----------------------------------------------+--------------------------------------------------------------------+----------------------+
  50. Methods
  51. -------
  52. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`clear<class_GridMap_method_clear>` **(** **)** |
  54. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`clear_baked_meshes<class_GridMap_method_clear_baked_meshes>` **(** **)** |
  56. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`RID<class_RID>` | :ref:`get_bake_mesh_instance<class_GridMap_method_get_bake_mesh_instance>` **(** :ref:`int<class_int>` idx **)** |
  58. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`Array<class_Array>` | :ref:`get_bake_meshes<class_GridMap_method_get_bake_meshes>` **(** **)** |
  60. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`int<class_int>` | :ref:`get_cell_item<class_GridMap_method_get_cell_item>` **(** :ref:`Vector3i<class_Vector3i>` position **)** |const| |
  62. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`int<class_int>` | :ref:`get_cell_item_orientation<class_GridMap_method_get_cell_item_orientation>` **(** :ref:`Vector3i<class_Vector3i>` position **)** |const| |
  64. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`bool<class_bool>` | :ref:`get_collision_layer_value<class_GridMap_method_get_collision_layer_value>` **(** :ref:`int<class_int>` layer_number **)** |const| |
  66. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`bool<class_bool>` | :ref:`get_collision_mask_value<class_GridMap_method_get_collision_mask_value>` **(** :ref:`int<class_int>` layer_number **)** |const| |
  68. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`Array<class_Array>` | :ref:`get_meshes<class_GridMap_method_get_meshes>` **(** **)** |const| |
  70. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`bool<class_bool>` | :ref:`get_navigation_layer_value<class_GridMap_method_get_navigation_layer_value>` **(** :ref:`int<class_int>` layer_number **)** |const| |
  72. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`Array<class_Array>` | :ref:`get_used_cells<class_GridMap_method_get_used_cells>` **(** **)** |const| |
  74. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`Array<class_Array>` | :ref:`get_used_cells_by_item<class_GridMap_method_get_used_cells_by_item>` **(** :ref:`int<class_int>` item **)** |const| |
  76. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`make_baked_meshes<class_GridMap_method_make_baked_meshes>` **(** :ref:`bool<class_bool>` gen_lightmap_uv=false, :ref:`float<class_float>` lightmap_uv_texel_size=0.1 **)** |
  78. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`Vector3<class_Vector3>` | :ref:`map_to_world<class_GridMap_method_map_to_world>` **(** :ref:`Vector3i<class_Vector3i>` map_position **)** |const| |
  80. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`resource_changed<class_GridMap_method_resource_changed>` **(** :ref:`Resource<class_Resource>` resource **)** |
  82. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`set_cell_item<class_GridMap_method_set_cell_item>` **(** :ref:`Vector3i<class_Vector3i>` position, :ref:`int<class_int>` item, :ref:`int<class_int>` orientation=0 **)** |
  84. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`set_collision_layer_value<class_GridMap_method_set_collision_layer_value>` **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)** |
  86. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`set_collision_mask_value<class_GridMap_method_set_collision_mask_value>` **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)** |
  88. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`set_navigation_layer_value<class_GridMap_method_set_navigation_layer_value>` **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)** |
  90. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`Vector3i<class_Vector3i>` | :ref:`world_to_map<class_GridMap_method_world_to_map>` **(** :ref:`Vector3<class_Vector3>` world_position **)** |const| |
  92. +---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. Signals
  94. -------
  95. .. _class_GridMap_signal_cell_size_changed:
  96. - **cell_size_changed** **(** :ref:`Vector3<class_Vector3>` cell_size **)**
  97. Emitted when :ref:`cell_size<class_GridMap_property_cell_size>` changes.
  98. Constants
  99. ---------
  100. .. _class_GridMap_constant_INVALID_CELL_ITEM:
  101. - **INVALID_CELL_ITEM** = **-1** --- Invalid cell item that can be used in :ref:`set_cell_item<class_GridMap_method_set_cell_item>` to clear cells (or represent an empty cell in :ref:`get_cell_item<class_GridMap_method_get_cell_item>`).
  102. Property Descriptions
  103. ---------------------
  104. .. _class_GridMap_property_bake_navigation:
  105. - :ref:`bool<class_bool>` **bake_navigation**
  106. +-----------+----------------------------+
  107. | *Default* | ``false`` |
  108. +-----------+----------------------------+
  109. | *Setter* | set_bake_navigation(value) |
  110. +-----------+----------------------------+
  111. | *Getter* | is_baking_navigation() |
  112. +-----------+----------------------------+
  113. If ``true``, this GridMap bakes a navigation region.
  114. ----
  115. .. _class_GridMap_property_cell_center_x:
  116. - :ref:`bool<class_bool>` **cell_center_x**
  117. +-----------+---------------------+
  118. | *Default* | ``true`` |
  119. +-----------+---------------------+
  120. | *Setter* | set_center_x(value) |
  121. +-----------+---------------------+
  122. | *Getter* | get_center_x() |
  123. +-----------+---------------------+
  124. If ``true``, grid items are centered on the X axis.
  125. ----
  126. .. _class_GridMap_property_cell_center_y:
  127. - :ref:`bool<class_bool>` **cell_center_y**
  128. +-----------+---------------------+
  129. | *Default* | ``true`` |
  130. +-----------+---------------------+
  131. | *Setter* | set_center_y(value) |
  132. +-----------+---------------------+
  133. | *Getter* | get_center_y() |
  134. +-----------+---------------------+
  135. If ``true``, grid items are centered on the Y axis.
  136. ----
  137. .. _class_GridMap_property_cell_center_z:
  138. - :ref:`bool<class_bool>` **cell_center_z**
  139. +-----------+---------------------+
  140. | *Default* | ``true`` |
  141. +-----------+---------------------+
  142. | *Setter* | set_center_z(value) |
  143. +-----------+---------------------+
  144. | *Getter* | get_center_z() |
  145. +-----------+---------------------+
  146. If ``true``, grid items are centered on the Z axis.
  147. ----
  148. .. _class_GridMap_property_cell_octant_size:
  149. - :ref:`int<class_int>` **cell_octant_size**
  150. +-----------+------------------------+
  151. | *Default* | ``8`` |
  152. +-----------+------------------------+
  153. | *Setter* | set_octant_size(value) |
  154. +-----------+------------------------+
  155. | *Getter* | get_octant_size() |
  156. +-----------+------------------------+
  157. The size of each octant measured in number of cells. This applies to all three axis.
  158. ----
  159. .. _class_GridMap_property_cell_scale:
  160. - :ref:`float<class_float>` **cell_scale**
  161. +-----------+-----------------------+
  162. | *Default* | ``1.0`` |
  163. +-----------+-----------------------+
  164. | *Setter* | set_cell_scale(value) |
  165. +-----------+-----------------------+
  166. | *Getter* | get_cell_scale() |
  167. +-----------+-----------------------+
  168. The scale of the cell items.
  169. This does not affect the size of the grid cells themselves, only the items in them. This can be used to make cell items overlap their neighbors.
  170. ----
  171. .. _class_GridMap_property_cell_size:
  172. - :ref:`Vector3<class_Vector3>` **cell_size**
  173. +-----------+----------------------+
  174. | *Default* | ``Vector3(2, 2, 2)`` |
  175. +-----------+----------------------+
  176. | *Setter* | set_cell_size(value) |
  177. +-----------+----------------------+
  178. | *Getter* | get_cell_size() |
  179. +-----------+----------------------+
  180. The dimensions of the grid's cells.
  181. This does not affect the size of the meshes. See :ref:`cell_scale<class_GridMap_property_cell_scale>`.
  182. ----
  183. .. _class_GridMap_property_collision_layer:
  184. - :ref:`int<class_int>` **collision_layer**
  185. +-----------+----------------------------+
  186. | *Default* | ``1`` |
  187. +-----------+----------------------------+
  188. | *Setter* | set_collision_layer(value) |
  189. +-----------+----------------------------+
  190. | *Getter* | get_collision_layer() |
  191. +-----------+----------------------------+
  192. The physics layers this GridMap is in.
  193. GridMaps act as static bodies, meaning they aren't affected by gravity or other forces. They only affect other physics bodies that collide with them.
  194. ----
  195. .. _class_GridMap_property_collision_mask:
  196. - :ref:`int<class_int>` **collision_mask**
  197. +-----------+---------------------------+
  198. | *Default* | ``1`` |
  199. +-----------+---------------------------+
  200. | *Setter* | set_collision_mask(value) |
  201. +-----------+---------------------------+
  202. | *Getter* | get_collision_mask() |
  203. +-----------+---------------------------+
  204. The physics layers this GridMap detects collisions in. See `Collision layers and masks <../tutorials/physics/physics_introduction.html#collision-layers-and-masks>`__ in the documentation for more information.
  205. ----
  206. .. _class_GridMap_property_mesh_library:
  207. - :ref:`MeshLibrary<class_MeshLibrary>` **mesh_library**
  208. +----------+-------------------------+
  209. | *Setter* | set_mesh_library(value) |
  210. +----------+-------------------------+
  211. | *Getter* | get_mesh_library() |
  212. +----------+-------------------------+
  213. The assigned :ref:`MeshLibrary<class_MeshLibrary>`.
  214. ----
  215. .. _class_GridMap_property_navigation_layers:
  216. - :ref:`int<class_int>` **navigation_layers**
  217. +-----------+------------------------------+
  218. | *Default* | ``1`` |
  219. +-----------+------------------------------+
  220. | *Setter* | set_navigation_layers(value) |
  221. +-----------+------------------------------+
  222. | *Getter* | get_navigation_layers() |
  223. +-----------+------------------------------+
  224. A bitmask determining all navigation layers the GridMap generated navigation regions belong to. These navigation layers can be checked upon when requesting a path with :ref:`NavigationServer3D.map_get_path<class_NavigationServer3D_method_map_get_path>`.
  225. ----
  226. .. _class_GridMap_property_physics_material:
  227. - :ref:`PhysicsMaterial<class_PhysicsMaterial>` **physics_material**
  228. +----------+-----------------------------+
  229. | *Setter* | set_physics_material(value) |
  230. +----------+-----------------------------+
  231. | *Getter* | get_physics_material() |
  232. +----------+-----------------------------+
  233. Overrides the default friction and bounce physics properties for the whole ``GridMap``.
  234. Method Descriptions
  235. -------------------
  236. .. _class_GridMap_method_clear:
  237. - void **clear** **(** **)**
  238. Clear all cells.
  239. ----
  240. .. _class_GridMap_method_clear_baked_meshes:
  241. - void **clear_baked_meshes** **(** **)**
  242. ----
  243. .. _class_GridMap_method_get_bake_mesh_instance:
  244. - :ref:`RID<class_RID>` **get_bake_mesh_instance** **(** :ref:`int<class_int>` idx **)**
  245. ----
  246. .. _class_GridMap_method_get_bake_meshes:
  247. - :ref:`Array<class_Array>` **get_bake_meshes** **(** **)**
  248. Returns an array of :ref:`ArrayMesh<class_ArrayMesh>`\ es and :ref:`Transform3D<class_Transform3D>` references of all bake meshes that exist within the current GridMap.
  249. ----
  250. .. _class_GridMap_method_get_cell_item:
  251. - :ref:`int<class_int>` **get_cell_item** **(** :ref:`Vector3i<class_Vector3i>` position **)** |const|
  252. The :ref:`MeshLibrary<class_MeshLibrary>` item index located at the given grid coordinates. If the cell is empty, :ref:`INVALID_CELL_ITEM<class_GridMap_constant_INVALID_CELL_ITEM>` will be returned.
  253. ----
  254. .. _class_GridMap_method_get_cell_item_orientation:
  255. - :ref:`int<class_int>` **get_cell_item_orientation** **(** :ref:`Vector3i<class_Vector3i>` position **)** |const|
  256. The orientation of the cell at the given grid coordinates. ``-1`` is returned if the cell is empty.
  257. ----
  258. .. _class_GridMap_method_get_collision_layer_value:
  259. - :ref:`bool<class_bool>` **get_collision_layer_value** **(** :ref:`int<class_int>` layer_number **)** |const|
  260. Returns whether or not the specified layer of the :ref:`collision_layer<class_GridMap_property_collision_layer>` is enabled, given a ``layer_number`` between 1 and 32.
  261. ----
  262. .. _class_GridMap_method_get_collision_mask_value:
  263. - :ref:`bool<class_bool>` **get_collision_mask_value** **(** :ref:`int<class_int>` layer_number **)** |const|
  264. Returns whether or not the specified layer of the :ref:`collision_mask<class_GridMap_property_collision_mask>` is enabled, given a ``layer_number`` between 1 and 32.
  265. ----
  266. .. _class_GridMap_method_get_meshes:
  267. - :ref:`Array<class_Array>` **get_meshes** **(** **)** |const|
  268. Returns an array of :ref:`Transform3D<class_Transform3D>` and :ref:`Mesh<class_Mesh>` references corresponding to the non-empty cells in the grid. The transforms are specified in world space.
  269. ----
  270. .. _class_GridMap_method_get_navigation_layer_value:
  271. - :ref:`bool<class_bool>` **get_navigation_layer_value** **(** :ref:`int<class_int>` layer_number **)** |const|
  272. Returns whether or not the specified layer of the :ref:`navigation_layers<class_GridMap_property_navigation_layers>` bitmask is enabled, given a ``layer_number`` between 1 and 32.
  273. ----
  274. .. _class_GridMap_method_get_used_cells:
  275. - :ref:`Array<class_Array>` **get_used_cells** **(** **)** |const|
  276. Returns an array of :ref:`Vector3<class_Vector3>` with the non-empty cell coordinates in the grid map.
  277. ----
  278. .. _class_GridMap_method_get_used_cells_by_item:
  279. - :ref:`Array<class_Array>` **get_used_cells_by_item** **(** :ref:`int<class_int>` item **)** |const|
  280. Returns an array of all cells with the given item index specified in ``item``.
  281. ----
  282. .. _class_GridMap_method_make_baked_meshes:
  283. - void **make_baked_meshes** **(** :ref:`bool<class_bool>` gen_lightmap_uv=false, :ref:`float<class_float>` lightmap_uv_texel_size=0.1 **)**
  284. ----
  285. .. _class_GridMap_method_map_to_world:
  286. - :ref:`Vector3<class_Vector3>` **map_to_world** **(** :ref:`Vector3i<class_Vector3i>` map_position **)** |const|
  287. Returns the position of a grid cell in the GridMap's local coordinate space.
  288. ----
  289. .. _class_GridMap_method_resource_changed:
  290. - void **resource_changed** **(** :ref:`Resource<class_Resource>` resource **)**
  291. ----
  292. .. _class_GridMap_method_set_cell_item:
  293. - void **set_cell_item** **(** :ref:`Vector3i<class_Vector3i>` position, :ref:`int<class_int>` item, :ref:`int<class_int>` orientation=0 **)**
  294. Sets the mesh index for the cell referenced by its grid coordinates.
  295. A negative item index such as :ref:`INVALID_CELL_ITEM<class_GridMap_constant_INVALID_CELL_ITEM>` will clear the cell.
  296. Optionally, the item's orientation can be passed. For valid orientation values, see :ref:`Basis.get_orthogonal_index<class_Basis_method_get_orthogonal_index>`.
  297. ----
  298. .. _class_GridMap_method_set_collision_layer_value:
  299. - void **set_collision_layer_value** **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)**
  300. Based on ``value``, enables or disables the specified layer in the :ref:`collision_layer<class_GridMap_property_collision_layer>`, given a ``layer_number`` between 1 and 32.
  301. ----
  302. .. _class_GridMap_method_set_collision_mask_value:
  303. - void **set_collision_mask_value** **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)**
  304. Based on ``value``, enables or disables the specified layer in the :ref:`collision_mask<class_GridMap_property_collision_mask>`, given a ``layer_number`` between 1 and 32.
  305. ----
  306. .. _class_GridMap_method_set_navigation_layer_value:
  307. - void **set_navigation_layer_value** **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)**
  308. Based on ``value``, enables or disables the specified layer in the :ref:`navigation_layers<class_GridMap_property_navigation_layers>` bitmask, given a ``layer_number`` between 1 and 32.
  309. ----
  310. .. _class_GridMap_method_world_to_map:
  311. - :ref:`Vector3i<class_Vector3i>` **world_to_map** **(** :ref:`Vector3<class_Vector3>` world_position **)** |const|
  312. Returns the coordinates of the grid cell containing the given point.
  313. \ ``pos`` should be in the GridMap's local coordinate space.
  314. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  315. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  316. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  317. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  318. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  319. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`