class_arvranchor.rst 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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/doc/classes/ARVRAnchor.xml.
  6. .. _class_ARVRAnchor:
  7. ARVRAnchor
  8. ==========
  9. **Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. An anchor point in AR space.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. The **ARVRAnchor** point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them.
  15. This node is mapped to one of the anchors through its unique ID. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the ID; the nodes will simply remain on 0,0,0 until a plane is recognized.
  16. Keep in mind that, as long as plane detection is enabled, the size, placing and orientation of an anchor will be updated as the detection logic learns more about the real world out there especially if only part of the surface is in view.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-----------------------+-------------------------------------------------------+-------+
  23. | :ref:`int<class_int>` | :ref:`anchor_id<class_ARVRAnchor_property_anchor_id>` | ``1`` |
  24. +-----------------------+-------------------------------------------------------+-------+
  25. .. rst-class:: classref-reftable-group
  26. Methods
  27. -------
  28. .. table::
  29. :widths: auto
  30. +-------------------------------+-------------------------------------------------------------------------------------+
  31. | :ref:`String<class_String>` | :ref:`get_anchor_name<class_ARVRAnchor_method_get_anchor_name>` **(** **)** |const| |
  32. +-------------------------------+-------------------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`get_is_active<class_ARVRAnchor_method_get_is_active>` **(** **)** |const| |
  34. +-------------------------------+-------------------------------------------------------------------------------------+
  35. | :ref:`Mesh<class_Mesh>` | :ref:`get_mesh<class_ARVRAnchor_method_get_mesh>` **(** **)** |const| |
  36. +-------------------------------+-------------------------------------------------------------------------------------+
  37. | :ref:`Plane<class_Plane>` | :ref:`get_plane<class_ARVRAnchor_method_get_plane>` **(** **)** |const| |
  38. +-------------------------------+-------------------------------------------------------------------------------------+
  39. | :ref:`Vector3<class_Vector3>` | :ref:`get_size<class_ARVRAnchor_method_get_size>` **(** **)** |const| |
  40. +-------------------------------+-------------------------------------------------------------------------------------+
  41. .. rst-class:: classref-section-separator
  42. ----
  43. .. rst-class:: classref-descriptions-group
  44. Signals
  45. -------
  46. .. _class_ARVRAnchor_signal_mesh_updated:
  47. .. rst-class:: classref-signal
  48. **mesh_updated** **(** :ref:`Mesh<class_Mesh>` mesh **)**
  49. Emitted when the mesh associated with the anchor changes or when one becomes available. This is especially important for topology that is constantly being ``mesh_updated``.
  50. .. rst-class:: classref-section-separator
  51. ----
  52. .. rst-class:: classref-descriptions-group
  53. Property Descriptions
  54. ---------------------
  55. .. _class_ARVRAnchor_property_anchor_id:
  56. .. rst-class:: classref-property
  57. :ref:`int<class_int>` **anchor_id** = ``1``
  58. .. rst-class:: classref-property-setget
  59. - void **set_anchor_id** **(** :ref:`int<class_int>` value **)**
  60. - :ref:`int<class_int>` **get_anchor_id** **(** **)**
  61. The anchor's ID. You can set this before the anchor itself exists. The first anchor gets an ID of ``1``, the second an ID of ``2``, etc. When anchors get removed, the engine can then assign the corresponding ID to new anchors. The most common situation where anchors "disappear" is when the AR server identifies that two anchors represent different parts of the same plane and merges them.
  62. .. rst-class:: classref-section-separator
  63. ----
  64. .. rst-class:: classref-descriptions-group
  65. Method Descriptions
  66. -------------------
  67. .. _class_ARVRAnchor_method_get_anchor_name:
  68. .. rst-class:: classref-method
  69. :ref:`String<class_String>` **get_anchor_name** **(** **)** |const|
  70. Returns the name given to this anchor.
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_ARVRAnchor_method_get_is_active:
  74. .. rst-class:: classref-method
  75. :ref:`bool<class_bool>` **get_is_active** **(** **)** |const|
  76. Returns ``true`` if the anchor is being tracked and ``false`` if no anchor with this ID is currently known.
  77. .. rst-class:: classref-item-separator
  78. ----
  79. .. _class_ARVRAnchor_method_get_mesh:
  80. .. rst-class:: classref-method
  81. :ref:`Mesh<class_Mesh>` **get_mesh** **(** **)** |const|
  82. If provided by the :ref:`ARVRInterface<class_ARVRInterface>`, this returns a mesh object for the anchor. For an anchor, this can be a shape related to the object being tracked or it can be a mesh that provides topology related to the anchor and can be used to create shadows/reflections on surfaces or for generating collision shapes.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_ARVRAnchor_method_get_plane:
  86. .. rst-class:: classref-method
  87. :ref:`Plane<class_Plane>` **get_plane** **(** **)** |const|
  88. Returns a plane aligned with our anchor; handy for intersection testing.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_ARVRAnchor_method_get_size:
  92. .. rst-class:: classref-method
  93. :ref:`Vector3<class_Vector3>` **get_size** **(** **)** |const|
  94. Returns the estimated size of the plane that was detected. Say when the anchor relates to a table in the real world, this is the estimated size of the surface of that table.
  95. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  96. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  97. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  98. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`