mirror of
https://github.com/stan220/godot-docs.git
synced 2026-09-08 17:28:58 +00:00
classref: Add property overview and setter/getter like in editor docs
Output from godotengine/godot#22013. Fixes #1729.
This commit is contained in:
+125
-29
@@ -8,6 +8,7 @@ GridMap
|
||||
=======
|
||||
|
||||
**Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||||
|
||||
**Category:** Core
|
||||
|
||||
Brief Description
|
||||
@@ -15,6 +16,31 @@ Brief Description
|
||||
|
||||
Node for 3D tile-based maps.
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+---------------------------------------+---------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`cell_center_x<class_GridMap_cell_center_x>` |
|
||||
+---------------------------------------+---------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`cell_center_y<class_GridMap_cell_center_y>` |
|
||||
+---------------------------------------+---------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`cell_center_z<class_GridMap_cell_center_z>` |
|
||||
+---------------------------------------+---------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`cell_octant_size<class_GridMap_cell_octant_size>` |
|
||||
+---------------------------------------+---------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`cell_scale<class_GridMap_cell_scale>` |
|
||||
+---------------------------------------+---------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`cell_size<class_GridMap_cell_size>` |
|
||||
+---------------------------------------+---------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`collision_layer<class_GridMap_collision_layer>` |
|
||||
+---------------------------------------+---------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`collision_mask<class_GridMap_collision_mask>` |
|
||||
+---------------------------------------+---------------------------------------------------------+
|
||||
| :ref:`MeshLibrary<class_MeshLibrary>` | :ref:`mesh_library<class_GridMap_mesh_library>` |
|
||||
+---------------------------------------+---------------------------------------------------------+
|
||||
| :ref:`MeshLibrary<class_MeshLibrary>` | :ref:`theme<class_GridMap_theme>` |
|
||||
+---------------------------------------+---------------------------------------------------------+
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
@@ -60,7 +86,6 @@ Constants
|
||||
---------
|
||||
|
||||
- **INVALID_CELL_ITEM** = **-1** --- Invalid cell item that can be used in :ref:`set_cell_item<class_GridMap_set_cell_item>` to clear cells (or represent an empty cell in :ref:`get_cell_item<class_GridMap_get_cell_item>`).
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -76,117 +101,189 @@ Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`../tutorials/3d/using_gridmaps`
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_GridMap_cell_center_x:
|
||||
|
||||
- :ref:`bool<class_bool>` **cell_center_x** - If ``true`` grid items are centered on the X axis.
|
||||
- :ref:`bool<class_bool>` **cell_center_x**
|
||||
|
||||
+----------+---------------------+
|
||||
| *Setter* | set_center_x(value) |
|
||||
+----------+---------------------+
|
||||
| *Getter* | get_center_x() |
|
||||
+----------+---------------------+
|
||||
|
||||
If ``true`` grid items are centered on the X axis.
|
||||
|
||||
.. _class_GridMap_cell_center_y:
|
||||
|
||||
- :ref:`bool<class_bool>` **cell_center_y** - If ``true`` grid items are centered on the Y axis.
|
||||
- :ref:`bool<class_bool>` **cell_center_y**
|
||||
|
||||
+----------+---------------------+
|
||||
| *Setter* | set_center_y(value) |
|
||||
+----------+---------------------+
|
||||
| *Getter* | get_center_y() |
|
||||
+----------+---------------------+
|
||||
|
||||
If ``true`` grid items are centered on the Y axis.
|
||||
|
||||
.. _class_GridMap_cell_center_z:
|
||||
|
||||
- :ref:`bool<class_bool>` **cell_center_z** - If ``true`` grid items are centered on the Z axis.
|
||||
- :ref:`bool<class_bool>` **cell_center_z**
|
||||
|
||||
+----------+---------------------+
|
||||
| *Setter* | set_center_z(value) |
|
||||
+----------+---------------------+
|
||||
| *Getter* | get_center_z() |
|
||||
+----------+---------------------+
|
||||
|
||||
If ``true`` grid items are centered on the Z axis.
|
||||
|
||||
.. _class_GridMap_cell_octant_size:
|
||||
|
||||
- :ref:`int<class_int>` **cell_octant_size** - The size of each octant measured in number of cells. This applies to all three axis.
|
||||
- :ref:`int<class_int>` **cell_octant_size**
|
||||
|
||||
+----------+------------------------+
|
||||
| *Setter* | set_octant_size(value) |
|
||||
+----------+------------------------+
|
||||
| *Getter* | get_octant_size() |
|
||||
+----------+------------------------+
|
||||
|
||||
The size of each octant measured in number of cells. This applies to all three axis.
|
||||
|
||||
.. _class_GridMap_cell_scale:
|
||||
|
||||
- :ref:`float<class_float>` **cell_scale**
|
||||
|
||||
+----------+-----------------------+
|
||||
| *Setter* | set_cell_scale(value) |
|
||||
+----------+-----------------------+
|
||||
| *Getter* | get_cell_scale() |
|
||||
+----------+-----------------------+
|
||||
|
||||
.. _class_GridMap_cell_size:
|
||||
|
||||
- :ref:`Vector3<class_Vector3>` **cell_size** - The dimensions of the grid's cells.
|
||||
- :ref:`Vector3<class_Vector3>` **cell_size**
|
||||
|
||||
+----------+----------------------+
|
||||
| *Setter* | set_cell_size(value) |
|
||||
+----------+----------------------+
|
||||
| *Getter* | get_cell_size() |
|
||||
+----------+----------------------+
|
||||
|
||||
The dimensions of the grid's cells.
|
||||
|
||||
.. _class_GridMap_collision_layer:
|
||||
|
||||
- :ref:`int<class_int>` **collision_layer**
|
||||
|
||||
+----------+----------------------------+
|
||||
| *Setter* | set_collision_layer(value) |
|
||||
+----------+----------------------------+
|
||||
| *Getter* | get_collision_layer() |
|
||||
+----------+----------------------------+
|
||||
|
||||
.. _class_GridMap_collision_mask:
|
||||
|
||||
- :ref:`int<class_int>` **collision_mask**
|
||||
|
||||
+----------+---------------------------+
|
||||
| *Setter* | set_collision_mask(value) |
|
||||
+----------+---------------------------+
|
||||
| *Getter* | get_collision_mask() |
|
||||
+----------+---------------------------+
|
||||
|
||||
.. _class_GridMap_mesh_library:
|
||||
|
||||
- :ref:`MeshLibrary<class_MeshLibrary>` **mesh_library** - The assigned :ref:`MeshLibrary<class_MeshLibrary>`.
|
||||
- :ref:`MeshLibrary<class_MeshLibrary>` **mesh_library**
|
||||
|
||||
+----------+-------------------------+
|
||||
| *Setter* | set_mesh_library(value) |
|
||||
+----------+-------------------------+
|
||||
| *Getter* | get_mesh_library() |
|
||||
+----------+-------------------------+
|
||||
|
||||
The assigned :ref:`MeshLibrary<class_MeshLibrary>`.
|
||||
|
||||
.. _class_GridMap_theme:
|
||||
|
||||
- :ref:`MeshLibrary<class_MeshLibrary>` **theme** - Deprecated, use :ref:`mesh_library<class_GridMap_mesh_library>` instead.
|
||||
- :ref:`MeshLibrary<class_MeshLibrary>` **theme**
|
||||
|
||||
+----------+------------------+
|
||||
| *Setter* | set_theme(value) |
|
||||
+----------+------------------+
|
||||
| *Getter* | get_theme() |
|
||||
+----------+------------------+
|
||||
|
||||
Deprecated, use :ref:`mesh_library<class_GridMap_mesh_library>` instead.
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_GridMap_clear:
|
||||
.. _class_GridMap_clear:
|
||||
|
||||
- void **clear** **(** **)**
|
||||
|
||||
Clear all cells.
|
||||
|
||||
.. _class_GridMap_clear_baked_meshes:
|
||||
.. _class_GridMap_clear_baked_meshes:
|
||||
|
||||
- void **clear_baked_meshes** **(** **)**
|
||||
|
||||
.. _class_GridMap_get_bake_mesh_instance:
|
||||
.. _class_GridMap_get_bake_mesh_instance:
|
||||
|
||||
- :ref:`RID<class_RID>` **get_bake_mesh_instance** **(** :ref:`int<class_int>` idx **)**
|
||||
|
||||
.. _class_GridMap_get_bake_meshes:
|
||||
.. _class_GridMap_get_bake_meshes:
|
||||
|
||||
- :ref:`Array<class_Array>` **get_bake_meshes** **(** **)**
|
||||
|
||||
.. _class_GridMap_get_cell_item:
|
||||
.. _class_GridMap_get_cell_item:
|
||||
|
||||
- :ref:`int<class_int>` **get_cell_item** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z **)** const
|
||||
|
||||
The :ref:`MeshLibrary<class_MeshLibrary>` item index located at the grid-based X, Y and Z coordinates. If the cell is empty, INVALID_CELL_ITEM will be returned.
|
||||
|
||||
.. _class_GridMap_get_cell_item_orientation:
|
||||
.. _class_GridMap_get_cell_item_orientation:
|
||||
|
||||
- :ref:`int<class_int>` **get_cell_item_orientation** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z **)** const
|
||||
|
||||
The orientation of the cell at the grid-based X, Y and Z coordinates. -1 is retuned if the cell is empty.
|
||||
The orientation of the cell at the grid-based X, Y and Z coordinates. -1 is returned if the cell is empty.
|
||||
|
||||
.. _class_GridMap_get_collision_layer_bit:
|
||||
.. _class_GridMap_get_collision_layer_bit:
|
||||
|
||||
- :ref:`bool<class_bool>` **get_collision_layer_bit** **(** :ref:`int<class_int>` bit **)** const
|
||||
|
||||
.. _class_GridMap_get_collision_mask_bit:
|
||||
.. _class_GridMap_get_collision_mask_bit:
|
||||
|
||||
- :ref:`bool<class_bool>` **get_collision_mask_bit** **(** :ref:`int<class_int>` bit **)** const
|
||||
|
||||
.. _class_GridMap_get_meshes:
|
||||
.. _class_GridMap_get_meshes:
|
||||
|
||||
- :ref:`Array<class_Array>` **get_meshes** **(** **)**
|
||||
|
||||
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.
|
||||
|
||||
.. _class_GridMap_get_used_cells:
|
||||
.. _class_GridMap_get_used_cells:
|
||||
|
||||
- :ref:`Array<class_Array>` **get_used_cells** **(** **)** const
|
||||
|
||||
Array of :ref:`Vector3<class_Vector3>` with the non empty cell coordinates in the grid map.
|
||||
|
||||
.. _class_GridMap_make_baked_meshes:
|
||||
.. _class_GridMap_make_baked_meshes:
|
||||
|
||||
- void **make_baked_meshes** **(** :ref:`bool<class_bool>` gen_lightmap_uv=false, :ref:`float<class_float>` lightmap_uv_texel_size=0.1 **)**
|
||||
|
||||
.. _class_GridMap_map_to_world:
|
||||
.. _class_GridMap_map_to_world:
|
||||
|
||||
- :ref:`Vector3<class_Vector3>` **map_to_world** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z **)** const
|
||||
|
||||
.. _class_GridMap_resource_changed:
|
||||
.. _class_GridMap_resource_changed:
|
||||
|
||||
- void **resource_changed** **(** :ref:`Resource<class_Resource>` resource **)**
|
||||
|
||||
.. _class_GridMap_set_cell_item:
|
||||
.. _class_GridMap_set_cell_item:
|
||||
|
||||
- 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 **)**
|
||||
|
||||
@@ -196,20 +293,19 @@ A negative item index will clear the cell.
|
||||
|
||||
Optionally, the item's orientation can be passed.
|
||||
|
||||
.. _class_GridMap_set_clip:
|
||||
.. _class_GridMap_set_clip:
|
||||
|
||||
- void **set_clip** **(** :ref:`bool<class_bool>` enabled, :ref:`bool<class_bool>` clipabove=true, :ref:`int<class_int>` floor=0, :ref:`Axis<enum_Vector3_Axis>` axis=0 **)**
|
||||
|
||||
.. _class_GridMap_set_collision_layer_bit:
|
||||
.. _class_GridMap_set_collision_layer_bit:
|
||||
|
||||
- void **set_collision_layer_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
|
||||
|
||||
.. _class_GridMap_set_collision_mask_bit:
|
||||
.. _class_GridMap_set_collision_mask_bit:
|
||||
|
||||
- void **set_collision_mask_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
|
||||
|
||||
.. _class_GridMap_world_to_map:
|
||||
.. _class_GridMap_world_to_map:
|
||||
|
||||
- :ref:`Vector3<class_Vector3>` **world_to_map** **(** :ref:`Vector3<class_Vector3>` pos **)** const
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user