XRInterfaceExtension
Inherits:XRInterface<RefCounted<Object
Base class for XR interface extensions (plugins).
Description
External XR interface plugins should inherit from this class.
Tutorials
Methods
_get_projection_for_view(view:int, aspect:float, z_near:float, z_far:float)virtual | |
_get_suggested_pose_names(tracker_name:StringName)virtualconst | |
_get_transform_for_view(view:int, cam_transform:Transform3D)virtual | |
_post_draw_viewport(render_target:RID, screen_rect:Rect2)virtual | |
_pre_draw_viewport(render_target:RID)virtual | |
_trigger_haptic_pulse(action_name:String, tracker_name:StringName, frequency:float, amplitude:float, duration_sec:float, delay_sec:float)virtual | |
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) | |
get_render_target_texture(render_target:RID) | |
Method Descriptions
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).
Returns the number of views this interface requires, 1 for mono, 2 for stereoscopic.
There is currently no description for this method. Please help us bycontributing one!
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.
Called if thisXRInterfaceExtension is active before rendering starts. Most XR interfaces will sync tracking at this point in time.
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.
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
.
There is currently no description for this method. Please help us bycontributing one!
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.
There is currently no description for this method. Please help us bycontributing one!