2017-09-13 04:42:36 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
2021-03-29 18:15:53 +08:00
<class name= "XRPositionalTracker" inherits= "Reference" version= "4.0" >
2017-09-13 04:42:36 +08:00
<brief_description >
2019-06-22 07:04:47 +08:00
A tracked object.
2017-09-13 04:42:36 +08:00
</brief_description>
<description >
2019-06-22 07:04:47 +08:00
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.
2020-04-08 22:47:36 +08:00
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.
2017-09-13 04:42:36 +08:00
</description>
<tutorials >
2020-08-05 20:43:40 +08:00
<link title= "VR tutorial index" > https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
2017-09-13 04:42:36 +08:00
</tutorials>
<methods >
<method name= "get_joy_id" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2019-06-22 07:04:47 +08:00
If this is a controller that is being tracked, the controller will also be represented by a joystick entry with this ID.
2017-09-13 04:42:36 +08:00
</description>
</method>
2019-02-05 18:02:13 +08:00
<method name= "get_mesh" qualifiers= "const" >
<return type= "Mesh" >
</return>
<description >
Returns the mesh related to a controller or anchor point if one is available.
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "get_orientation" qualifiers= "const" >
<return type= "Basis" >
</return>
<description >
2017-12-07 14:16:27 +08:00
Returns the controller's orientation matrix.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_position" qualifiers= "const" >
<return type= "Vector3" >
</return>
<description >
2017-12-07 14:16:27 +08:00
Returns the world-space controller position.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-01-04 21:33:44 +08:00
<method name= "get_tracker_hand" qualifiers= "const" >
<return type= "int" enum= "XRPositionalTracker.TrackerHand" >
</return>
<description >
Returns the hand holding this tracker, if known. See [enum TrackerHand] constants.
</description>
</method>
2020-02-27 19:09:23 +08:00
<method name= "get_tracker_id" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2020-04-08 22:47:36 +08:00
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.
2020-02-27 19:09:23 +08:00
</description>
</method>
2020-04-16 03:22:14 +08:00
<method name= "get_tracker_name" qualifiers= "const" >
<return type= "StringName" >
</return>
<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" >
</return>
<description >
Returns the tracker's type, which will be one of the values from the [enum XRServer.TrackerType] enum.
</description>
</method>
2021-01-04 21:33:44 +08:00
<method name= "get_transform" qualifiers= "const" >
<return type= "Transform" >
</return>
<argument index= "0" name= "adjust_by_reference_frame" type= "bool" >
</argument>
<description >
Returns the transform combining this device's orientation and position.
</description>
</method>
2020-12-10 19:16:14 +08:00
<method name= "is_tracking_orientation" qualifiers= "const" >
2017-09-13 04:42:36 +08:00
<return type= "bool" >
</return>
<description >
2020-12-10 19:16:14 +08:00
Returns [code]true[/code] if this device is tracking orientation.
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-12-10 19:16:14 +08:00
<method name= "is_tracking_position" qualifiers= "const" >
2017-09-13 04:42:36 +08:00
<return type= "bool" >
</return>
<description >
2020-12-10 19:16:14 +08:00
Returns [code]true[/code] if this device is tracking position.
2017-09-13 04:42:36 +08:00
</description>
</method>
</methods>
2017-11-13 16:24:36 +08:00
<members >
2019-06-29 18:38:01 +08:00
<member name= "rumble" type= "float" setter= "set_rumble" getter= "get_rumble" default= "0.0" >
2017-12-07 14:16:27 +08:00
The degree to which the tracker rumbles. Ranges from [code]0.0[/code] to [code]1.0[/code] with precision [code].01[/code].
2017-11-13 16:24:36 +08:00
</member>
</members>
2017-09-13 04:42:36 +08:00
<constants >
2017-11-25 06:16:30 +08:00
<constant name= "TRACKER_HAND_UNKNOWN" value= "0" enum= "TrackerHand" >
2017-10-22 08:35:25 +08:00
The hand this tracker is held in is unknown or not applicable.
2017-09-13 04:42:36 +08:00
</constant>
2020-12-10 18:30:37 +08:00
<constant name= "TRACKER_HAND_LEFT" value= "1" enum= "TrackerHand" >
2017-10-22 08:35:25 +08:00
This tracker is the left hand controller.
2017-09-13 04:42:36 +08:00
</constant>
2020-12-10 18:30:37 +08:00
<constant name= "TRACKER_HAND_RIGHT" value= "2" enum= "TrackerHand" >
2017-10-22 08:35:25 +08:00
This tracker is the right hand controller.
2017-09-13 04:42:36 +08:00
</constant>
</constants>
</class>