1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-04-01 06:36:41 +00:00

Bump openxr to version 1.0.13. Interaction profiles for vive cosmos and huawei

This commit is contained in:
Mads Buvik Sandvei 2020-11-29 17:15:53 +01:00
parent e56d74518d
commit 1e64aea1a5
4 changed files with 89 additions and 7 deletions

View file

@ -266,7 +266,7 @@ if(BUILD_OPENMW_VR)
FetchContent_Declare(
OpenXR
GIT_REPOSITORY https://github.com/KhronosGroup/OpenXR-SDK.git
GIT_TAG release-1.0.12
GIT_TAG release-1.0.13
)
FetchContent_MakeAvailable(OpenXR)

View file

@ -285,9 +285,11 @@ namespace MWVR
#if !XR_KHR_composition_layer_depth \
|| !XR_KHR_opengl_enable \
|| !XR_EXT_hp_mixed_reality_controller \
|| !XR_EXT_debug_utils
|| !XR_EXT_debug_utils \
|| !XR_HTC_vive_cosmos_controller_interaction \
|| !XR_HUAWEI_controller_interaction
#error "OpenXR extensions missing. Please upgrade your copy of the OpenXR SDK to 1.0.12 minimum"
#error "OpenXR extensions missing. Please upgrade your copy of the OpenXR SDK to 1.0.13 minimum"
#endif
void OpenXRManagerImpl::setupExtensionsAndLayers()
@ -298,7 +300,9 @@ namespace MWVR
std::vector<const char*> optionalExtensions = {
XR_KHR_COMPOSITION_LAYER_DEPTH_EXTENSION_NAME,
XR_EXT_HP_MIXED_REALITY_CONTROLLER_EXTENSION_NAME
XR_EXT_HP_MIXED_REALITY_CONTROLLER_EXTENSION_NAME,
XR_HTC_VIVE_COSMOS_CONTROLLER_INTERACTION_EXTENSION_NAME,
XR_HUAWEI_CONTROLLER_INTERACTION_EXTENSION_NAME
};
if (Settings::Manager::getBool("enable XR_EXT_debug_utils", "VR Debug"))

View file

