Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

XRInterfaceExtension

繼承: XRInterface < RefCounted < Object

XR 介面擴充(外掛程式)的基底類別。

說明

外部 XR 介面外掛程式應繼承自這個類。

教學

方法

void

_end_frame() virtual

bool

_get_anchor_detection_is_enabled() virtual const

int

_get_camera_feed_id() virtual const

Transform3D

_get_camera_transform() virtual

int

_get_capabilities() virtual const

RID

_get_color_texture() virtual

RID

_get_depth_texture() virtual

StringName

_get_name() virtual const

PackedVector3Array

_get_play_area() virtual const

PlayAreaMode

_get_play_area_mode() virtual const

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) virtual const

PackedStringArray

_get_suggested_tracker_names() virtual const

Dictionary

_get_system_info() virtual const

TrackingStatus

_get_tracking_status() virtual const

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

VRSTextureFormat

_get_vrs_texture_format() virtual

bool

_initialize() virtual

bool

_is_initialized() virtual const

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) virtual const

bool

_supports_play_area_mode(mode: PlayAreaMode) virtual const

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


方法說明

void _end_frame() virtual 🔗

如果該介面處於活動狀態,並且已提交佇列,則呼叫此方法。


bool _get_anchor_detection_is_enabled() virtual const 🔗

如果此介面啟用了錨點偵測,則返回 true


int _get_camera_feed_id() virtual const 🔗

返回在 CameraServer 上註冊的 CameraFeed 的相機源 ID,該 ID 應在支援 AR 的裝置(如果適用)上顯示為背景。


Transform3D _get_camera_transform() virtual 🔗

返回將 XRCamera3D 放置在世界中的 Transform3D


int _get_capabilities() virtual const 🔗

返回該介面的功能。


RID _get_color_texture() virtual 🔗

返回接受算繪結果的顏色紋理(如果適用)。


RID _get_depth_texture() virtual 🔗

返回接受算繪結果的深度紋理(如果適用)。


StringName _get_name() virtual const 🔗

返回該介面的名稱。


PackedVector3Array _get_play_area() virtual const 🔗

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


PlayAreaMode _get_play_area_mode() virtual const 🔗

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 🔗

返回給定試圖的投影矩陣,形式為 PackedFloat64Array


Vector2 _get_render_target_size() virtual 🔗

返回我們在這個介面上的算繪目標大小,覆蓋標記為 XR 視口的 Viewport 的大小。


PackedStringArray _get_suggested_pose_names(tracker_name: StringName) virtual const 🔗

返回一個 PackedStringArray,其中包含由此介面配置的姿勢名稱。請注意,使用者的配置可以覆蓋此列表。


PackedStringArray _get_suggested_tracker_names() virtual const 🔗

返回一個 PackedStringArray,其中包含由此介面配置的追蹤器名稱。請注意,使用者的配置可以覆蓋此列表。


Dictionary _get_system_info() virtual const 🔗

返回包含與這個介面相關的系統資訊的 Dictionary


TrackingStatus _get_tracking_status() virtual const 🔗

Returns the current status of our tracking.


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

返回給定視圖的 Transform3D


RID _get_velocity_texture() virtual 🔗

返回作為算繪目標的速度紋理(如果適用)。


int _get_view_count() virtual 🔗

返回此介面所需的視圖數量,1 代表單目平面視圖,2 代表雙目立體視圖。


RID _get_vrs_texture() virtual 🔗

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


VRSTextureFormat _get_vrs_texture_format() virtual 🔗

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


bool _initialize() virtual 🔗

初始化該介面,成功時返回 true


bool _is_initialized() virtual const 🔗

如果這個介面已初始化,則返回 true


void _post_draw_viewport(render_target: RID, screen_rect: Rect2) virtual 🔗

在 XR Viewport 繪製邏輯完成後呼叫。


bool _pre_draw_viewport(render_target: RID) virtual 🔗

如果這是我們的主要 XRInterfaceExtension,則在我們開始為每個活動的 XR Viewport 處理 Viewport 之前呼叫,如果該視口應該被算繪,則返回 true。如果使用者摘下頭戴式裝置,XR 介面可能會返回 false,我們可以暫停算繪。


void _pre_render() virtual 🔗

如果這個 XRInterfaceExtension 在算繪開始前處於啟動狀態,則會呼叫這個函式,大多數 XR 介面都會在此時進行追蹤同步。


void _process() virtual 🔗

如果這個 XRInterfaceExtension 在呼叫我們的物理和遊戲處理前處於啟動狀態,則會呼叫這個函式。大多數 XR 介面都會在此時更新其 XRPositionalTracker


void _set_anchor_detection_is_enabled(enabled: bool) virtual 🔗

如果支援,則在此介面上啟用錨點偵測。


bool _set_play_area_mode(mode: PlayAreaMode) virtual const 🔗

設定該介面的遊玩區域模式。


bool _supports_play_area_mode(mode: PlayAreaMode) virtual const 🔗

如果該介面支援該遊玩區域模式,則返回 true


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

將我們的算繪結果傳輸到螢幕上,還可以在此過程中套用鏡頭失真。只能在處理 _commit_views 時呼叫。


RID get_color_texture() 🔗

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


RID get_depth_texture() 🔗

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


RID get_render_target_texture(render_target: RID) 🔗

如果介面支援,則返回一個紋理的有效 RID,我們應更將目前影格算繪至該紋理。


RID get_velocity_texture() 🔗

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