GridMap.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="GridMap" inherits="Spatial" category="Core" version="3.1.2">
  3. <brief_description>
  4. Node for 3D tile-based maps.
  5. </brief_description>
  6. <description>
  7. GridMap lets you place meshes on a grid interactively. It works both from the editor and can help you create in-game level editors.
  8. GridMaps use a [MeshLibrary] which contain a list of tiles: meshes with materials plus optional collisions and extra elements.
  9. A GridMap contains a collection of cells. Each grid cell refers to a [MeshLibrary] item. All cells in the map have the same dimensions.
  10. 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.
  11. </description>
  12. <tutorials>
  13. <link>https://docs.godotengine.org/en/3.1/tutorials/3d/using_gridmaps.html</link>
  14. </tutorials>
  15. <methods>
  16. <method name="clear">
  17. <return type="void">
  18. </return>
  19. <description>
  20. Clear all cells.
  21. </description>
  22. </method>
  23. <method name="clear_baked_meshes">
  24. <return type="void">
  25. </return>
  26. <description>
  27. </description>
  28. </method>
  29. <method name="get_bake_mesh_instance">
  30. <return type="RID">
  31. </return>
  32. <argument index="0" name="idx" type="int">
  33. </argument>
  34. <description>
  35. </description>
  36. </method>
  37. <method name="get_bake_meshes">
  38. <return type="Array">
  39. </return>
  40. <description>
  41. </description>
  42. </method>
  43. <method name="get_cell_item" qualifiers="const">
  44. <return type="int">
  45. </return>
  46. <argument index="0" name="x" type="int">
  47. </argument>
  48. <argument index="1" name="y" type="int">
  49. </argument>
  50. <argument index="2" name="z" type="int">
  51. </argument>
  52. <description>
  53. The [MeshLibrary] item index located at the grid-based X, Y and Z coordinates. If the cell is empty, [constant INVALID_CELL_ITEM] will be returned.
  54. </description>
  55. </method>
  56. <method name="get_cell_item_orientation" qualifiers="const">
  57. <return type="int">
  58. </return>
  59. <argument index="0" name="x" type="int">
  60. </argument>
  61. <argument index="1" name="y" type="int">
  62. </argument>
  63. <argument index="2" name="z" type="int">
  64. </argument>
  65. <description>
  66. The orientation of the cell at the grid-based X, Y and Z coordinates. -1 is returned if the cell is empty.
  67. </description>
  68. </method>
  69. <method name="get_collision_layer_bit" qualifiers="const">
  70. <return type="bool">
  71. </return>
  72. <argument index="0" name="bit" type="int">
  73. </argument>
  74. <description>
  75. </description>
  76. </method>
  77. <method name="get_collision_mask_bit" qualifiers="const">
  78. <return type="bool">
  79. </return>
  80. <argument index="0" name="bit" type="int">
  81. </argument>
  82. <description>
  83. </description>
  84. </method>
  85. <method name="get_meshes">
  86. <return type="Array">
  87. </return>
  88. <description>
  89. Array of [Transform] and [Mesh] references corresponding to the non empty cells in the grid. The transforms are specified in world space.
  90. </description>
  91. </method>
  92. <method name="get_used_cells" qualifiers="const">
  93. <return type="Array">
  94. </return>
  95. <description>
  96. Array of [Vector3] with the non empty cell coordinates in the grid map.
  97. </description>
  98. </method>
  99. <method name="make_baked_meshes">
  100. <return type="void">
  101. </return>
  102. <argument index="0" name="gen_lightmap_uv" type="bool" default="false">
  103. </argument>
  104. <argument index="1" name="lightmap_uv_texel_size" type="float" default="0.1">
  105. </argument>
  106. <description>
  107. </description>
  108. </method>
  109. <method name="map_to_world" qualifiers="const">
  110. <return type="Vector3">
  111. </return>
  112. <argument index="0" name="x" type="int">
  113. </argument>
  114. <argument index="1" name="y" type="int">
  115. </argument>
  116. <argument index="2" name="z" type="int">
  117. </argument>
  118. <description>
  119. </description>
  120. </method>
  121. <method name="resource_changed">
  122. <return type="void">
  123. </return>
  124. <argument index="0" name="resource" type="Resource">
  125. </argument>
  126. <description>
  127. </description>
  128. </method>
  129. <method name="set_cell_item">
  130. <return type="void">
  131. </return>
  132. <argument index="0" name="x" type="int">
  133. </argument>
  134. <argument index="1" name="y" type="int">
  135. </argument>
  136. <argument index="2" name="z" type="int">
  137. </argument>
  138. <argument index="3" name="item" type="int">
  139. </argument>
  140. <argument index="4" name="orientation" type="int" default="0">
  141. </argument>
  142. <description>
  143. Set the mesh index for the cell referenced by its grid-based X, Y and Z coordinates.
  144. A negative item index will clear the cell.
  145. Optionally, the item's orientation can be passed.
  146. </description>
  147. </method>
  148. <method name="set_clip">
  149. <return type="void">
  150. </return>
  151. <argument index="0" name="enabled" type="bool">
  152. </argument>
  153. <argument index="1" name="clipabove" type="bool" default="true">
  154. </argument>
  155. <argument index="2" name="floor" type="int" default="0">
  156. </argument>
  157. <argument index="3" name="axis" type="int" enum="Vector3.Axis" default="0">
  158. </argument>
  159. <description>
  160. </description>
  161. </method>
  162. <method name="set_collision_layer_bit">
  163. <return type="void">
  164. </return>
  165. <argument index="0" name="bit" type="int">
  166. </argument>
  167. <argument index="1" name="value" type="bool">
  168. </argument>
  169. <description>
  170. </description>
  171. </method>
  172. <method name="set_collision_mask_bit">
  173. <return type="void">
  174. </return>
  175. <argument index="0" name="bit" type="int">
  176. </argument>
  177. <argument index="1" name="value" type="bool">
  178. </argument>
  179. <description>
  180. </description>
  181. </method>
  182. <method name="world_to_map" qualifiers="const">
  183. <return type="Vector3">
  184. </return>
  185. <argument index="0" name="pos" type="Vector3">
  186. </argument>
  187. <description>
  188. </description>
  189. </method>
  190. </methods>
  191. <members>
  192. <member name="cell_center_x" type="bool" setter="set_center_x" getter="get_center_x">
  193. If [code]true[/code], grid items are centered on the X axis.
  194. </member>
  195. <member name="cell_center_y" type="bool" setter="set_center_y" getter="get_center_y">
  196. If [code]true[/code], grid items are centered on the Y axis.
  197. </member>
  198. <member name="cell_center_z" type="bool" setter="set_center_z" getter="get_center_z">
  199. If [code]true[/code], grid items are centered on the Z axis.
  200. </member>
  201. <member name="cell_octant_size" type="int" setter="set_octant_size" getter="get_octant_size">
  202. The size of each octant measured in number of cells. This applies to all three axis.
  203. </member>
  204. <member name="cell_scale" type="float" setter="set_cell_scale" getter="get_cell_scale">
  205. </member>
  206. <member name="cell_size" type="Vector3" setter="set_cell_size" getter="get_cell_size">
  207. The dimensions of the grid's cells.
  208. </member>
  209. <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer">
  210. </member>
  211. <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask">
  212. </member>
  213. <member name="mesh_library" type="MeshLibrary" setter="set_mesh_library" getter="get_mesh_library">
  214. The assigned [MeshLibrary].
  215. </member>
  216. <member name="theme" type="MeshLibrary" setter="set_theme" getter="get_theme">
  217. Deprecated, use [member mesh_library] instead.
  218. </member>
  219. </members>
  220. <constants>
  221. <constant name="INVALID_CELL_ITEM" value="-1">
  222. Invalid cell item that can be used in [method set_cell_item] to clear cells (or represent an empty cell in [method get_cell_item]).
  223. </constant>
  224. </constants>
  225. </class>