Enumerationmigueldeicaza.swiftgodot 0.46.0SwiftGodot
TrackerType
XRServer.swift:37enum TrackerType
Cases
case head
The tracker tracks the location of the players head. This is usually a location centered between the players eyes. Note that for handheld AR devices this can be the current location of the device.
case controller
The tracker tracks the location of a controller.
case basestation
The tracker tracks the location of a base station.
case anchor
The tracker tracks the location and size of an AR anchor.
case hand
The tracker tracks the location and joints of a hand.
case body
The tracker tracks the location and joints of a body.
case face
The tracker tracks the expressions of a face.
case anyKnown
Used internally to filter trackers of any known type.
case unknown
Used internally if we haven’t set the tracker type yet.
case any
Used internally to select all trackers.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (31) members.
Types
enum RotationMode
class Signal1
Signal support.
class Signal2
Signal support.
class Signal3
Signal support.
class Signal4
Signal support.
class Signal5
Signal support.
Type members
static var primaryInterface: XRInterface?
The primary
XRInterface
currently bound to theXRServer
.static var worldOrigin: Transform3D
The current origin of our tracking space in the virtual world. This is used by the renderer to properly position the camera with new tracking data.
static var worldScale: Double
The scale of the game world compared to the real world. By default, most AR/VR platforms assume that 1 game unit corresponds to 1 real world meter.
static func addInterface(XRInterface?
) Registers an
XRInterface
object.static func addTracker(XRTracker?
) Registers a new
XRTracker
that tracks a physical object.static func centerOnHmd(rotationMode: XRServer.RotationMode, keepHeight: Bool
) This is an important function to understand correctly. AR and VR platforms all handle positioning slightly differently.
static func clearReferenceFrame(
) Clears the reference frame that was set by previous calls to
centerOnHmd(rotationMode:keepHeight:)
.static func findInterface(name: String
) -> XRInterface? Finds an interface by its
name
. For example, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it.static func getHmdTransform(
) -> Transform3D Returns the primary interface’s transformation.
static func getInterface(idx: Int32
) -> XRInterface? Returns the interface registered at the given
idx
index in the list of interfaces.static func getInterfaceCount(
) -> Int32 Returns the number of interfaces currently registered with the AR/VR server. If your project supports multiple AR/VR platforms, you can look through the available interface, and either present the user with a selection or simply try to initialize each interface and use the first one that returns
true
.static func getInterfaces(
) -> VariantCollection<GDictionary> Returns a list of available interfaces the ID and name of each interface.
static func getReferenceFrame(
) -> Transform3D Returns the reference frame transform. Mostly used internally and exposed for GDExtension build interfaces.
static func getTracker(trackerName: StringName
) -> XRTracker? Returns the positional tracker with the given
trackerName
.static func getTrackers(trackerTypes: Int32
) -> GDictionary Returns a dictionary of trackers for
trackerTypes
.static func removeInterface(XRInterface?
) Removes this
interface
.static func removeTracker(XRTracker?
) Removes this
tracker
.class var godotClassName: StringName
Instance members
var interfaceAdded: Signal1
Emitted when a new interface has been added.
var interfaceRemoved: Signal2
Emitted when an interface is removed.
var referenceFrameChanged: SimpleSignal
Emitted when the reference frame transform changes.
var trackerAdded: Signal3
Emitted when a new tracker has been added. If you don’t use a fixed number of controllers or if you’re using
XRAnchor3D
s for an AR solution, it is important to react to this signal to add the appropriateXRController3D
orXRAnchor3D
nodes related to this new tracker.var trackerRemoved: Signal5
Emitted when a tracker is removed. You should remove any
XRController3D
orXRAnchor3D
points if applicable. This is not mandatory, the nodes simply become inactive and will be made active again when a new tracker becomes available (i.e. a new controller is switched on that takes the place of the previous one).var trackerUpdated: Signal4
Emitted when an existing tracker has been updated. This can happen if the user switches controllers.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.