Documentation
¶
Overview ¶
External XR interface plugins should inherit from this class.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- 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) ID() ID
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- 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 Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this [Extension]See Interface for methods that can be overridden by T.
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsXRInterface ¶
func (self *Extension[T]) AsXRInterface() XRInterface.Instance
func (*Extension[T]) AsXRInterfaceExtension ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
type Instance [1]gdclass.XRInterfaceExtension
Instance of the class with convieniently typed arguments and results.
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 _commit_views.
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 [Resource.ID] for a texture to which we should render the current frame if supported by the interface.
func (Instance) GetVelocityTexture ¶
type Interface ¶
type Interface interface { // Returns the name of this interface. GetName() string // Returns the capabilities of this interface. GetCapabilities() int // Returns true if this interface has been initialized. IsInitialized() bool // Initializes the interface, returns true on success. Initialize() bool // Uninitialize the interface. Uninitialize() // Returns a data structure with system information related to this interface. GetSystemInfo() map[string]interface{} // Returns true if this interface supports this play area mode. SupportsPlayAreaMode(mode XRInterface.PlayAreaMode) bool // Returns the play area mode that sets up our play area. GetPlayAreaMode() XRInterface.PlayAreaMode // Set the play area mode for this interface. SetPlayAreaMode(mode XRInterface.PlayAreaMode) bool // Returns a [][Vector3.XYZ] 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 [graphics.gd/classdb/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.BasisOrigin] that positions the [graphics.gd/classdb/XRCamera3D] in the world. GetCameraTransform() Transform3D.BasisOrigin // Returns a [Transform3D.BasisOrigin] for a given view. GetTransformForView(view int, cam_transform Transform3D.BasisOrigin) Transform3D.BasisOrigin // Returns the projection matrix for the given view as a []float64. GetProjectionForView(view int, aspect Float.X, z_near Float.X, z_far Float.X) []float64 GetVrsTexture() RID.Texture // Returns the format of the texture returned by [Interface.GetVrsTexture]. GetVrsTextureFormat() XRInterface.VRSTextureFormat // Called if this [graphics.gd/classdb/XRInterfaceExtension] is active before our physics and game process is called. Most XR interfaces will update its [graphics.gd/classdb/XRPositionalTracker]s at this point in time. Process() // Called if this [graphics.gd/classdb/XRInterfaceExtension] is active before rendering starts. Most XR interfaces will sync tracking at this point in time. PreRender() // Called if this is our primary [graphics.gd/classdb/XRInterfaceExtension] before we start processing a [graphics.gd/classdb/Viewport] for every active XR [graphics.gd/classdb/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. PreDrawViewport(render_target RID.Framebuffer) bool // Called after the XR [graphics.gd/classdb/Viewport] draw logic has completed. PostDrawViewport(render_target RID.Framebuffer, screen_rect Rect2.PositionSize) // Called if interface is active and queues have been submitted. EndFrame() // Returns a []string with tracker names configured by this interface. Note that user configuration can override this list. GetSuggestedTrackerNames() []string // Returns a []string with pose names configured by this interface. Note that user configuration can override this list. GetSuggestedPoseNames(tracker_name string) []string // Returns an [XRInterface.TrackingStatus] specifying the current status of our tracking. GetTrackingStatus() XRInterface.TrackingStatus // 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 true 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 [graphics.gd/classdb/CameraFeed] registered with the [graphics.gd/classdb/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.Texture // Return depth texture into which to render (if applicable). GetDepthTexture() RID.Texture // Return velocity texture into which to render (if applicable). GetVelocityTexture() RID.Texture }