Rename 6DOF_PRECISE to HAS_UNIT_SCALE

This commit is contained in:
Henrik Rydgård 2022-11-06 11:39:41 +01:00
parent 9b619b8c0b
commit ef3b0607ef
3 changed files with 8 additions and 7 deletions

View file

@ -400,7 +400,7 @@ bool StartVRRender() {
// Decide if the scene is 3D or not
if (g_Config.bEnableVR && !VR_GetConfig(VR_CONFIG_FORCE_2D) && (VR_GetConfig(VR_CONFIG_3D_GEOMETRY_COUNT) > 15)) {
bool stereo = VR_GetConfig(VR_CONFIG_6DOF_PRECISE) && g_Config.bEnableStereo;
bool stereo = VR_GetConfig(VR_CONFIG_HAS_UNIT_SCALE) && g_Config.bEnableStereo;
VR_SetConfig(VR_CONFIG_MODE, stereo ? VR_MODE_STEREO_6DOF : VR_MODE_MONO_6DOF);
} else {
VR_SetConfig(VR_CONFIG_MODE, g_Config.bEnableStereo ? VR_MODE_STEREO_SCREEN : VR_MODE_MONO_SCREEN);
@ -553,9 +553,9 @@ void UpdateVRParams(float* projMatrix) {
float scale = 1.0f;
if (PSP_CoreParameter().compat.vrCompat().UnitsPerMeter > 0) {
scale = PSP_CoreParameter().compat.vrCompat().UnitsPerMeter;
VR_SetConfig(VR_CONFIG_6DOF_PRECISE, true);
VR_SetConfig(VR_CONFIG_HAS_UNIT_SCALE, true);
} else {
VR_SetConfig(VR_CONFIG_6DOF_PRECISE, false);
VR_SetConfig(VR_CONFIG_HAS_UNIT_SCALE, false);
}
VR_SetConfigFloat(VR_CONFIG_6DOF_SCALE, scale);
}

View file

@ -372,7 +372,7 @@ bool VR_InitFrame( engine_t* engine ) {
vrMatrix[matrix].M[1][3] += side.y;
vrMatrix[matrix].M[2][3] += side.z;
}
if (vrConfig[VR_CONFIG_6DOF_PRECISE] && (matrix == VR_VIEW_MATRIX_RIGHT_EYE)) {
if (vrConfig[VR_CONFIG_HAS_UNIT_SCALE] && (matrix == VR_VIEW_MATRIX_RIGHT_EYE)) {
float dx = fabs(invViewTransform[1].position.x - invViewTransform[0].position.x);
float dy = fabs(invViewTransform[1].position.y - invViewTransform[0].position.y);
float dz = fabs(invViewTransform[1].position.z - invViewTransform[0].position.z);

View file

@ -8,8 +8,9 @@ enum VRConfig {
VR_CONFIG_MODE, VR_CONFIG_3D_GEOMETRY_COUNT, VR_CONFIG_FORCE_2D,
//camera setup
VR_CONFIG_CAMERA_CONTROL,
VR_CONFIG_HAS_UNIT_SCALE,
//6DoF
VR_CONFIG_6DOF_ENABLED, VR_CONFIG_6DOF_PRECISE, VR_CONFIG_MIRROR_UPDATED,
VR_CONFIG_6DOF_ENABLED, VR_CONFIG_MIRROR_UPDATED,
VR_CONFIG_MIRROR_AXIS_X, VR_CONFIG_MIRROR_AXIS_Y, VR_CONFIG_MIRROR_AXIS_Z,
VR_CONFIG_MIRROR_PITCH, VR_CONFIG_MIRROR_YAW, VR_CONFIG_MIRROR_ROLL,
//mouse cursor
@ -26,10 +27,10 @@ enum VRConfig {
enum VRConfigFloat {
// 6dof
VR_CONFIG_6DOF_SCALE,
//camera setup
// camera setup
VR_CONFIG_FOV_SCALE, VR_CONFIG_CAMERA_DISTANCE,
VR_CONFIG_CAMERA_HEIGHT, VR_CONFIG_CAMERA_SIDE, VR_CONFIG_CANVAS_DISTANCE,
//2D canvas positioning
// 2D canvas positioning
VR_CONFIG_MENU_PITCH, VR_CONFIG_MENU_YAW, VR_CONFIG_RECENTER_YAW,
VR_CONFIG_FLOAT_MAX