diff options
| author | Bastiaan Olij | 2017-11-01 21:46:37 +1100 |
|---|---|---|
| committer | Bastiaan Olij | 2017-11-01 23:59:14 +1100 |
| commit | 167b7b55338761e3cb48677219d41f5bfc32c839 (patch) | |
| tree | b5f3ce606a8ef2cacb163a821cb8639dcda205d7 /modules/gdnative/nativearvr/arvr_interface_gdnative.cpp | |
| parent | 58889102b6fe3a562e4f5e0cb045def9ff2b1f53 (diff) | |
| download | godot-167b7b55338761e3cb48677219d41f5bfc32c839.tar.gz godot-167b7b55338761e3cb48677219d41f5bfc32c839.tar.zst godot-167b7b55338761e3cb48677219d41f5bfc32c839.zip | |
Adding rumble support to ARVR controllers (if implemented on the ARVR interface)
Diffstat (limited to '')
| -rw-r--r-- | modules/gdnative/nativearvr/arvr_interface_gdnative.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/gdnative/nativearvr/arvr_interface_gdnative.cpp b/modules/gdnative/nativearvr/arvr_interface_gdnative.cpp index ff8bda162..e2a7019fa 100644 --- a/modules/gdnative/nativearvr/arvr_interface_gdnative.cpp +++ b/modules/gdnative/nativearvr/arvr_interface_gdnative.cpp @@ -383,4 +383,16 @@ void GDAPI godot_arvr_set_controller_axis(godot_int p_controller_id, godot_int p } } } + +godot_real GDAPI godot_arvr_get_controller_rumble(godot_int p_controller_id) { + ARVRServer *arvr_server = ARVRServer::get_singleton(); + ERR_FAIL_NULL_V(arvr_server, 0.0); + + ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, p_controller_id); + if (tracker != NULL) { + return tracker->get_rumble(); + } + + return 0.0; +} } |
