Documentation
¶
Overview ¶
Package XRInterfaceExtension provides methods for working with XRInterfaceExtension object instances.
Index ¶
- type Advanced
- type Any
- type Implementation
- type Instance
- func (self Instance) AddBlit(render_target RID.Framebuffer, src_rect Rect2.PositionSize, ...)
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsXRInterface() XRInterface.Instance
- func (self Instance) AsXRInterfaceExtension() Instance
- func (self Instance) GetColorTexture() RID.Texture
- func (self Instance) GetDepthTexture() RID.Texture
- func (self Instance) GetRenderTargetTexture(render_target RID.Framebuffer) RID.Texture
- func (self Instance) GetVelocityTexture() RID.Texture
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
type Instance [1]gdclass.XRInterfaceExtension
External XR interface plugins should inherit from this class.
See [Interface] for methods that can be overridden by a [Class] that extends it.
%!(EXTRA string=XRInterfaceExtension)
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddBlit ¶
func (self Instance) AddBlit(render_target RID.Framebuffer, src_rect Rect2.PositionSize, dst_rect Rect2i.PositionSize, use_layer bool, layer int, apply_lens_distortion bool, eye_center Vector2.XY, k1 Float.X, k2 Float.X, upscale Float.X, aspect_ratio Float.X)
Blits our render results to screen optionally applying lens distortion. This can only be called while processing [code]_commit_views[/code].
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsXRInterface ¶
func (self Instance) AsXRInterface() XRInterface.Instance
func (Instance) AsXRInterfaceExtension ¶
func (Instance) GetColorTexture ¶
func (Instance) GetDepthTexture ¶
func (Instance) GetRenderTargetTexture ¶
func (self Instance) GetRenderTargetTexture(render_target RID.Framebuffer) RID.Texture
Returns a valid [RID] for a texture to which we should render the current frame if supported by the interface.
func (Instance) GetVelocityTexture ¶
func (*Instance) UnsafePointer ¶
type Interface ¶
type Interface interface { //Returns the name of this interface. GetName() string //Returns the capabilities of this interface. GetCapabilities() int //Returns [code]true[/code] if this interface has been initialized. IsInitialized() bool //Initializes the interface, returns [code]true[/code] on success. Initialize() bool //Uninitialize the interface. Uninitialize() //Returns a [Dictionary] with system information related to this interface. GetSystemInfo() map[any]any //Returns [code]true[/code] if this interface supports this play area mode. SupportsPlayAreaMode(mode gdclass.XRInterfacePlayAreaMode) bool //Returns the play area mode that sets up our play area. GetPlayAreaMode() gdclass.XRInterfacePlayAreaMode //Set the play area mode for this interface. SetPlayAreaMode(mode gdclass.XRInterfacePlayAreaMode) bool //Returns a [PackedVector3Array] that represents the play areas boundaries (if applicable). GetPlayArea() []Vector3.XYZ //Returns the size of our render target for this interface, this overrides the size of the [Viewport] marked as the xr viewport. GetRenderTargetSize() Vector2.XY //Returns the number of views this interface requires, 1 for mono, 2 for stereoscopic. GetViewCount() int //Returns the [Transform3D] that positions the [XRCamera3D] in the world. GetCameraTransform() Transform3D.BasisOrigin //Returns a [Transform3D] for a given view. GetTransformForView(view int, cam_transform Transform3D.BasisOrigin) Transform3D.BasisOrigin //Returns the projection matrix for the given view as a [PackedFloat64Array]. GetProjectionForView(view int, aspect Float.X, z_near Float.X, z_far Float.X) []float64 GetVrsTexture() RID.Any //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. Process() //Called if this [XRInterfaceExtension] is active before rendering starts. Most XR interfaces will sync tracking at this point in time. PreRender() //Called if this is our primary [XRInterfaceExtension] before we start processing a [Viewport] for every active XR [Viewport], returns [code]true[/code] if that viewport should be rendered. An XR interface may return [code]false[/code] if the user has taken off their headset and we can pause rendering. PreDrawViewport(render_target RID.Any) bool //Called after the XR [Viewport] draw logic has completed. PostDrawViewport(render_target RID.Any, screen_rect Rect2.PositionSize) //Called if interface is active and queues have been submitted. EndFrame() //Returns a [PackedStringArray] with tracker names configured by this interface. Note that user configuration can override this list. GetSuggestedTrackerNames() []string //Returns a [PackedStringArray] with pose names configured by this interface. Note that user configuration can override this list. GetSuggestedPoseNames(tracker_name string) []string //Returns a [enum XRInterface.TrackingStatus] specifying the current status of our tracking. GetTrackingStatus() gdclass.XRInterfaceTrackingStatus //Triggers a haptic pulse to be emitted on the specified tracker. TriggerHapticPulse(action_name string, tracker_name string, frequency Float.X, amplitude Float.X, duration_sec Float.X, delay_sec Float.X) //Return [code]true[/code] if anchor detection is enabled for this interface. GetAnchorDetectionIsEnabled() bool //Enables anchor detection on this interface if supported. SetAnchorDetectionIsEnabled(enabled bool) //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). GetCameraFeedId() int //Return color texture into which to render (if applicable). GetColorTexture() RID.Any //Return depth texture into which to render (if applicable). GetDepthTexture() RID.Any //Return velocity texture into which to render (if applicable). GetVelocityTexture() RID.Any }