Trait IOpenXrSpatialEntityExtension
pub trait IOpenXrSpatialEntityExtension: GodotClass<Base = OpenXrSpatialEntityExtension> + You_forgot_the_attribute__godot_api {
Show 52 methods
// Provided methods
fn init(base: Base<Self::Base>) -> Self { ... }
fn on_notification(&mut self, what: ObjectNotification) { ... }
fn on_get(&self, property: StringName) -> Option<Variant> { ... }
fn on_set(&mut self, property: StringName, value: Variant) -> bool { ... }
fn on_validate_property(&self, property: &mut PropertyInfo) { ... }
fn on_get_property_list(&mut self) -> Vec<PropertyInfo> { ... }
fn on_property_get_revert(&self, property: StringName) -> Option<Variant> { ... }
fn to_string(&self) -> GString { ... }
fn get_requested_extensions(&mut self, xr_version: u64) -> AnyDictionary { ... }
unsafe fn set_system_properties_and_get_next_pointer_rawptr(
&mut self,
next_pointer: RawPtr<*mut c_void>,
) -> u64 { ... }
unsafe fn set_instance_create_info_and_get_next_pointer_rawptr(
&mut self,
xr_version: u64,
next_pointer: RawPtr<*mut c_void>,
) -> u64 { ... }
unsafe fn set_session_create_and_get_next_pointer_rawptr(
&mut self,
next_pointer: RawPtr<*mut c_void>,
) -> u64 { ... }
unsafe fn set_swapchain_create_info_and_get_next_pointer_rawptr(
&mut self,
next_pointer: RawPtr<*mut c_void>,
) -> u64 { ... }
unsafe fn set_hand_joint_locations_and_get_next_pointer_rawptr(
&mut self,
hand_index: i32,
next_pointer: RawPtr<*mut c_void>,
) -> u64 { ... }
unsafe fn set_projection_views_and_get_next_pointer_rawptr(
&mut self,
view_index: i32,
next_pointer: RawPtr<*mut c_void>,
) -> u64 { ... }
unsafe fn set_frame_wait_info_and_get_next_pointer_rawptr(
&mut self,
next_pointer: RawPtr<*mut c_void>,
) -> u64 { ... }
unsafe fn set_frame_end_info_and_get_next_pointer_rawptr(
&mut self,
next_pointer: RawPtr<*mut c_void>,
) -> u64 { ... }
unsafe fn set_view_locate_info_and_get_next_pointer_rawptr(
&mut self,
next_pointer: RawPtr<*mut c_void>,
) -> u64 { ... }
unsafe fn set_reference_space_create_info_and_get_next_pointer_rawptr(
&mut self,
reference_space_type: i32,
next_pointer: RawPtr<*mut c_void>,
) -> u64 { ... }
fn prepare_view_configuration(&mut self, view_count: i32) { ... }
unsafe fn set_view_configuration_and_get_next_pointer_rawptr(
&mut self,
view: u32,
next_pointer: RawPtr<*mut c_void>,
) -> u64 { ... }
fn print_view_configuration_info(&self, view: i32) { ... }
fn get_composition_layer_count(&mut self) -> i32 { ... }
fn get_composition_layer(&mut self, index: i32) -> u64 { ... }
fn get_composition_layer_order(&mut self, index: i32) -> i32 { ... }
fn get_suggested_tracker_names(&mut self) -> PackedArray<GString> { ... }
fn on_register_metadata(&mut self) { ... }
fn on_before_instance_created(&mut self) { ... }
fn on_instance_created(&mut self, instance: u64) { ... }
fn on_instance_destroyed(&mut self) { ... }
fn on_session_created(&mut self, session: u64) { ... }
fn on_process(&mut self) { ... }
fn on_sync_actions(&mut self) { ... }
fn on_pre_render(&mut self) { ... }
fn on_main_swapchains_created(&mut self) { ... }
fn on_pre_draw_viewport(&mut self, viewport: Rid) { ... }
fn on_post_draw_viewport(&mut self, viewport: Rid) { ... }
fn on_session_destroyed(&mut self) { ... }
fn on_state_idle(&mut self) { ... }
fn on_state_ready(&mut self) { ... }
fn on_state_synchronized(&mut self) { ... }
fn on_state_visible(&mut self) { ... }
fn on_state_focused(&mut self) { ... }
fn on_state_stopping(&mut self) { ... }
fn on_state_loss_pending(&mut self) { ... }
fn on_state_exiting(&mut self) { ... }
unsafe fn on_event_polled_rawptr(
&mut self,
event: RawPtr<*const c_void>,
) -> bool { ... }
unsafe fn set_viewport_composition_layer_and_get_next_pointer_rawptr(
&mut self,
layer: RawPtr<*const c_void>,
property_values: Dictionary<Variant, Variant>,
next_pointer: RawPtr<*mut c_void>,
) -> u64 { ... }
fn get_viewport_composition_layer_extension_properties(
&mut self,
) -> Array<AnyDictionary> { ... }
fn get_viewport_composition_layer_extension_property_defaults(
&mut self,
) -> AnyDictionary { ... }
unsafe fn on_viewport_composition_layer_destroyed_rawptr(
&mut self,
layer: RawPtr<*const c_void>,
) { ... }
unsafe fn set_android_surface_swapchain_create_info_and_get_next_pointer_rawptr(
&mut self,
property_values: Dictionary<Variant, Variant>,
next_pointer: RawPtr<*mut c_void>,
) -> u64 { ... }
}Expand description
§Interface trait for class OpenXrSpatialEntityExtension.
Functions in this trait represent constructors (init) or virtual method callbacks invoked by the engine.
§Related symbols
Base interfaces: IOpenXrExtensionWrapper > IObject.
See also Godot docs for OpenXRSpatialEntityExtension methods.
Provided Methods§
fn init(base: Base<Self::Base>) -> Self
fn init(base: Base<Self::Base>) -> Self
Godot constructor, accepting an injected base object.
base refers to the base instance of the class, which can either be stored in a Base<T> field or discarded.
This method returns a fully-constructed instance, which will then be moved into a Gd<T> pointer.
If the class has a #[class(init)] attribute, this method will be auto-generated and must not be overridden.
fn on_notification(&mut self, what: ObjectNotification)
fn on_notification(&mut self, what: ObjectNotification)
Called when the object receives a Godot notification.
The type of notification can be identified through what. The enum is designed to hold all possible NOTIFICATION_*
constants that the current class can handle. However, this is not validated in Godot, so an enum variant Unknown exists
to represent integers out of known constants (mistakes or future additions).
This method is named _notification in Godot, but on_notification in Rust. To send notifications, use the
Object::notify method.
See also in Godot docs:
fn on_get(&self, property: StringName) -> Option<Variant>
fn on_get(&self, property: StringName) -> Option<Variant>
Called whenever get() is called or Godot gets the value of a property.
Should return the given property’s value as Some(value), or None if the property should be handled normally.
See also in Godot docs:
fn on_set(&mut self, property: StringName, value: Variant) -> bool
fn on_set(&mut self, property: StringName, value: Variant) -> bool
Called whenever Godot set() is called or Godot sets the value of a property.
Should set property to the given value and return true, or return false to indicate the property
should be handled normally.
See also in Godot docs:
fn on_validate_property(&self, property: &mut PropertyInfo)
fn on_validate_property(&self, property: &mut PropertyInfo)
Called whenever Godot retrieves value of property. Allows to customize existing properties.
Every property info goes through this method, except properties added with on_get_property_list().
Exposed property here is a shared mutable reference obtained (and returned to) from Godot.
See also in the Godot docs:
fn on_get_property_list(&mut self) -> Vec<PropertyInfo>
Available on since_api=4.3 only.
fn on_get_property_list(&mut self) -> Vec<PropertyInfo>
since_api=4.3 only.Called whenever Godot get_property_list() is called, the returned vector here is
appended to the existing list of properties.
This should mainly be used for advanced purposes, such as dynamically updating the property list in the editor.
See also in Godot docs:
fn on_property_get_revert(&self, property: StringName) -> Option<Variant>
fn on_property_get_revert(&self, property: StringName) -> Option<Variant>
Called by Godot to tell if a property has a custom revert or not.
Return None for no custom revert, and return Some(value) to specify the custom revert.
This is a combination of Godot’s Object::_property_get_revert and Object::_property_can_revert. This means that this
function will usually be called twice by Godot to find the revert.
Note that this should be a pure function. That is, it should always return the same value for a property as long as self
remains unchanged. Otherwise, this may lead to unexpected (safe) behavior.
fn to_string(&self) -> GString
fn to_string(&self) -> GString
String representation of the Godot instance.
Override this method to define how the instance is represented as a string.
Used by impl Display for Gd<T>, as well as str() and print() in GDScript.
fn get_requested_extensions(&mut self, xr_version: u64) -> AnyDictionary
fn get_requested_extensions(&mut self, xr_version: u64) -> AnyDictionary
Returns a Dictionary of OpenXR extensions related to this extension. xr_version specifies the OpenXR version we’re instantiating. This will be zero if the editor requests this list to flag supported features. The Dictionary should contain the name of the extension, mapped to a bool * cast to an integer:
-
If the
bool *is anullptrthis extension is mandatory. -
If the
bool *points to a boolean, the boolean will be updated totrueif the extension is enabled.
unsafe fn set_system_properties_and_get_next_pointer_rawptr(
&mut self,
next_pointer: RawPtr<*mut c_void>,
) -> u64
unsafe fn set_system_properties_and_get_next_pointer_rawptr( &mut self, next_pointer: RawPtr<*mut c_void>, ) -> u64
unsafe fn set_instance_create_info_and_get_next_pointer_rawptr(
&mut self,
xr_version: u64,
next_pointer: RawPtr<*mut c_void>,
) -> u64
unsafe fn set_instance_create_info_and_get_next_pointer_rawptr( &mut self, xr_version: u64, next_pointer: RawPtr<*mut c_void>, ) -> u64
§Godot docs
Add additional data structures when the OpenXR instance is created. xr_version specifies the OpenXR version we’re instantiating.
§Safety
This method has automatically been marked unsafe because it accepts raw pointers as parameters.
If Godot does not document any safety requirements, make sure you understand the underlying semantics.
unsafe fn set_session_create_and_get_next_pointer_rawptr(
&mut self,
next_pointer: RawPtr<*mut c_void>,
) -> u64
unsafe fn set_session_create_and_get_next_pointer_rawptr( &mut self, next_pointer: RawPtr<*mut c_void>, ) -> u64
unsafe fn set_swapchain_create_info_and_get_next_pointer_rawptr(
&mut self,
next_pointer: RawPtr<*mut c_void>,
) -> u64
unsafe fn set_swapchain_create_info_and_get_next_pointer_rawptr( &mut self, next_pointer: RawPtr<*mut c_void>, ) -> u64
unsafe fn set_hand_joint_locations_and_get_next_pointer_rawptr(
&mut self,
hand_index: i32,
next_pointer: RawPtr<*mut c_void>,
) -> u64
unsafe fn set_hand_joint_locations_and_get_next_pointer_rawptr( &mut self, hand_index: i32, next_pointer: RawPtr<*mut c_void>, ) -> u64
unsafe fn set_projection_views_and_get_next_pointer_rawptr(
&mut self,
view_index: i32,
next_pointer: RawPtr<*mut c_void>,
) -> u64
unsafe fn set_projection_views_and_get_next_pointer_rawptr( &mut self, view_index: i32, next_pointer: RawPtr<*mut c_void>, ) -> u64
§Godot docs
Add additional data structures to the projection view of the given view_index.
Note: This virtual method will be called on the render thread. Additionally, the data it returns will be used shortly after this method is called, so it needs to remain valid until the next time on_pre_render runs.
§Safety
This method has automatically been marked unsafe because it accepts raw pointers as parameters.
If Godot does not document any safety requirements, make sure you understand the underlying semantics.
unsafe fn set_frame_wait_info_and_get_next_pointer_rawptr(
&mut self,
next_pointer: RawPtr<*mut c_void>,
) -> u64
unsafe fn set_frame_wait_info_and_get_next_pointer_rawptr( &mut self, next_pointer: RawPtr<*mut c_void>, ) -> u64
§Godot docs
Add additional data structures to XrFrameWaitInfo.
This will only be called if the extension previously registered itself with register_frame_info_extension.
Note: This virtual method will be called on the render thread.
§Safety
This method has automatically been marked unsafe because it accepts raw pointers as parameters.
If Godot does not document any safety requirements, make sure you understand the underlying semantics.
unsafe fn set_frame_end_info_and_get_next_pointer_rawptr(
&mut self,
next_pointer: RawPtr<*mut c_void>,
) -> u64
unsafe fn set_frame_end_info_and_get_next_pointer_rawptr( &mut self, next_pointer: RawPtr<*mut c_void>, ) -> u64
§Godot docs
Add additional data structures to XrFrameEndInfo.
This will only be called if the extension previously registered itself with register_frame_info_extension.
Note: This virtual method will be called on the render thread. Additionally, the data it returns will be used shortly after this method is called, so it needs to remain valid until the next time on_pre_render runs.
§Safety
This method has automatically been marked unsafe because it accepts raw pointers as parameters.
If Godot does not document any safety requirements, make sure you understand the underlying semantics.
unsafe fn set_view_locate_info_and_get_next_pointer_rawptr(
&mut self,
next_pointer: RawPtr<*mut c_void>,
) -> u64
unsafe fn set_view_locate_info_and_get_next_pointer_rawptr( &mut self, next_pointer: RawPtr<*mut c_void>, ) -> u64
§Godot docs
Add additional data structures to XrViewLocateInfo.
This will only be called if the extension previously registered itself with register_frame_info_extension.
Note: This virtual method will be called on the render thread. Additionally, the data it returns will be used shortly after this method is called, so it needs to remain valid until the next time on_pre_render runs.
§Safety
This method has automatically been marked unsafe because it accepts raw pointers as parameters.
If Godot does not document any safety requirements, make sure you understand the underlying semantics.
unsafe fn set_reference_space_create_info_and_get_next_pointer_rawptr(
&mut self,
reference_space_type: i32,
next_pointer: RawPtr<*mut c_void>,
) -> u64
unsafe fn set_reference_space_create_info_and_get_next_pointer_rawptr( &mut self, reference_space_type: i32, next_pointer: RawPtr<*mut c_void>, ) -> u64
fn prepare_view_configuration(&mut self, view_count: i32)
fn prepare_view_configuration(&mut self, view_count: i32)
Called before set_view_configuration_and_get_next_pointer_rawptr to allow the extension to reserve data for the given number of views.
unsafe fn set_view_configuration_and_get_next_pointer_rawptr(
&mut self,
view: u32,
next_pointer: RawPtr<*mut c_void>,
) -> u64
unsafe fn set_view_configuration_and_get_next_pointer_rawptr( &mut self, view: u32, next_pointer: RawPtr<*mut c_void>, ) -> u64
fn print_view_configuration_info(&self, view: i32)
fn print_view_configuration_info(&self, view: i32)
Called to allow an extension to print additional information about its view configuration, if applicable. This will only be called if verbose output is enabled.
fn get_composition_layer_count(&mut self) -> i32
fn get_composition_layer_count(&mut self) -> i32
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 register_composition_layer_provider.
Note: This virtual method will be called on the render thread. Additionally, the data it returns will be used shortly after this method is called, so it needs to remain valid until the next time on_pre_render runs.
fn get_composition_layer(&mut self, index: i32) -> u64
fn get_composition_layer(&mut self, index: i32) -> u64
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 register_composition_layer_provider.
Note: This virtual method will be called on the render thread. Additionally, the data it returns will be used shortly after this method is called, so it needs to remain valid until the next time on_pre_render runs.
fn get_composition_layer_order(&mut self, index: i32) -> i32
fn get_composition_layer_order(&mut self, index: i32) -> i32
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 register_composition_layer_provider.
Note: This virtual method will be called on the render thread. Additionally, the data it returns will be used shortly after this method is called, so it needs to remain valid until the next time on_pre_render runs.
fn get_suggested_tracker_names(&mut self) -> PackedArray<GString>
fn get_suggested_tracker_names(&mut self) -> PackedArray<GString>
Returns a PackedStringArray of positional tracker names that are used within the extension wrapper.
fn on_register_metadata(&mut self)
fn on_register_metadata(&mut self)
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.
fn on_before_instance_created(&mut self)
fn on_before_instance_created(&mut self)
Called before the OpenXR instance is created.
Note: This virtual method will be called on the main thread, however, it will be called before OpenXR becomes involved in rendering, so it is safe to write to data that will be used by the render thread.
fn on_instance_created(&mut self, instance: u64)
fn on_instance_created(&mut self, instance: u64)
Called right after the OpenXR instance is created.
Note: This virtual method will be called on the main thread, however, it will be called before OpenXR becomes involved in rendering, so it is safe to write to data that will be used by the render thread.
fn on_instance_destroyed(&mut self)
fn on_instance_destroyed(&mut self)
Called right before the OpenXR instance is destroyed.
Note: This virtual method will be called on the main thread, however, it will be called after OpenXR is done being involved in rendering, so it is safe to write to data that was used by the render thread.
fn on_session_created(&mut self, session: u64)
fn on_session_created(&mut self, session: u64)
Called right after the OpenXR session is created.
Note: This virtual method will be called on the main thread, however, it will be called before OpenXR becomes involved in rendering, so it is safe to write to data that will be used by the render thread.
fn on_process(&mut self)
fn on_process(&mut self)
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.
fn on_sync_actions(&mut self)
fn on_sync_actions(&mut self)
Called when OpenXR has performed its action sync.
fn on_pre_render(&mut self)
fn on_pre_render(&mut self)
Called right before the XR viewports begin their rendering step.
Note: This virtual method will be called on the render thread.
fn on_main_swapchains_created(&mut self)
fn on_main_swapchains_created(&mut self)
Called right after the main swapchains are (re)created.
Note: This virtual method will be called on the render thread.
fn on_pre_draw_viewport(&mut self, viewport: Rid)
fn on_pre_draw_viewport(&mut self, viewport: Rid)
Called right before the given viewport is rendered.
Note: This virtual method will be called on the render thread.
fn on_post_draw_viewport(&mut self, viewport: Rid)
fn on_post_draw_viewport(&mut self, viewport: Rid)
Called right after the given viewport is rendered.
Note: The draw commands might only be queued at this point, not executed.
Note: This virtual method will be called on the render thread.
fn on_session_destroyed(&mut self)
fn on_session_destroyed(&mut self)
Called right before the OpenXR session is destroyed.
Note: This virtual method will be called on the main thread, however, it will be called after OpenXR is done being involved in rendering, so it is safe to write to data that was used by the render thread.
fn on_state_idle(&mut self)
fn on_state_idle(&mut self)
Called when the OpenXR session state is changed to idle.
fn on_state_ready(&mut self)
fn on_state_ready(&mut self)
Called when the OpenXR session state is changed to ready. This means OpenXR is ready to set up the session.
fn on_state_synchronized(&mut self)
fn on_state_synchronized(&mut self)
Called when the OpenXR session state is changed to synchronized. OpenXR also returns to this state when the application loses focus.
fn on_state_visible(&mut self)
fn on_state_visible(&mut self)
Called when the OpenXR session state is changed to visible. This means OpenXR is now ready to receive frames.
fn on_state_focused(&mut self)
fn on_state_focused(&mut self)
Called when the OpenXR session state is changed to focused. This state is the active state when the game runs.
fn on_state_stopping(&mut self)
fn on_state_stopping(&mut self)
Called when the OpenXR session state is changed to stopping.
fn on_state_loss_pending(&mut self)
fn on_state_loss_pending(&mut self)
Called when the OpenXR session state is changed to loss pending.
fn on_state_exiting(&mut self)
fn on_state_exiting(&mut self)
Called when the OpenXR session state is changed to exiting.
unsafe fn on_event_polled_rawptr(
&mut self,
event: RawPtr<*const c_void>,
) -> bool
unsafe fn on_event_polled_rawptr( &mut self, event: RawPtr<*const c_void>, ) -> bool
§Godot docs
Called when there is an OpenXR event to process. When implementing, return true if the event was handled, return false otherwise.
§Safety
This method has automatically been marked unsafe because it accepts raw pointers as parameters.
If Godot does not document any safety requirements, make sure you understand the underlying semantics.
unsafe fn set_viewport_composition_layer_and_get_next_pointer_rawptr(
&mut self,
layer: RawPtr<*const c_void>,
property_values: Dictionary<Variant, Variant>,
next_pointer: RawPtr<*mut c_void>,
) -> u64
unsafe fn set_viewport_composition_layer_and_get_next_pointer_rawptr( &mut self, layer: RawPtr<*const c_void>, property_values: Dictionary<Variant, Variant>, next_pointer: RawPtr<*mut c_void>, ) -> u64
§Godot docs
Add 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.
Note: This virtual method will be called on the render thread. Additionally, the data it returns will be used shortly after this method is called, so it needs to remain valid until the next time on_pre_render runs.
§Safety
This method has automatically been marked unsafe because it accepts raw pointers as parameters.
If Godot does not document any safety requirements, make sure you understand the underlying semantics.
fn get_viewport_composition_layer_extension_properties(
&mut self,
) -> Array<AnyDictionary>
fn get_viewport_composition_layer_extension_properties( &mut self, ) -> Array<AnyDictionary>
Gets an array of Dictionarys that represent properties, just like on_get_property_list, that will be added to OpenXRCompositionLayer nodes.
Note: This virtual method will be called on the render thread.
fn get_viewport_composition_layer_extension_property_defaults(
&mut self,
) -> AnyDictionary
fn get_viewport_composition_layer_extension_property_defaults( &mut self, ) -> AnyDictionary
Gets a Dictionary containing the default values for the properties returned by get_viewport_composition_layer_extension_properties.
unsafe fn on_viewport_composition_layer_destroyed_rawptr(
&mut self,
layer: RawPtr<*const c_void>,
)
unsafe fn on_viewport_composition_layer_destroyed_rawptr( &mut self, layer: RawPtr<*const c_void>, )
§Godot docs
Called when a composition layer created via OpenXRCompositionLayer is destroyed.
layer is a pointer to an XrCompositionLayerBaseHeader struct.
§Safety
This method has automatically been marked unsafe because it accepts raw pointers as parameters.
If Godot does not document any safety requirements, make sure you understand the underlying semantics.
unsafe fn set_android_surface_swapchain_create_info_and_get_next_pointer_rawptr(
&mut self,
property_values: Dictionary<Variant, Variant>,
next_pointer: RawPtr<*mut c_void>,
) -> u64
unsafe fn set_android_surface_swapchain_create_info_and_get_next_pointer_rawptr( &mut self, property_values: Dictionary<Variant, Variant>, next_pointer: RawPtr<*mut c_void>, ) -> u64
§Godot docs
Add 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.
Note: This virtual method will be called on the render thread.
§Safety
This method has automatically been marked unsafe because it accepts raw pointers as parameters.
If Godot does not document any safety requirements, make sure you understand the underlying semantics.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.