5.8.3 (#658)
* add delay if interface not found * adjust initialization behavior * pushed for debugging reasons for concerned parties * comment out simple recenter * remove old style motion, some minor optimizations * optimize default case check * optimized default condition * change manifest install behavior to trigger on desktop mode as well * add desktop mode binding launch * add tracker overlay option to utils * commit to check status * attempt to fix native LH issues with chaperone when exiting * add desktop mode toggle and some cleanup * remove adjust chaperone * remove clang format from ci, increment version, cleanup * update circle ci * fix conversion warning * add F13-19 to keyboard parser * add additional logging around failure to initialize * add unsaved changes * update version 5.8.1 * fix some collisions in enum declaration * add controller powers on steamvr, and no HMD to steamvr tab, increment version * slightly alter drag movement, fix qml issue * code cleanup * fix logspam/attempt to delete non existant overlays * increment version 5.8.3
This commit is contained in:
@@ -128,7 +128,8 @@ void ChaperoneTabController::handleChaperoneWarnings( float distance )
|
||||
}
|
||||
m_chaperoneHapticFeedbackActive = true;
|
||||
m_chaperoneHapticFeedbackThread = std::thread(
|
||||
[&]( ChaperoneTabController* _this ) {
|
||||
[&]( ChaperoneTabController* _this )
|
||||
{
|
||||
auto leftIndex
|
||||
= vr::VRSystem()
|
||||
->GetTrackedDeviceIndexForControllerRole(
|
||||
|
||||
@@ -454,23 +454,6 @@ void MoveCenterTabController::setFrictionPercent( int value, bool notify )
|
||||
}
|
||||
}
|
||||
|
||||
bool MoveCenterTabController::adjustChaperone() const
|
||||
{
|
||||
return settings::getSetting(
|
||||
settings::BoolSetting::PLAYSPACE_adjustChaperone4 );
|
||||
}
|
||||
|
||||
void MoveCenterTabController::setAdjustChaperone( bool value, bool notify )
|
||||
{
|
||||
settings::setSetting( settings::BoolSetting::PLAYSPACE_adjustChaperone4,
|
||||
value );
|
||||
|
||||
if ( notify )
|
||||
{
|
||||
emit adjustChaperoneChanged( value );
|
||||
}
|
||||
}
|
||||
|
||||
bool MoveCenterTabController::moveShortcutRight() const
|
||||
{
|
||||
return settings::getSetting(
|
||||
@@ -855,29 +838,6 @@ void MoveCenterTabController::setAllowExternalEdits( bool value, bool notify )
|
||||
}
|
||||
}
|
||||
|
||||
bool MoveCenterTabController::oldStyleMotion() const
|
||||
{
|
||||
return settings::getSetting(
|
||||
settings::BoolSetting::PLAYSPACE_oldStyleMotion );
|
||||
}
|
||||
|
||||
void MoveCenterTabController::setOldStyleMotion( bool value, bool notify )
|
||||
{
|
||||
// detect incoming change to old style, and hide working set
|
||||
if ( value && !oldStyleMotion() )
|
||||
{
|
||||
vr::VRChaperoneSetup()->HideWorkingSetPreview();
|
||||
}
|
||||
|
||||
settings::setSetting( settings::BoolSetting::PLAYSPACE_oldStyleMotion,
|
||||
value );
|
||||
|
||||
if ( notify )
|
||||
{
|
||||
emit oldStyleMotionChanged( value );
|
||||
}
|
||||
}
|
||||
|
||||
bool MoveCenterTabController::universeCenteredRotation() const
|
||||
{
|
||||
return settings::getSetting(
|
||||
@@ -901,23 +861,6 @@ bool MoveCenterTabController::isInitComplete() const
|
||||
return m_initComplete;
|
||||
}
|
||||
|
||||
bool MoveCenterTabController::simpleRecenter() const
|
||||
{
|
||||
return settings::getSetting(
|
||||
settings::BoolSetting::PLAYSPACE_simpleRecenter );
|
||||
}
|
||||
|
||||
void MoveCenterTabController::setSimpleRecenter( bool value, bool notify )
|
||||
{
|
||||
settings::setSetting( settings::BoolSetting::PLAYSPACE_simpleRecenter,
|
||||
value );
|
||||
|
||||
if ( notify )
|
||||
{
|
||||
emit simpleRecenterChanged( value );
|
||||
}
|
||||
}
|
||||
|
||||
void MoveCenterTabController::modOffsetX( float value, bool notify )
|
||||
{
|
||||
if ( !lockXToggle() )
|
||||
@@ -956,8 +899,7 @@ void MoveCenterTabController::modOffsetZ( float value, bool notify )
|
||||
|
||||
void MoveCenterTabController::shutdown()
|
||||
{
|
||||
reset();
|
||||
vr::VRChaperoneSetup()->HideWorkingSetPreview();
|
||||
vr::VRChaperoneSetup()->RevertWorkingCopy();
|
||||
}
|
||||
|
||||
void MoveCenterTabController::incomingSeatedReset()
|
||||
@@ -965,15 +907,18 @@ void MoveCenterTabController::incomingSeatedReset()
|
||||
// if we didn't send the request from OVRAS, we need to send another
|
||||
// ResetSeatedZeroPose(). It seems that only after this is sent from
|
||||
// OVRAS does ReloadFromDisk return valid info on WMR.
|
||||
if ( !m_selfRequestedSeatedRecenter && !simpleRecenter() )
|
||||
if ( !m_selfRequestedSeatedRecenter )
|
||||
{
|
||||
LOG( INFO ) << "steamvr center?";
|
||||
m_selfRequestedSeatedRecenter = true;
|
||||
vr::VRChaperone()->ResetZeroPose( vr::TrackingUniverseSeated );
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG( INFO ) << "not our receneter";
|
||||
updateSeatedResetData();
|
||||
}
|
||||
// vr::VRChaperone()->ResetZeroPose( vr::TrackingUniverseSeated );
|
||||
}
|
||||
|
||||
void MoveCenterTabController::reset()
|
||||
@@ -1117,94 +1062,64 @@ void MoveCenterTabController::zeroOffsets()
|
||||
LOG( INFO ) << "-Resetting offsets-";
|
||||
}
|
||||
}
|
||||
|
||||
// finished checking if out of bounds, proceed with normal zeroing
|
||||
// offsets
|
||||
auto chaperoneState = vr::VRChaperone()->GetCalibrationState();
|
||||
if ( chaperoneState < vr::ChaperoneCalibrationState_Error
|
||||
|| chaperoneState
|
||||
== vr::ChaperoneCalibrationState_Error_PlayAreaInvalid
|
||||
|| m_ignoreChaperoneState )
|
||||
m_oldOffsetX = 0.0f;
|
||||
m_oldOffsetY = 0.0f;
|
||||
m_oldOffsetZ = 0.0f;
|
||||
m_oldRotation = 0;
|
||||
m_offsetX = 0.0f;
|
||||
m_offsetY = 0.0f;
|
||||
m_offsetZ = 0.0f;
|
||||
m_rotation = 0;
|
||||
emit offsetXChanged( m_offsetX );
|
||||
emit offsetYChanged( m_offsetY );
|
||||
emit offsetZChanged( m_offsetZ );
|
||||
emit rotationChanged( m_rotation );
|
||||
updateChaperoneResetData();
|
||||
m_pendingZeroOffsets = false;
|
||||
if ( !m_chaperoneBasisAcquired )
|
||||
{
|
||||
if ( !m_chaperoneInit )
|
||||
m_chaperoneBasisAcquired = true;
|
||||
if ( !m_initComplete )
|
||||
{
|
||||
m_chaperoneInit = true;
|
||||
LOG( INFO ) << "Chaperone Initially Calibrated";
|
||||
}
|
||||
if ( chaperoneState > vr::ChaperoneCalibrationState_OK )
|
||||
{
|
||||
LOG( WARNING )
|
||||
<< "Chaperone Cal State Is warning during zero offsets: "
|
||||
<< chaperoneState;
|
||||
}
|
||||
m_oldOffsetX = 0.0f;
|
||||
m_oldOffsetY = 0.0f;
|
||||
m_oldOffsetZ = 0.0f;
|
||||
m_oldRotation = 0;
|
||||
m_offsetX = 0.0f;
|
||||
m_offsetY = 0.0f;
|
||||
m_offsetZ = 0.0f;
|
||||
m_rotation = 0;
|
||||
emit offsetXChanged( m_offsetX );
|
||||
emit offsetYChanged( m_offsetY );
|
||||
emit offsetZChanged( m_offsetZ );
|
||||
emit rotationChanged( m_rotation );
|
||||
updateChaperoneResetData();
|
||||
m_pendingZeroOffsets = false;
|
||||
if ( !m_chaperoneBasisAcquired )
|
||||
{
|
||||
m_chaperoneBasisAcquired = true;
|
||||
if ( !m_initComplete )
|
||||
setTrackingUniverse( vr::VRCompositor()->GetTrackingSpace() );
|
||||
if ( parent->isPreviousShutdownSafe() )
|
||||
{
|
||||
setTrackingUniverse( vr::VRCompositor()->GetTrackingSpace() );
|
||||
if ( parent->isPreviousShutdownSafe() )
|
||||
{
|
||||
// all init complete, safe to autosave chaperone profile
|
||||
parent->m_chaperoneTabController.createNewAutosaveProfile();
|
||||
m_initComplete = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// shutdown was unsafe last session!
|
||||
LOG( WARNING )
|
||||
<< "DETECTED UNSAFE SHUTDOWN FROM LAST SESSION";
|
||||
m_initComplete = true;
|
||||
if ( !parent->crashRecoveryDisabled() )
|
||||
{
|
||||
parent->m_chaperoneTabController
|
||||
.applyAutosavedProfile();
|
||||
LOG( INFO ) << "Applying last good chaperone "
|
||||
"profile autosave";
|
||||
}
|
||||
}
|
||||
// Now mark previous shutdown as unsafe in case we crash
|
||||
// some time during this session. Previous shutdown will be
|
||||
// marked as being safe once more just before our app shuts
|
||||
// down properly.
|
||||
parent->setPreviousShutdownSafe( false );
|
||||
// all init complete, safe to autosave chaperone profile
|
||||
parent->m_chaperoneTabController.createNewAutosaveProfile();
|
||||
m_initComplete = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// shutdown was unsafe last session!
|
||||
LOG( WARNING ) << "DETECTED UNSAFE SHUTDOWN FROM LAST SESSION";
|
||||
m_initComplete = true;
|
||||
if ( !parent->crashRecoveryDisabled() )
|
||||
{
|
||||
parent->m_chaperoneTabController.applyAutosavedProfile();
|
||||
LOG( INFO ) << "Applying last good chaperone "
|
||||
"profile autosave";
|
||||
}
|
||||
}
|
||||
// Now mark previous shutdown as unsafe in case we crash
|
||||
// some time during this session. Previous shutdown will be
|
||||
// marked as being safe once more just before our app shuts
|
||||
// down properly.
|
||||
parent->setPreviousShutdownSafe( false );
|
||||
}
|
||||
if ( m_roomSetupModeDetected )
|
||||
{
|
||||
LOG( INFO ) << "room setup EXIT detected";
|
||||
m_roomSetupModeDetected = false;
|
||||
}
|
||||
|
||||
LOG( INFO ) << "SUCCESS: Chaperone Data Updated and Offsets zeroed out";
|
||||
}
|
||||
else
|
||||
if ( m_roomSetupModeDetected )
|
||||
{
|
||||
if ( !m_pendingZeroOffsets )
|
||||
{
|
||||
LOG( INFO ) << "PENDING: Chaperone Data Update and Offsets zeroing";
|
||||
}
|
||||
m_pendingZeroOffsets = true;
|
||||
LOG( INFO ) << "room setup EXIT detected";
|
||||
m_roomSetupModeDetected = false;
|
||||
}
|
||||
|
||||
LOG( INFO ) << "SUCCESS: Chaperone Data Updated and Offsets zeroed out";
|
||||
}
|
||||
|
||||
void MoveCenterTabController::sendSeatedRecenter()
|
||||
{
|
||||
vr::VRChaperone()->ResetZeroPose( vr::TrackingUniverseSeated );
|
||||
// vr::VRChaperone()->ResetZeroPose( vr::TrackingUniverseStanding );
|
||||
}
|
||||
|
||||
double MoveCenterTabController::getHmdYawTotal()
|
||||
@@ -1235,14 +1150,11 @@ void MoveCenterTabController::updateSeatedResetData()
|
||||
{
|
||||
m_heightToggle = false;
|
||||
emit heightToggleChanged( m_heightToggle );
|
||||
m_oldOffsetX = 0.0f;
|
||||
m_oldOffsetY = 0.0f;
|
||||
m_oldOffsetZ = 0.0f;
|
||||
m_oldRotation = 0;
|
||||
m_offsetX = 0.0f;
|
||||
m_offsetY = 0.0f;
|
||||
m_offsetZ = 0.0f;
|
||||
m_rotation = 0;
|
||||
|
||||
m_oldOffsetX = m_oldOffsetY = m_oldOffsetZ = 0.0f;
|
||||
m_oldRotation = m_rotation = 0;
|
||||
m_offsetX = m_offsetY = m_offsetZ = 0.0f;
|
||||
|
||||
emit offsetXChanged( m_offsetX );
|
||||
emit offsetYChanged( m_offsetY );
|
||||
emit offsetZChanged( m_offsetZ );
|
||||
@@ -2135,24 +2047,6 @@ void MoveCenterTabController::zAxisLockToggle( bool zAxisLockToggleJustPressed )
|
||||
|
||||
// END of other bindings
|
||||
|
||||
void MoveCenterTabController::saveUncommittedChaperone()
|
||||
{
|
||||
if ( !m_chaperoneCommitted )
|
||||
{
|
||||
vr::VRChaperoneSetup()->CommitWorkingCopy(
|
||||
vr::EChaperoneConfigFile_Live );
|
||||
vr::VRChaperoneSetup()->HideWorkingSetPreview();
|
||||
m_chaperoneCommitted = true;
|
||||
unsigned checkQuadCount = 0;
|
||||
vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo(
|
||||
nullptr, &checkQuadCount );
|
||||
if ( checkQuadCount > 0 )
|
||||
{
|
||||
parent->chaperoneUtils().loadChaperoneData( false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE this function will create bad output if User Rotates 180 Degrees in
|
||||
// 1/7* frame-rate. (Worst Case 30 fps = ~770 deg/s)
|
||||
void MoveCenterTabController::updateHmdRotationCounter(
|
||||
@@ -2268,6 +2162,7 @@ void MoveCenterTabController::updateHandDrag(
|
||||
}
|
||||
|
||||
vr::TrackedDevicePose_t* movePose;
|
||||
movePose = devicePoses + moveHandId;
|
||||
if ( m_seatedModeDetected )
|
||||
{
|
||||
vr::TrackedDevicePose_t
|
||||
@@ -2279,10 +2174,6 @@ void MoveCenterTabController::updateHandDrag(
|
||||
vr::k_unMaxTrackedDeviceCount );
|
||||
movePose = seatedDevicePoses + moveHandId;
|
||||
}
|
||||
else
|
||||
{
|
||||
movePose = devicePoses + moveHandId;
|
||||
}
|
||||
|
||||
if ( !movePose->bPoseIsValid || !movePose->bDeviceIsConnected
|
||||
|| movePose->eTrackingResult != vr::TrackingResult_Running_OK )
|
||||
@@ -2596,16 +2487,19 @@ void MoveCenterTabController::updateGravity()
|
||||
void MoveCenterTabController::updateSpace( bool forceUpdate )
|
||||
{
|
||||
// Do nothing if all offsets and rotation are still the same...
|
||||
if ( m_offsetX == m_oldOffsetX && m_offsetY == m_oldOffsetY
|
||||
&& m_offsetZ == m_oldOffsetZ && m_rotation == m_oldRotation
|
||||
&& !forceUpdate )
|
||||
if ( ( abs( m_offsetX - m_oldOffsetX ) + abs( m_offsetY - m_oldOffsetY )
|
||||
+ abs( m_offsetZ - m_oldOffsetZ ) )
|
||||
== 0
|
||||
&& m_rotation == m_oldRotation && !forceUpdate )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// reload from disk if we're at zero offsets and allow external edits
|
||||
if ( allowExternalEdits() && m_oldOffsetX == 0.0f && m_oldOffsetY == 0.0f
|
||||
&& m_oldOffsetZ == 0.0f && m_oldRotation == 0 )
|
||||
if ( allowExternalEdits()
|
||||
&& ( abs( m_oldOffsetX ) + abs( m_oldOffsetY ) + abs( m_oldOffsetZ )
|
||||
+ abs( static_cast<float>( m_oldRotation ) ) )
|
||||
== 0 )
|
||||
{
|
||||
vr::VRChaperoneSetup()->ReloadFromDisk( vr::EChaperoneConfigFile_Live );
|
||||
vr::VRChaperoneSetup()->CommitWorkingCopy(
|
||||
@@ -2767,77 +2661,6 @@ void MoveCenterTabController::updateSpace( bool forceUpdate )
|
||||
&offsetSeatedCenter );
|
||||
}
|
||||
|
||||
// As of SVR 1.13.1 The Chaperone will follow Universe Center NOT raw
|
||||
// Center as such this should be off by defualt.
|
||||
// As of SVR 1.26.3 The chaperone seems to Have reverted back to pre 1.13.1
|
||||
// behavior
|
||||
// as of SVR 1.26.3 instead of 2x offset we have 1x offset and universe
|
||||
// centerS
|
||||
// as of SVR 1.26.4 1.26.3 changes are reverted as Such Adjust Chaperone
|
||||
// Should Not Be Needed We Will leave in Adjust Chaperone at this point but
|
||||
// make sure it defaults to off
|
||||
|
||||
if ( adjustChaperone() )
|
||||
{
|
||||
// outputLogPoses();
|
||||
// make a copy of our bounds and
|
||||
// reorient relative to new universe center
|
||||
|
||||
vr::HmdQuad_t* updatedBounds
|
||||
= new vr::HmdQuad_t[m_collisionBoundsCountForReset];
|
||||
|
||||
// for every quad in the chaperone bounds...
|
||||
for ( unsigned quad = 0; quad < m_collisionBoundsCountForReset; quad++ )
|
||||
{
|
||||
// at every corner in that quad...
|
||||
for ( unsigned corner = 0; corner < 4; corner++ )
|
||||
{
|
||||
// copy the corner's xyz coordinates
|
||||
updatedBounds[quad].vCorners[corner].v[0]
|
||||
= m_collisionBoundsForOffset[quad].vCorners[corner].v[0];
|
||||
|
||||
updatedBounds[quad].vCorners[corner].v[1]
|
||||
= m_collisionBoundsForOffset[quad].vCorners[corner].v[1];
|
||||
|
||||
updatedBounds[quad].vCorners[corner].v[2]
|
||||
= m_collisionBoundsForOffset[quad].vCorners[corner].v[2];
|
||||
|
||||
// cancel universe center's xyz offsets to each corner's
|
||||
// position and shift over by original center position so
|
||||
// that we are mirroring the offset as reflected about the
|
||||
// original origin
|
||||
updatedBounds[quad].vCorners[corner].v[0]
|
||||
-= offsetUniverseCenter.m[0][3]
|
||||
// - offsetUniverseCenter.m[0][3];
|
||||
- m_universeCenterForReset.m[0][3];
|
||||
// but don't touch y=0 values to keep floor corners
|
||||
// rooted down
|
||||
|
||||
if ( updatedBounds[quad].vCorners[corner].v[1] != 0 )
|
||||
{
|
||||
updatedBounds[quad].vCorners[corner].v[1]
|
||||
-= offsetUniverseCenter.m[1][3]
|
||||
//- offsetUniverseCenter.m[1][3];
|
||||
- m_universeCenterForReset.m[1][3];
|
||||
}
|
||||
updatedBounds[quad].vCorners[corner].v[2]
|
||||
-= offsetUniverseCenter.m[2][3]
|
||||
// - offsetUniverseCenter.m[2][3];
|
||||
- m_universeCenterForReset.m[2][3];
|
||||
|
||||
// rotate by universe center's yaw
|
||||
rotateFloatCoordinates(
|
||||
updatedBounds[quad].vCorners[corner].v,
|
||||
static_cast<float>( offsetUniverseCenterYaw ) );
|
||||
}
|
||||
}
|
||||
|
||||
// update chaperone working set preview (this does not commit)
|
||||
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(
|
||||
updatedBounds, m_collisionBoundsCountForReset );
|
||||
delete[] updatedBounds;
|
||||
}
|
||||
|
||||
// Center Marker for playspace.
|
||||
if ( parent->m_chaperoneTabController.m_centerMarkerOverlayNeedsUpdate )
|
||||
{
|
||||
@@ -2885,66 +2708,8 @@ void MoveCenterTabController::updateSpace( bool forceUpdate )
|
||||
vr::VRChaperoneSetup()->SetWorkingStandingZeroPoseToRawTrackingPose(
|
||||
&offsetUniverseCenter );
|
||||
|
||||
if ( oldStyleMotion() )
|
||||
{
|
||||
// check if universe center is outside of OpenVR commit bounds (1km)
|
||||
if ( abs( offsetUniverseCenterXyz[0] ) > k_maxOpenvrCommitOffset )
|
||||
{
|
||||
LOG( INFO ) << "COMMIT FAILED: Raw universe center out of commit "
|
||||
"bounds ( X: "
|
||||
<< offsetUniverseCenterXyz[0] << " )";
|
||||
vr::HmdMatrix34_t standingZero;
|
||||
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
|
||||
&standingZero );
|
||||
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose";
|
||||
outputLogHmdMatrix( standingZero );
|
||||
reset();
|
||||
parent->m_chaperoneTabController.applyAutosavedProfile();
|
||||
LOG( INFO ) << "-Resetting to autosaved chaperone profile-";
|
||||
return;
|
||||
}
|
||||
if ( abs( offsetUniverseCenterXyz[1] ) > k_maxOpenvrCommitOffset )
|
||||
{
|
||||
LOG( INFO ) << "COMMIT FAILED: Raw universe center out of commit "
|
||||
"bounds ( Y: "
|
||||
<< offsetUniverseCenterXyz[1] << " )";
|
||||
vr::HmdMatrix34_t standingZero;
|
||||
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
|
||||
&standingZero );
|
||||
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose";
|
||||
outputLogHmdMatrix( standingZero );
|
||||
reset();
|
||||
parent->m_chaperoneTabController.applyAutosavedProfile();
|
||||
LOG( INFO ) << "-Resetting to autosaved chaperone profile-";
|
||||
return;
|
||||
}
|
||||
if ( abs( offsetUniverseCenterXyz[2] ) > k_maxOpenvrCommitOffset )
|
||||
{
|
||||
LOG( INFO ) << "COMMIT FAILED: Raw universe center out of commit "
|
||||
"bounds ( Z: "
|
||||
<< offsetUniverseCenterXyz[2] << " )";
|
||||
vr::HmdMatrix34_t standingZero;
|
||||
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
|
||||
&standingZero );
|
||||
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose";
|
||||
outputLogHmdMatrix( standingZero );
|
||||
reset();
|
||||
parent->m_chaperoneTabController.applyAutosavedProfile();
|
||||
LOG( INFO ) << "-Resetting to autosaved chaperone profile-";
|
||||
return;
|
||||
}
|
||||
vr::VRChaperoneSetup()->CommitWorkingCopy(
|
||||
vr::EChaperoneConfigFile_Live );
|
||||
m_chaperoneCommitted = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
vr::VRChaperoneSetup()->ShowWorkingSetPreview();
|
||||
m_chaperoneCommitted = false;
|
||||
}
|
||||
vr::VRChaperoneSetup()->ShowWorkingSetPreview();
|
||||
|
||||
// loadChaperoneData( false ), false so that we don't load live data,
|
||||
// and reference the working set instead.
|
||||
if ( m_collisionBoundsCountForReset > 0 )
|
||||
{
|
||||
parent->chaperoneUtils().loadChaperoneData( false );
|
||||
@@ -3111,10 +2876,4 @@ void MoveCenterTabController::eventLoopTick(
|
||||
}
|
||||
}
|
||||
|
||||
void MoveCenterTabController::setIgnoreChaperoneState()
|
||||
{
|
||||
m_ignoreChaperoneState = true;
|
||||
LOG( INFO ) << "Ignoring Chaperone State for Zero Offsets";
|
||||
}
|
||||
|
||||
} // namespace advsettings
|
||||
|
||||
@@ -89,8 +89,6 @@ class MoveCenterTabController : public QObject
|
||||
NOTIFY smoothTurnRateChanged )
|
||||
Q_PROPERTY( int frictionPercent READ frictionPercent WRITE
|
||||
setFrictionPercent NOTIFY frictionPercentChanged )
|
||||
Q_PROPERTY( bool adjustChaperone READ adjustChaperone WRITE
|
||||
setAdjustChaperone NOTIFY adjustChaperoneChanged )
|
||||
Q_PROPERTY( bool moveShortcutRight READ moveShortcutRight WRITE
|
||||
setMoveShortcutRight NOTIFY moveShortcutRightChanged )
|
||||
Q_PROPERTY( bool moveShortcutLeft READ moveShortcutLeft WRITE
|
||||
@@ -130,13 +128,9 @@ class MoveCenterTabController : public QObject
|
||||
setShowLogMatricesButton NOTIFY showLogMatricesButtonChanged )
|
||||
Q_PROPERTY( bool allowExternalEdits READ allowExternalEdits WRITE
|
||||
setAllowExternalEdits NOTIFY allowExternalEditsChanged )
|
||||
Q_PROPERTY( bool oldStyleMotion READ oldStyleMotion WRITE setOldStyleMotion
|
||||
NOTIFY oldStyleMotionChanged )
|
||||
Q_PROPERTY(
|
||||
bool universeCenteredRotation READ universeCenteredRotation WRITE
|
||||
setUniverseCenteredRotation NOTIFY universeCenteredRotationChanged )
|
||||
Q_PROPERTY( bool simpleRecenter READ simpleRecenter WRITE setSimpleRecenter
|
||||
NOTIFY simpleRecenterChanged )
|
||||
Q_PROPERTY(
|
||||
float dragMult READ dragMult WRITE setDragMult NOTIFY dragMultChanged )
|
||||
|
||||
@@ -195,7 +189,6 @@ private:
|
||||
bool m_swapDragToRightHandActivated = false;
|
||||
bool m_gravityActive = false;
|
||||
bool m_gravityReversed = false;
|
||||
bool m_chaperoneCommitted = true;
|
||||
bool m_pendingZeroOffsets = true;
|
||||
bool m_pendingSeatedRecenter = false;
|
||||
bool m_selfRequestedSeatedRecenter = false;
|
||||
@@ -207,8 +200,6 @@ private:
|
||||
unsigned m_dragComfortFrameSkipCounter = 0;
|
||||
unsigned m_turnComfortFrameSkipCounter = 0;
|
||||
|
||||
bool m_chaperoneInit = true;
|
||||
|
||||
// Matrix used For Center Marker
|
||||
vr::HmdMatrix34_t m_offsetmatrix = utils::k_forwardUpMatrix;
|
||||
|
||||
@@ -236,7 +227,7 @@ private:
|
||||
void updateSpace( bool forceUpdate = false );
|
||||
void clampVelocity( double* velocity );
|
||||
void applyChaperoneResetData();
|
||||
void saveUncommittedChaperone();
|
||||
// void saveUncommittedChaperone();
|
||||
void outputLogHmdMatrix( vr::HmdMatrix34_t hmdMatrix );
|
||||
|
||||
std::vector<OffsetProfile> m_offsetProfiles;
|
||||
@@ -256,7 +247,6 @@ public:
|
||||
int snapTurnAngle() const;
|
||||
int smoothTurnRate() const;
|
||||
int frictionPercent() const;
|
||||
bool adjustChaperone() const;
|
||||
bool moveShortcutRight() const;
|
||||
bool moveShortcutLeft() const;
|
||||
bool turnBindRight() const;
|
||||
@@ -277,9 +267,7 @@ public:
|
||||
bool lockZToggle() const;
|
||||
bool showLogMatricesButton() const;
|
||||
bool allowExternalEdits() const;
|
||||
bool oldStyleMotion() const;
|
||||
bool universeCenteredRotation() const;
|
||||
bool simpleRecenter() const;
|
||||
bool isInitComplete() const;
|
||||
double getHmdYawTotal();
|
||||
void resetHmdYawTotal();
|
||||
@@ -293,7 +281,7 @@ public:
|
||||
void saveOffsetProfiles();
|
||||
Q_INVOKABLE unsigned getOffsetProfileCount();
|
||||
Q_INVOKABLE QString getOffsetProfileName( unsigned index );
|
||||
Q_INVOKABLE void setIgnoreChaperoneState();
|
||||
// Q_INVOKABLE void setIgnoreChaperoneState();
|
||||
|
||||
// actions:
|
||||
void leftHandSpaceDrag( bool leftHandDragActive );
|
||||
@@ -333,7 +321,6 @@ public slots:
|
||||
void setSmoothTurnRate( int value, bool notify = true );
|
||||
void setFrictionPercent( int value, bool notify = true );
|
||||
|
||||
void setAdjustChaperone( bool value, bool notify = true );
|
||||
void setMoveShortcutRight( bool value, bool notify = true );
|
||||
void setMoveShortcutLeft( bool value, bool notify = true );
|
||||
void setTurnBindRight( bool value, bool notify = true );
|
||||
@@ -359,9 +346,7 @@ public slots:
|
||||
void setLockZ( bool value, bool notify = true );
|
||||
void setShowLogMatricesButton( bool value, bool notify = true );
|
||||
void setAllowExternalEdits( bool value, bool notify = true );
|
||||
void setOldStyleMotion( bool value, bool notify = true );
|
||||
void setUniverseCenteredRotation( bool value, bool notify = true );
|
||||
void setSimpleRecenter( bool value, bool notify = true );
|
||||
|
||||
void shutdown();
|
||||
void reset();
|
||||
@@ -384,7 +369,6 @@ signals:
|
||||
void snapTurnAngleChanged( int value );
|
||||
void smoothTurnRateChanged( int value );
|
||||
void frictionPercentChanged( int value );
|
||||
void adjustChaperoneChanged( bool value );
|
||||
void moveShortcutRightChanged( bool value );
|
||||
void moveShortcutLeftChanged( bool value );
|
||||
void turnBindRightChanged( bool value );
|
||||
@@ -405,10 +389,7 @@ signals:
|
||||
void requireLockZChanged( bool value );
|
||||
void showLogMatricesButtonChanged( bool value );
|
||||
void allowExternalEditsChanged( bool value );
|
||||
void oldStyleMotionChanged( bool value );
|
||||
void universeCenteredRotationChanged( bool value );
|
||||
void simpleRecenterChanged( bool value );
|
||||
|
||||
void offsetProfilesUpdated();
|
||||
};
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <QQuickWindow>
|
||||
#include "../overlaycontroller.h"
|
||||
#include "../utils/update_rate.h"
|
||||
#include <QDesktopServices>
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
@@ -40,6 +41,8 @@ void SteamVRTabController::synchSteamVR()
|
||||
setCameraActive( cameraActive() );
|
||||
setCameraCont( cameraCont() );
|
||||
setCameraBounds( cameraBounds() );
|
||||
setControllerPower( controllerPower() );
|
||||
setNoHMD( noHMD() );
|
||||
}
|
||||
|
||||
bool SteamVRTabController::performanceGraph() const
|
||||
@@ -70,6 +73,33 @@ void SteamVRTabController::setPerformanceGraph( const bool value,
|
||||
}
|
||||
}
|
||||
|
||||
bool SteamVRTabController::noHMD() const
|
||||
{
|
||||
auto p = ovr_settings_wrapper::getBool(
|
||||
vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_RequireHmd_String );
|
||||
|
||||
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||
{
|
||||
return p.second;
|
||||
}
|
||||
return m_noHMD;
|
||||
}
|
||||
|
||||
void SteamVRTabController::setNoHMD( const bool value, const bool notify )
|
||||
{
|
||||
if ( m_noHMD != value )
|
||||
{
|
||||
m_noHMD = value;
|
||||
ovr_settings_wrapper::setBool( vr::k_pch_SteamVR_Section,
|
||||
vr::k_pch_SteamVR_RequireHmd_String,
|
||||
m_noHMD );
|
||||
if ( notify )
|
||||
{
|
||||
emit noHMDChanged( m_noHMD );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SteamVRTabController::multipleDriver() const
|
||||
{
|
||||
auto p = ovr_settings_wrapper::getBool(
|
||||
@@ -128,6 +158,35 @@ void SteamVRTabController::setNoFadeToGrid( const bool value,
|
||||
}
|
||||
}
|
||||
|
||||
bool SteamVRTabController::controllerPower() const
|
||||
{
|
||||
auto p = ovr_settings_wrapper::getBool(
|
||||
vr::k_pch_Power_Section,
|
||||
vr::k_pch_Power_AutoLaunchSteamVROnButtonPress );
|
||||
if ( p.first == ovr_settings_wrapper::SettingsError::NoError )
|
||||
{
|
||||
return p.second;
|
||||
}
|
||||
return m_controllerPower;
|
||||
}
|
||||
|
||||
void SteamVRTabController::setControllerPower( const bool value,
|
||||
const bool notify )
|
||||
{
|
||||
if ( m_controllerPower != value )
|
||||
{
|
||||
m_controllerPower = value;
|
||||
ovr_settings_wrapper::setBool(
|
||||
vr::k_pch_Power_Section,
|
||||
vr::k_pch_Power_AutoLaunchSteamVROnButtonPress,
|
||||
m_controllerPower );
|
||||
if ( notify )
|
||||
{
|
||||
emit controllerPowerChanged( m_controllerPower );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SteamVRTabController::systemButton() const
|
||||
{
|
||||
auto p = ovr_settings_wrapper::getBool(
|
||||
@@ -448,6 +507,12 @@ void SteamVRTabController::launchBindingUI()
|
||||
LOG( ERROR )
|
||||
<< "failed to get input handle? is your right controller on?";
|
||||
}
|
||||
if ( parent->isDesktopMode() )
|
||||
{
|
||||
QDesktopServices::openUrl(
|
||||
QUrl( "http://127.0.0.1:27062/dashboard/controllerbinding.html" ) );
|
||||
return;
|
||||
}
|
||||
auto error = vr::VRInput()->OpenBindingUI(
|
||||
application_strings::applicationKey, actionHandle, inputHandle, false );
|
||||
if ( error != vr::VRInputError_None )
|
||||
|
||||
@@ -65,6 +65,9 @@ class SteamVRTabController : public QObject
|
||||
cameraContChanged )
|
||||
Q_PROPERTY( bool perAppBindEnabled READ perAppBindEnabled WRITE
|
||||
setPerAppBindEnabled NOTIFY perAppBindEnabledChanged )
|
||||
Q_PROPERTY( bool controllerPower READ controllerPower WRITE
|
||||
setControllerPower NOTIFY controllerPowerChanged )
|
||||
Q_PROPERTY( bool noHMD READ noHMD WRITE setNoHMD NOTIFY noHMDChanged )
|
||||
|
||||
private:
|
||||
OverlayController* parent;
|
||||
@@ -74,6 +77,8 @@ private:
|
||||
bool m_noFadeToGridToggle = false;
|
||||
bool m_multipleDriverToggle = false;
|
||||
bool m_dnd = false;
|
||||
bool m_controllerPower = false;
|
||||
bool m_noHMD = false;
|
||||
QNetworkAccessManager m_networkManagerApply;
|
||||
QNetworkAccessManager m_networkManagerUrl;
|
||||
QNetworkAccessManager m_networkManagerBind;
|
||||
@@ -112,6 +117,8 @@ public:
|
||||
bool multipleDriver() const;
|
||||
bool systemButton() const;
|
||||
bool dnd() const;
|
||||
bool controllerPower() const;
|
||||
bool noHMD() const;
|
||||
|
||||
bool cameraActive() const;
|
||||
bool cameraBounds() const;
|
||||
@@ -163,6 +170,8 @@ public slots:
|
||||
void setNoFadeToGrid( bool value, bool notify = true );
|
||||
void setMultipleDriver( bool value, bool notify = true );
|
||||
void setDND( bool value, bool notify = true );
|
||||
void setControllerPower( bool value, bool notify = true );
|
||||
void setNoHMD( bool value, bool notify = true );
|
||||
|
||||
void setCameraActive( bool value, bool notify = true );
|
||||
void setCameraBounds( bool value, bool notify = true );
|
||||
@@ -182,6 +191,8 @@ signals:
|
||||
void systemButtonChanged( bool value );
|
||||
void noFadeToGridChanged( bool value );
|
||||
void dNDChanged( bool value );
|
||||
void controllerPowerChanged( bool value );
|
||||
void noHMDChanged( bool value );
|
||||
|
||||
void cameraActiveChanged( bool value );
|
||||
void cameraBoundsChanged( bool value );
|
||||
|
||||
@@ -204,6 +204,26 @@ void UtilitiesTabController::setVrcDebug( bool value, bool notify )
|
||||
}
|
||||
}
|
||||
|
||||
bool UtilitiesTabController::trackerOvlEnabled() const
|
||||
{
|
||||
return settings::getSetting(
|
||||
settings::BoolSetting::UTILITY_trackerOverlayEnabled );
|
||||
}
|
||||
|
||||
void UtilitiesTabController::setTrackerOvlEnabled( bool value, bool notify )
|
||||
{
|
||||
settings::setSetting( settings::BoolSetting::UTILITY_trackerOverlayEnabled,
|
||||
value );
|
||||
if ( notify )
|
||||
{
|
||||
emit trackerOvlEnabledChanged( value );
|
||||
}
|
||||
if ( !value )
|
||||
{
|
||||
destroyBatteryOverlays();
|
||||
}
|
||||
}
|
||||
|
||||
QString getBatteryIconPath( int batteryState )
|
||||
{
|
||||
constexpr auto batteryPrefix = "/res/img/battery/battery_";
|
||||
@@ -224,8 +244,9 @@ QString getBatteryIconPath( int batteryState )
|
||||
return QString::fromStdString( *batteryPath );
|
||||
}
|
||||
|
||||
vr::VROverlayHandle_t createBatteryOverlay( vr::TrackedDeviceIndex_t index,
|
||||
unsigned style = 0 )
|
||||
vr::VROverlayHandle_t UtilitiesTabController::createBatteryOverlay(
|
||||
vr::TrackedDeviceIndex_t index,
|
||||
unsigned style )
|
||||
{
|
||||
vr::VROverlayHandle_t handle = vr::k_ulOverlayHandleInvalid;
|
||||
std::string batteryKey = std::string( application_strings::applicationKey )
|
||||
@@ -273,14 +294,26 @@ vr::VROverlayHandle_t createBatteryOverlay( vr::TrackedDeviceIndex_t index,
|
||||
return handle;
|
||||
}
|
||||
|
||||
void UtilitiesTabController::eventLoopTick()
|
||||
void UtilitiesTabController::destroyBatteryOverlays()
|
||||
{
|
||||
if ( updateRate.shouldSubjectNotRun(
|
||||
UpdateSubject::UtilitiesTabController ) )
|
||||
for ( auto& el : m_batteryOverlayHandles )
|
||||
{
|
||||
return;
|
||||
if ( el == 0 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
auto err = vr::VROverlay()->DestroyOverlay( el );
|
||||
el = 0;
|
||||
if ( err != vr::VROverlayError_None )
|
||||
{
|
||||
LOG( ERROR ) << "Could not Delete Battery Overlay: "
|
||||
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( err );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UtilitiesTabController::handleTrackerBatOvl()
|
||||
{
|
||||
// attach battery overlay to all tracked devices that aren't a
|
||||
// controller or hmd
|
||||
for ( vr::TrackedDeviceIndex_t i = 0; i < vr::k_unMaxTrackedDeviceCount;
|
||||
@@ -364,4 +397,17 @@ void UtilitiesTabController::eventLoopTick()
|
||||
}
|
||||
}
|
||||
|
||||
void UtilitiesTabController::eventLoopTick()
|
||||
{
|
||||
if ( updateRate.shouldSubjectNotRun(
|
||||
UpdateSubject::UtilitiesTabController ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ( trackerOvlEnabled() )
|
||||
{
|
||||
handleTrackerBatOvl();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace advsettings
|
||||
|
||||
@@ -21,6 +21,8 @@ class UtilitiesTabController : public QObject
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(
|
||||
bool vrcDebug READ vrcDebug WRITE setVrcDebug NOTIFY vrcDebugChanged )
|
||||
Q_PROPERTY( bool trackerOvlEnabled READ trackerOvlEnabled WRITE
|
||||
setTrackerOvlEnabled NOTIFY trackerOvlEnabledChanged )
|
||||
|
||||
private:
|
||||
OverlayController* m_parent;
|
||||
@@ -31,6 +33,10 @@ private:
|
||||
= { 0 };
|
||||
int m_batteryState[vr::k_unMaxTrackedDeviceCount];
|
||||
bool m_batteryVisible[vr::k_unMaxTrackedDeviceCount];
|
||||
void handleTrackerBatOvl();
|
||||
vr::VROverlayHandle_t createBatteryOverlay( vr::TrackedDeviceIndex_t index,
|
||||
unsigned style = 0 );
|
||||
void destroyBatteryOverlays();
|
||||
|
||||
public:
|
||||
void initStage2( OverlayController* var_parent );
|
||||
@@ -38,6 +44,7 @@ public:
|
||||
void eventLoopTick();
|
||||
|
||||
bool vrcDebug() const;
|
||||
bool trackerOvlEnabled() const;
|
||||
|
||||
public slots:
|
||||
void sendKeyboardInput( QString input );
|
||||
@@ -76,9 +83,11 @@ public slots:
|
||||
Q_INVOKABLE void sendKeyboardThree();
|
||||
|
||||
void setVrcDebug( bool value, bool notify = true );
|
||||
void setTrackerOvlEnabled( bool value, bool notify = true );
|
||||
|
||||
signals:
|
||||
void vrcDebugChanged( bool value );
|
||||
void trackerOvlEnabledChanged( bool value );
|
||||
};
|
||||
|
||||
} // namespace advsettings
|
||||
|
||||
Reference in New Issue
Block a user