class_editorspatialgizmo.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the EditorSpatialGizmo.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_EditorSpatialGizmo:
  5. EditorSpatialGizmo
  6. ==================
  7. **Inherits:** :ref:`SpatialGizmo<class_spatialgizmo>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Custom gizmo for editing Spatial objects.
  12. Member Functions
  13. ----------------
  14. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`add_collision_segments<class_EditorSpatialGizmo_add_collision_segments>` **(** :ref:`PoolVector3Array<class_poolvector3array>` segments **)** |
  16. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`add_collision_triangles<class_EditorSpatialGizmo_add_collision_triangles>` **(** :ref:`TriangleMesh<class_trianglemesh>` triangles, :ref:`AABB<class_aabb>` bounds **)** |
  18. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`add_handles<class_EditorSpatialGizmo_add_handles>` **(** :ref:`PoolVector3Array<class_poolvector3array>` handles, :ref:`bool<class_bool>` billboard=false, :ref:`bool<class_bool>` secondary=false **)** |
  20. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`add_lines<class_EditorSpatialGizmo_add_lines>` **(** :ref:`PoolVector3Array<class_poolvector3array>` lines, :ref:`Material<class_material>` material, :ref:`bool<class_bool>` billboard=false **)** |
  22. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`add_mesh<class_EditorSpatialGizmo_add_mesh>` **(** :ref:`ArrayMesh<class_arraymesh>` mesh, :ref:`bool<class_bool>` billboard=false, :ref:`RID<class_rid>` skeleton **)** |
  24. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`add_unscaled_billboard<class_EditorSpatialGizmo_add_unscaled_billboard>` **(** :ref:`Material<class_material>` material, :ref:`float<class_float>` default_scale=1 **)** |
  26. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`clear<class_EditorSpatialGizmo_clear>` **(** **)** |
  28. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`commit_handle<class_EditorSpatialGizmo_commit_handle>` **(** :ref:`int<class_int>` index, :ref:`Variant<class_variant>` restore, :ref:`bool<class_bool>` cancel=false **)** virtual |
  30. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`String<class_string>` | :ref:`get_handle_name<class_EditorSpatialGizmo_get_handle_name>` **(** :ref:`int<class_int>` index **)** virtual |
  32. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`Variant<class_variant>` | :ref:`get_handle_value<class_EditorSpatialGizmo_get_handle_value>` **(** :ref:`int<class_int>` index **)** virtual |
  34. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`redraw<class_EditorSpatialGizmo_redraw>` **(** **)** virtual |
  36. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`set_handle<class_EditorSpatialGizmo_set_handle>` **(** :ref:`int<class_int>` index, :ref:`Camera<class_camera>` camera, :ref:`Vector2<class_vector2>` point **)** virtual |
  38. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`set_spatial_node<class_EditorSpatialGizmo_set_spatial_node>` **(** :ref:`Node<class_node>` node **)** |
  40. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. Description
  42. -----------
  43. Custom gizmo that is used for providing custom visualization and editing (handles) for 3D Spatial objects. These are created by :ref:`EditorPlugin.create_spatial_gizmo<class_EditorPlugin_create_spatial_gizmo>`.
  44. Member Function Description
  45. ---------------------------
  46. .. _class_EditorSpatialGizmo_add_collision_segments:
  47. - void **add_collision_segments** **(** :ref:`PoolVector3Array<class_poolvector3array>` segments **)**
  48. .. _class_EditorSpatialGizmo_add_collision_triangles:
  49. - void **add_collision_triangles** **(** :ref:`TriangleMesh<class_trianglemesh>` triangles, :ref:`AABB<class_aabb>` bounds **)**
  50. Add collision triangles to the gizmo for picking. A :ref:`TriangleMesh<class_trianglemesh>` can be generated from a regular :ref:`Mesh<class_mesh>` too. Call this function during :ref:`redraw<class_EditorSpatialGizmo_redraw>`.
  51. .. _class_EditorSpatialGizmo_add_handles:
  52. - void **add_handles** **(** :ref:`PoolVector3Array<class_poolvector3array>` handles, :ref:`bool<class_bool>` billboard=false, :ref:`bool<class_bool>` secondary=false **)**
  53. Add a list of handles (points) which can be used to deform the object being edited.
  54. There are virtual functions which will be called upon editing of these handles. Call this function during :ref:`redraw<class_EditorSpatialGizmo_redraw>`.
  55. .. _class_EditorSpatialGizmo_add_lines:
  56. - void **add_lines** **(** :ref:`PoolVector3Array<class_poolvector3array>` lines, :ref:`Material<class_material>` material, :ref:`bool<class_bool>` billboard=false **)**
  57. Add lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this function during :ref:`redraw<class_EditorSpatialGizmo_redraw>`.
  58. .. _class_EditorSpatialGizmo_add_mesh:
  59. - void **add_mesh** **(** :ref:`ArrayMesh<class_arraymesh>` mesh, :ref:`bool<class_bool>` billboard=false, :ref:`RID<class_rid>` skeleton **)**
  60. .. _class_EditorSpatialGizmo_add_unscaled_billboard:
  61. - void **add_unscaled_billboard** **(** :ref:`Material<class_material>` material, :ref:`float<class_float>` default_scale=1 **)**
  62. Add an unscaled billboard for visualization. Call this function during :ref:`redraw<class_EditorSpatialGizmo_redraw>`.
  63. .. _class_EditorSpatialGizmo_clear:
  64. - void **clear** **(** **)**
  65. .. _class_EditorSpatialGizmo_commit_handle:
  66. - void **commit_handle** **(** :ref:`int<class_int>` index, :ref:`Variant<class_variant>` restore, :ref:`bool<class_bool>` cancel=false **)** virtual
  67. Commit a handle being edited (handles must have been previously added by :ref:`add_handles<class_EditorSpatialGizmo_add_handles>`).
  68. If the cancel parameter is true, an option to restore the edited value to the original is provided.
  69. .. _class_EditorSpatialGizmo_get_handle_name:
  70. - :ref:`String<class_string>` **get_handle_name** **(** :ref:`int<class_int>` index **)** virtual
  71. Get the name of an edited handle (handles must have been previously added by :ref:`add_handles<class_EditorSpatialGizmo_add_handles>`).
  72. Handles can be named for reference to the user when editing.
  73. .. _class_EditorSpatialGizmo_get_handle_value:
  74. - :ref:`Variant<class_variant>` **get_handle_value** **(** :ref:`int<class_int>` index **)** virtual
  75. Get actual value of a handle. This value can be anything and used for eventually undoing the motion when calling :ref:`commit_handle<class_EditorSpatialGizmo_commit_handle>`
  76. .. _class_EditorSpatialGizmo_redraw:
  77. - void **redraw** **(** **)** virtual
  78. This function is called when the Spatial this gizmo refers to changes (the :ref:`Spatial.update_gizmo<class_Spatial_update_gizmo>` is called).
  79. .. _class_EditorSpatialGizmo_set_handle:
  80. - void **set_handle** **(** :ref:`int<class_int>` index, :ref:`Camera<class_camera>` camera, :ref:`Vector2<class_vector2>` point **)** virtual
  81. This function is used when the user drags a gizmo handle (previously added with :ref:`add_handles<class_EditorSpatialGizmo_add_handles>`) in screen coordinates.
  82. The :ref:`Camera<class_camera>` is also provided so screen coordinates can be converted to raycasts.
  83. .. _class_EditorSpatialGizmo_set_spatial_node:
  84. - void **set_spatial_node** **(** :ref:`Node<class_node>` node **)**