Trait IXrInterfaceExtension
pub trait IXrInterfaceExtension: GodotClass<Base = XrInterfaceExtension> + You_forgot_the_attribute__godot_api {
Show 40 methods
// Provided methods
fn init(base: Base<Self::Base>) -> Self { ... }
fn process(&mut 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_name(&self) -> StringName { ... }
fn get_capabilities(&self) -> u32 { ... }
fn is_initialized(&self) -> bool { ... }
fn initialize(&mut self) -> bool { ... }
fn uninitialize(&mut self) { ... }
fn get_system_info(&self) -> AnyDictionary { ... }
fn supports_play_area_mode(&self, mode: PlayAreaMode) -> bool { ... }
fn get_play_area_mode(&self) -> PlayAreaMode { ... }
fn set_play_area_mode(&self, mode: PlayAreaMode) -> bool { ... }
fn get_play_area(&self) -> PackedArray<Vector3> { ... }
fn get_render_target_size(&mut self) -> Vector2 { ... }
fn get_view_count(&mut self) -> u32 { ... }
fn get_camera_transform(&mut self) -> Transform3D { ... }
fn get_transform_for_view(
&mut self,
view: u32,
cam_transform: Transform3D,
) -> Transform3D { ... }
fn get_projection_for_view(
&mut self,
view: u32,
aspect: f64,
z_near: f64,
z_far: f64,
) -> PackedArray<f64> { ... }
fn get_vrs_texture(&mut self) -> Rid { ... }
fn get_vrs_texture_format(&mut self) -> VrsTextureFormat { ... }
fn pre_render(&mut self) { ... }
fn pre_draw_viewport(&mut self, render_target: Rid) -> bool { ... }
fn post_draw_viewport(&mut self, render_target: Rid, screen_rect: Rect2) { ... }
fn end_frame(&mut self) { ... }
fn get_suggested_tracker_names(&self) -> PackedArray<GString> { ... }
fn get_suggested_pose_names(
&self,
tracker_name: StringName,
) -> PackedArray<GString> { ... }
fn get_tracking_status(&self) -> TrackingStatus { ... }
fn trigger_haptic_pulse(
&mut self,
action_name: GString,
tracker_name: StringName,
frequency: f64,
amplitude: f64,
duration_sec: f64,
delay_sec: f64,
) { ... }
fn get_anchor_detection_is_enabled(&self) -> bool { ... }
fn set_anchor_detection_is_enabled(&mut self, enabled: bool) { ... }
fn get_camera_feed_id(&self) -> i32 { ... }
fn get_color_texture(&mut self) -> Rid { ... }
fn get_depth_texture(&mut self) -> Rid { ... }
fn get_velocity_texture(&mut self) -> Rid { ... }
}Expand description
§Interface trait for class XrInterfaceExtension.
Functions in this trait represent constructors (init) or virtual method callbacks invoked by the engine.
§Related symbols
Base interfaces: > IXrInterfaceIRefCounted > IObject.
(Strike-through means some intermediate Godot classes are marked final, and can thus not be inherited by GDExtension.)
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 process(&mut self)
fn process(&mut self)
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.
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_name(&self) -> StringName
fn get_name(&self) -> StringName
Returns the name of this interface.
fn get_capabilities(&self) -> u32
fn get_capabilities(&self) -> u32
Returns the capabilities of this interface.
fn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
Returns true if this interface has been initialized.
fn initialize(&mut self) -> bool
fn initialize(&mut self) -> bool
Initializes the interface, returns true on success.
fn uninitialize(&mut self)
fn uninitialize(&mut self)
Uninitialize the interface.
fn get_system_info(&self) -> AnyDictionary
fn get_system_info(&self) -> AnyDictionary
Returns a Dictionary with system information related to this interface.
fn supports_play_area_mode(&self, mode: PlayAreaMode) -> bool
fn supports_play_area_mode(&self, mode: PlayAreaMode) -> bool
Returns true if this interface supports this play area mode.
fn get_play_area_mode(&self) -> PlayAreaMode
fn get_play_area_mode(&self) -> PlayAreaMode
Returns the play area mode that sets up our play area.
fn set_play_area_mode(&self, mode: PlayAreaMode) -> bool
fn set_play_area_mode(&self, mode: PlayAreaMode) -> bool
Set the play area mode for this interface.
fn get_play_area(&self) -> PackedArray<Vector3>
fn get_play_area(&self) -> PackedArray<Vector3>
Returns a PackedVector3Array that represents the play areas boundaries (if applicable).
fn get_render_target_size(&mut self) -> Vector2
fn get_render_target_size(&mut self) -> Vector2
Returns the size of our render target for this interface, this overrides the size of the Viewport marked as the xr viewport.
fn get_view_count(&mut self) -> u32
fn get_view_count(&mut self) -> u32
Returns the number of views this interface requires, 1 for mono, 2 for stereoscopic.
fn get_camera_transform(&mut self) -> Transform3D
fn get_camera_transform(&mut self) -> Transform3D
Returns the Transform3D that positions the XRCamera3D in the world.
fn get_transform_for_view(
&mut self,
view: u32,
cam_transform: Transform3D,
) -> Transform3D
fn get_transform_for_view( &mut self, view: u32, cam_transform: Transform3D, ) -> Transform3D
Returns a Transform3D for a given view.
fn get_projection_for_view(
&mut self,
view: u32,
aspect: f64,
z_near: f64,
z_far: f64,
) -> PackedArray<f64>
fn get_projection_for_view( &mut self, view: u32, aspect: f64, z_near: f64, z_far: f64, ) -> PackedArray<f64>
Returns the projection matrix for the given view as a PackedFloat64Array.
fn get_vrs_texture(&mut self) -> Rid
fn get_vrs_texture_format(&mut self) -> VrsTextureFormat
fn get_vrs_texture_format(&mut self) -> VrsTextureFormat
Returns the format of the texture returned by get_vrs_texture.
fn pre_render(&mut self)
fn pre_render(&mut self)
Called if this XRInterfaceExtension is active before rendering starts. Most XR interfaces will sync tracking at this point in time.
fn pre_draw_viewport(&mut self, render_target: Rid) -> bool
fn pre_draw_viewport(&mut self, render_target: Rid) -> bool
fn post_draw_viewport(&mut self, render_target: Rid, screen_rect: Rect2)
fn post_draw_viewport(&mut self, render_target: Rid, screen_rect: Rect2)
Called after the XR Viewport draw logic has completed.
fn end_frame(&mut self)
fn end_frame(&mut self)
Called if interface is active and queues have been submitted.
fn get_suggested_tracker_names(&self) -> PackedArray<GString>
fn get_suggested_tracker_names(&self) -> PackedArray<GString>
Returns a PackedStringArray with tracker names configured by this interface. Note that user configuration can override this list.
fn get_suggested_pose_names(
&self,
tracker_name: StringName,
) -> PackedArray<GString>
fn get_suggested_pose_names( &self, tracker_name: StringName, ) -> PackedArray<GString>
Returns a PackedStringArray with pose names configured by this interface. Note that user configuration can override this list.
fn get_tracking_status(&self) -> TrackingStatus
fn get_tracking_status(&self) -> TrackingStatus
Returns the current status of our tracking.
fn trigger_haptic_pulse(
&mut self,
action_name: GString,
tracker_name: StringName,
frequency: f64,
amplitude: f64,
duration_sec: f64,
delay_sec: f64,
)
fn trigger_haptic_pulse( &mut self, action_name: GString, tracker_name: StringName, frequency: f64, amplitude: f64, duration_sec: f64, delay_sec: f64, )
Triggers a haptic pulse to be emitted on the specified tracker.
fn get_anchor_detection_is_enabled(&self) -> bool
fn get_anchor_detection_is_enabled(&self) -> bool
Return true if anchor detection is enabled for this interface.
fn set_anchor_detection_is_enabled(&mut self, enabled: bool)
fn set_anchor_detection_is_enabled(&mut self, enabled: bool)
Enables anchor detection on this interface if supported.
fn get_camera_feed_id(&self) -> i32
fn get_camera_feed_id(&self) -> i32
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).
fn get_color_texture(&mut self) -> Rid
fn get_color_texture(&mut self) -> Rid
Return color texture into which to render (if applicable).
fn get_depth_texture(&mut self) -> Rid
fn get_depth_texture(&mut self) -> Rid
Return depth texture into which to render (if applicable).
fn get_velocity_texture(&mut self) -> Rid
fn get_velocity_texture(&mut self) -> Rid
Return velocity texture into which to render (if applicable).
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.