summaryrefslogtreecommitdiffstats
path: root/scene/3d/xr_hand_modifier_3d.cpp
diff options
context:
space:
mode:
authorMalcolm Nixon <Malcolm.nixon@gmail.com>2024-09-05 00:14:55 -0400
committerMalcolm Nixon <Malcolm.nixon@gmail.com>2024-09-05 00:14:55 -0400
commit7c300d8408586a9f2cfe8eed89969ef5f6b8a183 (patch)
treef28858d1f700db0b675fbdcc1952e5ac1aa53430 /scene/3d/xr_hand_modifier_3d.cpp
parentb6223c0df0300ba2db17b5742c349f13c33f8884 (diff)
downloadredot-engine-7c300d8408586a9f2cfe8eed89969ef5f6b8a183.tar.gz
Add warning if XRHandModifier3D used with OpenXR and hand-tracking isn't enabled.
Diffstat (limited to 'scene/3d/xr_hand_modifier_3d.cpp')
-rw-r--r--scene/3d/xr_hand_modifier_3d.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/3d/xr_hand_modifier_3d.cpp b/scene/3d/xr_hand_modifier_3d.cpp
index aa63fb623f..3b533da701 100644
--- a/scene/3d/xr_hand_modifier_3d.cpp
+++ b/scene/3d/xr_hand_modifier_3d.cpp
@@ -30,6 +30,7 @@
#include "xr_hand_modifier_3d.h"
+#include "core/config/project_settings.h"
#include "servers/xr/xr_pose.h"
#include "servers/xr_server.h"
@@ -283,6 +284,17 @@ void XRHandModifier3D::_skeleton_changed(Skeleton3D *p_old, Skeleton3D *p_new) {
_get_joint_data();
}
+PackedStringArray XRHandModifier3D::get_configuration_warnings() const {
+ PackedStringArray warnings = SkeletonModifier3D::get_configuration_warnings();
+
+ // Detect OpenXR without the Hand Tracking extension.
+ if (GLOBAL_GET("xr/openxr/enabled") && !GLOBAL_GET("xr/openxr/extensions/hand_tracking")) {
+ warnings.push_back("XRHandModifier3D requires the OpenXR Hand Tracking extension to be enabled.");
+ }
+
+ return warnings;
+}
+
void XRHandModifier3D::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {