| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="XRInterfaceExtension" inherits="XRInterface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Base class for XR interface extensions (plugins). |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | External XR interface plugins should inherit from this class. |
| 8 | </description> |
| 9 | <tutorials> |
| 10 | <link title="XR documentation index">$DOCS_URL/tutorials/xr/index.html</link> |
| 11 | </tutorials> |
| 12 | <methods> |
| 13 | <method name="_end_frame" qualifiers="virtual"> |
| 14 | <return type="void" /> |
| 15 | <description> |
| 16 | Called if interface is active and queues have been submitted. |
| 17 | </description> |
| 18 | </method> |
| 19 | <method name="_get_anchor_detection_is_enabled" qualifiers="virtual const"> |
| 20 | <return type="bool" /> |
| 21 | <description> |
| 22 | Return [code]true[/code] if anchor detection is enabled for this interface. |
| 23 | </description> |
| 24 | </method> |
| 25 | <method name="_get_camera_feed_id" qualifiers="virtual const"> |
| 26 | <return type="int" /> |
| 27 | <description> |
| 28 | 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). |
| 29 | </description> |
| 30 | </method> |
| 31 | <method name="_get_camera_transform" qualifiers="virtual"> |
| 32 | <return type="Transform3D" /> |
| 33 | <description> |
| 34 | Returns the [Transform3D] that positions the [XRCamera3D] in the world. |
| 35 | </description> |
| 36 | </method> |
| 37 | <method name="_get_capabilities" qualifiers="virtual const"> |
| 38 | <return type="int" /> |
| 39 | <description> |
| 40 | Returns the capabilities of this interface. |
| 41 | </description> |
| 42 | </method> |
| 43 | <method name="_get_color_texture" qualifiers="virtual"> |
| 44 | <return type="RID" /> |
| 45 | <description> |
| 46 | Return color texture into which to render (if applicable). |
| 47 | </description> |
| 48 | </method> |
| 49 | <method name="_get_depth_texture" qualifiers="virtual"> |
| 50 | <return type="RID" /> |
| 51 | <description> |
| 52 | Return depth texture into which to render (if applicable). |
| 53 | </description> |
| 54 | </method> |
| 55 | <method name="_get_name" qualifiers="virtual const"> |
| 56 | <return type="StringName" /> |
| 57 | <description> |
| 58 | Returns the name of this interface. |
| 59 | </description> |
| 60 | </method> |
| 61 | <method name="_get_play_area" qualifiers="virtual const"> |
| 62 | <return type="PackedVector3Array" /> |
| 63 | <description> |
| 64 | Returns a [PackedVector3Array] that represents the play areas boundaries (if applicable). |
| 65 | </description> |
| 66 | </method> |
| 67 | <method name="_get_play_area_mode" qualifiers="virtual const"> |
| 68 | <return type="int" enum="XRInterface.PlayAreaMode" /> |
| 69 | <description> |
| 70 | Returns the play area mode that sets up our play area. |
| 71 | </description> |
| 72 | </method> |
| 73 | <method name="_get_projection_for_view" qualifiers="virtual"> |
| 74 | <return type="PackedFloat64Array" /> |
| 75 | <param index="0" name="view" type="int" /> |
| 76 | <param index="1" name="aspect" type="float" /> |
| 77 | <param index="2" name="z_near" type="float" /> |
| 78 | <param index="3" name="z_far" type="float" /> |
| 79 | <description> |
| 80 | Returns the projection matrix for the given view as a [PackedFloat64Array]. |
| 81 | </description> |
| 82 | </method> |
| 83 | <method name="_get_render_target_size" qualifiers="virtual"> |
| 84 | <return type="Vector2" /> |
| 85 | <description> |
| 86 | Returns the size of our render target for this interface, this overrides the size of the [Viewport] marked as the xr viewport. |
| 87 | </description> |
| 88 | </method> |
| 89 | <method name="_get_suggested_pose_names" qualifiers="virtual const"> |
| 90 | <return type="PackedStringArray" /> |
| 91 | <param index="0" name="tracker_name" type="StringName" /> |
| 92 | <description> |
| 93 | Returns a [PackedStringArray] with pose names configured by this interface. Note that user configuration can override this list. |
| 94 | </description> |
| 95 | </method> |
| 96 | <method name="_get_suggested_tracker_names" qualifiers="virtual const"> |
| 97 | <return type="PackedStringArray" /> |
| 98 | <description> |
| 99 | Returns a [PackedStringArray] with tracker names configured by this interface. Note that user configuration can override this list. |
| 100 | </description> |
| 101 | </method> |
| 102 | <method name="_get_system_info" qualifiers="virtual const"> |
| 103 | <return type="Dictionary" /> |
| 104 | <description> |
| 105 | Returns a [Dictionary] with system information related to this interface. |
| 106 | </description> |
| 107 | </method> |
| 108 | <method name="_get_tracking_status" qualifiers="virtual const"> |
| 109 | <return type="int" enum="XRInterface.TrackingStatus" /> |
| 110 | <description> |
| 111 | Returns the current status of our tracking. |
| 112 | </description> |
| 113 | </method> |
| 114 | <method name="_get_transform_for_view" qualifiers="virtual"> |
| 115 | <return type="Transform3D" /> |
| 116 | <param index="0" name="view" type="int" /> |
| 117 | <param index="1" name="cam_transform" type="Transform3D" /> |
| 118 | <description> |
| 119 | Returns a [Transform3D] for a given view. |
| 120 | </description> |
| 121 | </method> |
| 122 | <method name="_get_velocity_texture" qualifiers="virtual"> |
| 123 | <return type="RID" /> |
| 124 | <description> |
| 125 | Return velocity texture into which to render (if applicable). |
| 126 | </description> |
| 127 | </method> |
| 128 | <method name="_get_view_count" qualifiers="virtual"> |
| 129 | <return type="int" /> |
| 130 | <description> |
| 131 | Returns the number of views this interface requires, 1 for mono, 2 for stereoscopic. |
| 132 | </description> |
| 133 | </method> |
| 134 | <method name="_get_vrs_texture" qualifiers="virtual"> |
| 135 | <return type="RID" /> |
| 136 | <description> |
| 137 | </description> |
| 138 | </method> |
| 139 | <method name="_get_vrs_texture_format" qualifiers="virtual"> |
| 140 | <return type="int" enum="XRInterface.VRSTextureFormat" /> |
| 141 | <description> |
| 142 | Returns the format of the texture returned by [method _get_vrs_texture]. |
| 143 | </description> |
| 144 | </method> |
| 145 | <method name="_initialize" qualifiers="virtual"> |
| 146 | <return type="bool" /> |
| 147 | <description> |
| 148 | Initializes the interface, returns [code]true[/code] on success. |
| 149 | </description> |
| 150 | </method> |
| 151 | <method name="_is_initialized" qualifiers="virtual const"> |
| 152 | <return type="bool" /> |
| 153 | <description> |
| 154 | Returns [code]true[/code] if this interface has been initialized. |
| 155 | </description> |
| 156 | </method> |
| 157 | <method name="_post_draw_viewport" qualifiers="virtual"> |
| 158 | <return type="void" /> |
| 159 | <param index="0" name="render_target" type="RID" /> |
| 160 | <param index="1" name="screen_rect" type="Rect2" /> |
| 161 | <description> |
| 162 | Called after the XR [Viewport] draw logic has completed. |
| 163 | </description> |
| 164 | </method> |
| 165 | <method name="_pre_draw_viewport" qualifiers="virtual"> |
| 166 | <return type="bool" /> |
| 167 | <param index="0" name="render_target" type="RID" /> |
| 168 | <description> |
| 169 | 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. |
| 170 | </description> |
| 171 | </method> |
| 172 | <method name="_pre_render" qualifiers="virtual"> |
| 173 | <return type="void" /> |
| 174 | <description> |
| 175 | Called if this [XRInterfaceExtension] is active before rendering starts. Most XR interfaces will sync tracking at this point in time. |
| 176 | </description> |
| 177 | </method> |
| 178 | <method name="_process" qualifiers="virtual"> |
| 179 | <return type="void" /> |
| 180 | <description> |
| 181 | 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. |
| 182 | </description> |
| 183 | </method> |
| 184 | <method name="_set_anchor_detection_is_enabled" qualifiers="virtual"> |
| 185 | <return type="void" /> |
| 186 | <param index="0" name="enabled" type="bool" /> |
| 187 | <description> |
| 188 | Enables anchor detection on this interface if supported. |
| 189 | </description> |
| 190 | </method> |
| 191 | <method name="_set_play_area_mode" qualifiers="virtual const"> |
| 192 | <return type="bool" /> |
| 193 | <param index="0" name="mode" type="int" enum="XRInterface.PlayAreaMode" /> |
| 194 | <description> |
| 195 | Set the play area mode for this interface. |
| 196 | </description> |
| 197 | </method> |
| 198 | <method name="_supports_play_area_mode" qualifiers="virtual const"> |
| 199 | <return type="bool" /> |
| 200 | <param index="0" name="mode" type="int" enum="XRInterface.PlayAreaMode" /> |
| 201 | <description> |
| 202 | Returns [code]true[/code] if this interface supports this play area mode. |
| 203 | </description> |
| 204 | </method> |
| 205 | <method name="_trigger_haptic_pulse" qualifiers="virtual"> |
| 206 | <return type="void" /> |
| 207 | <param index="0" name="action_name" type="String" /> |
| 208 | <param index="1" name="tracker_name" type="StringName" /> |
| 209 | <param index="2" name="frequency" type="float" /> |
| 210 | <param index="3" name="amplitude" type="float" /> |
| 211 | <param index="4" name="duration_sec" type="float" /> |
| 212 | <param index="5" name="delay_sec" type="float" /> |
| 213 | <description> |
| 214 | Triggers a haptic pulse to be emitted on the specified tracker. |
| 215 | </description> |
| 216 | </method> |
| 217 | <method name="_uninitialize" qualifiers="virtual"> |
| 218 | <return type="void" /> |
| 219 | <description> |
| 220 | Uninitialize the interface. |
| 221 | </description> |
| 222 | </method> |
| 223 | <method name="add_blit"> |
| 224 | <return type="void" /> |
| 225 | <param index="0" name="render_target" type="RID" /> |
| 226 | <param index="1" name="src_rect" type="Rect2" /> |
| 227 | <param index="2" name="dst_rect" type="Rect2i" /> |
| 228 | <param index="3" name="use_layer" type="bool" /> |
| 229 | <param index="4" name="layer" type="int" /> |
| 230 | <param index="5" name="apply_lens_distortion" type="bool" /> |
| 231 | <param index="6" name="eye_center" type="Vector2" /> |
| 232 | <param index="7" name="k1" type="float" /> |
| 233 | <param index="8" name="k2" type="float" /> |
| 234 | <param index="9" name="upscale" type="float" /> |
| 235 | <param index="10" name="aspect_ratio" type="float" /> |
| 236 | <description> |
| 237 | Blits our render results to screen optionally applying lens distortion. This can only be called while processing [code]_commit_views[/code]. |
| 238 | </description> |
| 239 | </method> |
| 240 | <method name="get_color_texture"> |
| 241 | <return type="RID" /> |
| 242 | <description> |
| 243 | </description> |
| 244 | </method> |
| 245 | <method name="get_depth_texture"> |
| 246 | <return type="RID" /> |
| 247 | <description> |
| 248 | </description> |
| 249 | </method> |
| 250 | <method name="get_render_target_texture"> |
| 251 | <return type="RID" /> |
| 252 | <param index="0" name="render_target" type="RID" /> |
| 253 | <description> |
| 254 | Returns a valid [RID] for a texture to which we should render the current frame if supported by the interface. |
| 255 | </description> |
| 256 | </method> |
| 257 | <method name="get_velocity_texture"> |
| 258 | <return type="RID" /> |
| 259 | <description> |
| 260 | </description> |
| 261 | </method> |
| 262 | </methods> |
| 263 | </class> |