class_gridmap.rst 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/modules/gridmap/doc_classes/GridMap.xml.
  6. .. _class_GridMap:
  7. GridMap
  8. =======
  9. **Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Node for 3D tile-based maps.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. 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.
  16. 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.
  17. 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.
  18. \ **Note:** GridMap doesn't extend :ref:`VisualInstance<class_VisualInstance>` and therefore can't be hidden or cull masked based on :ref:`VisualInstance.layers<class_VisualInstance_property_layers>`. If you make a light not affect the first layer, the whole GridMap won't be lit by the light in question.
  19. .. rst-class:: classref-introduction-group
  20. Tutorials
  21. ---------
  22. - :doc:`Using gridmaps <../tutorials/3d/using_gridmaps>`
  23. - `3D Platformer Demo <https://godotengine.org/asset-library/asset/125>`__
  24. - `3D Kinematic Character Demo <https://godotengine.org/asset-library/asset/126>`__
  25. .. rst-class:: classref-reftable-group
  26. Properties
  27. ----------
  28. .. table::
  29. :widths: auto
  30. +-----------------------------------------------+----------------------------------------------------------------------+------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`bake_navigation<class_GridMap_property_bake_navigation>` | ``false`` |
  32. +-----------------------------------------------+----------------------------------------------------------------------+------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`cell_center_x<class_GridMap_property_cell_center_x>` | ``true`` |
  34. +-----------------------------------------------+----------------------------------------------------------------------+------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`cell_center_y<class_GridMap_property_cell_center_y>` | ``true`` |
  36. +-----------------------------------------------+----------------------------------------------------------------------+------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`cell_center_z<class_GridMap_property_cell_center_z>` | ``true`` |
  38. +-----------------------------------------------+----------------------------------------------------------------------+------------------------+
  39. | :ref:`int<class_int>` | :ref:`cell_octant_size<class_GridMap_property_cell_octant_size>` | ``8`` |
  40. +-----------------------------------------------+----------------------------------------------------------------------+------------------------+
  41. | :ref:`float<class_float>` | :ref:`cell_scale<class_GridMap_property_cell_scale>` | ``1.0`` |
  42. +-----------------------------------------------+----------------------------------------------------------------------+------------------------+
  43. | :ref:`Vector3<class_Vector3>` | :ref:`cell_size<class_GridMap_property_cell_size>` | ``Vector3( 2, 2, 2 )`` |
  44. +-----------------------------------------------+----------------------------------------------------------------------+------------------------+
  45. | :ref:`int<class_int>` | :ref:`collision_layer<class_GridMap_property_collision_layer>` | ``1`` |
  46. +-----------------------------------------------+----------------------------------------------------------------------+------------------------+
  47. | :ref:`int<class_int>` | :ref:`collision_mask<class_GridMap_property_collision_mask>` | ``1`` |
  48. +-----------------------------------------------+----------------------------------------------------------------------+------------------------+
  49. | :ref:`MeshLibrary<class_MeshLibrary>` | :ref:`mesh_library<class_GridMap_property_mesh_library>` | |
  50. +-----------------------------------------------+----------------------------------------------------------------------+------------------------+
  51. | :ref:`int<class_int>` | :ref:`navigation_layers<class_GridMap_property_navigation_layers>` | ``1`` |
  52. +-----------------------------------------------+----------------------------------------------------------------------+------------------------+
  53. | :ref:`PhysicsMaterial<class_PhysicsMaterial>` | :ref:`physics_material<class_GridMap_property_physics_material>` | |
  54. +-----------------------------------------------+----------------------------------------------------------------------+------------------------+
  55. | :ref:`bool<class_bool>` | :ref:`use_in_baked_light<class_GridMap_property_use_in_baked_light>` | ``false`` |
  56. +-----------------------------------------------+----------------------------------------------------------------------+------------------------+
  57. .. rst-class:: classref-reftable-group
  58. Methods
  59. -------
  60. .. table::
  61. :widths: auto
  62. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | void | :ref:`clear<class_GridMap_method_clear>` **(** **)** |
  64. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | void | :ref:`clear_baked_meshes<class_GridMap_method_clear_baked_meshes>` **(** **)** |
  66. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`RID<class_RID>` | :ref:`get_bake_mesh_instance<class_GridMap_method_get_bake_mesh_instance>` **(** :ref:`int<class_int>` idx **)** |
  68. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`Array<class_Array>` | :ref:`get_bake_meshes<class_GridMap_method_get_bake_meshes>` **(** **)** |
  70. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`int<class_int>` | :ref:`get_cell_item<class_GridMap_method_get_cell_item>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z **)** |const| |
  72. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`int<class_int>` | :ref:`get_cell_item_orientation<class_GridMap_method_get_cell_item_orientation>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z **)** |const| |
  74. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`bool<class_bool>` | :ref:`get_collision_layer_bit<class_GridMap_method_get_collision_layer_bit>` **(** :ref:`int<class_int>` bit **)** |const| |
  76. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`bool<class_bool>` | :ref:`get_collision_mask_bit<class_GridMap_method_get_collision_mask_bit>` **(** :ref:`int<class_int>` bit **)** |const| |
  78. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`Array<class_Array>` | :ref:`get_meshes<class_GridMap_method_get_meshes>` **(** **)** |const| |
  80. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`Array<class_Array>` | :ref:`get_used_cells<class_GridMap_method_get_used_cells>` **(** **)** |const| |
  82. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`Array<class_Array>` | :ref:`get_used_cells_by_item<class_GridMap_method_get_used_cells_by_item>` **(** :ref:`int<class_int>` item **)** |const| |
  84. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | 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 **)** |
  86. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`Vector3<class_Vector3>` | :ref:`map_to_world<class_GridMap_method_map_to_world>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z **)** |const| |
  88. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`resource_changed<class_GridMap_method_resource_changed>` **(** :ref:`Resource<class_Resource>` resource **)** |
  90. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`set_cell_item<class_GridMap_method_set_cell_item>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z, :ref:`int<class_int>` item, :ref:`int<class_int>` orientation=0 **)** |
  92. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | void | :ref:`set_clip<class_GridMap_method_set_clip>` **(** :ref:`bool<class_bool>` enabled, :ref:`bool<class_bool>` clipabove=true, :ref:`int<class_int>` floor=0, Vector3.Axis axis=0 **)** |
  94. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | void | :ref:`set_collision_layer_bit<class_GridMap_method_set_collision_layer_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  96. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | void | :ref:`set_collision_mask_bit<class_GridMap_method_set_collision_mask_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  98. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`Vector3<class_Vector3>` | :ref:`world_to_map<class_GridMap_method_world_to_map>` **(** :ref:`Vector3<class_Vector3>` pos **)** |const| |
  100. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. .. rst-class:: classref-section-separator
  102. ----
  103. .. rst-class:: classref-descriptions-group
  104. Signals
  105. -------
  106. .. _class_GridMap_signal_cell_size_changed:
  107. .. rst-class:: classref-signal
  108. **cell_size_changed** **(** :ref:`Vector3<class_Vector3>` cell_size **)**
  109. Emitted when :ref:`cell_size<class_GridMap_property_cell_size>` changes.
  110. .. rst-class:: classref-section-separator
  111. ----
  112. .. rst-class:: classref-descriptions-group
  113. Constants
  114. ---------
  115. .. _class_GridMap_constant_INVALID_CELL_ITEM:
  116. .. rst-class:: classref-constant
  117. **INVALID_CELL_ITEM** = ``-1``
  118. 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>`).
  119. .. rst-class:: classref-section-separator
  120. ----
  121. .. rst-class:: classref-descriptions-group
  122. Property Descriptions
  123. ---------------------
  124. .. _class_GridMap_property_bake_navigation:
  125. .. rst-class:: classref-property
  126. :ref:`bool<class_bool>` **bake_navigation** = ``false``
  127. .. rst-class:: classref-property-setget
  128. - void **set_bake_navigation** **(** :ref:`bool<class_bool>` value **)**
  129. - :ref:`bool<class_bool>` **is_baking_navigation** **(** **)**
  130. If ``true``, this GridMap uses cell navmesh resources to create navigation regions.
  131. .. rst-class:: classref-item-separator
  132. ----
  133. .. _class_GridMap_property_cell_center_x:
  134. .. rst-class:: classref-property
  135. :ref:`bool<class_bool>` **cell_center_x** = ``true``
  136. .. rst-class:: classref-property-setget
  137. - void **set_center_x** **(** :ref:`bool<class_bool>` value **)**
  138. - :ref:`bool<class_bool>` **get_center_x** **(** **)**
  139. If ``true``, grid items are centered on the X axis.
  140. .. rst-class:: classref-item-separator
  141. ----
  142. .. _class_GridMap_property_cell_center_y:
  143. .. rst-class:: classref-property
  144. :ref:`bool<class_bool>` **cell_center_y** = ``true``
  145. .. rst-class:: classref-property-setget
  146. - void **set_center_y** **(** :ref:`bool<class_bool>` value **)**
  147. - :ref:`bool<class_bool>` **get_center_y** **(** **)**
  148. If ``true``, grid items are centered on the Y axis.
  149. .. rst-class:: classref-item-separator
  150. ----
  151. .. _class_GridMap_property_cell_center_z:
  152. .. rst-class:: classref-property
  153. :ref:`bool<class_bool>` **cell_center_z** = ``true``
  154. .. rst-class:: classref-property-setget
  155. - void **set_center_z** **(** :ref:`bool<class_bool>` value **)**
  156. - :ref:`bool<class_bool>` **get_center_z** **(** **)**
  157. If ``true``, grid items are centered on the Z axis.
  158. .. rst-class:: classref-item-separator
  159. ----
  160. .. _class_GridMap_property_cell_octant_size:
  161. .. rst-class:: classref-property
  162. :ref:`int<class_int>` **cell_octant_size** = ``8``
  163. .. rst-class:: classref-property-setget
  164. - void **set_octant_size** **(** :ref:`int<class_int>` value **)**
  165. - :ref:`int<class_int>` **get_octant_size** **(** **)**
  166. The size of each octant measured in number of cells. This applies to all three axis.
  167. .. rst-class:: classref-item-separator
  168. ----
  169. .. _class_GridMap_property_cell_scale:
  170. .. rst-class:: classref-property
  171. :ref:`float<class_float>` **cell_scale** = ``1.0``
  172. .. rst-class:: classref-property-setget
  173. - void **set_cell_scale** **(** :ref:`float<class_float>` value **)**
  174. - :ref:`float<class_float>` **get_cell_scale** **(** **)**
  175. The scale of the cell items.
  176. 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.
  177. .. rst-class:: classref-item-separator
  178. ----
  179. .. _class_GridMap_property_cell_size:
  180. .. rst-class:: classref-property
  181. :ref:`Vector3<class_Vector3>` **cell_size** = ``Vector3( 2, 2, 2 )``
  182. .. rst-class:: classref-property-setget
  183. - void **set_cell_size** **(** :ref:`Vector3<class_Vector3>` value **)**
  184. - :ref:`Vector3<class_Vector3>` **get_cell_size** **(** **)**
  185. The dimensions of the grid's cells.
  186. This does not affect the size of the meshes. See :ref:`cell_scale<class_GridMap_property_cell_scale>`.
  187. .. rst-class:: classref-item-separator
  188. ----
  189. .. _class_GridMap_property_collision_layer:
  190. .. rst-class:: classref-property
  191. :ref:`int<class_int>` **collision_layer** = ``1``
  192. .. rst-class:: classref-property-setget
  193. - void **set_collision_layer** **(** :ref:`int<class_int>` value **)**
  194. - :ref:`int<class_int>` **get_collision_layer** **(** **)**
  195. The physics layers this GridMap is in.
  196. 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.
  197. .. rst-class:: classref-item-separator
  198. ----
  199. .. _class_GridMap_property_collision_mask:
  200. .. rst-class:: classref-property
  201. :ref:`int<class_int>` **collision_mask** = ``1``
  202. .. rst-class:: classref-property-setget
  203. - void **set_collision_mask** **(** :ref:`int<class_int>` value **)**
  204. - :ref:`int<class_int>` **get_collision_mask** **(** **)**
  205. 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.
  206. .. rst-class:: classref-item-separator
  207. ----
  208. .. _class_GridMap_property_mesh_library:
  209. .. rst-class:: classref-property
  210. :ref:`MeshLibrary<class_MeshLibrary>` **mesh_library**
  211. .. rst-class:: classref-property-setget
  212. - void **set_mesh_library** **(** :ref:`MeshLibrary<class_MeshLibrary>` value **)**
  213. - :ref:`MeshLibrary<class_MeshLibrary>` **get_mesh_library** **(** **)**
  214. The assigned :ref:`MeshLibrary<class_MeshLibrary>`.
  215. .. rst-class:: classref-item-separator
  216. ----
  217. .. _class_GridMap_property_navigation_layers:
  218. .. rst-class:: classref-property
  219. :ref:`int<class_int>` **navigation_layers** = ``1``
  220. .. rst-class:: classref-property-setget
  221. - void **set_navigation_layers** **(** :ref:`int<class_int>` value **)**
  222. - :ref:`int<class_int>` **get_navigation_layers** **(** **)**
  223. The navigation layers the GridMap generates its navigation regions in.
  224. .. rst-class:: classref-item-separator
  225. ----
  226. .. _class_GridMap_property_physics_material:
  227. .. rst-class:: classref-property
  228. :ref:`PhysicsMaterial<class_PhysicsMaterial>` **physics_material**
  229. .. rst-class:: classref-property-setget
  230. - void **set_physics_material** **(** :ref:`PhysicsMaterial<class_PhysicsMaterial>` value **)**
  231. - :ref:`PhysicsMaterial<class_PhysicsMaterial>` **get_physics_material** **(** **)**
  232. Overrides the default friction and bounce physics properties for the whole **GridMap**.
  233. .. rst-class:: classref-item-separator
  234. ----
  235. .. _class_GridMap_property_use_in_baked_light:
  236. .. rst-class:: classref-property
  237. :ref:`bool<class_bool>` **use_in_baked_light** = ``false``
  238. .. rst-class:: classref-property-setget
  239. - void **set_use_in_baked_light** **(** :ref:`bool<class_bool>` value **)**
  240. - :ref:`bool<class_bool>` **get_use_in_baked_light** **(** **)**
  241. Controls whether this GridMap will be baked in a :ref:`BakedLightmap<class_BakedLightmap>` or not.
  242. .. rst-class:: classref-section-separator
  243. ----
  244. .. rst-class:: classref-descriptions-group
  245. Method Descriptions
  246. -------------------
  247. .. _class_GridMap_method_clear:
  248. .. rst-class:: classref-method
  249. void **clear** **(** **)**
  250. Clear all cells.
  251. .. rst-class:: classref-item-separator
  252. ----
  253. .. _class_GridMap_method_clear_baked_meshes:
  254. .. rst-class:: classref-method
  255. void **clear_baked_meshes** **(** **)**
  256. .. container:: contribute
  257. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  258. .. rst-class:: classref-item-separator
  259. ----
  260. .. _class_GridMap_method_get_bake_mesh_instance:
  261. .. rst-class:: classref-method
  262. :ref:`RID<class_RID>` **get_bake_mesh_instance** **(** :ref:`int<class_int>` idx **)**
  263. .. container:: contribute
  264. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  265. .. rst-class:: classref-item-separator
  266. ----
  267. .. _class_GridMap_method_get_bake_meshes:
  268. .. rst-class:: classref-method
  269. :ref:`Array<class_Array>` **get_bake_meshes** **(** **)**
  270. Returns an array of :ref:`ArrayMesh<class_ArrayMesh>`\ es and :ref:`Transform<class_Transform>` references of all bake meshes that exist within the current GridMap.
  271. .. rst-class:: classref-item-separator
  272. ----
  273. .. _class_GridMap_method_get_cell_item:
  274. .. rst-class:: classref-method
  275. :ref:`int<class_int>` **get_cell_item** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z **)** |const|
  276. The :ref:`MeshLibrary<class_MeshLibrary>` item index located at the grid-based X, Y and Z coordinates. If the cell is empty, :ref:`INVALID_CELL_ITEM<class_GridMap_constant_INVALID_CELL_ITEM>` will be returned.
  277. .. rst-class:: classref-item-separator
  278. ----
  279. .. _class_GridMap_method_get_cell_item_orientation:
  280. .. rst-class:: classref-method
  281. :ref:`int<class_int>` **get_cell_item_orientation** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z **)** |const|
  282. The orientation of the cell at the grid-based X, Y and Z coordinates. -1 is returned if the cell is empty.
  283. .. rst-class:: classref-item-separator
  284. ----
  285. .. _class_GridMap_method_get_collision_layer_bit:
  286. .. rst-class:: classref-method
  287. :ref:`bool<class_bool>` **get_collision_layer_bit** **(** :ref:`int<class_int>` bit **)** |const|
  288. Returns an individual bit on the :ref:`collision_layer<class_GridMap_property_collision_layer>`.
  289. .. rst-class:: classref-item-separator
  290. ----
  291. .. _class_GridMap_method_get_collision_mask_bit:
  292. .. rst-class:: classref-method
  293. :ref:`bool<class_bool>` **get_collision_mask_bit** **(** :ref:`int<class_int>` bit **)** |const|
  294. Returns an individual bit on the :ref:`collision_mask<class_GridMap_property_collision_mask>`.
  295. .. rst-class:: classref-item-separator
  296. ----
  297. .. _class_GridMap_method_get_meshes:
  298. .. rst-class:: classref-method
  299. :ref:`Array<class_Array>` **get_meshes** **(** **)** |const|
  300. Returns an array of :ref:`Transform<class_Transform>` and :ref:`Mesh<class_Mesh>` references corresponding to the non-empty cells in the grid. The transforms are specified in world space.
  301. .. rst-class:: classref-item-separator
  302. ----
  303. .. _class_GridMap_method_get_used_cells:
  304. .. rst-class:: classref-method
  305. :ref:`Array<class_Array>` **get_used_cells** **(** **)** |const|
  306. Returns an array of :ref:`Vector3<class_Vector3>` with the non-empty cell coordinates in the grid map.
  307. .. rst-class:: classref-item-separator
  308. ----
  309. .. _class_GridMap_method_get_used_cells_by_item:
  310. .. rst-class:: classref-method
  311. :ref:`Array<class_Array>` **get_used_cells_by_item** **(** :ref:`int<class_int>` item **)** |const|
  312. Returns an array of all cells with the given item index specified in ``item``.
  313. .. rst-class:: classref-item-separator
  314. ----
  315. .. _class_GridMap_method_make_baked_meshes:
  316. .. rst-class:: classref-method
  317. void **make_baked_meshes** **(** :ref:`bool<class_bool>` gen_lightmap_uv=false, :ref:`float<class_float>` lightmap_uv_texel_size=0.1 **)**
  318. .. container:: contribute
  319. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  320. .. rst-class:: classref-item-separator
  321. ----
  322. .. _class_GridMap_method_map_to_world:
  323. .. rst-class:: classref-method
  324. :ref:`Vector3<class_Vector3>` **map_to_world** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z **)** |const|
  325. Returns the position of a grid cell in the GridMap's local coordinate space.
  326. .. rst-class:: classref-item-separator
  327. ----
  328. .. _class_GridMap_method_resource_changed:
  329. .. rst-class:: classref-method
  330. void **resource_changed** **(** :ref:`Resource<class_Resource>` resource **)**
  331. .. container:: contribute
  332. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  333. .. rst-class:: classref-item-separator
  334. ----
  335. .. _class_GridMap_method_set_cell_item:
  336. .. rst-class:: classref-method
  337. void **set_cell_item** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z, :ref:`int<class_int>` item, :ref:`int<class_int>` orientation=0 **)**
  338. Sets the mesh index for the cell referenced by its grid-based X, Y and Z coordinates.
  339. A negative item index such as :ref:`INVALID_CELL_ITEM<class_GridMap_constant_INVALID_CELL_ITEM>` will clear the cell.
  340. Optionally, the item's orientation can be passed. For valid orientation values, see :ref:`Basis.get_orthogonal_index<class_Basis_method_get_orthogonal_index>`.
  341. .. rst-class:: classref-item-separator
  342. ----
  343. .. _class_GridMap_method_set_clip:
  344. .. rst-class:: classref-method
  345. void **set_clip** **(** :ref:`bool<class_bool>` enabled, :ref:`bool<class_bool>` clipabove=true, :ref:`int<class_int>` floor=0, Vector3.Axis axis=0 **)**
  346. .. container:: contribute
  347. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  348. .. rst-class:: classref-item-separator
  349. ----
  350. .. _class_GridMap_method_set_collision_layer_bit:
  351. .. rst-class:: classref-method
  352. void **set_collision_layer_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  353. Sets an individual bit on the :ref:`collision_layer<class_GridMap_property_collision_layer>`.
  354. .. rst-class:: classref-item-separator
  355. ----
  356. .. _class_GridMap_method_set_collision_mask_bit:
  357. .. rst-class:: classref-method
  358. void **set_collision_mask_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  359. Sets an individual bit on the :ref:`collision_mask<class_GridMap_property_collision_mask>`.
  360. .. rst-class:: classref-item-separator
  361. ----
  362. .. _class_GridMap_method_world_to_map:
  363. .. rst-class:: classref-method
  364. :ref:`Vector3<class_Vector3>` **world_to_map** **(** :ref:`Vector3<class_Vector3>` pos **)** |const|
  365. Returns the coordinates of the grid cell containing the given point.
  366. \ ``pos`` should be in the GridMap's local coordinate space.
  367. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  368. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  369. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  370. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`