Merge pull request #15935 from sethalves/fix-comfort-mode

BUGZ-1017: fix bug that caused comfort-mode to be active at all times in HMD
This commit is contained in:
Shannon Romano 2019-07-16 09:57:56 -07:00 committed by GitHub
commit bee8ba489a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 14 deletions

View file

@ -485,22 +485,13 @@ float HmdDisplayPlugin::stutterRate() const {
}
float adjustVisionSqueezeRatioForDevice(float visionSqueezeRatio, float visionSqueezeDeviceLow, float visionSqueezeDeviceHigh) {
const float SETTINGS_STEP = 0.2f; // adjusting the slider in preferences changes the ratio by this much
if (visionSqueezeRatio == 0.0f) {
if (visionSqueezeRatio <= 0.0f) {
return 0.0f;
}
float deviceRange = visionSqueezeDeviceHigh - visionSqueezeDeviceLow;
if (visionSqueezeRatio <= SETTINGS_STEP) {
// lowest "enabled" setting -- without this special case the user doesn't see anything on the lowest setting
float scaleFactor = (visionSqueezeRatio == SETTINGS_STEP) ? 0.24f : 0.18f; // these magic values were picked through experimentation
return deviceRange * scaleFactor + visionSqueezeDeviceLow;
} else {
const float SQUEEZE_ADJUSTMENT = 0.75f; // magic number picked through experimentation
return deviceRange * (SQUEEZE_ADJUSTMENT * visionSqueezeRatio) + visionSqueezeDeviceLow;
}
const float SQUEEZE_ADJUSTMENT = 0.75f; // magic number picked through experimentation
return deviceRange * (SQUEEZE_ADJUSTMENT * visionSqueezeRatio) + visionSqueezeDeviceLow;
}
void HmdDisplayPlugin::updateVisionSqueezeParameters(float visionSqueezeX, float visionSqueezeY,

View file

@ -55,9 +55,9 @@ void OculusDisplayPlugin::init() {
// Different HMDs end up showing the squeezed-vision egg as different sizes. These values
// attempt to make them appear the same.
_visionSqueezeDeviceLowX = 0.8f;
_visionSqueezeDeviceLowX = 0.7f;
_visionSqueezeDeviceHighX = 0.98f;
_visionSqueezeDeviceLowY = 0.8f;
_visionSqueezeDeviceLowY = 0.7f;
_visionSqueezeDeviceHighY = 0.9f;
emit deviceConnected(getName());