Improved reset handling & bugfixes
This commit is contained in:
@@ -256,7 +256,7 @@ MyStackViewPage {
|
|||||||
chaperoneVisibilityText.text = Math.round(val) + "%"
|
chaperoneVisibilityText.text = Math.round(val) + "%"
|
||||||
}
|
}
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
ChaperoneTabController.setBoundsVisibility(Math.round(value), false)
|
ChaperoneTabController.setBoundsVisibility(value.toFixed(2), false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -372,7 +372,9 @@ MyStackViewPage {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onPositionChanged: {
|
onPositionChanged: {
|
||||||
var val = (this.from + ( this.position * (this.to - this.from))).toFixed(2)
|
var val = (this.from + ( this.position * (this.to - this.from))).toFixed(2)
|
||||||
ChaperoneTabController.setHeight(val, false);
|
if (activeFocus) {
|
||||||
|
ChaperoneTabController.setHeight(val, false);
|
||||||
|
}
|
||||||
chaperoneHeightText.text = val
|
chaperoneHeightText.text = val
|
||||||
}
|
}
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
@@ -459,11 +461,7 @@ MyStackViewPage {
|
|||||||
text: "Reset"
|
text: "Reset"
|
||||||
Layout.preferredWidth: 250
|
Layout.preferredWidth: 250
|
||||||
onClicked: {
|
onClicked: {
|
||||||
chaperoneVisibilitySlider.value = 0.6
|
ChaperoneTabController.reset()
|
||||||
chaperoneFadeDistanceSlider.value = 0.7
|
|
||||||
chaperoneCenterMarkerToggle.checked = false
|
|
||||||
chaperonePlaySpaceToggle.checked = false
|
|
||||||
chaperoneForceBoundsToggle.checked = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -289,9 +289,9 @@ MyStackViewPage {
|
|||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
playspaceAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone
|
playspaceAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone
|
||||||
playSpaceMoveXText.text = MoveCenterTabController.offsetX.toFixed(1)
|
playSpaceMoveXText.text = MoveCenterTabController.offsetX.toFixed(2)
|
||||||
playSpaceMoveYText.text = MoveCenterTabController.offsetY.toFixed(1)
|
playSpaceMoveYText.text = MoveCenterTabController.offsetY.toFixed(2)
|
||||||
playSpaceMoveZText.text = MoveCenterTabController.offsetZ.toFixed(1)
|
playSpaceMoveZText.text = MoveCenterTabController.offsetZ.toFixed(2)
|
||||||
playspaceRotationSlider.value = MoveCenterTabController.rotation
|
playspaceRotationSlider.value = MoveCenterTabController.rotation
|
||||||
if (MoveCenterTabController.trackingUniverse === 0) {
|
if (MoveCenterTabController.trackingUniverse === 0) {
|
||||||
playspaceModeText.text = "Sitting"
|
playspaceModeText.text = "Sitting"
|
||||||
|
|||||||
@@ -184,11 +184,7 @@ MyStackViewPage {
|
|||||||
text: "Reset"
|
text: "Reset"
|
||||||
Layout.preferredWidth: 250
|
Layout.preferredWidth: 250
|
||||||
onClicked: {
|
onClicked: {
|
||||||
steamvrSupersamplingSlider.value = 1.0
|
SteamVRTabController.reset()
|
||||||
steamvrCompositorSupersamplingSlider.value = 1.0
|
|
||||||
steamvrAllowInterleavedReprojectionToggle.checked = true
|
|
||||||
steamvrAllowAsyncReprojectionToggle.checked = true
|
|
||||||
steamvrForceReprojectionToggle.checked = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -495,4 +495,33 @@ float ChaperoneTabController::getBoundsMaxY() {
|
|||||||
return result;
|
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
|
} // namespace advconfig
|
||||||
|
|||||||
@@ -111,6 +111,8 @@ public slots:
|
|||||||
void applyChaperoneProfile(unsigned index);
|
void applyChaperoneProfile(unsigned index);
|
||||||
void deleteChaperoneProfile(unsigned index);
|
void deleteChaperoneProfile(unsigned index);
|
||||||
|
|
||||||
|
void reset();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void boundsVisibilityChanged(float value);
|
void boundsVisibilityChanged(float value);
|
||||||
void fadeDistanceChanged(float value);
|
void fadeDistanceChanged(float value);
|
||||||
|
|||||||
@@ -101,7 +101,8 @@ void MoveCenterTabController::setAdjustChaperone(bool value, bool notify) {
|
|||||||
parent->AddOffsetToCollisionBounds(2, -m_offsetZ, false);
|
parent->AddOffsetToCollisionBounds(2, -m_offsetZ, false);
|
||||||
}
|
}
|
||||||
if (m_rotation != 0) {
|
if (m_rotation != 0) {
|
||||||
parent->RotateCollisionBounds(-m_rotation, false);
|
float angle = m_rotation * 2 * M_PI / 360.0;
|
||||||
|
parent->RotateCollisionBounds(-angle, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (m_offsetX != 0.0f) {
|
if (m_offsetX != 0.0f) {
|
||||||
@@ -114,7 +115,8 @@ void MoveCenterTabController::setAdjustChaperone(bool value, bool notify) {
|
|||||||
parent->AddOffsetToCollisionBounds(2, m_offsetZ, false);
|
parent->AddOffsetToCollisionBounds(2, m_offsetZ, false);
|
||||||
}
|
}
|
||||||
if (m_rotation != 0) {
|
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);
|
vr::VRChaperoneSetup()->CommitWorkingCopy(vr::EChaperoneConfigFile_Live);
|
||||||
|
|||||||
@@ -67,11 +67,13 @@ void SteamVRTabController::eventLoopTick() {
|
|||||||
|
|
||||||
|
|
||||||
void SteamVRTabController::setSuperSampling(float value, bool notify) {
|
void SteamVRTabController::setSuperSampling(float value, bool notify) {
|
||||||
|
bool override = false;
|
||||||
if (value <= 0.01f) {
|
if (value <= 0.01f) {
|
||||||
LOG(WARNING) << "Encountered a supersampling value <= 0.01, setting supersampling to 1.0";
|
LOG(WARNING) << "Encountered a supersampling value <= 0.01, setting supersampling to 1.0";
|
||||||
value = 1.0f;
|
value = 1.0f;
|
||||||
|
override = true;
|
||||||
}
|
}
|
||||||
if (m_superSampling != value) {
|
if (override || m_superSampling != value) {
|
||||||
LOG(DEBUG) << "Supersampling value changed: " << m_superSampling << " => " << value;
|
LOG(DEBUG) << "Supersampling value changed: " << m_superSampling << " => " << value;
|
||||||
m_superSampling = value;
|
m_superSampling = value;
|
||||||
vr::VRSettings()->SetFloat(vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, m_superSampling);
|
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) {
|
void SteamVRTabController::setCompositorSuperSampling(float value, bool notify) {
|
||||||
|
bool override = false;
|
||||||
if (value <= 0.01f) {
|
if (value <= 0.01f) {
|
||||||
LOG(WARNING) << "Encountered a compositor supersampling value <= 0.01, setting supersampling to 1.0";
|
LOG(WARNING) << "Encountered a compositor supersampling value <= 0.01, setting supersampling to 1.0";
|
||||||
value = 1.0f;
|
value = 1.0f;
|
||||||
|
override = true;
|
||||||
}
|
}
|
||||||
if (m_compositorSuperSampling != value) {
|
if (override || m_compositorSuperSampling != value) {
|
||||||
LOG(DEBUG) << "Compositor supersampling value changed: " << m_compositorSuperSampling << " => " << value;
|
LOG(DEBUG) << "Compositor supersampling value changed: " << m_compositorSuperSampling << " => " << value;
|
||||||
m_compositorSuperSampling = value;
|
m_compositorSuperSampling = value;
|
||||||
vr::VRSettings()->SetFloat(vrsettings_compositor_category, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, m_compositorSuperSampling);
|
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() {
|
void SteamVRTabController::restartSteamVR() {
|
||||||
QString cmd = QString("cmd.exe /C restartvrserver.bat \"") + parent->getVRRuntimePathUrl().toLocalFile() + QString("\"");
|
QString cmd = QString("cmd.exe /C restartvrserver.bat \"") + parent->getVRRuntimePathUrl().toLocalFile() + QString("\"");
|
||||||
LOG(INFO) << "SteamVR Restart Command: " << cmd;
|
LOG(INFO) << "SteamVR Restart Command: " << cmd;
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public slots:
|
|||||||
void setAllowAsyncReprojection(bool value, bool notify = true);
|
void setAllowAsyncReprojection(bool value, bool notify = true);
|
||||||
void setForceReprojection(bool value, bool notify = true);
|
void setForceReprojection(bool value, bool notify = true);
|
||||||
|
|
||||||
|
void reset();
|
||||||
void restartSteamVR();
|
void restartSteamVR();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|||||||
Reference in New Issue
Block a user