2021-08-23 07:23:16 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 10:08:05 +02:00
<class name= "XRInterfaceExtension" inherits= "XRInterface" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2021-08-23 07:23:16 +02:00
<brief_description >
Base class for XR interface extensions (plugins).
</brief_description>
<description >
External XR interface plugins should inherit from this class.
</description>
<tutorials >
2023-08-15 12:14:01 +02:00
<link title= "XR documentation index" > $DOCS_URL/tutorials/xr/index.html</link>
2021-08-23 07:23:16 +02:00
</tutorials>
<methods >
2022-01-26 02:25:20 +01:00
<method name= "_end_frame" qualifiers= "virtual" >
2021-08-23 07:23:16 +02:00
<return type= "void" />
<description >
2022-01-26 02:25:20 +01:00
Called if interface is active and queues have been submitted.
2021-08-23 07:23:16 +02:00
</description>
</method>
<method name= "_get_anchor_detection_is_enabled" qualifiers= "virtual const" >
<return type= "bool" />
<description >
2022-01-26 02:25:20 +01:00
Return [code]true[/code] if anchor detection is enabled for this interface.
2021-08-23 07:23:16 +02:00
</description>
</method>
<method name= "_get_camera_feed_id" qualifiers= "virtual const" >
<return type= "int" />
<description >
2022-12-08 02:40:49 +01:00
Returns the camera feed ID for the [CameraFeed] registered with the [CameraServer] that should be presented as the background on an AR capable device (if applicable).
2021-08-23 07:23:16 +02:00
</description>
</method>
<method name= "_get_camera_transform" qualifiers= "virtual" >
<return type= "Transform3D" />
<description >
2022-01-26 02:25:20 +01:00
Returns the [Transform3D] that positions the [XRCamera3D] in the world.
2021-08-23 07:23:16 +02:00
</description>
</method>
<method name= "_get_capabilities" qualifiers= "virtual const" >
<return type= "int" />
<description >
2022-01-26 02:25:20 +01:00
Returns the capabilities of this interface.
2021-08-23 07:23:16 +02:00
</description>
</method>
2022-09-01 10:10:53 +02:00
<method name= "_get_color_texture" qualifiers= "virtual" >
<return type= "RID" />
<description >
Return color texture into which to render (if applicable).
</description>
</method>
<method name= "_get_depth_texture" qualifiers= "virtual" >
<return type= "RID" />
<description >
Return depth texture into which to render (if applicable).
</description>
</method>
2021-08-23 07:23:16 +02:00
<method name= "_get_name" qualifiers= "virtual const" >
<return type= "StringName" />
<description >
2022-01-26 02:25:20 +01:00
Returns the name of this interface.
2021-08-23 07:23:16 +02:00
</description>
</method>
2021-06-27 13:51:30 +02:00
<method name= "_get_play_area" qualifiers= "virtual const" >
<return type= "PackedVector3Array" />
<description >
2024-03-01 00:59:28 +01:00
Returns a [PackedVector3Array] that represents the play areas boundaries (if applicable).
2021-06-27 13:51:30 +02:00
</description>
</method>
<method name= "_get_play_area_mode" qualifiers= "virtual const" >
2023-01-15 20:33:20 +01:00
<return type= "int" enum= "XRInterface.PlayAreaMode" />
2021-06-27 13:51:30 +02:00
<description >
2023-11-09 10:16:30 +01:00
Returns the play area mode that sets up our play area.
2021-06-27 13:51:30 +02:00
</description>
</method>
2021-08-23 07:23:16 +02:00
<method name= "_get_projection_for_view" qualifiers= "virtual" >
<return type= "PackedFloat64Array" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "view" type= "int" />
<param index= "1" name= "aspect" type= "float" />
<param index= "2" name= "z_near" type= "float" />
<param index= "3" name= "z_far" type= "float" />
2021-08-23 07:23:16 +02:00
<description >
2022-01-26 02:25:20 +01:00
Returns the projection matrix for the given view as a [PackedFloat64Array].
2021-08-23 07:23:16 +02:00
</description>
</method>
<method name= "_get_render_target_size" qualifiers= "virtual" >
<return type= "Vector2" />
<description >
2022-01-26 02:25:20 +01:00
Returns the size of our render target for this interface, this overrides the size of the [Viewport] marked as the xr viewport.
2021-08-23 07:23:16 +02:00
</description>
</method>
2021-08-29 08:05:11 +02:00
<method name= "_get_suggested_pose_names" qualifiers= "virtual const" >
<return type= "PackedStringArray" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "tracker_name" type= "StringName" />
2021-08-29 08:05:11 +02:00
<description >
2022-01-26 02:25:20 +01:00
Returns a [PackedStringArray] with pose names configured by this interface. Note that user configuration can override this list.
2021-08-29 08:05:11 +02:00
</description>
</method>
<method name= "_get_suggested_tracker_names" qualifiers= "virtual const" >
<return type= "PackedStringArray" />
<description >
2022-01-26 02:25:20 +01:00
Returns a [PackedStringArray] with tracker names configured by this interface. Note that user configuration can override this list.
2021-08-29 08:05:11 +02:00
</description>
</method>
2023-03-13 02:26:10 +01:00
<method name= "_get_system_info" qualifiers= "virtual const" >
<return type= "Dictionary" />
<description >
2023-08-04 10:17:28 +02:00
Returns a [Dictionary] with system information related to this interface.
2023-03-13 02:26:10 +01:00
</description>
</method>
2021-08-23 07:23:16 +02:00
<method name= "_get_tracking_status" qualifiers= "virtual const" >
2023-01-15 20:33:20 +01:00
<return type= "int" enum= "XRInterface.TrackingStatus" />
2021-08-23 07:23:16 +02:00
<description >
2022-01-26 02:25:20 +01:00
Returns a [enum XRInterface.TrackingStatus] specifying the current status of our tracking.
2021-08-23 07:23:16 +02:00
</description>
</method>
<method name= "_get_transform_for_view" qualifiers= "virtual" >
<return type= "Transform3D" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "view" type= "int" />
<param index= "1" name= "cam_transform" type= "Transform3D" />
2021-08-23 07:23:16 +02:00
<description >
2022-01-26 02:25:20 +01:00
Returns a [Transform3D] for a given view.
2021-08-23 07:23:16 +02:00
</description>
</method>
2022-09-01 10:10:53 +02:00
<method name= "_get_velocity_texture" qualifiers= "virtual" >
<return type= "RID" />
<description >
Return velocity texture into which to render (if applicable).
</description>
</method>
2021-08-23 07:23:16 +02:00
<method name= "_get_view_count" qualifiers= "virtual" >
<return type= "int" />
<description >
2022-01-26 02:25:20 +01:00
Returns the number of views this interface requires, 1 for mono, 2 for stereoscopic.
2021-08-23 07:23:16 +02:00
</description>
</method>
2022-02-11 12:33:54 +01:00
<method name= "_get_vrs_texture" qualifiers= "virtual" >
<return type= "RID" />
<description >
</description>
</method>
2021-08-23 07:23:16 +02:00
<method name= "_initialize" qualifiers= "virtual" >
<return type= "bool" />
<description >
2022-01-26 02:25:20 +01:00
Initializes the interface, returns [code]true[/code] on success.
2021-08-23 07:23:16 +02:00
</description>
</method>
<method name= "_is_initialized" qualifiers= "virtual const" >
<return type= "bool" />
<description >
2022-11-01 15:29:38 +01:00
Returns [code]true[/code] if this interface has been initialized.
2021-08-23 07:23:16 +02:00
</description>
</method>
2022-01-26 02:25:20 +01:00
<method name= "_post_draw_viewport" qualifiers= "virtual" >
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "render_target" type= "RID" />
<param index= "1" name= "screen_rect" type= "Rect2" />
2022-01-26 02:25:20 +01:00
<description >
Called after the XR [Viewport] draw logic has completed.
</description>
</method>
<method name= "_pre_draw_viewport" qualifiers= "virtual" >
<return type= "bool" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "render_target" type= "RID" />
2022-01-26 02:25:20 +01:00
<description >
Called if this is our primary [XRInterfaceExtension] before we start processing a [Viewport] for every active XR [Viewport], returns [code]true[/code] if that viewport should be rendered. An XR interface may return [code]false[/code] if the user has taken off their headset and we can pause rendering.
</description>
</method>
<method name= "_pre_render" qualifiers= "virtual" >
<return type= "void" />
<description >
2023-04-18 13:53:47 +02:00
Called if this [XRInterfaceExtension] is active before rendering starts. Most XR interfaces will sync tracking at this point in time.
2021-08-23 07:23:16 +02:00
</description>
</method>
<method name= "_process" qualifiers= "virtual" >
<return type= "void" />
<description >
2023-04-18 13:53:47 +02:00
Called if this [XRInterfaceExtension] is active before our physics and game process is called. Most XR interfaces will update its [XRPositionalTracker]s at this point in time.
2021-08-23 07:23:16 +02:00
</description>
</method>
<method name= "_set_anchor_detection_is_enabled" qualifiers= "virtual" >
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "enabled" type= "bool" />
2021-08-23 07:23:16 +02:00
<description >
2022-01-26 02:25:20 +01:00
Enables anchor detection on this interface if supported.
2021-08-23 07:23:16 +02:00
</description>
</method>
2021-06-27 13:51:30 +02:00
<method name= "_set_play_area_mode" qualifiers= "virtual const" >
<return type= "bool" />
2023-01-15 20:33:20 +01:00
<param index= "0" name= "mode" type= "int" enum= "XRInterface.PlayAreaMode" />
2021-06-27 13:51:30 +02:00
<description >
2022-01-26 02:25:20 +01:00
Set the play area mode for this interface.
2021-06-27 13:51:30 +02:00
</description>
</method>
<method name= "_supports_play_area_mode" qualifiers= "virtual const" >
<return type= "bool" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "mode" type= "int" enum= "XRInterface.PlayAreaMode" />
2021-06-27 13:51:30 +02:00
<description >
2022-01-26 02:25:20 +01:00
Returns [code]true[/code] if this interface supports this play area mode.
2021-06-27 13:51:30 +02:00
</description>
</method>
2021-08-29 08:05:11 +02:00
<method name= "_trigger_haptic_pulse" qualifiers= "virtual" >
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "action_name" type= "String" />
<param index= "1" name= "tracker_name" type= "StringName" />
<param index= "2" name= "frequency" type= "float" />
<param index= "3" name= "amplitude" type= "float" />
<param index= "4" name= "duration_sec" type= "float" />
<param index= "5" name= "delay_sec" type= "float" />
2021-08-29 08:05:11 +02:00
<description >
2022-01-26 02:25:20 +01:00
Triggers a haptic pulse to be emitted on the specified tracker.
2021-08-29 08:05:11 +02:00
</description>
</method>
2021-08-23 07:23:16 +02:00
<method name= "_uninitialize" qualifiers= "virtual" >
<return type= "void" />
<description >
2022-01-26 02:25:20 +01:00
Uninitialize the interface.
2021-08-23 07:23:16 +02:00
</description>
</method>
<method name= "add_blit" >
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "render_target" type= "RID" />
<param index= "1" name= "src_rect" type= "Rect2" />
<param index= "2" name= "dst_rect" type= "Rect2i" />
<param index= "3" name= "use_layer" type= "bool" />
<param index= "4" name= "layer" type= "int" />
<param index= "5" name= "apply_lens_distortion" type= "bool" />
<param index= "6" name= "eye_center" type= "Vector2" />
<param index= "7" name= "k1" type= "float" />
<param index= "8" name= "k2" type= "float" />
<param index= "9" name= "upscale" type= "float" />
<param index= "10" name= "aspect_ratio" type= "float" />
2021-08-23 07:23:16 +02:00
<description >
Blits our render results to screen optionally applying lens distortion. This can only be called while processing [code]_commit_views[/code].
</description>
</method>
2022-09-01 10:10:53 +02:00
<method name= "get_color_texture" >
<return type= "RID" />
<description >
</description>
</method>
<method name= "get_depth_texture" >
<return type= "RID" />
<description >
</description>
</method>
2021-08-29 04:52:19 +02:00
<method name= "get_render_target_texture" >
<return type= "RID" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "render_target" type= "RID" />
2021-08-29 04:52:19 +02:00
<description >
2022-01-26 02:25:20 +01:00
Returns a valid [RID] for a texture to which we should render the current frame if supported by the interface.
2021-08-29 04:52:19 +02:00
</description>
</method>
2022-09-01 10:10:53 +02:00
<method name= "get_velocity_texture" >
<return type= "RID" />
<description >
</description>
</method>
2021-08-23 07:23:16 +02:00
</methods>
</class>