summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2020-02-27 22:09:23 +1100
committerBastiaan Olij <mux213@gmail.com>2020-03-04 10:22:26 +0100
commitf0b1edef8b5e3751caae6b1bc8fadf004c1578a9 (patch)
tree3e6b2fb5676942188cab5e151fa2707fd78ea586
parentaee36ec01b346a9b1bef607eb0b66722f58eeca1 (diff)
Exposing get_tracker_id for ARVRPositionalTracker to GDScript
-rw-r--r--doc/classes/ARVRPositionalTracker.xml7
-rw-r--r--servers/arvr/arvr_positional_tracker.cpp1
2 files changed, 8 insertions, 0 deletions
diff --git a/doc/classes/ARVRPositionalTracker.xml b/doc/classes/ARVRPositionalTracker.xml
index 9225717978..640b721d37 100644
--- a/doc/classes/ARVRPositionalTracker.xml
+++ b/doc/classes/ARVRPositionalTracker.xml
@@ -54,6 +54,13 @@
Returns the world-space controller position.
</description>
</method>
+ <method name="get_tracker_id" qualifiers="const">
+ <return type="int">
+ </return>
+ <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 [ARVRController] and [ARVRAnchor] nodes.
+ </description>
+ </method>
<method name="get_tracks_orientation" qualifiers="const">
<return type="bool">
</return>
diff --git a/servers/arvr/arvr_positional_tracker.cpp b/servers/arvr/arvr_positional_tracker.cpp
index 9acc36a139..a64e36b6a2 100644
--- a/servers/arvr/arvr_positional_tracker.cpp
+++ b/servers/arvr/arvr_positional_tracker.cpp
@@ -38,6 +38,7 @@ void ARVRPositionalTracker::_bind_methods() {
// this class is read only from GDScript, so we only have access to getters..
ClassDB::bind_method(D_METHOD("get_type"), &ARVRPositionalTracker::get_type);
+ ClassDB::bind_method(D_METHOD("get_tracker_id"), &ARVRPositionalTracker::get_tracker_id);
ClassDB::bind_method(D_METHOD("get_name"), &ARVRPositionalTracker::get_name);
ClassDB::bind_method(D_METHOD("get_joy_id"), &ARVRPositionalTracker::get_joy_id);
ClassDB::bind_method(D_METHOD("get_tracks_orientation"), &ARVRPositionalTracker::get_tracks_orientation);