From 0ab8889c0d245de0ff0a6c5b985d2a671dfaf8ac Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Thu, 27 Feb 2020 22:09:23 +1100 Subject: [PATCH] Exposing get_tracker_id for ARVRPositionalTracker to GDScript (cherry picked from commit f0b1edef8b5e3751caae6b1bc8fadf004c1578a9) --- doc/classes/ARVRPositionalTracker.xml | 7 +++++++ servers/arvr/arvr_positional_tracker.cpp | 1 + 2 files changed, 8 insertions(+) diff --git a/doc/classes/ARVRPositionalTracker.xml b/doc/classes/ARVRPositionalTracker.xml index a281d02be1b..3255ad9bccb 100644 --- a/doc/classes/ARVRPositionalTracker.xml +++ b/doc/classes/ARVRPositionalTracker.xml @@ -54,6 +54,13 @@ Returns the world-space controller position. + + + + + 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. + + diff --git a/servers/arvr/arvr_positional_tracker.cpp b/servers/arvr/arvr_positional_tracker.cpp index 4438475d441..fc473c1fc8f 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);