.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the ARVRAnchor.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.

.. _class_ARVRAnchor:

ARVRAnchor
==========

**Inherits:** :ref:`Spatial<class_spatial>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`

**Category:** Core

Brief Description
-----------------

Anchor point in AR Space

Member Functions
----------------

+--------------------------------+----------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>`          | :ref:`get_anchor_id<class_ARVRAnchor_get_anchor_id>`  **(** **)** const                            |
+--------------------------------+----------------------------------------------------------------------------------------------------+
| :ref:`String<class_string>`    | :ref:`get_anchor_name<class_ARVRAnchor_get_anchor_name>`  **(** **)** const                        |
+--------------------------------+----------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>`        | :ref:`get_is_active<class_ARVRAnchor_get_is_active>`  **(** **)** const                            |
+--------------------------------+----------------------------------------------------------------------------------------------------+
| :ref:`Plane<class_plane>`      | :ref:`get_plane<class_ARVRAnchor_get_plane>`  **(** **)** const                                    |
+--------------------------------+----------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_vector3>`  | :ref:`get_size<class_ARVRAnchor_get_size>`  **(** **)** const                                      |
+--------------------------------+----------------------------------------------------------------------------------------------------+
| void                           | :ref:`set_anchor_id<class_ARVRAnchor_set_anchor_id>`  **(** :ref:`int<class_int>` anchor_id  **)** |
+--------------------------------+----------------------------------------------------------------------------------------------------+

Member Variables
----------------

- :ref:`int<class_int>` **anchor_id**

Description
-----------

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.

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 recognised.

Keep in mind that as long as plane detection is enable the size, placing and orientation of an anchor will be updates as the detection logic learns more about the real world out there especially if only part of the surface is in view.

Member Function Description
---------------------------

.. _class_ARVRAnchor_get_anchor_id:

- :ref:`int<class_int>`  **get_anchor_id**  **(** **)** const

Returns the anchor id for this anchor.

.. _class_ARVRAnchor_get_anchor_name:

- :ref:`String<class_string>`  **get_anchor_name**  **(** **)** const

Returns the name given to this anchor.

.. _class_ARVRAnchor_get_is_active:

- :ref:`bool<class_bool>`  **get_is_active**  **(** **)** const

Returns true if the anchor is being tracked and false if no anchor with this id is currently known.

.. _class_ARVRAnchor_get_plane:

- :ref:`Plane<class_plane>`  **get_plane**  **(** **)** const

Returns a plane aligned with our anchor, handy for intersection testing

.. _class_ARVRAnchor_get_size:

- :ref:`Vector3<class_vector3>`  **get_size**  **(** **)** const

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.

.. _class_ARVRAnchor_set_anchor_id:

- void  **set_anchor_id**  **(** :ref:`int<class_int>` anchor_id  **)**

Binds this anchor node to an anchor with this id. You can set this before the anchor itself exists. The first anchor that is identified gets id 1, the second id 2, etc. When anchors get removed that slot remains free and can be assigned to the next anchor that is identified. The most common situation where anchors 'disappear' is when the AR server identifies that two anchors represent different parts of the same plane and merge them.


