merge mainline changes into qt6

This commit is contained in:
ykeara
2026-09-25 15:06:43 -05:00
30 changed files with 2965 additions and 450 deletions
+182 -102
View File
@@ -271,10 +271,11 @@ void MoveCenterTabController::setTrackingUniverse( int value, bool notify )
if ( m_trackingUniverse != value )
{
vr::VRChaperoneSetup()->HideWorkingSetPreview();
if ( !m_roomSetupModeDetected && value == vr::TrackingUniverseStanding )
{
reset();
}
//TODO verify
// if ( !m_roomSetupModeDetected && value == vr::TrackingUniverseStanding )
// {
// reset();
// }
m_trackingUniverse = value;
if ( notify )
@@ -910,6 +911,7 @@ void MoveCenterTabController::incomingZeroReset()
// However It does appear to effect the recenter method (potentially other
// aspects) IN mixed tracking environments I get this issue, the check if
// there is an error and apply autosaved profile is hopefully a workaround
<<<<<<< HEAD
auto calState = vr::VRChaperone()->GetCalibrationState();
qInfo() << "Calibration State on Zero Reset is: " << calState;
@@ -946,14 +948,42 @@ void MoveCenterTabController::incomingZeroReset()
m_recenterStages = 0;
return;
}
=======
//auto calState = vr::VRChaperone()->GetCalibrationState();
//LOG( INFO ) << "Calibration State on Recenter is: " << calState;
//TODO 8/3/2026 SteamFrame May Need special handling, will discuss With Valve currently
//reset zero pose seems to move floor level as well as our changes, requiring 2 resets to set at correct level
//or we could potentially not apply our offset during this process
float offset[3] = { 0, 0, 0 };
offset[1] = -m_offsetY;
//TODO set universe center and seated recenter as 0 for this part
vr::VRChaperoneSetup()->RevertWorkingCopy();
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
&m_universeCenterForReset );
vr::VRChaperoneSetup()->GetWorkingSeatedZeroPoseToRawTrackingPose(
&m_seatedCenterForReset );
addOffset(offset);
resetOffsets(true);
//reset();
return;
>>>>>>> origin/master
}
//TODO 9/4/26 This needs to be looked at This moves the chaperone, and seems to do same thing as
//zerooffsets....
void MoveCenterTabController::reset()
{
// DO NOT attempt to apply autosaved profile on reset, as it is triggered by
// the apply chaperone profile Side effects are bad!
<<<<<<< HEAD
auto calState = vr::VRChaperone()->GetCalibrationState();
qInfo() << "Calibration State on Reset is: " << calState;
=======
//auto calState = vr::VRChaperone()->GetCalibrationState();
//LOG( INFO ) << "Calibration State on Reset is: " << calState;
>>>>>>> origin/master
if ( !m_chaperoneBasisAcquired )
{
@@ -1013,6 +1043,7 @@ void MoveCenterTabController::reset()
emit rotationChanged( m_rotation );
}
//TODO This needs to be renamed, it's mainly for initilization reasons
void MoveCenterTabController::zeroOffsets()
{
// first we'll check if we're outside the max commit distance
@@ -1106,13 +1137,17 @@ void MoveCenterTabController::zeroOffsets()
m_pendingZeroOffsets = false;
if ( !m_chaperoneBasisAcquired )
{
m_chaperoneBasisAcquired = true;
//TODO 8/3/2026, leaving this as is currently, Due to unreliable chaperone state information in current SteamVR versions
//this initilization can cause issues.
//m_initComplete = true;
//parent->m_chaperoneTabController.createNewAutosaveProfile();
if ( !m_initComplete )
{
setTrackingUniverse( vr::VRCompositor()->GetTrackingSpace() );
if ( parent->isPreviousShutdownSafe() )
{
//if ( parent->isPreviousShutdownSafe() )
//{
auto calState = vr::VRChaperone()->GetCalibrationState();
<<<<<<< HEAD
if ( calState == 200 )
{
qWarning()
@@ -1120,11 +1155,17 @@ void MoveCenterTabController::zeroOffsets()
"universe change to finish initialization";
}
else
=======
if ( calState != 200 )
>>>>>>> origin/master
{
// all init complete, safe to autosave chaperone profile
parent->m_chaperoneTabController.createNewAutosaveProfile();
m_initComplete = true;
m_chaperoneBasisAcquired = true;
LOG( INFO ) << "Chaperone Initilization Complete, Space Drag Now Enabled";
}
<<<<<<< HEAD
}
else
{
@@ -1143,6 +1184,26 @@ void MoveCenterTabController::zeroOffsets()
// marked as being safe once more just before our app shuts
// down properly.
parent->setPreviousShutdownSafe( false );
=======
//}
// else
// {
// // shutdown was unsafe last session!
// LOG( WARNING ) << "DETECTED UNSAFE SHUTDOWN FROM LAST SESSION";
// m_initComplete = false;
// 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 );
>>>>>>> origin/master
}
m_pendingZeroOffsets = true;
}
@@ -1152,7 +1213,11 @@ void MoveCenterTabController::zeroOffsets()
m_roomSetupModeDetected = false;
}
<<<<<<< HEAD
qInfo() << "SUCCESS: Chaperone Data Updated and Offsets zeroed out";
=======
//LOG( INFO ) << "SUCCESS: Chaperone Data Updated and Offsets zeroed out";
>>>>>>> origin/master
}
void MoveCenterTabController::sendSeatedRecenter()
@@ -1187,6 +1252,7 @@ void MoveCenterTabController::clampVelocity( double* velocity )
void MoveCenterTabController::updateChaperoneResetData()
{
<<<<<<< HEAD
auto cstate = vr::VRChaperone()->GetCalibrationState();
if ( cstate > 199 )
{
@@ -1195,10 +1261,21 @@ void MoveCenterTabController::updateChaperoneResetData()
}
else
{
=======
//auto cstate = vr::VRChaperone()->GetCalibrationState();
//TODO 8/3/26 calibration state is unreliable at best.
// if ( false)//cstate > 199 )
// {
// LOG( WARNING ) << "Chaperone Calibration State is error: " << cstate
// << " While Trying to Update Reset Data";
// }
// else
//{
>>>>>>> origin/master
vr::VRChaperoneSetup()->CommitWorkingCopy(
vr::EChaperoneConfigFile_Live );
vr::VRChaperoneSetup()->RevertWorkingCopy();
}
//}
unsigned currentQuadCount = 0;
vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo( nullptr,
&currentQuadCount );
@@ -1898,8 +1975,14 @@ void MoveCenterTabController::resetOffsets( bool resetOffsetsJustPressed )
emit offsetZChanged( m_offsetZ );
emit rotationChanged( m_rotation );
updateSpace( true );
<<<<<<< HEAD
auto calState = vr::VRChaperone()->GetCalibrationState();
qInfo() << "Calibration State on Reset Offsets is: " << calState;
=======
//auto calState = vr::VRChaperone()->GetCalibrationState();
//LOG( INFO ) << "Calibration State on Reset Offsets is: " << calState;
>>>>>>> origin/master
// if ( calState > 199 && m_initComplete )
// {
@@ -2628,7 +2711,7 @@ void MoveCenterTabController::updateSpace( bool forceUpdate )
}
// keep the seated origin synced with offsets if in seated mode
if ( m_trackingUniverse == vr::TrackingUniverseSeated )
if ( m_trackingUniverse == vr::TrackingUniverseSeated || m_trackingUniverse == vr::TrackingUniverseRawAndUncalibrated )
{
vr::HmdMatrix34_t offsetSeatedCenter;
@@ -2751,7 +2834,6 @@ void MoveCenterTabController::eventLoopTick(
vr::VRChaperoneSetup()->RevertWorkingCopy();
}
setTrackingUniverse( int( universe ) );
// TODO set to allow.
return;
}
@@ -2783,102 +2865,100 @@ void MoveCenterTabController::eventLoopTick(
zeroOffsets();
// m_roomSetupModeDetected is set to false in zeroOffsets() if it's
// successful.
return;
}
setTrackingUniverse( int( universe ) );
// get current space rotation in radians
double angle = m_rotation * k_centidegreesToRadians;
// hmd rotations stats counting doesn't need to be smooth, so we
// skip some frames for performance
if ( m_hmdRotationStatsUpdateCounter >= k_hmdRotationCounterUpdateRate )
{
// device pose index 0 is always the hmd
updateHmdRotationCounter( devicePoses[0], angle );
m_hmdRotationStatsUpdateCounter = 0;
}
else
{
setTrackingUniverse( int( universe ) );
// get current space rotation in radians
double angle = m_rotation * k_centidegreesToRadians;
// hmd rotations stats counting doesn't need to be smooth, so we
// skip some frames for performance
if ( m_hmdRotationStatsUpdateCounter >= k_hmdRotationCounterUpdateRate )
{
// device pose index 0 is always the hmd
updateHmdRotationCounter( devicePoses[0], angle );
m_hmdRotationStatsUpdateCounter = 0;
}
else
{
m_hmdRotationStatsUpdateCounter++;
}
// only update dynamic motion if the dash is closed
if ( !parent->isDashboardVisible() )
{
// detect new dash closed
if ( m_dashWasOpenPreviousFrame )
{
// reset velocity time points on dash closed so we don't
// factor in the time motion was paused during the open dash
m_lastDragUpdateTimePoint = std::chrono::steady_clock::now();
m_lastGravityUpdateTimePoint = std::chrono::steady_clock::now();
}
// force chaperone bounds visible if turn or drag settings
// require
if ( dragBounds()
&& m_activeDragHand != vr::TrackedControllerRole_Invalid )
{
vr::VRChaperone()->ForceBoundsVisible( true );
}
else if ( turnBounds()
&& m_activeTurnHand != vr::TrackedControllerRole_Invalid )
{
vr::VRChaperone()->ForceBoundsVisible( true );
}
// only set back to default every frame if setting is enabled
else if ( turnBounds() || dragBounds() )
{
vr::VRChaperone()->ForceBoundsVisible(
parent->m_chaperoneTabController.forceBounds() );
}
// Smooth turn motion can cause sim-sickness so we check if the
// user wants to skip frames to reduce vection. We use the
// factor squared because of logarithmic human perception.
if ( m_turnComfortFrameSkipCounter >= static_cast<unsigned>(
( turnComfortFactor() * turnComfortFactor() ) ) )
{
updateHandTurn( devicePoses, angle );
m_turnComfortFrameSkipCounter = 0;
}
else
{
m_turnComfortFrameSkipCounter++;
}
// Smooth drag motion can cause sim-sickness so we check if the
// user wants to skip frames to reduce vection. We use the
// factor squared because of logarithmic human perception.
if ( m_dragComfortFrameSkipCounter >= static_cast<unsigned>(
( dragComfortFactor() * dragComfortFactor() ) ) )
{
updateHandDrag( devicePoses, angle );
m_lastDragUpdateTimePoint = std::chrono::steady_clock::now();
m_dragComfortFrameSkipCounter = 0;
}
else
{
m_dragComfortFrameSkipCounter++;
}
if ( m_gravityActive
&& m_activeDragHand == vr::TrackedControllerRole_Invalid )
{
updateGravity();
m_lastGravityUpdateTimePoint = std::chrono::steady_clock::now();
}
m_dashWasOpenPreviousFrame = false;
}
else
{
// dash is open this frame
m_dashWasOpenPreviousFrame = true;
}
updateSpace();
m_hmdRotationStatsUpdateCounter++;
}
// only update dynamic motion if the dash is closed
if ( !parent->isDashboardVisible() )
{
// detect new dash closed
if ( m_dashWasOpenPreviousFrame )
{
// reset velocity time points on dash closed so we don't
// factor in the time motion was paused during the open dash
m_lastDragUpdateTimePoint = std::chrono::steady_clock::now();
m_lastGravityUpdateTimePoint = std::chrono::steady_clock::now();
}
// force chaperone bounds visible if turn or drag settings
// require
if ( dragBounds()
&& m_activeDragHand != vr::TrackedControllerRole_Invalid )
{
vr::VRChaperone()->ForceBoundsVisible( true );
}
else if ( turnBounds()
&& m_activeTurnHand != vr::TrackedControllerRole_Invalid )
{
vr::VRChaperone()->ForceBoundsVisible( true );
}
// only set back to default every frame if setting is enabled
else if ( turnBounds() || dragBounds() )
{
vr::VRChaperone()->ForceBoundsVisible(
parent->m_chaperoneTabController.forceBounds() );
}
// Smooth turn motion can cause sim-sickness so we check if the
// user wants to skip frames to reduce vection. We use the
// factor squared because of logarithmic human perception.
if ( m_turnComfortFrameSkipCounter >= static_cast<unsigned>(
( turnComfortFactor() * turnComfortFactor() ) ) )
{
updateHandTurn( devicePoses, angle );
m_turnComfortFrameSkipCounter = 0;
}
else
{
m_turnComfortFrameSkipCounter++;
}
// Smooth drag motion can cause sim-sickness so we check if the
// user wants to skip frames to reduce vection. We use the
// factor squared because of logarithmic human perception.
if ( m_dragComfortFrameSkipCounter >= static_cast<unsigned>(
( dragComfortFactor() * dragComfortFactor() ) ) )
{
updateHandDrag( devicePoses, angle );
m_lastDragUpdateTimePoint = std::chrono::steady_clock::now();
m_dragComfortFrameSkipCounter = 0;
}
else
{
m_dragComfortFrameSkipCounter++;
}
if ( m_gravityActive
&& m_activeDragHand == vr::TrackedControllerRole_Invalid )
{
updateGravity();
m_lastGravityUpdateTimePoint = std::chrono::steady_clock::now();
}
m_dashWasOpenPreviousFrame = false;
}
else
{
// dash is open this frame
m_dashWasOpenPreviousFrame = true;
}
updateSpace();
}
} // namespace advsettings