XRInterfaceExtension
继承: XRInterface
< RefCounted
< Object
Base class for XR interface extensions (plugins).
描述
External XR interface plugins should inherit from this class.
方法
方法说明
void
_end_frame ( ) virtual1
Called if interface is active and queues have been submitted.
bool
_get_anchor_detection_is_enabled ( ) virtual1 const2
Return true
if anchor detection is enabled for this interface.
int
_get_camera_feed_id ( ) virtual1 const2
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).
Transform3D
_get_camera_transform ( ) virtual1
Returns the Transform3D
that positions the XRCamera3D
in the world.
int
_get_capabilities ( ) virtual1 const2
Returns the capabilities of this interface.
RID
_get_color_texture ( ) virtual1
Return color texture into which to render (if applicable).
RID
_get_depth_texture ( ) virtual1
Return depth texture into which to render (if applicable).
StringName
_get_name ( ) virtual1 const2
Returns the name of this interface.
PackedVector3Array
_get_play_area ( ) virtual1 const2
Returns a PackedVector3Array
that represents the play areas boundaries (if applicable).
PlayAreaMode _get_play_area_mode ( ) virtual1 const2
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
) virtual1
Returns the projection matrix for the given view as a PackedFloat64Array
.
Vector2
_get_render_target_size ( ) virtual1
Returns 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 ( tracker_name: StringName
) virtual1 const2
Returns a PackedStringArray
with pose names configured by this interface. Note that user configuration can override this list.
PackedStringArray
_get_suggested_tracker_names ( ) virtual1 const2
Returns a PackedStringArray
with tracker names configured by this interface. Note that user configuration can override this list.
Dictionary
_get_system_info ( ) virtual1 const2
Returns a Dictionary
with system information related to this interface.
TrackingStatus _get_tracking_status ( ) virtual1 const2
Returns a TrackingStatus specifying the current status of our tracking.
Transform3D
_get_transform_for_view ( view: int
, cam_transform: Transform3D
) virtual1
Returns a Transform3D
for a given view.
RID
_get_velocity_texture ( ) virtual1
Return velocity texture into which to render (if applicable).
int
_get_view_count ( ) virtual1
Returns the number of views this interface requires, 1 for mono, 2 for stereoscopic.
RID
_get_vrs_texture ( ) virtual1
该方法目前没有描述,请帮我们\ :ref:贡献一个 <doc_updating_the_class_reference>
\ 吧!
Initializes the interface, returns true
on success.
bool
_is_initialized ( ) virtual1 const2
Returns true
if this interface has been initialized.
void
_post_draw_viewport ( render_target: RID
, screen_rect: Rect2
) virtual1
Called after the XR Viewport
draw logic has completed.
bool
_pre_draw_viewport ( render_target: RID
) virtual1
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.
void
_pre_render ( ) virtual1
Called if this XRInterfaceExtension is active before rendering starts. Most XR interfaces will sync tracking at this point in time.
void
_process ( ) virtual1
Called if this XRInterfaceExtension is active before our physics and game process is called. Most XR interfaces will update its XRPositionalTracker
s at this point in time.
void
_set_anchor_detection_is_enabled ( enabled: bool
) virtual1
Enables anchor detection on this interface if supported.
bool
_set_play_area_mode ( mode: PlayAreaMode ) virtual1 const2
Set the play area mode for this interface.
bool
_supports_play_area_mode ( mode: PlayAreaMode ) virtual1 const2
Returns true
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
) virtual1
Triggers a haptic pulse to be emitted on the specified tracker.
void
_uninitialize ( ) virtual1
Uninitialize the interface.
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
)
Blits our render results to screen optionally applying lens distortion. This can only be called while processing _commit_views
.
RID
get_color_texture ( )
该方法目前没有描述,请帮我们\ :ref:贡献一个 <doc_updating_the_class_reference>
\ 吧!
RID
get_depth_texture ( )
该方法目前没有描述,请帮我们\ :ref:贡献一个 <doc_updating_the_class_reference>
\ 吧!
RID
get_render_target_texture ( render_target: RID
)
Returns a valid RID
for a texture to which we should render the current frame if supported by the interface.
RID
get_velocity_texture ( )
该方法目前没有描述,请帮我们\ :ref:贡献一个 <doc_updating_the_class_reference>
\ 吧!
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。