Class reference
XRInterfaceExtension
Inherits XRInterface
Base class for XR interface extensions (plugins).
Description
External XR interface plugins should inherit from this class.
Methods
void _end_frame() virtual
Called if interface is active and queues have been submitted.
bool _get_anchor_detection_is_enabled() virtual const
bool _get_anchor_detection_is_enabled() virtual constReturn true if anchor detection is enabled for this interface.
int _get_camera_feed_id() virtual const
int _get_camera_feed_id() virtual constReturns 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).
Transform3D _get_camera_transform() virtual
Transform3D _get_camera_transform() virtualReturns the Transform3D that positions the XRCamera3D in the world.
int _get_capabilities() virtual const
int _get_capabilities() virtual constReturns the capabilities of this interface.
RID _get_color_texture() virtual
RID _get_color_texture() virtualReturn color texture into which to render (if applicable).
RID _get_depth_texture() virtual
RID _get_depth_texture() virtualReturn depth texture into which to render (if applicable).
StringName _get_name() virtual const
StringName _get_name() virtual constReturns the name of this interface.
PackedVector3Array _get_play_area() virtual const
PackedVector3Array _get_play_area() virtual constReturns a PackedVector3Array that represents the play areas boundaries (if applicable).
int _get_play_area_mode() virtual const
int _get_play_area_mode() virtual constReturns the play area mode that sets up our play area.
PackedFloat64Array _get_projection_for_view(int view, float aspect, float z_near, float z_far) virtual
PackedFloat64Array _get_projection_for_view(int view, float aspect, float z_near, float z_far) virtualReturns the projection matrix for the given view as a PackedFloat64Array.
Vector2 _get_render_target_size() virtual
Vector2 _get_render_target_size() virtualReturns the size of our render target for this interface, this overrides the size of the Viewport marked as the xr viewport.
PackedStringArray _get_suggested_pose_names(StringName tracker_name) virtual const
PackedStringArray _get_suggested_pose_names(StringName tracker_name) virtual constReturns a PackedStringArray with pose names configured by this interface. Note that user configuration can override this list.
PackedStringArray _get_suggested_tracker_names() virtual const
PackedStringArray _get_suggested_tracker_names() virtual constReturns a PackedStringArray with tracker names configured by this interface. Note that user configuration can override this list.
Dictionary _get_system_info() virtual const
Dictionary _get_system_info() virtual constReturns a Dictionary with system information related to this interface.
int _get_tracking_status() virtual const
int _get_tracking_status() virtual constReturns an XRInterface.TrackingStatus specifying the current status of our tracking.
Transform3D _get_transform_for_view(int view, Transform3D cam_transform) virtual
Transform3D _get_transform_for_view(int view, Transform3D cam_transform) virtualReturns a Transform3D for a given view.
RID _get_velocity_texture() virtual
RID _get_velocity_texture() virtualReturn velocity texture into which to render (if applicable).
int _get_view_count() virtual
int _get_view_count() virtualReturns the number of views this interface requires, 1 for mono, 2 for stereoscopic.
RID _get_vrs_texture() virtual
RID _get_vrs_texture() virtualint _get_vrs_texture_format() virtual
int _get_vrs_texture_format() virtualReturns the format of the texture returned by _get_vrs_texture().
bool _initialize() virtual
bool _initialize() virtualInitializes the interface, returns true on success.
bool _is_initialized() virtual const
bool _is_initialized() virtual constReturns true if this interface has been initialized.
void _post_draw_viewport(RID render_target, Rect2 screen_rect) virtual
RID render_target, Rect2 screen_rect) virtualCalled after the XR Viewport draw logic has completed.
bool _pre_draw_viewport(RID render_target) virtual
bool _pre_draw_viewport(RID render_target) virtualCalled 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.
void _pre_render() virtual
Called if this XRInterfaceExtension is active before rendering starts. Most XR interfaces will sync tracking at this point in time.
void _process() virtual
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.
void _set_anchor_detection_is_enabled(bool enabled) virtual
bool enabled) virtualEnables anchor detection on this interface if supported.
bool _set_play_area_mode(int mode) virtual const
bool _set_play_area_mode(int mode) virtual constSet the play area mode for this interface.
bool _supports_play_area_mode(int mode) virtual const
bool _supports_play_area_mode(int mode) virtual constReturns true if this interface supports this play area mode.
void _trigger_haptic_pulse(String action_name, StringName tracker_name, float frequency, float amplitude, float duration_sec, float delay_sec) virtual
String action_name, StringName tracker_name, float frequency, float amplitude, float duration_sec, float delay_sec) virtualTriggers a haptic pulse to be emitted on the specified tracker.
void _uninitialize() virtual
Uninitialize the interface.
void add_blit(RID render_target, Rect2 src_rect, Rect2i dst_rect, bool use_layer, int layer, bool apply_lens_distortion, Vector2 eye_center, float k1, float k2, float upscale, float aspect_ratio)
RID render_target, Rect2 src_rect, Rect2i dst_rect, bool use_layer, int layer, bool apply_lens_distortion, Vector2 eye_center, float k1, float k2, float upscale, float aspect_ratio)Blits our render results to screen optionally applying lens distortion. This can only be called while processing _commit_views.
RID get_color_texture()
RID get_color_texture()RID get_depth_texture()
RID get_depth_texture()RID get_render_target_texture(RID render_target)
RID get_render_target_texture(RID render_target)Returns a valid RID for a texture to which we should render the current frame if supported by the interface.
RID get_velocity_texture()
RID get_velocity_texture()