blob: 1264f89f6497803fef00727b901a62902e82210a (
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
|
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ARVRController" inherits="Spatial" category="Core" version="3.2">
<brief_description>
A spatial node representing a spatially tracked controller.
</brief_description>
<description>
This is a helper spatial node that is linked to the tracking of controllers. It also offers several handy passthroughs to the state of buttons and such on the controllers.
Controllers are linked by their id. You can create controller nodes before the controllers are available. Say your game always uses two controllers (one for each hand) you can predefine the controllers with id 1 and 2 and they will become active as soon as the controllers are identified. If you expect additional controllers to be used, you should react to the signals and add ARVRController nodes to your scene.
The position of the controller node is automatically updated by the ARVR Server. This makes this node ideal to add child nodes to visualise the controller.
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="get_controller_name" qualifiers="const">
<return type="String">
</return>
<description>
If active, returns the name of the associated controller if provided by the AR/VR SDK used.
</description>
</method>
<method name="get_hand" qualifiers="const">
<return type="int" enum="ARVRPositionalTracker.TrackerHand">
</return>
<description>
Returns the hand holding this controller, if known. See TRACKER_* constants in [ARVRPositionalTracker].
</description>
</method>
<method name="get_is_active" qualifiers="const">
<return type="bool">
</return>
<description>
Returns [code]true[/code] if the bound controller is active. ARVR systems attempt to track active controllers.
</description>
</method>
<method name="get_joystick_axis" qualifiers="const">
<return type="float">
</return>
<argument index="0" name="axis" type="int">
</argument>
<description>
Returns the value of the given axis for things like triggers, touchpads, etc. that are embedded into the controller.
</description>
</method>
<method name="get_joystick_id" qualifiers="const">
<return type="int">
</return>
<description>
Returns the ID of the joystick object bound to this. Every controller tracked by the ARVR Server that has buttons and axis will also be registered as a joystick within Godot. This means that all the normal joystick tracking and input mapping will work for buttons and axis found on the AR/VR controllers. This ID is purely offered as information so you can link up the controller with its joystick entry.
</description>
</method>
<method name="is_button_pressed" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="button" type="int">
</argument>
<description>
Returns [code]true[/code] if the button at index [code]button[/code] is pressed.
</description>
</method>
</methods>
<members>
<member name="controller_id" type="int" setter="set_controller_id" getter="get_controller_id">
The controller's id.
A controller id of 0 is unbound and will always result in an inactive node. Controller id 1 is reserved for the first controller that identifies itself as the left hand controller and id 2 is reserved for the first controller that identifies itself as the right hand controller.
For any other controller that the [ARVRServer] detects, we continue with controller id 3.
When a controller is turned off, its slot is freed. This ensures controllers will keep the same id even when controllers with lower ids are turned off.
</member>
<member name="rumble" type="float" setter="set_rumble" getter="get_rumble">
The degree to which the tracker rumbles. Ranges from [code]0.0[/code] to [code]1.0[/code] with precision [code].01[/code]. If changed, updates [member ARVRPositionalTracker.rumble] accordingly.
</member>
</members>
<signals>
<signal name="button_pressed">
<argument index="0" name="button" type="int">
</argument>
<description>
Emitted when a button on this controller is pressed.
</description>
</signal>
<signal name="button_release">
<argument index="0" name="button" type="int">
</argument>
<description>
Emitted when a button on this controller is released.
</description>
</signal>
</signals>
<constants>
</constants>
</class>
|