:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/../../GodotApplePlugins/doc_classes/ARRaycastQuery.xml. .. _class_ARRaycastQuery: ARRaycastQuery ============== **Inherits:** :ref:`RefCounted` **<** :ref:`Object` Defines a raycast query against detected AR surfaces. .. rst-class:: classref-introduction-group Description ----------- Describes the origin, direction, target surface type, and alignment for a raycast. **iOS only.** On visionOS and macOS, this type exists for API consistency but raycasting is not available through ARKit. On visionOS, use RealityKit scene queries (CollisionComponent) for spatial hit-testing instead. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------------+-------------------------------------------------------------------------+----------------------+ | :ref:`Vector3` | :ref:`direction` | ``Vector3(0, 0, 0)`` | +-------------------------------+-------------------------------------------------------------------------+----------------------+ | :ref:`Vector3` | :ref:`origin` | ``Vector3(0, 0, 0)`` | +-------------------------------+-------------------------------------------------------------------------+----------------------+ | :ref:`int` | :ref:`target` | ``1`` | +-------------------------------+-------------------------------------------------------------------------+----------------------+ | :ref:`int` | :ref:`target_alignment` | ``2`` | +-------------------------------+-------------------------------------------------------------------------+----------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ARRaycastQuery` | :ref:`create`\ (\ origin\: :ref:`Vector3`, direction\: :ref:`Vector3`, target\: :ref:`Target`, targetAlignment\: :ref:`TargetAlignment`\ ) |static| | +---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_ARRaycastQuery_Target: .. rst-class:: classref-enumeration enum **Target**: :ref:`🔗` .. _class_ARRaycastQuery_constant_EXISTING_PLANE_GEOMETRY: .. rst-class:: classref-enumeration-constant :ref:`Target` **EXISTING_PLANE_GEOMETRY** = ``1`` Match against the actual geometry of detected planes. .. _class_ARRaycastQuery_constant_EXISTING_PLANE_INFINITE: .. rst-class:: classref-enumeration-constant :ref:`Target` **EXISTING_PLANE_INFINITE** = ``2`` Match against infinite extensions of detected planes. .. _class_ARRaycastQuery_constant_ESTIMATED_PLANE: .. rst-class:: classref-enumeration-constant :ref:`Target` **ESTIMATED_PLANE** = ``3`` Match against estimated planes inferred from feature points. .. rst-class:: classref-item-separator ---- .. _enum_ARRaycastQuery_TargetAlignment: .. rst-class:: classref-enumeration enum **TargetAlignment**: :ref:`🔗` .. _class_ARRaycastQuery_constant_HORIZONTAL: .. rst-class:: classref-enumeration-constant :ref:`TargetAlignment` **HORIZONTAL** = ``0`` Restrict matches to horizontal surfaces. .. _class_ARRaycastQuery_constant_VERTICAL: .. rst-class:: classref-enumeration-constant :ref:`TargetAlignment` **VERTICAL** = ``1`` Restrict matches to vertical surfaces. .. _class_ARRaycastQuery_constant_ANY: .. rst-class:: classref-enumeration-constant :ref:`TargetAlignment` **ANY** = ``2`` Allow matches on surfaces of any supported alignment. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_ARRaycastQuery_property_direction: .. rst-class:: classref-property :ref:`Vector3` **direction** = ``Vector3(0, 0, 0)`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_direction**\ (\ value\: :ref:`Vector3`\ ) - :ref:`Vector3` **get_direction**\ (\ ) The ray direction in world space. .. rst-class:: classref-item-separator ---- .. _class_ARRaycastQuery_property_origin: .. rst-class:: classref-property :ref:`Vector3` **origin** = ``Vector3(0, 0, 0)`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_origin**\ (\ value\: :ref:`Vector3`\ ) - :ref:`Vector3` **get_origin**\ (\ ) The ray origin in world space. .. rst-class:: classref-item-separator ---- .. _class_ARRaycastQuery_property_target: .. rst-class:: classref-property :ref:`int` **target** = ``1`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_target**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_target**\ (\ ) The type of surface the raycast should test against. See :ref:`Target`. .. rst-class:: classref-item-separator ---- .. _class_ARRaycastQuery_property_target_alignment: .. rst-class:: classref-property :ref:`int` **target_alignment** = ``2`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_target_alignment**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_target_alignment**\ (\ ) The alignment constraint applied to matches. See :ref:`TargetAlignment`. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_ARRaycastQuery_method_create: .. rst-class:: classref-method :ref:`ARRaycastQuery` **create**\ (\ origin\: :ref:`Vector3`, direction\: :ref:`Vector3`, target\: :ref:`Target`, targetAlignment\: :ref:`TargetAlignment`\ ) |static| :ref:`🔗` Creates a raycast query from ``origin`` along ``direction``, using the requested target type and alignment. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`