2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-02-14 13:18:53 +00:00
<class name= "XRPositionalTracker" inherits= "RefCounted" version= "4.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 20:42:36 +00:00
<brief_description >
2019-06-21 23:04:47 +00:00
A tracked object.
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2019-06-21 23:04:47 +00: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.
2021-08-29 06:05:11 +00:00
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 [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 GDExtension-based interfaces can interact with them.
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
2021-11-15 09:43:07 +00:00
<link title= "VR documentation index" > $DOCS_URL/tutorials/vr/index.html</link>
2017-09-12 20:42:36 +00:00
</tutorials>
<methods >
2021-08-29 06:05:11 +00:00
<method name= "get_input" qualifiers= "const" >
<return type= "Variant" />
<argument index= "0" name= "name" type= "StringName" />
2017-09-12 20:42:36 +00:00
<description >
2021-08-29 06:05:11 +00:00
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.
2017-09-12 20:42:36 +00:00
</description>
</method>
2021-08-29 06:05:11 +00:00
<method name= "get_pose" qualifiers= "const" >
<return type= "XRPose" />
<argument index= "0" name= "name" type= "StringName" />
2019-02-05 10:02:13 +00:00
<description >
2021-08-29 06:05:11 +00:00
Returns the current [XRPose] state object for the bound [code]pose[/code].
2019-02-05 10:02:13 +00:00
</description>
</method>
2021-08-29 06:05:11 +00:00
<method name= "has_pose" qualifiers= "const" >
<return type= "bool" />
<argument index= "0" name= "name" type= "StringName" />
2017-09-12 20:42:36 +00:00
<description >
2021-08-29 06:05:11 +00:00
Returns [code]true[/code] if the bound [code]tracker[/code] is available and is currently tracking the bound [code]pose[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
2021-08-29 06:05:11 +00:00
<method name= "invalidate_pose" >
<return type= "void" />
<argument index= "0" name= "name" type= "StringName" />
2017-09-12 20:42:36 +00:00
<description >
2021-08-29 06:05:11 +00:00
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 loose tracking or just remain at their last known position.
2017-09-12 20:42:36 +00:00
</description>
</method>
2021-08-29 06:05:11 +00:00
<method name= "set_input" >
<return type= "void" />
<argument index= "0" name= "name" type= "StringName" />
<argument index= "1" name= "value" type= "Variant" />
2021-01-04 13:33:44 +00:00
<description >
2021-08-29 06:05:11 +00:00
Changes the value for the given input. This method is called by a [XRInterface] implementation and should not be used directly.
2021-01-04 13:33:44 +00:00
</description>
</method>
2021-08-29 06:05:11 +00:00
<method name= "set_pose" >
<return type= "void" />
<argument index= "0" name= "name" type= "StringName" />
<argument index= "1" name= "transform" type= "Transform3D" />
<argument index= "2" name= "linear_velocity" type= "Vector3" />
<argument index= "3" name= "angular_velocity" type= "Vector3" />
2022-01-19 08:21:06 +00:00
<argument index= "4" name= "tracking_confidence" type= "int" enum= "XRPose.TrackingConfidence" />
2020-02-27 11:09:23 +00:00
<description >
2022-01-19 08:21:06 +00:00
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.
2020-02-27 11:09:23 +00:00
</description>
</method>
2021-08-29 06:05:11 +00:00
</methods>
<members >
<member name= "description" type= "String" setter= "set_tracker_desc" getter= "get_tracker_desc" default= """" >
The description of this tracker.
</member>
<member name= "hand" type= "int" setter= "set_tracker_hand" getter= "get_tracker_hand" enum= "XRPositionalTracker.TrackerHand" default= "0" >
Defines which hand this tracker relates to.
</member>
<member name= "name" type= "StringName" setter= "set_tracker_name" getter= "get_tracker_name" default= "&"Unknown"" >
The unique name of this tracker. The trackers that are available differ between various XR runtimes and can often be configured by the user. Godot maintains a number of reserved names that it expects the [XRInterface] to implement if applicable:
- [code]left_hand[/code] identifies the controller held in the players left hand
- [code]right_hand[/code] identifies the controller held in the players right hand
</member>
<member name= "type" type= "int" setter= "set_tracker_type" getter= "get_tracker_type" enum= "XRServer.TrackerType" default= "128" >
The type of tracker.
</member>
</members>
<signals >
<signal name= "button_pressed" >
<argument index= "0" name= "name" type= "String" />
2020-04-15 19:22:14 +00:00
<description >
2021-08-29 06:05:11 +00:00
Emitted when a button on this tracker is pressed. Note that many XR runtimes allow other inputs to be mapped to buttons.
2020-04-15 19:22:14 +00:00
</description>
2021-08-29 06:05:11 +00:00
</signal>
<signal name= "button_released" >
<argument index= "0" name= "name" type= "String" />
2020-04-15 19:22:14 +00:00
<description >
2021-08-29 06:05:11 +00:00
Emitted when a button on this tracker is released.
2020-04-15 19:22:14 +00:00
</description>
2021-08-29 06:05:11 +00:00
</signal>
<signal name= "input_axis_changed" >
<argument index= "0" name= "name" type= "String" />
<argument index= "1" name= "vector" type= "Vector2" />
2021-01-04 13:33:44 +00:00
<description >
2021-08-29 06:05:11 +00:00
Emitted when a thumbstick or thumbpad on this tracker moves.
2021-01-04 13:33:44 +00:00
</description>
2021-08-29 06:05:11 +00:00
</signal>
<signal name= "input_value_changed" >
<argument index= "0" name= "name" type= "String" />
<argument index= "1" name= "value" type= "float" />
2017-09-12 20:42:36 +00:00
<description >
2021-08-29 06:05:11 +00:00
Emitted when a trigger or similar input on this tracker changes value.
2017-09-12 20:42:36 +00:00
</description>
2021-08-29 06:05:11 +00:00
</signal>
<signal name= "pose_changed" >
<argument index= "0" name= "pose" type= "XRPose" />
2017-09-12 20:42:36 +00:00
<description >
2021-08-29 06:05:11 +00:00
Emitted when the state of a pose tracked by this tracker changes.
2017-09-12 20:42:36 +00:00
</description>
2021-08-29 06:05:11 +00:00
</signal>
</signals>
2017-09-12 20:42:36 +00:00
<constants >
2017-11-24 22:16:30 +00:00
<constant name= "TRACKER_HAND_UNKNOWN" value= "0" enum= "TrackerHand" >
2017-10-22 00:35:25 +00:00
The hand this tracker is held in is unknown or not applicable.
2017-09-12 20:42:36 +00:00
</constant>
2020-12-10 10:30:37 +00:00
<constant name= "TRACKER_HAND_LEFT" value= "1" enum= "TrackerHand" >
2017-10-22 00:35:25 +00:00
This tracker is the left hand controller.
2017-09-12 20:42:36 +00:00
</constant>
2020-12-10 10:30:37 +00:00
<constant name= "TRACKER_HAND_RIGHT" value= "2" enum= "TrackerHand" >
2017-10-22 00:35:25 +00:00
This tracker is the right hand controller.
2017-09-12 20:42:36 +00:00
</constant>
</constants>
</class>