summaryrefslogtreecommitdiff
path: root/modules/openxr/openxr_interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/openxr/openxr_interface.cpp')
-rw-r--r--modules/openxr/openxr_interface.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/modules/openxr/openxr_interface.cpp b/modules/openxr/openxr_interface.cpp
index 41ce8c019e..6c2f08e21d 100644
--- a/modules/openxr/openxr_interface.cpp
+++ b/modules/openxr/openxr_interface.cpp
@@ -57,7 +57,24 @@ PackedStringArray OpenXRInterface::get_suggested_tracker_names() const {
PackedStringArray arr = {
"left_hand", // /user/hand/left is mapped to our defaults
"right_hand", // /user/hand/right is mapped to our defaults
- "/user/treadmill"
+ "/user/treadmill",
+
+ // Even though these are only available if you have the tracker extension,
+ // we add these as we may be deploying on a different platform than our
+ // editor is running on.
+ "/user/vive_tracker_htcx/role/handheld_object",
+ "/user/vive_tracker_htcx/role/left_foot",
+ "/user/vive_tracker_htcx/role/right_foot",
+ "/user/vive_tracker_htcx/role/left_shoulder",
+ "/user/vive_tracker_htcx/role/right_shoulder",
+ "/user/vive_tracker_htcx/role/left_elbow",
+ "/user/vive_tracker_htcx/role/right_elbow",
+ "/user/vive_tracker_htcx/role/left_knee",
+ "/user/vive_tracker_htcx/role/right_knee",
+ "/user/vive_tracker_htcx/role/waist",
+ "/user/vive_tracker_htcx/role/chest",
+ "/user/vive_tracker_htcx/role/camera",
+ "/user/vive_tracker_htcx/role/keyboard"
};
return arr;
@@ -106,14 +123,14 @@ void OpenXRInterface::_load_action_map() {
#ifdef TOOLS_ENABLED
// Save our action sets so our user can
action_map->set_path(default_tres_name, true);
- ResourceSaver::save(default_tres_name, action_map);
+ ResourceSaver::save(action_map, default_tres_name);
#endif
}
}
// process our action map
if (action_map.is_valid()) {
- Map<Ref<OpenXRAction>, Action *> xr_actions;
+ HashMap<Ref<OpenXRAction>, Action *> xr_actions;
Array action_sets = action_map->get_action_sets();
for (int i = 0; i < action_sets.size(); i++) {
@@ -614,8 +631,8 @@ Transform3D OpenXRInterface::get_transform_for_view(uint32_t p_view, const Trans
return p_cam_transform * xr_server->get_reference_frame() * t;
}
-CameraMatrix OpenXRInterface::get_projection_for_view(uint32_t p_view, double p_aspect, double p_z_near, double p_z_far) {
- CameraMatrix cm;
+Projection OpenXRInterface::get_projection_for_view(uint32_t p_view, double p_aspect, double p_z_near, double p_z_far) {
+ Projection cm;
if (openxr_api) {
if (openxr_api->get_view_projection(p_view, p_z_near, p_z_far, cm)) {