XRInterfaceExtension

Inherits:XRInterface<RefCounted<Object

Base class for XR interface extensions (plugins).

Description

External XR interface plugins should inherit from this class.

Tutorials

Methods

void

_end_frame()virtual

bool

_get_anchor_detection_is_enabled()virtualconst

int

_get_camera_feed_id()virtualconst

Transform3D

_get_camera_transform()virtual

int

_get_capabilities()virtualconst

RID

_get_color_texture()virtual

RID

_get_depth_texture()virtual

StringName

_get_name()virtualconst

PackedVector3Array

_get_play_area()virtualconst

PlayAreaMode

_get_play_area_mode()virtualconst

PackedFloat64Array

_get_projection_for_view(view:int, aspect:float, z_near:float, z_far:float)virtual

Vector2

_get_render_target_size()virtual

PackedStringArray

_get_suggested_pose_names(tracker_name:StringName)virtualconst

PackedStringArray

_get_suggested_tracker_names()virtualconst

Dictionary

_get_system_info()virtualconst

TrackingStatus

_get_tracking_status()virtualconst

Transform3D

_get_transform_for_view(view:int, cam_transform:Transform3D)virtual

RID

_get_velocity_texture()virtual

int

_get_view_count()virtual

RID

_get_vrs_texture()virtual

bool

_initialize()virtual

bool

_is_initialized()virtualconst

void

_post_draw_viewport(render_target:RID, screen_rect:Rect2)virtual

bool

_pre_draw_viewport(render_target:RID)virtual

void

_pre_render()virtual

void

_process()virtual

void

_set_anchor_detection_is_enabled(enabled:bool)virtual

bool

_set_play_area_mode(mode:PlayAreaMode)virtualconst

bool

_supports_play_area_mode(mode:PlayAreaMode)virtualconst

void

_trigger_haptic_pulse(action_name:String, tracker_name:StringName, frequency:float, amplitude:float, duration_sec:float, delay_sec:float)virtual

void

_uninitialize()virtual

void

add_blit(render_target:RID, src_rect:Rect2, dst_rect:Rect2i, use_layer:bool, layer:int, apply_lens_distortion:bool, eye_center:Vector2, k1:float, k2:float, upscale:float, aspect_ratio:float)

RID

get_color_texture()

RID

get_depth_texture()

RID

get_render_target_texture(render_target:RID)

RID

get_velocity_texture()


Method Descriptions

void_end_frame()virtual🔗

Called if interface is active and queues have been submitted.


bool_get_anchor_detection_is_enabled()virtualconst🔗

Returntrue if anchor detection is enabled for this interface.


int_get_camera_feed_id()virtualconst🔗

Returns the camera feed ID for theCameraFeed registered with theCameraServer that should be presented as the background on an AR capable device (if applicable).


Transform3D_get_camera_transform()virtual🔗

Returns theTransform3D that positions theXRCamera3D in the world.


int_get_capabilities()virtualconst🔗

Returns the capabilities of this interface.


RID_get_color_texture()virtual🔗

Return color texture into which to render (if applicable).


RID_get_depth_texture()virtual🔗

Return depth texture into which to render (if applicable).


StringName_get_name()virtualconst🔗

Returns the name of this interface.


PackedVector3Array_get_play_area()virtualconst🔗

Returns aPackedVector3Array that represents the play areas boundaries (if applicable).


PlayAreaMode_get_play_area_mode()virtualconst🔗

Returns the play area mode that sets up our play area.


PackedFloat64Array_get_projection_for_view(view:int, aspect:float, z_near:float, z_far:float)virtual🔗

Returns the projection matrix for the given view as aPackedFloat64Array.


Vector2_get_render_target_size()virtual🔗

Returns the size of our render target for this interface, this overrides the size of theViewport marked as the xr viewport.


PackedStringArray_get_suggested_pose_names(tracker_name:StringName)virtualconst🔗

Returns aPackedStringArray with pose names configured by this interface. Note that user configuration can override this list.


PackedStringArray_get_suggested_tracker_names()virtualconst🔗

Returns aPackedStringArray with tracker names configured by this interface. Note that user configuration can override this list.


Dictionary_get_system_info()virtualconst🔗

Returns aDictionary with system information related to this interface.


TrackingStatus_get_tracking_status()virtualconst🔗

Returns aTrackingStatus specifying the current status of our tracking.


Transform3D_get_transform_for_view(view:int, cam_transform:Transform3D)virtual🔗

Returns aTransform3D for a given view.


RID_get_velocity_texture()virtual🔗

Return velocity texture into which to render (if applicable).


int_get_view_count()virtual🔗

Returns the number of views this interface requires, 1 for mono, 2 for stereoscopic.


RID_get_vrs_texture()virtual🔗

There is currently no description for this method. Please help us bycontributing one!


bool_initialize()virtual🔗

Initializes the interface, returnstrue on success.


bool_is_initialized()virtualconst🔗

Returnstrue if this interface has been initialized.


void_post_draw_viewport(render_target:RID, screen_rect:Rect2)virtual🔗

Called after the XRViewport draw logic has completed.


bool_pre_draw_viewport(render_target:RID)virtual🔗

Called if this is our primaryXRInterfaceExtension before we start processing aViewport for every active XRViewport, returnstrue if that viewport should be rendered. An XR interface may returnfalse if the user has taken off their headset and we can pause rendering.


void_pre_render()virtual🔗

Called if thisXRInterfaceExtension is active before rendering starts. Most XR interfaces will sync tracking at this point in time.


void_process()virtual🔗

Called if thisXRInterfaceExtension is active before our physics and game process is called. Most XR interfaces will update itsXRPositionalTrackers at this point in time.


void_set_anchor_detection_is_enabled(enabled:bool)virtual🔗

Enables anchor detection on this interface if supported.


bool_set_play_area_mode(mode:PlayAreaMode)virtualconst🔗

Set the play area mode for this interface.


bool_supports_play_area_mode(mode:PlayAreaMode)virtualconst🔗

Returnstrue if this interface supports this play area mode.


void_trigger_haptic_pulse(action_name:String, tracker_name:StringName, frequency:float, amplitude:float, duration_sec:float, delay_sec:float)virtual🔗

Triggers a haptic pulse to be emitted on the specified tracker.


void_uninitialize()virtual🔗

Uninitialize the interface.


voidadd_blit(render_target:RID, src_rect:Rect2, dst_rect:Rect2i, use_layer:bool, layer:int, apply_lens_distortion:bool, eye_center:Vector2, k1:float, k2:float, upscale:float, aspect_ratio:float)🔗

Blits our render results to screen optionally applying lens distortion. This can only be called while processing_commit_views.


RIDget_color_texture()🔗

There is currently no description for this method. Please help us bycontributing one!


RIDget_depth_texture()🔗

There is currently no description for this method. Please help us bycontributing one!


RIDget_render_target_texture(render_target:RID)🔗

Returns a validRID for a texture to which we should render the current frame if supported by the interface.


RIDget_velocity_texture()🔗

There is currently no description for this method. Please help us bycontributing one!


User-contributed notes

Please read theUser-contributed notes policy before submitting a comment.