123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- :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/modules/openxr/doc_classes/OpenXRCompositionLayer.xml.
- .. _class_OpenXRCompositionLayer:
- OpenXRCompositionLayer
- ======================
- **Experimental:** This class may be changed or removed in future versions.
- **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- **Inherited By:** :ref:`OpenXRCompositionLayerCylinder<class_OpenXRCompositionLayerCylinder>`, :ref:`OpenXRCompositionLayerEquirect<class_OpenXRCompositionLayerEquirect>`, :ref:`OpenXRCompositionLayerQuad<class_OpenXRCompositionLayerQuad>`
- The parent class of all OpenXR composition layer nodes.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- Composition layers allow 2D viewports to be displayed inside of the headset by the XR compositor through special projections that retain their quality. This allows for rendering clear text while keeping the layer at a native resolution.
- \ **Note:** If the OpenXR runtime doesn't support the given composition layer type, a fallback mesh can be generated with a :ref:`ViewportTexture<class_ViewportTexture>`, in order to emulate the composition layer.
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +---------------------------------------+-----------------------------------------------------------------------------------------+--------------------------+
- | :ref:`bool<class_bool>` | :ref:`alpha_blend<class_OpenXRCompositionLayer_property_alpha_blend>` | ``false`` |
- +---------------------------------------+-----------------------------------------------------------------------------------------+--------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`android_surface_size<class_OpenXRCompositionLayer_property_android_surface_size>` | ``Vector2i(1024, 1024)`` |
- +---------------------------------------+-----------------------------------------------------------------------------------------+--------------------------+
- | :ref:`bool<class_bool>` | :ref:`enable_hole_punch<class_OpenXRCompositionLayer_property_enable_hole_punch>` | ``false`` |
- +---------------------------------------+-----------------------------------------------------------------------------------------+--------------------------+
- | :ref:`SubViewport<class_SubViewport>` | :ref:`layer_viewport<class_OpenXRCompositionLayer_property_layer_viewport>` | |
- +---------------------------------------+-----------------------------------------------------------------------------------------+--------------------------+
- | :ref:`int<class_int>` | :ref:`sort_order<class_OpenXRCompositionLayer_property_sort_order>` | ``1`` |
- +---------------------------------------+-----------------------------------------------------------------------------------------+--------------------------+
- | :ref:`bool<class_bool>` | :ref:`use_android_surface<class_OpenXRCompositionLayer_property_use_android_surface>` | ``false`` |
- +---------------------------------------+-----------------------------------------------------------------------------------------+--------------------------+
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`JavaObject<class_JavaObject>` | :ref:`get_android_surface<class_OpenXRCompositionLayer_method_get_android_surface>`\ (\ ) |
- +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2<class_Vector2>` | :ref:`intersects_ray<class_OpenXRCompositionLayer_method_intersects_ray>`\ (\ origin\: :ref:`Vector3<class_Vector3>`, direction\: :ref:`Vector3<class_Vector3>`\ ) |const| |
- +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_natively_supported<class_OpenXRCompositionLayer_method_is_natively_supported>`\ (\ ) |const| |
- +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_OpenXRCompositionLayer_property_alpha_blend:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **alpha_blend** = ``false`` :ref:`🔗<class_OpenXRCompositionLayer_property_alpha_blend>`
- .. rst-class:: classref-property-setget
- - |void| **set_alpha_blend**\ (\ value\: :ref:`bool<class_bool>`\ )
- - :ref:`bool<class_bool>` **get_alpha_blend**\ (\ )
- Enables the blending the layer using its alpha channel.
- Can be combined with :ref:`Viewport.transparent_bg<class_Viewport_property_transparent_bg>` to give the layer a transparent background.
- .. rst-class:: classref-item-separator
- ----
- .. _class_OpenXRCompositionLayer_property_android_surface_size:
- .. rst-class:: classref-property
- :ref:`Vector2i<class_Vector2i>` **android_surface_size** = ``Vector2i(1024, 1024)`` :ref:`🔗<class_OpenXRCompositionLayer_property_android_surface_size>`
- .. rst-class:: classref-property-setget
- - |void| **set_android_surface_size**\ (\ value\: :ref:`Vector2i<class_Vector2i>`\ )
- - :ref:`Vector2i<class_Vector2i>` **get_android_surface_size**\ (\ )
- The size of the Android surface to create if :ref:`use_android_surface<class_OpenXRCompositionLayer_property_use_android_surface>` is enabled.
- .. rst-class:: classref-item-separator
- ----
- .. _class_OpenXRCompositionLayer_property_enable_hole_punch:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **enable_hole_punch** = ``false`` :ref:`🔗<class_OpenXRCompositionLayer_property_enable_hole_punch>`
- .. rst-class:: classref-property-setget
- - |void| **set_enable_hole_punch**\ (\ value\: :ref:`bool<class_bool>`\ )
- - :ref:`bool<class_bool>` **get_enable_hole_punch**\ (\ )
- Enables a technique called "hole punching", which allows putting the composition layer behind the main projection layer (i.e. setting :ref:`sort_order<class_OpenXRCompositionLayer_property_sort_order>` to a negative value) while "punching a hole" through everything rendered by Godot so that the layer is still visible.
- This can be used to create the illusion that the composition layer exists in the same 3D space as everything rendered by Godot, allowing objects to appear to pass both behind or in front of the composition layer.
- .. rst-class:: classref-item-separator
- ----
- .. _class_OpenXRCompositionLayer_property_layer_viewport:
- .. rst-class:: classref-property
- :ref:`SubViewport<class_SubViewport>` **layer_viewport** :ref:`🔗<class_OpenXRCompositionLayer_property_layer_viewport>`
- .. rst-class:: classref-property-setget
- - |void| **set_layer_viewport**\ (\ value\: :ref:`SubViewport<class_SubViewport>`\ )
- - :ref:`SubViewport<class_SubViewport>` **get_layer_viewport**\ (\ )
- The :ref:`SubViewport<class_SubViewport>` to render on the composition layer.
- .. rst-class:: classref-item-separator
- ----
- .. _class_OpenXRCompositionLayer_property_sort_order:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **sort_order** = ``1`` :ref:`🔗<class_OpenXRCompositionLayer_property_sort_order>`
- .. rst-class:: classref-property-setget
- - |void| **set_sort_order**\ (\ value\: :ref:`int<class_int>`\ )
- - :ref:`int<class_int>` **get_sort_order**\ (\ )
- The sort order for this composition layer. Higher numbers will be shown in front of lower numbers.
- \ **Note:** This will have no effect if a fallback mesh is being used.
- .. rst-class:: classref-item-separator
- ----
- .. _class_OpenXRCompositionLayer_property_use_android_surface:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **use_android_surface** = ``false`` :ref:`🔗<class_OpenXRCompositionLayer_property_use_android_surface>`
- .. rst-class:: classref-property-setget
- - |void| **set_use_android_surface**\ (\ value\: :ref:`bool<class_bool>`\ )
- - :ref:`bool<class_bool>` **get_use_android_surface**\ (\ )
- If enabled, an Android surface will be created (with the dimensions from :ref:`android_surface_size<class_OpenXRCompositionLayer_property_android_surface_size>`) which will provide the 2D content for the composition layer, rather than using :ref:`layer_viewport<class_OpenXRCompositionLayer_property_layer_viewport>`.
- See :ref:`get_android_surface<class_OpenXRCompositionLayer_method_get_android_surface>` for information about how to get the surface so that your application can draw to it.
- \ **Note:** This will only work in Android builds.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_OpenXRCompositionLayer_method_get_android_surface:
- .. rst-class:: classref-method
- :ref:`JavaObject<class_JavaObject>` **get_android_surface**\ (\ ) :ref:`🔗<class_OpenXRCompositionLayer_method_get_android_surface>`
- Returns a :ref:`JavaObject<class_JavaObject>` representing an ``android.view.Surface`` if :ref:`use_android_surface<class_OpenXRCompositionLayer_property_use_android_surface>` is enabled and OpenXR has created the surface. Otherwise, this will return ``null``.
- \ **Note:** The surface can only be created during an active OpenXR session. So, if :ref:`use_android_surface<class_OpenXRCompositionLayer_property_use_android_surface>` is enabled outside of an OpenXR session, it won't be created until a new session fully starts.
- .. rst-class:: classref-item-separator
- ----
- .. _class_OpenXRCompositionLayer_method_intersects_ray:
- .. rst-class:: classref-method
- :ref:`Vector2<class_Vector2>` **intersects_ray**\ (\ origin\: :ref:`Vector3<class_Vector3>`, direction\: :ref:`Vector3<class_Vector3>`\ ) |const| :ref:`🔗<class_OpenXRCompositionLayer_method_intersects_ray>`
- Returns UV coordinates where the given ray intersects with the composition layer. ``origin`` and ``direction`` must be in global space.
- Returns ``Vector2(-1.0, -1.0)`` if the ray doesn't intersect.
- .. rst-class:: classref-item-separator
- ----
- .. _class_OpenXRCompositionLayer_method_is_natively_supported:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_natively_supported**\ (\ ) |const| :ref:`🔗<class_OpenXRCompositionLayer_method_is_natively_supported>`
- Returns ``true`` if the OpenXR runtime natively supports this composition layer type.
- \ **Note:** This will only return an accurate result after the OpenXR session has started.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |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.)`
|