classref: Sync with latest 4.0-dev

This commit is contained in:
Rémi Verschelde
2021-11-15 12:28:38 +01:00
parent d6d97aaf5e
commit 30193215cf
829 changed files with 12891 additions and 7761 deletions

View File

@@ -1,6 +1,6 @@
:github_url: hide
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the XRInterface.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
@@ -30,34 +30,53 @@ Tutorials
Properties
----------
+-------------------------+--------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`ar_is_anchor_detection_enabled<class_XRInterface_property_ar_is_anchor_detection_enabled>` | ``false`` |
+-------------------------+--------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`interface_is_primary<class_XRInterface_property_interface_is_primary>` | ``false`` |
+-------------------------+--------------------------------------------------------------------------------------------------+-----------+
+----------------------------------------------------+--------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`ar_is_anchor_detection_enabled<class_XRInterface_property_ar_is_anchor_detection_enabled>` | ``false`` |
+----------------------------------------------------+--------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`interface_is_primary<class_XRInterface_property_interface_is_primary>` | ``false`` |
+----------------------------------------------------+--------------------------------------------------------------------------------------------------+-----------+
| :ref:`PlayAreaMode<enum_XRInterface_PlayAreaMode>` | :ref:`xr_play_area_mode<class_XRInterface_property_xr_play_area_mode>` | ``0`` |
+----------------------------------------------------+--------------------------------------------------------------------------------------------------+-----------+
Methods
-------
+--------------------------------------------------------+----------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_camera_feed_id<class_XRInterface_method_get_camera_feed_id>` **(** **)** |
+--------------------------------------------------------+----------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_capabilities<class_XRInterface_method_get_capabilities>` **(** **)** |const| |
+--------------------------------------------------------+----------------------------------------------------------------------------------------------+
| :ref:`StringName<class_StringName>` | :ref:`get_name<class_XRInterface_method_get_name>` **(** **)** |const| |
+--------------------------------------------------------+----------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_render_target_size<class_XRInterface_method_get_render_target_size>` **(** **)** |
+--------------------------------------------------------+----------------------------------------------------------------------------------------------+
| :ref:`TrackingStatus<enum_XRInterface_TrackingStatus>` | :ref:`get_tracking_status<class_XRInterface_method_get_tracking_status>` **(** **)** |const| |
+--------------------------------------------------------+----------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_view_count<class_XRInterface_method_get_view_count>` **(** **)** |
+--------------------------------------------------------+----------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`initialize<class_XRInterface_method_initialize>` **(** **)** |
+--------------------------------------------------------+----------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_initialized<class_XRInterface_method_is_initialized>` **(** **)** |const| |
+--------------------------------------------------------+----------------------------------------------------------------------------------------------+
| void | :ref:`uninitialize<class_XRInterface_method_uninitialize>` **(** **)** |
+--------------------------------------------------------+----------------------------------------------------------------------------------------------+
+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_camera_feed_id<class_XRInterface_method_get_camera_feed_id>` **(** **)** |
+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_capabilities<class_XRInterface_method_get_capabilities>` **(** **)** |const| |
+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`StringName<class_StringName>` | :ref:`get_name<class_XRInterface_method_get_name>` **(** **)** |const| |
+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedVector3Array<class_PackedVector3Array>` | :ref:`get_play_area<class_XRInterface_method_get_play_area>` **(** **)** |const| |
+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_render_target_size<class_XRInterface_method_get_render_target_size>` **(** **)** |
+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`TrackingStatus<enum_XRInterface_TrackingStatus>` | :ref:`get_tracking_status<class_XRInterface_method_get_tracking_status>` **(** **)** |const| |
+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_view_count<class_XRInterface_method_get_view_count>` **(** **)** |
+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`initialize<class_XRInterface_method_initialize>` **(** **)** |
+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_initialized<class_XRInterface_method_is_initialized>` **(** **)** |const| |
+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`set_play_area_mode<class_XRInterface_method_set_play_area_mode>` **(** :ref:`PlayAreaMode<enum_XRInterface_PlayAreaMode>` mode **)** |
+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`supports_play_area_mode<class_XRInterface_method_supports_play_area_mode>` **(** :ref:`PlayAreaMode<enum_XRInterface_PlayAreaMode>` mode **)** |
+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`trigger_haptic_pulse<class_XRInterface_method_trigger_haptic_pulse>` **(** :ref:`String<class_String>` action_name, :ref:`StringName<class_StringName>` tracker_name, :ref:`float<class_float>` frequency, :ref:`float<class_float>` amplitude, :ref:`float<class_float>` duration_sec, :ref:`float<class_float>` delay_sec **)** |
+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`uninitialize<class_XRInterface_method_uninitialize>` **(** **)** |
+--------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_XRInterface_signal_play_area_changed:
- **play_area_changed** **(** :ref:`int<class_int>` mode **)**
Emitted when the play area is changed. This can be a result of the player resetting the boundary or entering a new play area, the player changing the play area mode, the world scale changing or the player resetting their headset orientation.
Enumerations
------------
@@ -70,6 +89,10 @@ Enumerations
.. _class_XRInterface_constant_XR_STEREO:
.. _class_XRInterface_constant_XR_QUAD:
.. _class_XRInterface_constant_XR_VR:
.. _class_XRInterface_constant_XR_AR:
.. _class_XRInterface_constant_XR_EXTERNAL:
@@ -82,27 +105,13 @@ enum **Capabilities**:
- **XR_STEREO** = **2** --- This interface supports stereoscopic rendering.
- **XR_AR** = **4** --- This interface supports AR (video background and real world tracking).
- **XR_QUAD** = **4** --- This interface supports quad rendering (not yet supported by Godot).
- **XR_EXTERNAL** = **8** --- This interface outputs to an external device. If the main viewport is used, the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of :ref:`get_render_target_size<class_XRInterface_method_get_render_target_size>`). Using a separate viewport node frees up the main viewport for other purposes.
- **XR_VR** = **8** --- this interface supports VR.
----
- **XR_AR** = **16** --- This interface supports AR (video background and real world tracking).
.. _enum_XRInterface_Eyes:
.. _class_XRInterface_constant_EYE_MONO:
.. _class_XRInterface_constant_EYE_LEFT:
.. _class_XRInterface_constant_EYE_RIGHT:
enum **Eyes**:
- **EYE_MONO** = **0** --- Mono output, this is mostly used internally when retrieving positioning information for our camera node or when stereo scopic rendering is not supported.
- **EYE_LEFT** = **1** --- Left eye output, this is mostly used internally when rendering the image for the left eye and obtaining positioning and projection information.
- **EYE_RIGHT** = **2** --- Right eye output, this is mostly used internally when rendering the image for the right eye and obtaining positioning and projection information.
- **XR_EXTERNAL** = **32** --- This interface outputs to an external device. If the main viewport is used, the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of :ref:`get_render_target_size<class_XRInterface_method_get_render_target_size>`). Using a separate viewport node frees up the main viewport for other purposes.
----
@@ -130,6 +139,32 @@ enum **TrackingStatus**:
- **XR_NOT_TRACKING** = **4** --- Tracking is not functional (camera not plugged in or obscured, lighthouses turned off, etc.).
----
.. _enum_XRInterface_PlayAreaMode:
.. _class_XRInterface_constant_XR_PLAY_AREA_UNKNOWN:
.. _class_XRInterface_constant_XR_PLAY_AREA_3DOF:
.. _class_XRInterface_constant_XR_PLAY_AREA_SITTING:
.. _class_XRInterface_constant_XR_PLAY_AREA_ROOMSCALE:
.. _class_XRInterface_constant_XR_PLAY_AREA_STAGE:
enum **PlayAreaMode**:
- **XR_PLAY_AREA_UNKNOWN** = **0** --- Play area mode not set or not available.
- **XR_PLAY_AREA_3DOF** = **1** --- Play area only supports orientation tracking, no positional tracking, area will center around player.
- **XR_PLAY_AREA_SITTING** = **2** --- Player is in seated position, limited positional tracking, fixed guardian around player.
- **XR_PLAY_AREA_ROOMSCALE** = **3** --- Player is free to move around, full positional tracking.
- **XR_PLAY_AREA_STAGE** = **4** --- Same as roomscale but origin point is fixed to the center of the physical space, XRServer.center_on_hmd disabled.
Property Descriptions
---------------------
@@ -163,6 +198,22 @@ On an AR interface, ``true`` if anchor detection is enabled.
``true`` if this is the primary interface.
----
.. _class_XRInterface_property_xr_play_area_mode:
- :ref:`PlayAreaMode<enum_XRInterface_PlayAreaMode>` **xr_play_area_mode**
+-----------+---------------------------+
| *Default* | ``0`` |
+-----------+---------------------------+
| *Setter* | set_play_area_mode(value) |
+-----------+---------------------------+
| *Getter* | get_play_area_mode() |
+-----------+---------------------------+
The play area mode for this interface.
Method Descriptions
-------------------
@@ -190,6 +241,14 @@ Returns the name of this interface (OpenXR, OpenVR, OpenHMD, ARKit, etc).
----
.. _class_XRInterface_method_get_play_area:
- :ref:`PackedVector3Array<class_PackedVector3Array>` **get_play_area** **(** **)** |const|
Returns an array of vectors that denotes the physical play area mapped to the virtual space around the :ref:`XROrigin3D<class_XROrigin3D>` point. The points form a convex polygon that can be used to react to or visualise the play area. This returns an empty array if this feature is not supported or if the information is not yet available.
----
.. _class_XRInterface_method_get_render_target_size:
- :ref:`Vector2<class_Vector2>` **get_render_target_size** **(** **)**
@@ -238,6 +297,34 @@ Is ``true`` if this interface has been initialised.
----
.. _class_XRInterface_method_set_play_area_mode:
- :ref:`bool<class_bool>` **set_play_area_mode** **(** :ref:`PlayAreaMode<enum_XRInterface_PlayAreaMode>` mode **)**
Sets the active play area mode, will return ``false`` if the mode can't be used with this interface.
----
.. _class_XRInterface_method_supports_play_area_mode:
- :ref:`bool<class_bool>` **supports_play_area_mode** **(** :ref:`PlayAreaMode<enum_XRInterface_PlayAreaMode>` mode **)**
Call this to find out if a given play area mode is supported by this interface.
----
.. _class_XRInterface_method_trigger_haptic_pulse:
- void **trigger_haptic_pulse** **(** :ref:`String<class_String>` action_name, :ref:`StringName<class_StringName>` tracker_name, :ref:`float<class_float>` frequency, :ref:`float<class_float>` amplitude, :ref:`float<class_float>` duration_sec, :ref:`float<class_float>` delay_sec **)**
Triggers a haptic pulse on a device associated with this interface.
``action_name`` is the name of the action for this pulse.
``tracker_name`` is optional and can be used to direct the pulse to a specific device provided that device is bound to this haptic.
----
.. _class_XRInterface_method_uninitialize:
- void **uninitialize** **(** **)**