class_arvranchor.rst 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ARVRAnchor.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ARVRAnchor:
  6. ARVRAnchor
  7. ==========
  8. **Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Anchor point in AR Space.
  13. Properties
  14. ----------
  15. +-----------------------+-------------------------------------------------------+
  16. | :ref:`int<class_int>` | :ref:`anchor_id<class_ARVRAnchor_property_anchor_id>` |
  17. +-----------------------+-------------------------------------------------------+
  18. Methods
  19. -------
  20. +-------------------------------+-----------------------------------------------------------------------------------+
  21. | :ref:`String<class_String>` | :ref:`get_anchor_name<class_ARVRAnchor_method_get_anchor_name>` **(** **)** const |
  22. +-------------------------------+-----------------------------------------------------------------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`get_is_active<class_ARVRAnchor_method_get_is_active>` **(** **)** const |
  24. +-------------------------------+-----------------------------------------------------------------------------------+
  25. | :ref:`Plane<class_Plane>` | :ref:`get_plane<class_ARVRAnchor_method_get_plane>` **(** **)** const |
  26. +-------------------------------+-----------------------------------------------------------------------------------+
  27. | :ref:`Vector3<class_Vector3>` | :ref:`get_size<class_ARVRAnchor_method_get_size>` **(** **)** const |
  28. +-------------------------------+-----------------------------------------------------------------------------------+
  29. Description
  30. -----------
  31. The ARVR Anchor 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.
  32. 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 and the nodes will simply remain on 0,0,0 until a plane is recognized.
  33. 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.
  34. Property Descriptions
  35. ---------------------
  36. .. _class_ARVRAnchor_property_anchor_id:
  37. - :ref:`int<class_int>` **anchor_id**
  38. +----------+----------------------+
  39. | *Setter* | set_anchor_id(value) |
  40. +----------+----------------------+
  41. | *Getter* | get_anchor_id() |
  42. +----------+----------------------+
  43. 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.
  44. Method Descriptions
  45. -------------------
  46. .. _class_ARVRAnchor_method_get_anchor_name:
  47. - :ref:`String<class_String>` **get_anchor_name** **(** **)** const
  48. Returns the name given to this anchor.
  49. ----
  50. .. _class_ARVRAnchor_method_get_is_active:
  51. - :ref:`bool<class_bool>` **get_is_active** **(** **)** const
  52. Returns ``true`` if the anchor is being tracked and ``false`` if no anchor with this id is currently known.
  53. ----
  54. .. _class_ARVRAnchor_method_get_plane:
  55. - :ref:`Plane<class_Plane>` **get_plane** **(** **)** const
  56. Returns a plane aligned with our anchor; handy for intersection testing.
  57. ----
  58. .. _class_ARVRAnchor_method_get_size:
  59. - :ref:`Vector3<class_Vector3>` **get_size** **(** **)** const
  60. 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.