mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 03:47:13 +02:00
fix bug that caused comfort-mode to be active at all times in HMD
This commit is contained in:
parent
020c7a5f44
commit
22a913bee2
2 changed files with 5 additions and 14 deletions
|
@ -485,22 +485,13 @@ float HmdDisplayPlugin::stutterRate() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
float adjustVisionSqueezeRatioForDevice(float visionSqueezeRatio, float visionSqueezeDeviceLow, float visionSqueezeDeviceHigh) {
|
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;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
float deviceRange = visionSqueezeDeviceHigh - visionSqueezeDeviceLow;
|
float deviceRange = visionSqueezeDeviceHigh - visionSqueezeDeviceLow;
|
||||||
|
const float SQUEEZE_ADJUSTMENT = 0.75f; // magic number picked through experimentation
|
||||||
if (visionSqueezeRatio <= SETTINGS_STEP) {
|
return deviceRange * (SQUEEZE_ADJUSTMENT * visionSqueezeRatio) + visionSqueezeDeviceLow;
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HmdDisplayPlugin::updateVisionSqueezeParameters(float visionSqueezeX, float visionSqueezeY,
|
void HmdDisplayPlugin::updateVisionSqueezeParameters(float visionSqueezeX, float visionSqueezeY,
|
||||||
|
|
|
@ -55,9 +55,9 @@ void OculusDisplayPlugin::init() {
|
||||||
|
|
||||||
// Different HMDs end up showing the squeezed-vision egg as different sizes. These values
|
// Different HMDs end up showing the squeezed-vision egg as different sizes. These values
|
||||||
// attempt to make them appear the same.
|
// attempt to make them appear the same.
|
||||||
_visionSqueezeDeviceLowX = 0.8f;
|
_visionSqueezeDeviceLowX = 0.7f;
|
||||||
_visionSqueezeDeviceHighX = 0.98f;
|
_visionSqueezeDeviceHighX = 0.98f;
|
||||||
_visionSqueezeDeviceLowY = 0.8f;
|
_visionSqueezeDeviceLowY = 0.7f;
|
||||||
_visionSqueezeDeviceHighY = 0.9f;
|
_visionSqueezeDeviceHighY = 0.9f;
|
||||||
|
|
||||||
emit deviceConnected(getName());
|
emit deviceConnected(getName());
|
||||||
|
|
Loading…
Reference in a new issue