WMR/Rift bind release reset fix and space fix undo disable (#142)

* Test removal of HideWorkingSetPreview for issue #133

* Update WorkingSetPreview on apply reset data for issue #133

* fixed bug to apply floor fix offsets properly

* updated version to 3.0.1

* format

* Prevent space offsets effect on fix floor measurement

* Reorder chaperone commit timing on reset

This is an attempt to smooth apparent ~0.1sec lag on first movement after using a reset.

* Fix space fix tab (todo: reimplement undo button)
This commit is contained in:
Kung-vr
2019-03-30 13:56:27 -05:00
committed by ykeara
parent f57347a89c
commit bcdf87b0f5
8 changed files with 40 additions and 13 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ import distutils.dir_util
#Const globals #Const globals
#Version string must be bumped every release. #Version string must be bumped every release.
#TODO: See developer documentation. #TODO: See developer documentation.
VERSION_STRING = "3-0-0" VERSION_STRING = "3-0-1"
EXIT_CODE_SUCCESS = 0 EXIT_CODE_SUCCESS = 0
EXIT_CODE_FAILURE_BUILD_APP = 1 EXIT_CODE_FAILURE_BUILD_APP = 1
+1 -1
View File
@@ -11,7 +11,7 @@
!define THIRDDIR "..\third-party" !define THIRDDIR "..\third-party"
!define PACKAGEDIR "..\src\package_files" !define PACKAGEDIR "..\src\package_files"
!define PROJECTDIR "..\" !define PROJECTDIR "..\"
!define VERSION_STRING "3-0-0" !define VERSION_STRING "3-0-1"
;Installer icon ;Installer icon
+4
View File
@@ -855,6 +855,7 @@ void OverlayController::AddOffsetToUniverseCenter(
{ {
if ( commit ) if ( commit )
{ {
vr::VRChaperoneSetup()->HideWorkingSetPreview();
vr::VRChaperoneSetup()->RevertWorkingCopy(); vr::VRChaperoneSetup()->RevertWorkingCopy();
} }
vr::HmdMatrix34_t curPos; vr::HmdMatrix34_t curPos;
@@ -907,6 +908,7 @@ void OverlayController::RotateUniverseCenter(
{ {
if ( commit ) if ( commit )
{ {
vr::VRChaperoneSetup()->HideWorkingSetPreview();
vr::VRChaperoneSetup()->RevertWorkingCopy(); vr::VRChaperoneSetup()->RevertWorkingCopy();
} }
vr::HmdMatrix34_t curPos; vr::HmdMatrix34_t curPos;
@@ -969,6 +971,7 @@ void OverlayController::AddOffsetToCollisionBounds( float offset[3],
// y-coordinates reset to the defaults. // y-coordinates reset to the defaults.
if ( commit ) if ( commit )
{ {
vr::VRChaperoneSetup()->HideWorkingSetPreview();
vr::VRChaperoneSetup()->RevertWorkingCopy(); vr::VRChaperoneSetup()->RevertWorkingCopy();
} }
unsigned collisionBoundsCount = 0; unsigned collisionBoundsCount = 0;
@@ -1012,6 +1015,7 @@ void OverlayController::RotateCollisionBounds( float angle, bool commit )
{ {
if ( commit ) if ( commit )
{ {
vr::VRChaperoneSetup()->HideWorkingSetPreview();
vr::VRChaperoneSetup()->RevertWorkingCopy(); vr::VRChaperoneSetup()->RevertWorkingCopy();
} }
unsigned collisionBoundsCount = 0; unsigned collisionBoundsCount = 0;
+1 -1
View File
@@ -46,7 +46,7 @@ constexpr auto applicationOrganizationName = "AdvancedSettings-Team";
constexpr auto applicationName = "OpenVRAdvancedSettings"; constexpr auto applicationName = "OpenVRAdvancedSettings";
constexpr const char* applicationKey = "OVRAS-Team.AdvancedSettings"; constexpr const char* applicationKey = "OVRAS-Team.AdvancedSettings";
constexpr const char* applicationDisplayName = "Advanced Settings"; constexpr const char* applicationDisplayName = "Advanced Settings";
constexpr const char* applicationVersionString = "v3.0.0"; constexpr const char* applicationVersionString = "v3.0.1";
} // namespace application_strings } // namespace application_strings
// application namespace // application namespace
+7 -3
View File
@@ -67,6 +67,8 @@ MyStackViewPage {
MyPushButton { MyPushButton {
id: undoFixButton id: undoFixButton
enabled: false enabled: false
// TODO re-enable undo and remove visible: false
visible: false
Layout.fillWidth: true Layout.fillWidth: true
text: "Undo Fix" text: "Undo Fix"
onClicked: { onClicked: {
@@ -90,7 +92,7 @@ MyStackViewPage {
Component.onCompleted: { Component.onCompleted: {
statusMessageText.text = "" statusMessageText.text = ""
undoFixButton.enabled = FixFloorTabController.canUndo //undoFixButton.enabled = FixFloorTabController.canUndo
fixButton.enabled = true fixButton.enabled = true
} }
@@ -118,10 +120,12 @@ MyStackViewPage {
} }
onMeasureEndSignal: { onMeasureEndSignal: {
fixButton.enabled = true fixButton.enabled = true
undoFixButton.enabled = FixFloorTabController.canUndo // undoFixButton.enabled = FixFloorTabController.canUndo
} }
onCanUndoChanged: { onCanUndoChanged: {
undoFixButton.enabled = FixFloorTabController.canUndo //undoFixButton.enabled = FixFloorTabController.canUndo
// revert below to this -^
undoFixButton.enabled = false
} }
} }
@@ -812,7 +812,8 @@ void ChaperoneTabController::setHeight( float value, bool notify )
if ( m_height != value ) if ( m_height != value )
{ {
m_height = value; m_height = value;
vr::VRChaperoneSetup()->RevertWorkingCopy(); // TODO revert?
// vr::VRChaperoneSetup()->RevertWorkingCopy();
unsigned collisionBoundsCount = 0; unsigned collisionBoundsCount = 0;
vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo( vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo(
nullptr, &collisionBoundsCount ); nullptr, &collisionBoundsCount );
@@ -831,8 +832,9 @@ void ChaperoneTabController::setHeight( float value, bool notify )
} }
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo( vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(
collisionBounds, collisionBoundsCount ); collisionBounds, collisionBoundsCount );
vr::VRChaperoneSetup()->CommitWorkingCopy( // TODO revert?
vr::EChaperoneConfigFile_Live ); // vr::VRChaperoneSetup()->CommitWorkingCopy(
// vr::EChaperoneConfigFile_Live );
delete[] collisionBounds; delete[] collisionBounds;
} }
if ( notify ) if ( notify )
@@ -1358,6 +1360,7 @@ void ChaperoneTabController::addChaperoneProfile(
profile->includesChaperoneGeometry = includeGeometry; profile->includesChaperoneGeometry = includeGeometry;
if ( includeGeometry ) if ( includeGeometry )
{ {
vr::VRChaperoneSetup()->HideWorkingSetPreview();
vr::VRChaperoneSetup()->RevertWorkingCopy(); vr::VRChaperoneSetup()->RevertWorkingCopy();
uint32_t quadCount = 0; uint32_t quadCount = 0;
vr::VRChaperoneSetup()->GetLiveCollisionBoundsInfo( nullptr, vr::VRChaperoneSetup()->GetLiveCollisionBoundsInfo( nullptr,
@@ -1505,6 +1508,7 @@ void ChaperoneTabController::applyChaperoneProfile( unsigned index )
if ( profile.includesChaperoneGeometry ) if ( profile.includesChaperoneGeometry )
{ {
parent->m_moveCenterTabController.reset(); parent->m_moveCenterTabController.reset();
vr::VRChaperoneSetup()->HideWorkingSetPreview();
vr::VRChaperoneSetup()->RevertWorkingCopy(); vr::VRChaperoneSetup()->RevertWorkingCopy();
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo( vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(
profile.chaperoneGeometryQuads.get(), profile.chaperoneGeometryQuads.get(),
+10 -3
View File
@@ -161,7 +161,10 @@ void FixFloorTabController::eventLoopTick(
floorOffsetY; floorOffsetY;
*/ */
} }
floorOffsetY = static_cast<float>( tempOffsetY ); else
{
floorOffsetY = static_cast<float>( tempOffsetY );
}
} }
else else
{ {
@@ -188,7 +191,10 @@ void FixFloorTabController::eventLoopTick(
floorOffsetY; floorOffsetY;
*/ */
} }
floorOffsetY = static_cast<float>( tempOffsetY ); else
{
floorOffsetY = static_cast<float>( tempOffsetY );
}
} }
floorOffsetX = static_cast<float>( tempOffsetX ); floorOffsetX = static_cast<float>( tempOffsetX );
@@ -205,7 +211,6 @@ void FixFloorTabController::eventLoopTick(
offset[0] = floorOffsetX; offset[0] = floorOffsetX;
offset[2] = floorOffsetZ; offset[2] = floorOffsetZ;
} }
parent->m_moveCenterTabController.reset();
parent->AddOffsetToUniverseCenter( parent->AddOffsetToUniverseCenter(
vr::TrackingUniverseStanding, offset, true ); vr::TrackingUniverseStanding, offset, true );
statusMessage statusMessage
@@ -291,6 +296,7 @@ void FixFloorTabController::setCanUndo( bool value, bool notify )
void FixFloorTabController::fixFloorClicked() void FixFloorTabController::fixFloorClicked()
{ {
parent->m_moveCenterTabController.reset();
statusMessage = "Fixing ..."; statusMessage = "Fixing ...";
statusMessageTimeout = 1.0; statusMessageTimeout = 1.0;
emit statusMessageSignal(); emit statusMessageSignal();
@@ -301,6 +307,7 @@ void FixFloorTabController::fixFloorClicked()
void FixFloorTabController::recenterClicked() void FixFloorTabController::recenterClicked()
{ {
parent->m_moveCenterTabController.reset();
statusMessage = "Fixing ..."; statusMessage = "Fixing ...";
statusMessageTimeout = 1.0; statusMessageTimeout = 1.0;
emit statusMessageSignal(); emit statusMessageSignal();
@@ -731,6 +731,7 @@ void MoveCenterTabController::clampVelocity( double* velocity )
void MoveCenterTabController::updateChaperoneResetData() void MoveCenterTabController::updateChaperoneResetData()
{ {
vr::VRChaperoneSetup()->HideWorkingSetPreview();
vr::VRChaperoneSetup()->RevertWorkingCopy(); vr::VRChaperoneSetup()->RevertWorkingCopy();
unsigned currentQuadCount = 0; unsigned currentQuadCount = 0;
vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo( nullptr, vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo( nullptr,
@@ -768,16 +769,22 @@ void MoveCenterTabController::updateChaperoneResetData()
-universeCenterForResetYaw ); -universeCenterForResetYaw );
} }
} }
// update the working set preview for potential Oculus and WMR issues
vr::VRChaperoneSetup()->ShowWorkingSetPreview();
} }
void MoveCenterTabController::applyChaperoneResetData() void MoveCenterTabController::applyChaperoneResetData()
{ {
vr::VRChaperoneSetup()->HideWorkingSetPreview();
vr::VRChaperoneSetup()->RevertWorkingCopy(); vr::VRChaperoneSetup()->RevertWorkingCopy();
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo( vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(
m_collisionBoundsForReset, m_collisionBoundsCountForReset ); m_collisionBoundsForReset, m_collisionBoundsCountForReset );
vr::VRChaperoneSetup()->SetWorkingStandingZeroPoseToRawTrackingPose( vr::VRChaperoneSetup()->SetWorkingStandingZeroPoseToRawTrackingPose(
&m_universeCenterForReset ); &m_universeCenterForReset );
vr::VRChaperoneSetup()->CommitWorkingCopy( vr::EChaperoneConfigFile_Live ); vr::VRChaperoneSetup()->CommitWorkingCopy( vr::EChaperoneConfigFile_Live );
// update the working set preview otherwise Oculus and WMR users may not see
// results of the reset
vr::VRChaperoneSetup()->ShowWorkingSetPreview();
} }
// START of drag bindings: // START of drag bindings:
@@ -1487,7 +1494,8 @@ void MoveCenterTabController::saveUncommittedChaperone()
{ {
vr::VRChaperoneSetup()->CommitWorkingCopy( vr::VRChaperoneSetup()->CommitWorkingCopy(
vr::EChaperoneConfigFile_Live ); vr::EChaperoneConfigFile_Live );
vr::VRChaperoneSetup()->HideWorkingSetPreview(); // test removal for oculus and WMR users
// vr::VRChaperoneSetup()->HideWorkingSetPreview();
m_chaperoneCommitted = true; m_chaperoneCommitted = true;
} }
} }