mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-11 05:26:24 +02:00
OpenXR - Option to set canvas distance added
This commit is contained in:
1 parent
428145c4b9
commit
70c4781feb
6 files changed
+8
-2
No files matched your search
@@ -216,6 +216,7 @@ bool GLRenderManager::ThreadFrame() {
|
||||
|
||||
// Set customizations
|
||||
VR_SetConfig(VR_CONFIG_6DOF_ENABLED, g_Config.bEnable6DoF);
|
||||
VR_SetConfig(VR_CONFIG_CANVAS_DISTANCE, g_Config.iCanvasDistance);
|
||||
VR_SetConfig(VR_CONFIG_FOV_SCALE, g_Config.iFieldOfViewPercentage);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -383,11 +383,12 @@ void VR_EndFrame( engine_t* engine ) {
|
||||
cylinder_layer.subImage.imageRect.extent.width = width;
|
||||
cylinder_layer.subImage.imageRect.extent.height = height;
|
||||
cylinder_layer.subImage.imageArrayIndex = 0;
|
||||
float distance = vrConfig[VR_CONFIG_CANVAS_DISTANCE];
|
||||
const XrVector3f axis = {0.0f, 1.0f, 0.0f};
|
||||
XrVector3f pos = {
|
||||
invViewTransform[0].position.x - sin(ToRadians(menuYaw)) * 6.0f,
|
||||
invViewTransform[0].position.x - sin(ToRadians(menuYaw)) * distance,
|
||||
invViewTransform[0].position.y,
|
||||
invViewTransform[0].position.z - cos(ToRadians(menuYaw)) * 6.0f
|
||||
invViewTransform[0].position.z - cos(ToRadians(menuYaw)) * distance
|
||||
};
|
||||
cylinder_layer.pose.orientation = XrQuaternionf_CreateFromVectorAngle(axis, ToRadians(menuYaw));
|
||||
cylinder_layer.pose.position = pos;
|
||||
|
||||
@@ -16,6 +16,7 @@ enum VRConfig {
|
||||
VR_CONFIG_3D_GEOMETRY_COUNT,
|
||||
VR_CONFIG_FOV_SCALE,
|
||||
VR_CONFIG_FORCE_2D,
|
||||
VR_CONFIG_CANVAS_DISTANCE,
|
||||
VR_CONFIG_MAX
|
||||
};
|
||||
|
||||
|
||||
@@ -1208,6 +1208,7 @@ static ConfigSetting themeSettings[] = {
|
||||
static ConfigSetting vrSettings[] = {
|
||||
ConfigSetting("VREnable", &g_Config.bEnableVR, true),
|
||||
ConfigSetting("VREnable6DoF", &g_Config.bEnable6DoF, true),
|
||||
ConfigSetting("VRCanvasDistance", &g_Config.iCanvasDistance, 6),
|
||||
ConfigSetting("VRFieldOfView", &g_Config.iFieldOfViewPercentage, 100),
|
||||
};
|
||||
|
||||
|
||||
@@ -456,6 +456,7 @@ public:
|
||||
// Virtual reality
|
||||
bool bEnableVR;
|
||||
bool bEnable6DoF;
|
||||
int iCanvasDistance;
|
||||
int iFieldOfViewPercentage;
|
||||
|
||||
// Debugger
|
||||
|
||||
@@ -1119,6 +1119,7 @@ void GameSettingsScreen::CreateViews() {
|
||||
vr6DoF->SetEnabledPtr(&g_Config.bEnableVR);
|
||||
PopupSliderChoice *vrFieldOfView = vrSettings->Add(new PopupSliderChoice(&g_Config.iFieldOfViewPercentage, 100, 150, vr->T("Field of view scale", "Headset's field of view scale"), 10, screenManager(), vr->T("% of native FoV")));
|
||||
vrFieldOfView->SetEnabledPtr(&g_Config.bEnableVR);
|
||||
vrSettings->Add(new PopupSliderChoice(&g_Config.iCanvasDistance, 1, 10, vr->T("Distance to 2D menus and scenes", "Distance to 2D menus and scenes"), 1, screenManager(), ""));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user