Instance Methodmigueldeicaza.swiftgodot 0.45.0SwiftGodot
isSessionSupported(sessionMode:)
Checks if the given sessionMode
is supported by the user’s browser.
final func isSessionSupported(sessionMode: String)
Possible values come from WebXR’s XRSessionMode, including: "immersive-vr"
, "immersive-ar"
, and "inline"
.
This method returns nothing, instead it emits the [signal session_supported] signal with the result.
Other members in extension
Types
class Signal1
Signal support.
class Signal2
Signal support.
class Signal3
Signal support.
class Signal4
Signal support.
class Signal5
Signal support.
class Signal6
Signal support.
class Signal7
Signal support.
class Signal8
Signal support.
enum TargetRayMode
Type members
Instance members
var displayRefreshRateChanged: SimpleSignal
Emitted after the display’s refresh rate has changed.
var optionalFeatures: String
A comma-seperated list of optional features used by
initialize
when setting up the WebXR session.var referenceSpaceReset: SimpleSignal
Emitted to indicate that the reference space has been reset or reconfigured.
var referenceSpaceType: String
The reference space type (from the list of requested types set in the
requestedReferenceSpaceTypes
property), that was ultimately used byinitialize
when setting up the WebXR session.var requestedReferenceSpaceTypes: String
A comma-seperated list of reference space types used by
initialize
when setting up the WebXR session.var requiredFeatures: String
A comma-seperated list of required features used by
initialize
when setting up the WebXR session.var select: Signal4
Emitted after one of the input sources has finished its “primary action”.
var selectend: Signal5
Emitted when one of the input sources has finished its “primary action”.
var selectstart: Signal3
Emitted when one of the input source has started its “primary action”.
var sessionEnded: SimpleSignal
Emitted when the user ends the WebXR session (which can be done using UI from the browser or device).
var sessionFailed: Signal2
Emitted by
initialize
if the session fails to start.var sessionMode: String
The session mode used by
initialize
when setting up the WebXR session.var sessionStarted: SimpleSignal
Emitted by
initialize
if the session is successfully started.var sessionSupported: Signal1
Emitted by
isSessionSupported(sessionMode:)
to indicate if the givensessionMode
is supported or not.var squeeze: Signal7
Emitted after one of the input sources has finished its “primary squeeze action”.
var squeezeend: Signal8
Emitted when one of the input sources has finished its “primary squeeze action”.
var squeezestart: Signal6
Emitted when one of the input sources has started its “primary squeeze action”.
var visibilityState: String
Indicates if the WebXR session’s imagery is visible to the user.
var visibilityStateChanged: SimpleSignal
Emitted when
visibilityState
has changed.func getAvailableDisplayRefreshRates(
) -> GArray Returns display refresh rates supported by the current HMD. Only returned if this feature is supported by the web browser and after the interface has been initialized.
func getDisplayRefreshRate(
) -> Double Returns the display refresh rate for the current HMD. Not supported on all HMDs and browsers. It may not report an accurate value until after using
setDisplayRefreshRate(_:)
.func getInputSourceTargetRayMode(inputSourceId: Int32
) -> WebXRInterface.TargetRayMode Returns the target ray mode for the given
inputSourceId
.func getInputSourceTracker(inputSourceId: Int32
) -> XRPositionalTracker? Gets an
XRPositionalTracker
for the giveninputSourceId
.func isInputSourceActive(inputSourceId: Int32
) -> Bool Returns
true
if there is an active input source with the giveninputSourceId
.func setDisplayRefreshRate(Double
) Sets the display refresh rate for the current HMD. Not supported on all HMDs and browsers. It won’t take effect right away until after [signal display_refresh_rate_changed] is emitted.