@ -294,12 +294,45 @@ namespace MWVR
mXRInput->suggestBindings(ActionSet::GUI, controllerProfilePath, GUIBindings);
}
void VRInputManager::suggestBindingsHuaweiController()
{
std::string controllerProfilePath = "/interaction_profiles/huawei/controller";
// In-game character controls
SuggestedBindings gameplayBindings{
{A_Recenter, "/user/hand/left/input/home/click"},
{A_VrMetaMenu, "/user/hand/left/input/home/click"},
{MWInput::A_Jump, "/user/hand/left/input/trigger/click"},
{MWInput::A_MoveForwardBackward,"/user/hand/left/input/trackpad/y"},
{MWInput::A_MoveLeftRight, "/user/hand/left/input/trackpad/x"},
{MWInput::A_ToggleSpell, "/user/hand/left/input/trackpad/click"},
{MWInput::A_Sneak, "/user/hand/left/input/back/click"},
{MWInput::A_LookLeftRight, "/user/hand/right/input/trackpad/x"},
{MWInput::A_ToggleWeapon, "/user/hand/right/input/trackpad/click"},
{MWInput::A_Use, "/user/hand/right/input/trigger/click"},
{A_ActivateTouch, "/user/hand/right/input/squeeze/click"},
{MWInput::A_Activate, "/user/hand/right/input/squeeze/click"},
};
// GUI controls
SuggestedBindings GUIBindings{
{A_MenuBack, "/user/hand/left/input/trackpad/click"},
{MWInput::A_GameMenu, "/user/hand/left/input/home/click"},
{A_Recenter, "/user/hand/left/input/home/click"},
{A_MenuUpDown, "/user/hand/right/input/thumbstick/y"},
{A_MenuLeftRight, "/user/hand/right/input/thumbstick/x"},
{A_MenuSelect, "/user/hand/right/input/trackpad/click"},
{MWInput::A_Use, "/user/hand/right/input/trigger/click"},
};
mXRInput->suggestBindings(ActionSet::Gameplay, controllerProfilePath, gameplayBindings);
mXRInput->suggestBindings(ActionSet::GUI, controllerProfilePath, GUIBindings);
}
void VRInputManager::suggestBindingsMicrosoftMixedReality()
{
std::string controllerProfilePath = "/interaction_profiles/microsoft/motion_controller";
// TODO: Slightly better than the vive wands, but still not good.
// In-game character controls
SuggestedBindings gameplayBindings{
{A_Recenter, "/user/hand/left/input/menu/click"},
@ -405,6 +438,45 @@ namespace MWVR
mXRInput->suggestBindings(ActionSet::GUI, controllerProfilePath, GUIBindings);
}
void VRInputManager::suggestBindingsViveCosmos()
{
std::string controllerProfilePath = "/interaction_profiles/htc/vive_cosmos_controller";
// In-game character controls
SuggestedBindings gameplayBindings{
{A_Recenter, "/user/hand/left/input/menu/click"},
{A_VrMetaMenu, "/user/hand/left/input/menu/click"},
{MWInput::A_Sneak, "/user/hand/left/input/squeeze/value"},
{MWInput::A_MoveForwardBackward,"/user/hand/left/input/thumbstick/y"},
{MWInput::A_MoveLeftRight, "/user/hand/left/input/thumbstick/x"},
{MWInput::A_AlwaysRun, "/user/hand/left/input/thumbstick/click"},
{MWInput::A_Jump, "/user/hand/left/input/trigger/click"},
{MWInput::A_ToggleSpell, "/user/hand/left/input/x/click"},
{MWInput::A_Rest, "/user/hand/left/input/y/click"},
{MWInput::A_ToggleWeapon, "/user/hand/right/input/a/click"},
{MWInput::A_Inventory, "/user/hand/right/input/b/click"},
{MWInput::A_LookLeftRight, "/user/hand/right/input/thumbstick/x"},
{MWInput::A_AutoMove, "/user/hand/right/input/thumbstick/click"},
{MWInput::A_Use, "/user/hand/right/input/trigger/click"},
{A_ActivateTouch, "/user/hand/right/input/squeeze/value"},
{MWInput::A_Activate, "/user/hand/right/input/squeeze/value"},
};
// GUI controls
SuggestedBindings GUIBindings{
{A_Recenter, "/user/hand/left/input/menu/click"},
{MWInput::A_GameMenu, "/user/hand/left/input/menu/click"},
{A_MenuUpDown, "/user/hand/right/input/thumbstick/y"},
{A_MenuLeftRight, "/user/hand/right/input/thumbstick/x"},
{A_MenuSelect, "/user/hand/right/input/a/click"},
{A_MenuBack, "/user/hand/right/input/b/click"},
{MWInput::A_Use, "/user/hand/right/input/trigger/click"},
};
mXRInput->suggestBindings(ActionSet::Gameplay, controllerProfilePath, gameplayBindings);
mXRInput->suggestBindings(ActionSet::GUI, controllerProfilePath, GUIBindings);
}
void VRInputManager::suggestBindingsXboxController()
{
//TODO
@ -450,6 +522,10 @@ namespace MWVR
if (xr->xrExtensionIsEnabled(XR_EXT_HP_MIXED_REALITY_CONTROLLER_EXTENSION_NAME))
suggestBindingsHpMixedReality();
if (xr->xrExtensionIsEnabled(XR_HUAWEI_CONTROLLER_INTERACTION_EXTENSION_NAME))
suggestBindingsHuaweiController();
if (xr->xrExtensionIsEnabled(XR_HTC_VIVE_COSMOS_CONTROLLER_INTERACTION_EXTENSION_NAME))
suggestBindingsViveCosmos();
mXRInput->attachActionSets();
}

View file

@ -67,9 +67,11 @@ namespace MWVR
void suggestBindingsSimple();
void suggestBindingsOculusTouch();
void suggestBindingsHpMixedReality();
void suggestBindingsMicrosoftMixedReality();
void suggestBindingsHuaweiController();
void suggestBindingsIndex();
void suggestBindingsMicrosoftMixedReality();
void suggestBindingsVive();
void suggestBindingsViveCosmos();
void suggestBindingsXboxController();
std::unique_ptr<OpenXRInput> mXRInput;