summaryrefslogtreecommitdiff
path: root/doc/classes/XRPositionalTracker.xml
blob: d231bfde746056cdb797ab079ea45323aaec7b0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?xml version="1.0" encoding="UTF-8" ?>
<class name="XRPositionalTracker" inherits="RefCounted" version="4.0">
	<brief_description>
		A tracked object.
	</brief_description>
	<description>
		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 AR/VR interface detects them, instances of this object are automatically added to this list of active tracking objects accessible through the [XRServer].
		The [XRController3D] 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 GDNative-based interfaces can interact with them.
	</description>
	<tutorials>
		<link title="VR documentation index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
	</tutorials>
	<methods>
		<method name="get_joy_id" qualifiers="const">
			<return type="int" />
			<description>
				If this is a controller that is being tracked, the controller will also be represented by a joystick entry with this ID.
			</description>
		</method>
		<method name="get_mesh" qualifiers="const">
			<return type="Mesh" />
			<description>
				Returns the mesh related to a controller or anchor point if one is available.
			</description>
		</method>
		<method name="get_orientation" qualifiers="const">
			<return type="Basis" />
			<description>
				Returns the controller's orientation matrix.
			</description>
		</method>
		<method name="get_position" qualifiers="const">
			<return type="Vector3" />
			<description>
				Returns the world-space controller position.
			</description>
		</method>
		<method name="get_tracker_hand" qualifiers="const">
			<return type="int" enum="XRPositionalTracker.TrackerHand" />
			<description>
				Returns the hand holding this tracker, if known. See [enum TrackerHand] constants.
			</description>
		</method>
		<method name="get_tracker_id" qualifiers="const">
			<return type="int" />
			<description>
				Returns the internal tracker ID. This uniquely identifies the tracker per tracker type and matches the ID you need to specify for nodes such as the [XRController3D] and [XRAnchor3D] nodes.
			</description>
		</method>
		<method name="get_tracker_name" qualifiers="const">
			<return type="StringName" />
			<description>
				Returns the controller or anchor point's name, if applicable.
			</description>
		</method>
		<method name="get_tracker_type" qualifiers="const">
			<return type="int" enum="XRServer.TrackerType" />
			<description>
				Returns the tracker's type, which will be one of the values from the [enum XRServer.TrackerType] enum.
			</description>
		</method>
		<method name="get_transform" qualifiers="const">
			<return type="Transform3D" />
			<argument index="0" name="adjust_by_reference_frame" type="bool" />
			<description>
				Returns the transform combining this device's orientation and position.
			</description>
		</method>
		<method name="is_tracking_orientation" qualifiers="const">
			<return type="bool" />
			<description>
				Returns [code]true[/code] if this device is tracking orientation.
			</description>
		</method>
		<method name="is_tracking_position" qualifiers="const">
			<return type="bool" />
			<description>
				Returns [code]true[/code] if this device is tracking position.
			</description>
		</method>
	</methods>
	<members>
		<member name="rumble" type="float" setter="set_rumble" getter="get_rumble" default="0.0">
			The degree to which the tracker rumbles. Ranges from [code]0.0[/code] to [code]1.0[/code] with precision [code].01[/code].
		</member>
	</members>
	<constants>
		<constant name="TRACKER_HAND_UNKNOWN" value="0" enum="TrackerHand">
			The hand this tracker is held in is unknown or not applicable.
		</constant>
		<constant name="TRACKER_HAND_LEFT" value="1" enum="TrackerHand">
			This tracker is the left hand controller.
		</constant>
		<constant name="TRACKER_HAND_RIGHT" value="2" enum="TrackerHand">
			This tracker is the right hand controller.
		</constant>
	</constants>
</class>