Index · Object → RefCounted → XRInterface → XRInterfaceExtension

XRInterfaceExtension

Base class for XR interface extensions (plugins).

Class Description

External XR interface plugins should inherit from this class.

Properties

Inherited from XRInterface (4)

Methods

func _end_frame() -> void

Called if interface is active and queues have been submitted.

func _get_anchor_detection_is_enabled() -> bool

Return true if anchor detection is enabled for this interface.

func _get_camera_feed_id() -> int

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).

func _get_camera_transform() -> Transform3D

Returns the Transform3D that positions the XRCamera3D in the world.

func _get_capabilities() -> int

Returns the capabilities of this interface.

func _get_color_texture() -> RID

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

func _get_depth_texture() -> RID

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

func _get_name() -> StringName

Returns the name of this interface.

func _get_play_area() -> PackedVector3Array

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

func _get_play_area_mode() -> XRInterface.PlayAreaMode

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

func _get_projection_for_view(view: int, aspect: float, z_near: float, z_far: float) -> PackedFloat64Array

Returns the projection matrix for the given view as a PackedFloat64Array.

func _get_render_target_size() -> Vector2

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

func _get_suggested_pose_names(tracker_name: StringName) -> PackedStringArray

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

func _get_suggested_tracker_names() -> PackedStringArray

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

func _get_system_info() -> Dictionary

Returns a Dictionary with system information related to this interface.

func _get_tracking_status() -> XRInterface.TrackingStatus

Returns the current status of our tracking.

func _get_transform_for_view(view: int, cam_transform: Transform3D) -> Transform3D

Returns a Transform3D for a given view.

func _get_velocity_texture() -> RID

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

func _get_view_count() -> int

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

func _get_vrs_texture() -> RID
func _get_vrs_texture_format() -> XRInterface.VRSTextureFormat

Returns the format of the texture returned by _get_vrs_texture().

func _initialize() -> bool

Initializes the interface, returns true on success.

func _is_initialized() -> bool

Returns true if this interface has been initialized.

func _post_draw_viewport(render_target: RID, screen_rect: Rect2) -> void

Called after the XR Viewport draw logic has completed.

func _pre_draw_viewport(render_target: RID) -> bool

Called if this is our primary XRInterfaceExtension before we start processing a Viewport for every active XR Viewport, returns true if that viewport should be rendered. An XR interface may return false if the user has taken off their headset and we can pause rendering.

func _pre_render() -> void

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

func _process() -> void

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

func _set_anchor_detection_is_enabled(enabled: bool) -> void

Enables anchor detection on this interface if supported.

func _set_play_area_mode(mode: XRInterface.PlayAreaMode) -> bool

Set the play area mode for this interface.

func _supports_play_area_mode(mode: XRInterface.PlayAreaMode) -> bool

Returns true if this interface supports this play area mode.

func _trigger_haptic_pulse(action_name: String, tracker_name: StringName, frequency: float, amplitude: float, duration_sec: float, delay_sec: float) -> void

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

func _uninitialize() -> void

Uninitialize the interface.

func 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) -> void

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

func get_color_texture() -> RID
func get_depth_texture() -> RID
func get_render_target_texture(render_target: RID) -> RID

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

func get_velocity_texture() -> RID
Inherited from XRInterface (22)
func get_projection_for_view(view: int, aspect: float, near: float, far: float) -> Projection
func get_transform_for_view(view: int, cam_transform: Transform3D) -> Transform3D
func initialize() -> bool
func stop_passthrough() -> void
func trigger_haptic_pulse(action_name: String, tracker_name: StringName, frequency: float, amplitude: float, duration_sec: float, delay_sec: float) -> void
func uninitialize() -> void
Inherited from RefCounted (4)
func init_ref() -> bool
func reference() -> bool
func unreference() -> bool
Inherited from Object (62)
func _get(property: StringName) -> Variant
func _get_property_list() -> Dictionary[]
func _init() -> void
func _iter_get(iter: Variant) -> Variant
func _iter_init(iter: Array) -> bool
func _iter_next(iter: Array) -> bool
func _notification(what: int) -> void
func _set(property: StringName, value: Variant) -> bool
func _to_string() -> String
func _validate_property(property: Dictionary) -> void
func add_user_signal(signal: String, arguments: Array = []) -> void
func call(method: StringName) -> Variant
func callv(method: StringName, arg_array: Array) -> Variant
func cancel_free() -> void
func connect(signal: StringName, callable: Callable, flags: int = 0) -> Error
func disconnect(signal: StringName, callable: Callable) -> void
func emit_signal(signal: StringName) -> Error
func free() -> void
func get(property: StringName) -> Variant
func get_class() -> String
func get_incoming_connections() -> Dictionary[]
func get_indexed(property_path: NodePath) -> Variant
func get_meta(name: StringName, default: Variant = null) -> Variant
func get_meta_list() -> StringName[]
func get_method_list() -> Dictionary[]
func get_property_list() -> Dictionary[]
func get_signal_connection_list(signal: StringName) -> Dictionary[]
func get_signal_list() -> Dictionary[]
func has_meta(name: StringName) -> bool
func has_method(method: StringName) -> bool
func has_signal(signal: StringName) -> bool
func is_class(class: StringName) -> bool
func is_connected(signal: StringName, callable: Callable) -> bool
func notification(what: int, reversed: bool = false) -> void
func remove_meta(name: StringName) -> void
func remove_user_signal(signal: StringName) -> void
func set(property: StringName, value: Variant) -> void
func set_block_signals(enable: bool) -> void
func set_deferred(property: StringName, value: Variant) -> void
func set_indexed(property_path: NodePath, value: Variant) -> void
func set_message_translation(enable: bool) -> void
func set_meta(name: StringName, value: Variant) -> void
func set_script(script: Variant) -> void
func set_translation_domain(domain: StringName) -> void
func to_string() -> String
func tr(message: StringName, context: StringName = &"") -> String
func tr_n(message: StringName, plural_message: StringName, n: int, context: StringName = &"") -> String

Signals

Inherited from XRInterface (1)
signal play_area_changed(mode: int)
Inherited from Object (2)