Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AESContext
- AStar2D
- AStar3D
- AStarGrid2D
- AudioEffectInstance (1)
- AudioSample
- AudioSamplePlayback
- AudioStreamPlayback (5)
- CameraFeed
- CharFXTransform
- ConfigFile
- Crypto
- DTLSServer
- DirAccess
- ENetConnection
- EditorContextMenuPlugin
- EditorDebuggerPlugin
- EditorDebuggerSession
- EditorExportPlatform (6)
- EditorExportPlugin
- EditorExportPreset
- EditorFeatureProfile
- EditorFileSystemImportFormatSupportQuery
- EditorInspectorPlugin
- EditorResourceConversionPlugin
- EditorResourcePreviewGenerator
- EditorResourceTooltipPlugin
- EditorSceneFormatImporter (4)
- EditorScenePostImport
- EditorScenePostImportPlugin
- EditorScript
- EditorTranslationParserPlugin
- EncodedObjectAsID
- EngineProfiler
- Expression
- FileAccess
- GLTFObjectModelProperty
- HMACContext
- HTTPClient
- HashingContext
- ImageFormatLoader (1)
- JavaClass
- JavaObject
- JavaScriptObject
- KinematicCollision2D
- KinematicCollision3D
- Lightmapper (1)
- MeshConvexDecompositionSettings
- MeshDataTool
- MultiplayerAPI (2)
- Mutex
- NavigationPathQueryParameters2D
- NavigationPathQueryParameters3D
- NavigationPathQueryResult2D
- NavigationPathQueryResult3D
- Node3DGizmo (1)
- OggPacketSequencePlayback
- OpenXRAPIExtension
- PCKPacker
- PackedDataContainerRef
- PacketPeer (8)
- PhysicsPointQueryParameters2D
- PhysicsPointQueryParameters3D
- PhysicsRayQueryParameters2D
- PhysicsRayQueryParameters3D
- PhysicsShapeQueryParameters2D
- PhysicsShapeQueryParameters3D
- PhysicsTestMotionParameters2D
- PhysicsTestMotionParameters3D
- PhysicsTestMotionResult2D
- PhysicsTestMotionResult3D
- RDAttachmentFormat
- RDFramebufferPass
- RDPipelineColorBlendState
- RDPipelineColorBlendStateAttachment
- RDPipelineDepthStencilState
- RDPipelineMultisampleState
- RDPipelineRasterizationState
- RDPipelineSpecializationConstant
- RDSamplerState
- RDShaderSource
- RDTextureFormat
- RDTextureView
- RDUniform
- RDVertexAttribute
- RandomNumberGenerator
- RegEx
- RegExMatch
- RenderSceneBuffers (2)
- RenderSceneBuffersConfiguration
- Resource (103)
- ResourceFormatLoader
- ResourceFormatSaver
- ResourceImporter (16)
- SceneState
- SceneTreeTimer
- Semaphore
- SkinReference
- StreamPeer (5)
- SurfaceTool
- TCPServer
- TLSOptions
- TextLine
- TextParagraph
- TextServer (1)
- Thread
- TranslationDomain
- TriangleMesh
- Tween
- Tweener (5)
- UDPServer
- UPNP
- UPNPDevice
- WeakRef
- WebRTCPeerConnection (1)
- XMLParser
- XRInterface (4)
- XRPose
- XRTracker (2)
- ZIPPacker
- ZIPReader
Table of contents
-
var hand = TRACKER_HAND_UNKNOWN -
var profile: String = "" -
const func get_input(name: StringName) -> Variant -
const func get_pose(name: StringName) -> XRPose -
const func has_pose(name: StringName) -> bool -
func invalidate_pose(name: StringName) -> void -
func set_input(value: Variant) -> void -
func set_pose(tracking_confidence: int enumXRPose.TrackingConfidence) -> void -
const TRACKER_HAND_UNKNOWN = 0 enum TrackerHand -
const TRACKER_HAND_LEFT = 1 enum TrackerHand -
const TRACKER_HAND_RIGHT = 2 enum TrackerHand -
const TRACKER_HAND_MAX = 3 enum TrackerHand -
enum TrackerHand -
signal button_pressed(name: String) -
signal button_released(name: String) -
signal input_float_changed(value: float) -
signal input_vector2_changed(vector: Vector2) -
signal pose_changed(pose: XRPose) -
signal pose_lost_tracking(pose: XRPose) -
signal profile_changed(role: String)
XRPositionalTracker #
is_refcounted, is_instantiable, core, not_builtin_classes
A tracked object.
An instance of this object represents a device that is tracked, such as a controller or anchor point. HMDs aren't represented here as they are handled internally.
As controllers are turned on and the XRInterface detects them, instances of this object are automatically added to this list of active tracking objects accessible through the XRServer.
The XRNode3D and XRAnchor3D both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDExtension-based interfaces can interact with them.
Members #
var hand = TRACKER_HAND_UNKNOWN#
Defines which hand this tracker relates to.
var profile: String = ""#
The profile associated with this tracker, interface dependent but will indicate the type of controller being tracked.
Methods #
const func get_input(name: StringName) -> Variant#
Returns an input for this tracker. It can return a boolean, float or Vector2 value depending on whether the input is a button, trigger or thumbstick/thumbpad.
const func get_pose(name: StringName) -> XRPose#
Returns the current XRPose state object for the bound name pose.
const func has_pose(name: StringName) -> bool#
Returns true if the tracker is available and is currently tracking the bound name pose.
func invalidate_pose(name: StringName) -> void#
Marks this pose as invalid, we don't clear the last reported state but it allows users to decide if trackers need to be hidden if we lose tracking or just remain at their last known position.
func set_input(value: Variant) -> void#
Changes the value for the given input. This method is called by a XRInterface implementation and should not be used directly.
func set_pose(tracking_confidence: int enumXRPose.TrackingConfidence) -> void#
Sets the transform, linear velocity, angular velocity and tracking confidence for the given pose. This method is called by a XRInterface implementation and should not be used directly.
Annotations #
Constants #
const TRACKER_HAND_UNKNOWN = 0 enum TrackerHand#
The hand this tracker is held in is unknown or not applicable.
const TRACKER_HAND_LEFT = 1 enum TrackerHand#
This tracker is the left hand controller.
const TRACKER_HAND_RIGHT = 2 enum TrackerHand#
This tracker is the right hand controller.
const TRACKER_HAND_MAX = 3 enum TrackerHand#
Represents the size of the TrackerHand enum.
Constructors #
Enums #
TrackerHand#
enum TrackerHand {
TRACKER_HAND_UNKNOWN = 0,
TRACKER_HAND_LEFT = 1,
TRACKER_HAND_RIGHT = 2,
TRACKER_HAND_MAX = 3,
} Operators #
Signals #
signal button_pressed(name: String)#
Emitted when a button on this tracker is pressed. Note that many XR runtimes allow other inputs to be mapped to buttons.
signal button_released(name: String)#
Emitted when a button on this tracker is released.
signal input_float_changed(value: float)#
Emitted when a trigger or similar input on this tracker changes value.
signal input_vector2_changed(vector: Vector2)#
Emitted when a thumbstick or thumbpad on this tracker moves.
signal pose_changed(pose: XRPose)#
Emitted when the state of a pose tracked by this tracker changes.
signal pose_lost_tracking(pose: XRPose)#
Emitted when a pose tracked by this tracker stops getting updated tracking data.
signal profile_changed(role: String)#
Emitted when the profile of our tracker changes.