diff --git a/CMakeLists.txt b/CMakeLists.txt index b500f82b..f3a5f225 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ set(CMAKE_CXX_STANDARD 20) include(FetchContent) include(ExternalProject) +include(GNUInstallDirs) include("cmake/AutoOption.cmake") option(WIVRN_USE_SYSTEM_FREETYPE "Use system FreeType" ON) diff --git a/README.md b/README.md index e4a0cb71..73edb52e 100644 --- a/README.md +++ b/README.md @@ -246,3 +246,5 @@ WiVRn uses the following software: - [spdlog](https://github.com/gabime/spdlog) - [VulkanMemoryAllocator](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator) - [x264](https://www.videolan.org/developers/x264.html) optional, for software encoding + +The controller models are from the [WebXR input profiles](https://www.npmjs.com/package/@webxr-input-profiles/motion-controllers) diff --git a/assets/controllers/generic-trigger-squeeze/left.glb b/assets/controllers/generic-trigger-squeeze/left.glb new file mode 100755 index 00000000..fddef8eb Binary files /dev/null and b/assets/controllers/generic-trigger-squeeze/left.glb differ diff --git a/assets/controllers/generic-trigger-squeeze/none.glb b/assets/controllers/generic-trigger-squeeze/none.glb new file mode 100755 index 00000000..14e66af0 Binary files /dev/null and b/assets/controllers/generic-trigger-squeeze/none.glb differ diff --git a/assets/controllers/generic-trigger-squeeze/profile.json b/assets/controllers/generic-trigger-squeeze/profile.json new file mode 100755 index 00000000..60d8811f --- /dev/null +++ b/assets/controllers/generic-trigger-squeeze/profile.json @@ -0,0 +1,168 @@ +{ + "profileId": "generic-trigger-squeeze", + "fallbackProfileIds": [], + "layouts": { + "left": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "generic-trigger-squeeze-left", + "assetPath": "left.glb" + }, + "right": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "generic-trigger-squeeze-right", + "assetPath": "right.glb" + }, + "none": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + }, + "xr_standard_squeeze_pressed_mirror": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_mirror_value", + "minNodeName": "xr_standard_squeeze_pressed_mirror_min", + "maxNodeName": "xr_standard_squeeze_pressed_mirror_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "generic-trigger-squeeze-none", + "assetPath": "none.glb" + } + } +} \ No newline at end of file diff --git a/assets/controllers/generic-trigger-squeeze/right.glb b/assets/controllers/generic-trigger-squeeze/right.glb new file mode 100755 index 00000000..d62051d9 Binary files /dev/null and b/assets/controllers/generic-trigger-squeeze/right.glb differ diff --git a/assets/controllers/meta-quest-touch-plus/left.glb b/assets/controllers/meta-quest-touch-plus/left.glb new file mode 100644 index 00000000..1bd74214 Binary files /dev/null and b/assets/controllers/meta-quest-touch-plus/left.glb differ diff --git a/assets/controllers/meta-quest-touch-plus/profile.json b/assets/controllers/meta-quest-touch-plus/profile.json new file mode 100644 index 00000000..7804bda6 --- /dev/null +++ b/assets/controllers/meta-quest-touch-plus/profile.json @@ -0,0 +1,330 @@ +{ + "profileId": "meta-quest-touch-plus", + "fallbackProfileIds": [ + "oculus-touch-v3", + "oculus-touch", + "generic-trigger-squeeze-thumbstick" + ], + "layouts": { + "left": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + } + } + }, + "xr-standard-thumbstick": { + "type": "thumbstick", + "gamepadIndices": { + "button": 3, + "xAxis": 2, + "yAxis": 3 + }, + "rootNodeName": "xr_standard_thumbstick", + "visualResponses": { + "xr_standard_thumbstick_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_pressed_value", + "minNodeName": "xr_standard_thumbstick_pressed_min", + "maxNodeName": "xr_standard_thumbstick_pressed_max" + }, + "xr_standard_thumbstick_xaxis_pressed": { + "componentProperty": "xAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_xaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max" + }, + "xr_standard_thumbstick_yaxis_pressed": { + "componentProperty": "yAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_yaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max" + } + } + }, + "x-button": { + "type": "button", + "gamepadIndices": { + "button": 4 + }, + "rootNodeName": "x_button", + "visualResponses": { + "x_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "x_button_pressed_value", + "minNodeName": "x_button_pressed_min", + "maxNodeName": "x_button_pressed_max" + } + } + }, + "y-button": { + "type": "button", + "gamepadIndices": { + "button": 5 + }, + "rootNodeName": "y_button", + "visualResponses": { + "y_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "y_button_pressed_value", + "minNodeName": "y_button_pressed_min", + "maxNodeName": "y_button_pressed_max" + } + } + }, + "thumbrest": { + "type": "button", + "gamepadIndices": { + "button": 6 + }, + "rootNodeName": "thumbrest", + "visualResponses": { + "thumbrest_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "thumbrest_pressed_value", + "minNodeName": "thumbrest_pressed_min", + "maxNodeName": "thumbrest_pressed_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "meta-quest-touch-plus-left", + "assetPath": "left.glb" + }, + "right": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + } + } + }, + "xr-standard-thumbstick": { + "type": "thumbstick", + "gamepadIndices": { + "button": 3, + "xAxis": 2, + "yAxis": 3 + }, + "rootNodeName": "xr_standard_thumbstick", + "visualResponses": { + "xr_standard_thumbstick_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_pressed_value", + "minNodeName": "xr_standard_thumbstick_pressed_min", + "maxNodeName": "xr_standard_thumbstick_pressed_max" + }, + "xr_standard_thumbstick_xaxis_pressed": { + "componentProperty": "xAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_xaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max" + }, + "xr_standard_thumbstick_yaxis_pressed": { + "componentProperty": "yAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_yaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max" + } + } + }, + "a-button": { + "type": "button", + "gamepadIndices": { + "button": 4 + }, + "rootNodeName": "a_button", + "visualResponses": { + "a_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "a_button_pressed_value", + "minNodeName": "a_button_pressed_min", + "maxNodeName": "a_button_pressed_max" + } + } + }, + "b-button": { + "type": "button", + "gamepadIndices": { + "button": 5 + }, + "rootNodeName": "b_button", + "visualResponses": { + "b_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "b_button_pressed_value", + "minNodeName": "b_button_pressed_min", + "maxNodeName": "b_button_pressed_max" + } + } + }, + "thumbrest": { + "type": "button", + "gamepadIndices": { + "button": 6 + }, + "rootNodeName": "thumbrest", + "visualResponses": { + "thumbrest_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "thumbrest_pressed_value", + "minNodeName": "thumbrest_pressed_min", + "maxNodeName": "thumbrest_pressed_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "meta-quest-touch-plus-right", + "assetPath": "right.glb" + } + } +} \ No newline at end of file diff --git a/assets/controllers/meta-quest-touch-plus/right.glb b/assets/controllers/meta-quest-touch-plus/right.glb new file mode 100644 index 00000000..ed0d521c Binary files /dev/null and b/assets/controllers/meta-quest-touch-plus/right.glb differ diff --git a/assets/controllers/meta-quest-touch-pro/left.glb b/assets/controllers/meta-quest-touch-pro/left.glb new file mode 100644 index 00000000..df8c76b8 Binary files /dev/null and b/assets/controllers/meta-quest-touch-pro/left.glb differ diff --git a/assets/controllers/meta-quest-touch-pro/profile.json b/assets/controllers/meta-quest-touch-pro/profile.json new file mode 100644 index 00000000..989fa4fa --- /dev/null +++ b/assets/controllers/meta-quest-touch-pro/profile.json @@ -0,0 +1,330 @@ +{ + "profileId": "meta-quest-touch-pro", + "fallbackProfileIds": [ + "oculus-touch-v2", + "oculus-touch", + "generic-trigger-squeeze-thumbstick" + ], + "layouts": { + "left": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + } + } + }, + "xr-standard-thumbstick": { + "type": "thumbstick", + "gamepadIndices": { + "button": 3, + "xAxis": 2, + "yAxis": 3 + }, + "rootNodeName": "xr_standard_thumbstick", + "visualResponses": { + "xr_standard_thumbstick_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_pressed_value", + "minNodeName": "xr_standard_thumbstick_pressed_min", + "maxNodeName": "xr_standard_thumbstick_pressed_max" + }, + "xr_standard_thumbstick_xaxis_pressed": { + "componentProperty": "xAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_xaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max" + }, + "xr_standard_thumbstick_yaxis_pressed": { + "componentProperty": "yAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_yaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max" + } + } + }, + "x-button": { + "type": "button", + "gamepadIndices": { + "button": 4 + }, + "rootNodeName": "x_button", + "visualResponses": { + "x_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "x_button_pressed_value", + "minNodeName": "x_button_pressed_min", + "maxNodeName": "x_button_pressed_max" + } + } + }, + "y-button": { + "type": "button", + "gamepadIndices": { + "button": 5 + }, + "rootNodeName": "y_button", + "visualResponses": { + "y_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "y_button_pressed_value", + "minNodeName": "y_button_pressed_min", + "maxNodeName": "y_button_pressed_max" + } + } + }, + "thumbrest": { + "type": "button", + "gamepadIndices": { + "button": 6 + }, + "rootNodeName": "thumbrest", + "visualResponses": { + "thumbrest_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "thumbrest_pressed_value", + "minNodeName": "thumbrest_pressed_min", + "maxNodeName": "thumbrest_pressed_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "meta-quest-touch-pro-left", + "assetPath": "left.glb" + }, + "right": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + } + } + }, + "xr-standard-thumbstick": { + "type": "thumbstick", + "gamepadIndices": { + "button": 3, + "xAxis": 2, + "yAxis": 3 + }, + "rootNodeName": "xr_standard_thumbstick", + "visualResponses": { + "xr_standard_thumbstick_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_pressed_value", + "minNodeName": "xr_standard_thumbstick_pressed_min", + "maxNodeName": "xr_standard_thumbstick_pressed_max" + }, + "xr_standard_thumbstick_xaxis_pressed": { + "componentProperty": "xAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_xaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max" + }, + "xr_standard_thumbstick_yaxis_pressed": { + "componentProperty": "yAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_yaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max" + } + } + }, + "a-button": { + "type": "button", + "gamepadIndices": { + "button": 4 + }, + "rootNodeName": "a_button", + "visualResponses": { + "a_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "a_button_pressed_value", + "minNodeName": "a_button_pressed_min", + "maxNodeName": "a_button_pressed_max" + } + } + }, + "b-button": { + "type": "button", + "gamepadIndices": { + "button": 5 + }, + "rootNodeName": "b_button", + "visualResponses": { + "b_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "b_button_pressed_value", + "minNodeName": "b_button_pressed_min", + "maxNodeName": "b_button_pressed_max" + } + } + }, + "thumbrest": { + "type": "button", + "gamepadIndices": { + "button": 6 + }, + "rootNodeName": "thumbrest", + "visualResponses": { + "thumbrest_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "thumbrest_pressed_value", + "minNodeName": "thumbrest_pressed_min", + "maxNodeName": "thumbrest_pressed_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "meta-quest-touch-pro-right", + "assetPath": "right.glb" + } + } +} \ No newline at end of file diff --git a/assets/controllers/meta-quest-touch-pro/right.glb b/assets/controllers/meta-quest-touch-pro/right.glb new file mode 100644 index 00000000..79d235dc Binary files /dev/null and b/assets/controllers/meta-quest-touch-pro/right.glb differ diff --git a/assets/controllers/oculus-touch-v2/left.glb b/assets/controllers/oculus-touch-v2/left.glb new file mode 100644 index 00000000..5a1107f3 Binary files /dev/null and b/assets/controllers/oculus-touch-v2/left.glb differ diff --git a/assets/controllers/oculus-touch-v2/profile.json b/assets/controllers/oculus-touch-v2/profile.json new file mode 100644 index 00000000..c5676b25 --- /dev/null +++ b/assets/controllers/oculus-touch-v2/profile.json @@ -0,0 +1,329 @@ +{ + "profileId": "oculus-touch-v2", + "fallbackProfileIds": [ + "oculus-touch", + "generic-trigger-squeeze-thumbstick" + ], + "layouts": { + "left": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + } + } + }, + "xr-standard-thumbstick": { + "type": "thumbstick", + "gamepadIndices": { + "button": 3, + "xAxis": 2, + "yAxis": 3 + }, + "rootNodeName": "xr_standard_thumbstick", + "visualResponses": { + "xr_standard_thumbstick_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_pressed_value", + "minNodeName": "xr_standard_thumbstick_pressed_min", + "maxNodeName": "xr_standard_thumbstick_pressed_max" + }, + "xr_standard_thumbstick_xaxis_pressed": { + "componentProperty": "xAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_xaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max" + }, + "xr_standard_thumbstick_yaxis_pressed": { + "componentProperty": "yAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_yaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max" + } + } + }, + "x-button": { + "type": "button", + "gamepadIndices": { + "button": 4 + }, + "rootNodeName": "x_button", + "visualResponses": { + "x_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "x_button_pressed_value", + "minNodeName": "x_button_pressed_min", + "maxNodeName": "x_button_pressed_max" + } + } + }, + "y-button": { + "type": "button", + "gamepadIndices": { + "button": 5 + }, + "rootNodeName": "y_button", + "visualResponses": { + "y_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "y_button_pressed_value", + "minNodeName": "y_button_pressed_min", + "maxNodeName": "y_button_pressed_max" + } + } + }, + "thumbrest": { + "type": "button", + "gamepadIndices": { + "button": 6 + }, + "rootNodeName": "thumbrest", + "visualResponses": { + "thumbrest_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "thumbrest_pressed_value", + "minNodeName": "thumbrest_pressed_min", + "maxNodeName": "thumbrest_pressed_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "oculus-touch-v2-left", + "assetPath": "left.glb" + }, + "right": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + } + } + }, + "xr-standard-thumbstick": { + "type": "thumbstick", + "gamepadIndices": { + "button": 3, + "xAxis": 2, + "yAxis": 3 + }, + "rootNodeName": "xr_standard_thumbstick", + "visualResponses": { + "xr_standard_thumbstick_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_pressed_value", + "minNodeName": "xr_standard_thumbstick_pressed_min", + "maxNodeName": "xr_standard_thumbstick_pressed_max" + }, + "xr_standard_thumbstick_xaxis_pressed": { + "componentProperty": "xAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_xaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max" + }, + "xr_standard_thumbstick_yaxis_pressed": { + "componentProperty": "yAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_yaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max" + } + } + }, + "a-button": { + "type": "button", + "gamepadIndices": { + "button": 4 + }, + "rootNodeName": "a_button", + "visualResponses": { + "a_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "a_button_pressed_value", + "minNodeName": "a_button_pressed_min", + "maxNodeName": "a_button_pressed_max" + } + } + }, + "b-button": { + "type": "button", + "gamepadIndices": { + "button": 5 + }, + "rootNodeName": "b_button", + "visualResponses": { + "b_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "b_button_pressed_value", + "minNodeName": "b_button_pressed_min", + "maxNodeName": "b_button_pressed_max" + } + } + }, + "thumbrest": { + "type": "button", + "gamepadIndices": { + "button": 6 + }, + "rootNodeName": "thumbrest", + "visualResponses": { + "thumbrest_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "thumbrest_pressed_value", + "minNodeName": "thumbrest_pressed_min", + "maxNodeName": "thumbrest_pressed_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "oculus-touch-v2-right", + "assetPath": "right.glb" + } + } +} \ No newline at end of file diff --git a/assets/controllers/oculus-touch-v2/right.glb b/assets/controllers/oculus-touch-v2/right.glb new file mode 100644 index 00000000..ca07031e Binary files /dev/null and b/assets/controllers/oculus-touch-v2/right.glb differ diff --git a/assets/controllers/oculus-touch-v3/left.glb b/assets/controllers/oculus-touch-v3/left.glb new file mode 100644 index 00000000..e247b11c Binary files /dev/null and b/assets/controllers/oculus-touch-v3/left.glb differ diff --git a/assets/controllers/oculus-touch-v3/profile.json b/assets/controllers/oculus-touch-v3/profile.json new file mode 100644 index 00000000..a61c32c7 --- /dev/null +++ b/assets/controllers/oculus-touch-v3/profile.json @@ -0,0 +1,330 @@ +{ + "profileId": "oculus-touch-v3", + "fallbackProfileIds": [ + "oculus-touch-v2", + "oculus-touch", + "generic-trigger-squeeze-thumbstick" + ], + "layouts": { + "left": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + } + } + }, + "xr-standard-thumbstick": { + "type": "thumbstick", + "gamepadIndices": { + "button": 3, + "xAxis": 2, + "yAxis": 3 + }, + "rootNodeName": "xr_standard_thumbstick", + "visualResponses": { + "xr_standard_thumbstick_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_pressed_value", + "minNodeName": "xr_standard_thumbstick_pressed_min", + "maxNodeName": "xr_standard_thumbstick_pressed_max" + }, + "xr_standard_thumbstick_xaxis_pressed": { + "componentProperty": "xAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_xaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max" + }, + "xr_standard_thumbstick_yaxis_pressed": { + "componentProperty": "yAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_yaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max" + } + } + }, + "x-button": { + "type": "button", + "gamepadIndices": { + "button": 4 + }, + "rootNodeName": "x_button", + "visualResponses": { + "x_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "x_button_pressed_value", + "minNodeName": "x_button_pressed_min", + "maxNodeName": "x_button_pressed_max" + } + } + }, + "y-button": { + "type": "button", + "gamepadIndices": { + "button": 5 + }, + "rootNodeName": "y_button", + "visualResponses": { + "y_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "y_button_pressed_value", + "minNodeName": "y_button_pressed_min", + "maxNodeName": "y_button_pressed_max" + } + } + }, + "thumbrest": { + "type": "button", + "gamepadIndices": { + "button": 6 + }, + "rootNodeName": "thumbrest", + "visualResponses": { + "thumbrest_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "thumbrest_pressed_value", + "minNodeName": "thumbrest_pressed_min", + "maxNodeName": "thumbrest_pressed_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "oculus-touch-v3-left", + "assetPath": "left.glb" + }, + "right": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + } + } + }, + "xr-standard-thumbstick": { + "type": "thumbstick", + "gamepadIndices": { + "button": 3, + "xAxis": 2, + "yAxis": 3 + }, + "rootNodeName": "xr_standard_thumbstick", + "visualResponses": { + "xr_standard_thumbstick_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_pressed_value", + "minNodeName": "xr_standard_thumbstick_pressed_min", + "maxNodeName": "xr_standard_thumbstick_pressed_max" + }, + "xr_standard_thumbstick_xaxis_pressed": { + "componentProperty": "xAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_xaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max" + }, + "xr_standard_thumbstick_yaxis_pressed": { + "componentProperty": "yAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_yaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max" + } + } + }, + "a-button": { + "type": "button", + "gamepadIndices": { + "button": 4 + }, + "rootNodeName": "a_button", + "visualResponses": { + "a_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "a_button_pressed_value", + "minNodeName": "a_button_pressed_min", + "maxNodeName": "a_button_pressed_max" + } + } + }, + "b-button": { + "type": "button", + "gamepadIndices": { + "button": 5 + }, + "rootNodeName": "b_button", + "visualResponses": { + "b_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "b_button_pressed_value", + "minNodeName": "b_button_pressed_min", + "maxNodeName": "b_button_pressed_max" + } + } + }, + "thumbrest": { + "type": "button", + "gamepadIndices": { + "button": 6 + }, + "rootNodeName": "thumbrest", + "visualResponses": { + "thumbrest_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "thumbrest_pressed_value", + "minNodeName": "thumbrest_pressed_min", + "maxNodeName": "thumbrest_pressed_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "oculus-touch-v3-right", + "assetPath": "right.glb" + } + } +} \ No newline at end of file diff --git a/assets/controllers/oculus-touch-v3/right.glb b/assets/controllers/oculus-touch-v3/right.glb new file mode 100644 index 00000000..79ffc272 Binary files /dev/null and b/assets/controllers/oculus-touch-v3/right.glb differ diff --git a/assets/controllers/pico-4/left.glb b/assets/controllers/pico-4/left.glb new file mode 100644 index 00000000..e98215f0 Binary files /dev/null and b/assets/controllers/pico-4/left.glb differ diff --git a/assets/controllers/pico-4/profile.json b/assets/controllers/pico-4/profile.json new file mode 100644 index 00000000..61fb7202 --- /dev/null +++ b/assets/controllers/pico-4/profile.json @@ -0,0 +1,286 @@ +{ + "profileId": "pico-4", + "fallbackProfileIds": [ + "generic-trigger-squeeze-thumbstick" + ], + "layouts": { + "left": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + } + } + }, + "xr-standard-thumbstick": { + "type": "thumbstick", + "gamepadIndices": { + "button": 3, + "xAxis": 2, + "yAxis": 3 + }, + "rootNodeName": "xr_standard_thumbstick", + "visualResponses": { + "xr_standard_thumbstick_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_pressed_value", + "minNodeName": "xr_standard_thumbstick_pressed_min", + "maxNodeName": "xr_standard_thumbstick_pressed_max" + }, + "xr_standard_thumbstick_xaxis_pressed": { + "componentProperty": "xAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_xaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max" + }, + "xr_standard_thumbstick_yaxis_pressed": { + "componentProperty": "yAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_yaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max" + } + } + }, + "x-button": { + "type": "button", + "gamepadIndices": { + "button": 4 + }, + "rootNodeName": "x_button", + "visualResponses": { + "x_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "x_button_pressed_value", + "minNodeName": "x_button_pressed_min", + "maxNodeName": "x_button_pressed_max" + } + } + }, + "y-button": { + "type": "button", + "gamepadIndices": { + "button": 5 + }, + "rootNodeName": "y_button", + "visualResponses": { + "y_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "y_button_pressed_value", + "minNodeName": "y_button_pressed_min", + "maxNodeName": "y_button_pressed_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "pico-4-left", + "assetPath": "left.glb" + }, + "right": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + } + } + }, + "xr-standard-thumbstick": { + "type": "thumbstick", + "gamepadIndices": { + "button": 3, + "xAxis": 2, + "yAxis": 3 + }, + "rootNodeName": "xr_standard_thumbstick", + "visualResponses": { + "xr_standard_thumbstick_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_pressed_value", + "minNodeName": "xr_standard_thumbstick_pressed_min", + "maxNodeName": "xr_standard_thumbstick_pressed_max" + }, + "xr_standard_thumbstick_xaxis_pressed": { + "componentProperty": "xAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_xaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max" + }, + "xr_standard_thumbstick_yaxis_pressed": { + "componentProperty": "yAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_yaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max" + } + } + }, + "a-button": { + "type": "button", + "gamepadIndices": { + "button": 4 + }, + "rootNodeName": "a_button", + "visualResponses": { + "a_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "a_button_pressed_value", + "minNodeName": "a_button_pressed_min", + "maxNodeName": "a_button_pressed_max" + } + } + }, + "b-button": { + "type": "button", + "gamepadIndices": { + "button": 5 + }, + "rootNodeName": "b_button", + "visualResponses": { + "b_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "b_button_pressed_value", + "minNodeName": "b_button_pressed_min", + "maxNodeName": "b_button_pressed_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "pico-4-right", + "assetPath": "right.glb" + } + } +} \ No newline at end of file diff --git a/assets/controllers/pico-4/right.glb b/assets/controllers/pico-4/right.glb new file mode 100644 index 00000000..2ba9a967 Binary files /dev/null and b/assets/controllers/pico-4/right.glb differ diff --git a/assets/controllers/pico-neo3/left.glb b/assets/controllers/pico-neo3/left.glb new file mode 100644 index 00000000..fb983686 Binary files /dev/null and b/assets/controllers/pico-neo3/left.glb differ diff --git a/assets/controllers/pico-neo3/profile.json b/assets/controllers/pico-neo3/profile.json new file mode 100644 index 00000000..ec90a910 --- /dev/null +++ b/assets/controllers/pico-neo3/profile.json @@ -0,0 +1,286 @@ +{ + "profileId": "pico-neo3", + "fallbackProfileIds": [ + "generic-trigger-squeeze-thumbstick" + ], + "layouts": { + "left": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + } + } + }, + "xr-standard-thumbstick": { + "type": "thumbstick", + "gamepadIndices": { + "button": 3, + "xAxis": 2, + "yAxis": 3 + }, + "rootNodeName": "xr_standard_thumbstick", + "visualResponses": { + "xr_standard_thumbstick_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_pressed_value", + "minNodeName": "xr_standard_thumbstick_pressed_min", + "maxNodeName": "xr_standard_thumbstick_pressed_max" + }, + "xr_standard_thumbstick_xaxis_pressed": { + "componentProperty": "xAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_xaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max" + }, + "xr_standard_thumbstick_yaxis_pressed": { + "componentProperty": "yAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_yaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max" + } + } + }, + "x-button": { + "type": "button", + "gamepadIndices": { + "button": 4 + }, + "rootNodeName": "x_button", + "visualResponses": { + "x_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "x_button_pressed_value", + "minNodeName": "x_button_pressed_min", + "maxNodeName": "x_button_pressed_max" + } + } + }, + "y-button": { + "type": "button", + "gamepadIndices": { + "button": 5 + }, + "rootNodeName": "y_button", + "visualResponses": { + "y_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "y_button_pressed_value", + "minNodeName": "y_button_pressed_min", + "maxNodeName": "y_button_pressed_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "pico-neo3-left", + "assetPath": "left.glb" + }, + "right": { + "selectComponentId": "xr-standard-trigger", + "components": { + "xr-standard-trigger": { + "type": "trigger", + "gamepadIndices": { + "button": 0 + }, + "rootNodeName": "xr_standard_trigger", + "visualResponses": { + "xr_standard_trigger_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_trigger_pressed_value", + "minNodeName": "xr_standard_trigger_pressed_min", + "maxNodeName": "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + "type": "squeeze", + "gamepadIndices": { + "button": 1 + }, + "rootNodeName": "xr_standard_squeeze", + "visualResponses": { + "xr_standard_squeeze_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_squeeze_pressed_value", + "minNodeName": "xr_standard_squeeze_pressed_min", + "maxNodeName": "xr_standard_squeeze_pressed_max" + } + } + }, + "xr-standard-thumbstick": { + "type": "thumbstick", + "gamepadIndices": { + "button": 3, + "xAxis": 2, + "yAxis": 3 + }, + "rootNodeName": "xr_standard_thumbstick", + "visualResponses": { + "xr_standard_thumbstick_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_pressed_value", + "minNodeName": "xr_standard_thumbstick_pressed_min", + "maxNodeName": "xr_standard_thumbstick_pressed_max" + }, + "xr_standard_thumbstick_xaxis_pressed": { + "componentProperty": "xAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_xaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max" + }, + "xr_standard_thumbstick_yaxis_pressed": { + "componentProperty": "yAxis", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value", + "minNodeName": "xr_standard_thumbstick_yaxis_pressed_min", + "maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max" + } + } + }, + "a-button": { + "type": "button", + "gamepadIndices": { + "button": 4 + }, + "rootNodeName": "a_button", + "visualResponses": { + "a_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "a_button_pressed_value", + "minNodeName": "a_button_pressed_min", + "maxNodeName": "a_button_pressed_max" + } + } + }, + "b-button": { + "type": "button", + "gamepadIndices": { + "button": 5 + }, + "rootNodeName": "b_button", + "visualResponses": { + "b_button_pressed": { + "componentProperty": "button", + "states": [ + "default", + "touched", + "pressed" + ], + "valueNodeProperty": "transform", + "valueNodeName": "b_button_pressed_value", + "minNodeName": "b_button_pressed_min", + "maxNodeName": "b_button_pressed_max" + } + } + } + }, + "gamepadMapping": "xr-standard", + "rootNodeName": "pico-neo3-right", + "assetPath": "right.glb" + } + } +} \ No newline at end of file diff --git a/assets/controllers/pico-neo3/right.glb b/assets/controllers/pico-neo3/right.glb new file mode 100644 index 00000000..043055bd Binary files /dev/null and b/assets/controllers/pico-neo3/right.glb differ diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index cc1ef33b..361443d5 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -73,6 +73,11 @@ else() file(GLOB PLATFORM_SOURCE CONFIGURE_DEPENDS "decoder/ffmpeg/*.cpp") target_sources(wivrn PRIVATE ${PLATFORM_SOURCE}) + + install(DIRECTORY ${CMAKE_SOURCE_DIR}/assets DESTINATION ${CMAKE_INSTALL_DATADIR}/wivrn) + + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/share) + file(CREATE_LINK ${CMAKE_SOURCE_DIR}/assets ${CMAKE_BINARY_DIR}/share/assets SYMBOLIC) endif() if(ANDROID OR Vulkan_VERSION VERSION_LESS 1.3.268) @@ -159,3 +164,4 @@ if(USE_ANDROID_VALIDATION_LAYER) target_link_libraries(wivrn vvl1 vvl2) # Hack to get gradle to package the validation layer in the APK endif() + diff --git a/client/asset.cpp b/client/asset.cpp index da250a57..0f01073d 100644 --- a/client/asset.cpp +++ b/client/asset.cpp @@ -19,13 +19,14 @@ #include "asset.h" #include "application.h" +#include #include #include #ifdef __ANDROID__ #include -asset::asset(std::filesystem::path path) +asset::asset(const std::filesystem::path& path) { spdlog::debug("Loading Android asset {}", path.string()); android_asset = AAssetManager_open(application::asset_manager(), path.c_str(), AASSET_MODE_BUFFER); @@ -56,17 +57,34 @@ asset::~asset() #else -asset::asset(std::filesystem::path path) +static std::filesystem::path get_asset_root() { + const char * path = std::getenv("WIVRN_ASSET_ROOT"); + if (path && strcmp(path, "")) + return path; + + // Linux only: see https://stackoverflow.com/a/1024937 + auto exe = std::filesystem::read_symlink("/proc/self/exe"); + + return exe.parent_path().parent_path() / "share" / "wivrn" / "assets"; +} + +std::filesystem::path asset::asset_root() +{ + static std::filesystem::path root = get_asset_root(); + return root; +} + +asset::asset(const std::filesystem::path& path) +{ + assert(path.is_relative()); + // TODO mmap - // TODO: load only once if it is already loaded + // TODO load only once if it is already loaded spdlog::debug("Loading file asset {}", path.string()); - if (path.is_relative()) - path = "assets" / path; - - std::ifstream file(path, std::ios::binary | std::ios::ate); + std::ifstream file(asset_root() / path, std::ios::binary | std::ios::ate); file.exceptions(std::ios_base::badbit | std::ios_base::failbit); size_t size = file.tellg(); diff --git a/client/asset.h b/client/asset.h index 48711d70..4b87e0a0 100644 --- a/client/asset.h +++ b/client/asset.h @@ -31,17 +31,17 @@ struct AAsset; class asset { - #ifdef __ANDROID__ AAsset * android_asset = nullptr; std::span bytes; #else + static std::filesystem::path asset_root(); std::vector bytes; #endif public: asset() = default; - asset(std::filesystem::path path); + asset(const std::filesystem::path& path); #ifdef __ANDROID__ asset(asset && other); diff --git a/client/scenes/lobby.cpp b/client/scenes/lobby.cpp index ba1f6e6d..cbe6ec52 100644 --- a/client/scenes/lobby.cpp +++ b/client/scenes/lobby.cpp @@ -86,7 +86,7 @@ scenes::lobby::lobby() : teapot.import(loader("lobby.gltf")); - input = input_profile("webxr-profiles/" + choose_webxr_profile() + "/profile.json", loader, teapot); + input = input_profile("controllers/" + choose_webxr_profile() + "/profile.json", loader, teapot); spdlog::info("Loaded input profile {}", input->id); }