OpenXRExtensionWrapperExtension
继承: Object
Allows clients to implement OpenXR extensions with GDExtension.
描述
OpenXRExtensionWrapperExtension allows clients to implement OpenXR extensions with GDExtension. The extension should be registered with register_extension_wrapper
.
方法
方法说明
int
_get_composition_layer ( index: int
) virtual1
Returns a pointer to an XrCompositionLayerBaseHeader
struct to provide the given composition layer.
This will only be called if the extension previously registered itself with OpenXRAPIExtension.register_composition_layer_provider
.
int
_get_composition_layer_count ( ) virtual1
Returns the number of composition layers this extension wrapper provides via _get_composition_layer
.
This will only be called if the extension previously registered itself with OpenXRAPIExtension.register_composition_layer_provider
.
int
_get_composition_layer_order ( index: int
) virtual1
Returns an integer that will be used to sort the given composition layer provided via _get_composition_layer
. Lower numbers will move the layer to the front of the list, and higher numbers to the end. The default projection layer has an order of 0
, so layers provided by this method should probably be above or below (but not exactly) 0
.
This will only be called if the extension previously registered itself with OpenXRAPIExtension.register_composition_layer_provider
.
Dictionary
_get_requested_extensions ( ) virtual1
Returns a Dictionary
of OpenXR extensions related to this extension. The Dictionary
should contain the name of the extension, mapped to a bool *
cast to an integer:
-
If the
bool *
is anullptr
this extension is mandatory. -
If the
bool *
points to a boolean, the boolean will be updated totrue
if the extension is enabled.
PackedStringArray
_get_suggested_tracker_names ( ) virtual1
Returns a PackedStringArray
of positional tracker names that are used within the extension wrapper.
Array Dictionary
_get_viewport_composition_layer_extension_properties ( ) virtual1
Gets an array of Dictionary
s that represent properties, just like Object._get_property_list
, that will be added to OpenXRCompositionLayer
nodes.
Dictionary
_get_viewport_composition_layer_extension_property_defaults ( ) virtual1
Gets a Dictionary
containing the default values for the properties returned by _get_viewport_composition_layer_extension_properties
.
void
_on_before_instance_created ( ) virtual1
Called before the OpenXR instance is created.
bool
_on_event_polled ( event: const void*
) virtual1
Called when there is an OpenXR event to process. When implementing, return true
if the event was handled, return false
otherwise.
void
_on_instance_created ( instance: int
) virtual1
Called right after the OpenXR instance is created.
void
_on_instance_destroyed ( ) virtual1
Called right before the OpenXR instance is destroyed.
void
_on_main_swapchains_created ( ) virtual1
Called right after the main swapchains are (re)created.
void
_on_post_draw_viewport ( viewport: RID
) virtual1
Called right after the given viewport is rendered.
Note: The draw commands might only be queued at this point, not executed.
void
_on_pre_draw_viewport ( viewport: RID
) virtual1
Called right before the given viewport is rendered.
void
_on_pre_render ( ) virtual1
Called right before the XR viewports begin their rendering step.
void
_on_process ( ) virtual1
Called as part of the OpenXR process handling. This happens right before general and physics processing steps of the main loop. During this step controller data is queried and made available to game logic.
void
_on_register_metadata ( ) virtual1
Allows extensions to register additional controller metadata. This function is called even when the OpenXR API is not constructed as the metadata needs to be available to the editor.
Extensions should also provide metadata regardless of whether they are supported on the host system. The controller data is used to setup action maps for users who may have access to the relevant hardware.
void
_on_session_created ( session: int
) virtual1
Called right after the OpenXR session is created.
void
_on_session_destroyed ( ) virtual1
Called right before the OpenXR session is destroyed.
void
_on_state_exiting ( ) virtual1
Called when the OpenXR session state is changed to exiting.
void
_on_state_focused ( ) virtual1
Called when the OpenXR session state is changed to focused. This state is the active state when the game runs.
void
_on_state_idle ( ) virtual1
Called when the OpenXR session state is changed to idle.
void
_on_state_loss_pending ( ) virtual1
Called when the OpenXR session state is changed to loss pending.
void
_on_state_ready ( ) virtual1
Called when the OpenXR session state is changed to ready. This means OpenXR is ready to set up the session.
void
_on_state_stopping ( ) virtual1
Called when the OpenXR session state is changed to stopping.
void
_on_state_synchronized ( ) virtual1
Called when the OpenXR session state is changed to synchronized. OpenXR also returns to this state when the application loses focus.
void
_on_state_visible ( ) virtual1
Called when the OpenXR session state is changed to visible. This means OpenXR is now ready to receive frames.
void
_on_viewport_composition_layer_destroyed ( layer: const void*
) virtual1
Called when a composition layer created via OpenXRCompositionLayer
is destroyed.
layer
is a pointer to an XrCompositionLayerBaseHeader
struct.
int
_set_android_surface_swapchain_create_info_and_get_next_pointer ( property_values: Dictionary
, next_pointer: void*
) virtual1
Adds additional data structures to Android surface swapchains created by OpenXRCompositionLayer
.
property_values
contains the values of the properties returned by _get_viewport_composition_layer_extension_properties
.
int
_set_hand_joint_locations_and_get_next_pointer ( hand_index: int
, next_pointer: void*
) virtual1
Adds additional data structures when each hand tracker is created.
int
_set_instance_create_info_and_get_next_pointer ( next_pointer: void*
) virtual1
Adds additional data structures when the OpenXR instance is created.
int
_set_session_create_and_get_next_pointer ( next_pointer: void*
) virtual1
Adds additional data structures when the OpenXR session is created.
int
_set_swapchain_create_info_and_get_next_pointer ( next_pointer: void*
) virtual1
Adds additional data structures when creating OpenXR swapchains.
int
_set_system_properties_and_get_next_pointer ( next_pointer: void*
) virtual1
Adds additional data structures when interogating OpenXR system abilities.
int
_set_viewport_composition_layer_and_get_next_pointer ( layer: const void*
, property_values: Dictionary
, next_pointer: void*
) virtual1
Adds additional data structures to composition layers created by OpenXRCompositionLayer
.
property_values
contains the values of the properties returned by _get_viewport_composition_layer_extension_properties
.
layer
is a pointer to an XrCompositionLayerBaseHeader
struct.
OpenXRAPIExtension
get_openxr_api ( )
Returns the created OpenXRAPIExtension
, which can be used to access the OpenXR API.
void
register_extension_wrapper ( )
Registers the extension. This should happen at core module initialization level.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。