diff --git a/Core/Config.cpp b/Core/Config.cpp index d4360b4c51..dff6e44b2c 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1197,6 +1197,8 @@ static ConfigSetting vrSettings[] = { ConfigSetting("VRFieldOfView", &g_Config.fFieldOfViewPercentage, 100.0f), ConfigSetting("VRHeadUpDisplayScale", &g_Config.fHeadUpDisplayScale, 0.3f), ConfigSetting("VRMotionLength", &g_Config.fMotionLength, 0.5f), + ConfigSetting("VRHeadRotationScale", &g_Config.fHeadRotationScale, 0.5f), + ConfigSetting("VRHeadRotation", &g_Config.iHeadRotation, 0), ConfigSetting(false), }; diff --git a/Core/Config.h b/Core/Config.h index a6b8a04d91..ab57955346 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -475,6 +475,8 @@ public: float fFieldOfViewPercentage; float fHeadUpDisplayScale; float fMotionLength; + float fHeadRotationScale; + int iHeadRotation; // Debugger int iDisasmWindowX; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 96ef0caa74..1bce79387e 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1083,6 +1083,10 @@ void GameSettingsScreen::CreateViews() { vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fCanvasDistance, 1.0f, 15.0f, vr->T("Distance to 2D menus and scenes"), 1.0f, screenManager(), "")); vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fFieldOfViewPercentage, 100.0f, 200.0f, vr->T("Field of view scale"), 10.0f, screenManager(), vr->T("% of native FoV"))); vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fHeadUpDisplayScale, 0.0f, 1.5f, vr->T("Heads-up display scale"), 0.1f, screenManager(), "")); + static const char *vrHeadRotations[] = { vr->T("Disabled"), vr->T("Horizontal only"), vr->T("Horizontal and vertical") }; + vrSettings->Add(new PopupMultiChoice(&g_Config.iHeadRotation, vr->T("Map HMD rotations on keys instead of VR camera"), vrHeadRotations, 0, ARRAY_SIZE(vrHeadRotations), vr->GetName(), screenManager())); + PopupSliderChoiceFloat *vrHeadRotationScale = vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fHeadRotationScale, 0.3f, 1.0f, vr->T("Scale HMD rotations affects game camera"), 0.1f, screenManager(), "")); + vrHeadRotationScale->SetEnabledFunc([&] { return g_Config.iHeadRotation > 0; }); vrSettings->Add(new ItemHeader(vr->T("VR controllers"))); vrSettings->Add(new CheckBox(&g_Config.bEnableMotions, vr->T("Map controller movements to keys")));