Improved reset handling & bugfixes
This commit is contained in:
@@ -495,4 +495,33 @@ float ChaperoneTabController::getBoundsMaxY() {
|
||||
return result;
|
||||
}
|
||||
|
||||
void ChaperoneTabController::reset() {
|
||||
vr::EVRSettingsError vrSettingsError;
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(vr::k_pch_CollisionBounds_Section, vr::k_pch_CollisionBounds_ColorGammaA_Int32, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"" << vr::k_pch_CollisionBounds_ColorGammaA_Int32 << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(vr::k_pch_CollisionBounds_Section, vr::k_pch_CollisionBounds_FadeDistance_Float, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"" << vr::k_pch_CollisionBounds_FadeDistance_Float << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(vr::k_pch_CollisionBounds_Section, vr::k_pch_CollisionBounds_CenterMarkerOn_Bool, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"" << vr::k_pch_CollisionBounds_CenterMarkerOn_Bool << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(vr::k_pch_CollisionBounds_Section, vr::k_pch_CollisionBounds_PlaySpaceOn_Bool, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"" << vr::k_pch_CollisionBounds_PlaySpaceOn_Bool << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
setForceBounds(false);
|
||||
|
||||
vr::VRSettings()->Sync();
|
||||
settingsUpdateCounter = 999; // Easiest way to get default values
|
||||
}
|
||||
|
||||
} // namespace advconfig
|
||||
|
||||
@@ -111,6 +111,8 @@ public slots:
|
||||
void applyChaperoneProfile(unsigned index);
|
||||
void deleteChaperoneProfile(unsigned index);
|
||||
|
||||
void reset();
|
||||
|
||||
signals:
|
||||
void boundsVisibilityChanged(float value);
|
||||
void fadeDistanceChanged(float value);
|
||||
|
||||
@@ -101,7 +101,8 @@ void MoveCenterTabController::setAdjustChaperone(bool value, bool notify) {
|
||||
parent->AddOffsetToCollisionBounds(2, -m_offsetZ, false);
|
||||
}
|
||||
if (m_rotation != 0) {
|
||||
parent->RotateCollisionBounds(-m_rotation, false);
|
||||
float angle = m_rotation * 2 * M_PI / 360.0;
|
||||
parent->RotateCollisionBounds(-angle, false);
|
||||
}
|
||||
} else {
|
||||
if (m_offsetX != 0.0f) {
|
||||
@@ -114,7 +115,8 @@ void MoveCenterTabController::setAdjustChaperone(bool value, bool notify) {
|
||||
parent->AddOffsetToCollisionBounds(2, m_offsetZ, false);
|
||||
}
|
||||
if (m_rotation != 0) {
|
||||
parent->RotateCollisionBounds(m_rotation, false);
|
||||
float angle = m_rotation * 2 * M_PI / 360.0;
|
||||
parent->RotateCollisionBounds(angle, false);
|
||||
}
|
||||
}
|
||||
vr::VRChaperoneSetup()->CommitWorkingCopy(vr::EChaperoneConfigFile_Live);
|
||||
|
||||
@@ -67,11 +67,13 @@ void SteamVRTabController::eventLoopTick() {
|
||||
|
||||
|
||||
void SteamVRTabController::setSuperSampling(float value, bool notify) {
|
||||
bool override = false;
|
||||
if (value <= 0.01f) {
|
||||
LOG(WARNING) << "Encountered a supersampling value <= 0.01, setting supersampling to 1.0";
|
||||
value = 1.0f;
|
||||
override = true;
|
||||
}
|
||||
if (m_superSampling != value) {
|
||||
if (override || m_superSampling != value) {
|
||||
LOG(DEBUG) << "Supersampling value changed: " << m_superSampling << " => " << value;
|
||||
m_superSampling = value;
|
||||
vr::VRSettings()->SetFloat(vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, m_superSampling);
|
||||
@@ -84,11 +86,13 @@ void SteamVRTabController::setSuperSampling(float value, bool notify) {
|
||||
|
||||
|
||||
void SteamVRTabController::setCompositorSuperSampling(float value, bool notify) {
|
||||
bool override = false;
|
||||
if (value <= 0.01f) {
|
||||
LOG(WARNING) << "Encountered a compositor supersampling value <= 0.01, setting supersampling to 1.0";
|
||||
value = 1.0f;
|
||||
override = true;
|
||||
}
|
||||
if (m_compositorSuperSampling != value) {
|
||||
if (override || m_compositorSuperSampling != value) {
|
||||
LOG(DEBUG) << "Compositor supersampling value changed: " << m_compositorSuperSampling << " => " << value;
|
||||
m_compositorSuperSampling = value;
|
||||
vr::VRSettings()->SetFloat(vrsettings_compositor_category, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, m_compositorSuperSampling);
|
||||
@@ -160,6 +164,40 @@ void SteamVRTabController::setForceReprojection(bool value, bool notify) {
|
||||
}
|
||||
|
||||
|
||||
void SteamVRTabController::reset() {
|
||||
vr::EVRSettingsError vrSettingsError;
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"" << vr::k_pch_SteamVR_RenderTargetMultiplier_Float << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
setCompositorSuperSampling(1.0f); // Is not in default.vrsettings yet
|
||||
vr::VRSettings()->RemoveKeyInSection(vrsettings_compositor_category, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"" << vrsettings_compositor_category << "::" << vr::k_pch_SteamVR_RenderTargetMultiplier_Float << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(vr::k_pch_SteamVR_Section, vrsettings_steamvr_allowInterleavedReprojection, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"" << vrsettings_steamvr_allowInterleavedReprojection << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(vr::k_pch_SteamVR_Section, vrsettings_steamvr_allowAsyncReprojection, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"" << vrsettings_steamvr_allowAsyncReprojection << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_ForceReprojection_Bool, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"" << vr::k_pch_SteamVR_ForceReprojection_Bool << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->Sync();
|
||||
settingsUpdateCounter = 999; // Easiest way to get default values
|
||||
}
|
||||
|
||||
|
||||
void SteamVRTabController::restartSteamVR() {
|
||||
QString cmd = QString("cmd.exe /C restartvrserver.bat \"") + parent->getVRRuntimePathUrl().toLocalFile() + QString("\"");
|
||||
LOG(INFO) << "SteamVR Restart Command: " << cmd;
|
||||
|
||||
@@ -56,6 +56,7 @@ public slots:
|
||||
void setAllowAsyncReprojection(bool value, bool notify = true);
|
||||
void setForceReprojection(bool value, bool notify = true);
|
||||
|
||||
void reset();
|
||||
void restartSteamVR();
|
||||
|
||||
signals:
|
||||
|
||||
Reference in New Issue
Block a user