Skip to content

Commit 72e91e9

Browse files
authored
5.8.11 (#668)
* change fix floor re-center to just be standard recenter * add some error handling around calibration state, force chaperone to live state on 0 offset * fix commit * Changed fix floor functions to operate off of move center controller * add cur offset to center rebased to move center tab controller * update version number * fix initialization issue for universe center * add check to re-initialize if calibration state is not yet set i.e. lighthouse sleep * increment version number, slight change for specifically 200 error * remove commented code * fix conversion error warning
1 parent 3c856a5 commit 72e91e9

File tree

8 files changed

+84
-130
lines changed

8 files changed

+84
-130
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.8.9-release
1+
5.8.11-release

src/overlaycontroller.cpp

Lines changed: 5 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -861,23 +861,6 @@ void OverlayController::setExclusiveInputEnabled( bool value, bool notify )
861861
emit exclusiveInputEnabledChanged( value );
862862
}
863863
}
864-
865-
/*void OverlayController::setOpenXRFixEnabled( bool value, bool notify )
866-
{
867-
settings::setSetting( settings::BoolSetting::APPLICATION_openXRWorkAround,
868-
value );
869-
if ( notify )
870-
{
871-
emit openXRFixEnabledChanged( value );
872-
}
873-
}
874-
875-
bool OverlayController::openXRFixEnabled() const
876-
{
877-
return settings::getSetting(
878-
settings::BoolSetting::APPLICATION_openXRWorkAround );
879-
}*/
880-
881864
void OverlayController::setAutoApplyChaperoneEnabled( bool value, bool notify )
882865
{
883866
settings::setSetting( settings::BoolSetting::APPLICATION_autoApplyChaperone,
@@ -1268,6 +1251,11 @@ void OverlayController::mainEventLoop()
12681251
m_chaperoneUtils.loadChaperoneData();
12691252
chaperoneDataAlreadyUpdated = true;
12701253
}
1254+
if ( previousUniverseId == 0
1255+
&& !m_moveCenterTabController.isInitComplete() )
1256+
{
1257+
m_moveCenterTabController.zeroOffsets();
1258+
}
12711259
}
12721260
break;
12731261
case vr::VREvent_Input_ActionManifestReloaded:
@@ -1359,73 +1347,6 @@ void OverlayController::mainEventLoop()
13591347
}
13601348
}
13611349

1362-
void OverlayController::AddOffsetToUniverseCenter(
1363-
vr::ETrackingUniverseOrigin universe,
1364-
unsigned axisId,
1365-
float offset,
1366-
bool adjustBounds,
1367-
bool commit )
1368-
{
1369-
float offsetArray[3] = { 0, 0, 0 };
1370-
offsetArray[axisId] = offset;
1371-
AddOffsetToUniverseCenter( universe, offsetArray, adjustBounds, commit );
1372-
}
1373-
1374-
void OverlayController::AddOffsetToUniverseCenter(
1375-
vr::ETrackingUniverseOrigin universe,
1376-
float offset[3],
1377-
bool adjustBounds,
1378-
bool commit )
1379-
{
1380-
if ( offset[0] != 0.0f || offset[1] != 0.0f || offset[2] != 0.0f )
1381-
{
1382-
if ( commit )
1383-
{
1384-
vr::VRChaperoneSetup()->HideWorkingSetPreview();
1385-
vr::VRChaperoneSetup()->RevertWorkingCopy();
1386-
}
1387-
vr::HmdMatrix34_t curPos;
1388-
if ( universe == vr::TrackingUniverseStanding )
1389-
{
1390-
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
1391-
&curPos );
1392-
}
1393-
else
1394-
{
1395-
vr::VRChaperoneSetup()->GetWorkingSeatedZeroPoseToRawTrackingPose(
1396-
&curPos );
1397-
}
1398-
for ( int i = 0; i < 3; i++ )
1399-
{
1400-
curPos.m[0][3] += curPos.m[0][i] * offset[i];
1401-
curPos.m[1][3] += curPos.m[1][i] * offset[i];
1402-
curPos.m[2][3] += curPos.m[2][i] * offset[i];
1403-
}
1404-
if ( universe == vr::TrackingUniverseStanding )
1405-
{
1406-
vr::VRChaperoneSetup()->SetWorkingStandingZeroPoseToRawTrackingPose(
1407-
&curPos );
1408-
}
1409-
else
1410-
{
1411-
vr::VRChaperoneSetup()->SetWorkingSeatedZeroPoseToRawTrackingPose(
1412-
&curPos );
1413-
}
1414-
if ( adjustBounds && universe == vr::TrackingUniverseStanding )
1415-
{
1416-
float collisionOffset[] = { -offset[0], -offset[1], -offset[2] };
1417-
AddOffsetToCollisionBounds( collisionOffset, false );
1418-
}
1419-
if ( commit )
1420-
{
1421-
vr::VRChaperoneSetup()->CommitWorkingCopy(
1422-
vr::EChaperoneConfigFile_Live );
1423-
vr::VRChaperoneSetup()->ReloadFromDisk(
1424-
vr::EChaperoneConfigFile_Temp );
1425-
}
1426-
}
1427-
}
1428-
14291350
void OverlayController::RotateUniverseCenter(
14301351
vr::ETrackingUniverseOrigin universe,
14311352
float yAngle,

src/overlaycontroller.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,6 @@ class OverlayController : public QObject
200200
const std::string& name,
201201
const std::string& key = "" );
202202

203-
void AddOffsetToUniverseCenter( vr::ETrackingUniverseOrigin universe,
204-
unsigned axisId,
205-
float offset,
206-
bool adjustBounds = true,
207-
bool commit = true );
208-
void AddOffsetToUniverseCenter( vr::ETrackingUniverseOrigin universe,
209-
float offset[3],
210-
bool adjustBounds = true,
211-
bool commit = true );
212203
void RotateUniverseCenter( vr::ETrackingUniverseOrigin universe,
213204
float yAngle,
214205
bool adjustBounds = true,

src/res/qml/FixFloorPage.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ MyStackViewPage {
9393
text: "Apply Space Settings Offsets as Center"
9494
Layout.preferredHeight: 80
9595
onClicked: {
96-
MoveCenterTabController.zeroOffsets()
96+
MoveCenterTabController.addCurOffsetAsCenter()
9797
}
9898
}
9999

src/tabcontrollers/FixFloorTabController.cpp

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,7 @@ void FixFloorTabController::dashboardLoopTick(
207207
offset[0] = floorOffsetX;
208208
offset[2] = floorOffsetZ;
209209
}
210-
parent->AddOffsetToUniverseCenter(
211-
vr::TrackingUniverseStanding, offset, true );
210+
parent->m_moveCenterTabController.addOffset( offset );
212211
statusMessage
213212
= ( state == 2 ) ? "Recentering ... Ok" : "Fixing ... OK";
214213
statusMessageTimeout = 1.0;
@@ -302,24 +301,13 @@ void FixFloorTabController::fixFloorClicked()
302301

303302
void FixFloorTabController::recenterClicked()
304303
{
305-
parent->m_moveCenterTabController.reset();
306-
statusMessage = "Fixing ...";
307-
statusMessageTimeout = 1.0;
308-
emit statusMessageSignal();
309-
emit measureStartSignal();
310-
measurementCount = 0;
311-
state = 2;
304+
parent->m_moveCenterTabController.sendSeatedRecenter();
312305
}
313306

314307
void FixFloorTabController::undoFixFloorClicked()
315308
{
316-
parent->m_moveCenterTabController.reset();
317-
parent->AddOffsetToUniverseCenter(
318-
vr::TrackingUniverseStanding, 0, -floorOffsetX, false );
319-
parent->AddOffsetToUniverseCenter(
320-
vr::TrackingUniverseStanding, 1, -floorOffsetY, false );
321-
parent->AddOffsetToUniverseCenter(
322-
vr::TrackingUniverseStanding, 2, -floorOffsetZ, false );
309+
float off[3] = { -floorOffsetX, -floorOffsetY, -floorOffsetZ };
310+
parent->m_moveCenterTabController.addOffset( off );
323311
LOG( INFO ) << "Fix Floor: Undo Floor Offset = [" << -floorOffsetX << ", "
324312
<< -floorOffsetY << ", " << -floorOffsetZ << "]";
325313
floorOffsetY = 0.0f;

src/tabcontrollers/MoveCenterTabController.cpp

Lines changed: 68 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,27 @@ void MoveCenterTabController::applyOffsetProfile( unsigned index )
123123
}
124124
}
125125

126+
void MoveCenterTabController::addOffset( float offset[] )
127+
{
128+
m_universeCenterForReset.m[0][3] += offset[0];
129+
m_universeCenterForReset.m[1][3] += offset[1];
130+
m_universeCenterForReset.m[2][3] += offset[2];
131+
132+
m_seatedCenterForReset.m[0][3] += offset[0];
133+
m_seatedCenterForReset.m[1][3] += offset[1];
134+
m_seatedCenterForReset.m[2][3] += offset[2];
135+
136+
updateSpace( true );
137+
}
138+
139+
void MoveCenterTabController::addCurOffsetAsCenter()
140+
{
141+
float off[3] = { -m_offsetX, m_offsetY, -m_offsetZ };
142+
// zeroOffsets();
143+
resetOffsets( true );
144+
addOffset( off );
145+
}
146+
126147
void MoveCenterTabController::deleteOffsetProfile( unsigned index )
127148
{
128149
if ( index < m_offsetProfiles.size() )
@@ -1097,18 +1118,25 @@ void MoveCenterTabController::zeroOffsets()
10971118
setTrackingUniverse( vr::VRCompositor()->GetTrackingSpace() );
10981119
if ( parent->isPreviousShutdownSafe() )
10991120
{
1100-
// all init complete, safe to autosave chaperone profile
1101-
parent->m_chaperoneTabController.createNewAutosaveProfile();
1102-
m_initComplete = true;
11031121
auto calState = vr::VRChaperone()->GetCalibrationState();
1104-
LOG( INFO ) << "Calibration State after autosave profile is: "
1105-
<< calState;
1122+
if ( calState == 200 )
1123+
{
1124+
LOG( WARNING )
1125+
<< "Chaperone State Does Not Exist Yet, will wait for "
1126+
"universe change to finish initialization";
1127+
}
1128+
else
1129+
{
1130+
// all init complete, safe to autosave chaperone profile
1131+
parent->m_chaperoneTabController.createNewAutosaveProfile();
1132+
m_initComplete = true;
1133+
}
11061134
}
11071135
else
11081136
{
11091137
// shutdown was unsafe last session!
11101138
LOG( WARNING ) << "DETECTED UNSAFE SHUTDOWN FROM LAST SESSION";
1111-
m_initComplete = true;
1139+
m_initComplete = false;
11121140
if ( !parent->crashRecoveryDisabled() )
11131141
{
11141142
parent->m_chaperoneTabController.applyAutosavedProfile();
@@ -1165,8 +1193,18 @@ void MoveCenterTabController::clampVelocity( double* velocity )
11651193

11661194
void MoveCenterTabController::updateChaperoneResetData()
11671195
{
1168-
// TODO
1169-
// vr::VRChaperoneSetup()->RevertWorkingCopy();
1196+
auto cstate = vr::VRChaperone()->GetCalibrationState();
1197+
if ( cstate > 199 )
1198+
{
1199+
LOG( WARNING ) << "Chaperone Calibration State is error: " << cstate
1200+
<< " While Trying to Update Reset Data";
1201+
}
1202+
else
1203+
{
1204+
vr::VRChaperoneSetup()->CommitWorkingCopy(
1205+
vr::EChaperoneConfigFile_Live );
1206+
vr::VRChaperoneSetup()->RevertWorkingCopy();
1207+
}
11701208
unsigned currentQuadCount = 0;
11711209
vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo( nullptr,
11721210
&currentQuadCount );
@@ -1857,16 +1895,6 @@ void MoveCenterTabController::resetOffsets( bool resetOffsetsJustPressed )
18571895
// of keyboard input.
18581896
if ( resetOffsetsJustPressed )
18591897
{
1860-
auto calState = vr::VRChaperone()->GetCalibrationState();
1861-
LOG( INFO ) << "Calibration State on Reset Offsets is: " << calState;
1862-
1863-
if ( calState > 199 && m_initComplete )
1864-
{
1865-
LOG( INFO ) << "Chaperone calibration state is error, attempting "
1866-
"to apply autosaved profile to fix issue";
1867-
parent->m_chaperoneTabController.applyAutosavedProfile();
1868-
}
1869-
18701898
m_offsetX = 0.0f;
18711899
m_offsetY = 0.0f;
18721900
m_offsetZ = 0.0f;
@@ -1876,6 +1904,16 @@ void MoveCenterTabController::resetOffsets( bool resetOffsetsJustPressed )
18761904
emit offsetZChanged( m_offsetZ );
18771905
emit rotationChanged( m_rotation );
18781906
updateSpace( true );
1907+
auto calState = vr::VRChaperone()->GetCalibrationState();
1908+
LOG( INFO ) << "Calibration State on Reset Offsets is: " << calState;
1909+
1910+
// if ( calState > 199 && m_initComplete )
1911+
// {
1912+
// LOG( INFO ) << "Chaperone calibration state is error,
1913+
// attempting "
1914+
// "to apply autosaved profile to fix issue";
1915+
// parent->m_chaperoneTabController.applyAutosavedProfile();
1916+
// }
18791917
// reset();
18801918
}
18811919
}
@@ -2478,6 +2516,18 @@ void MoveCenterTabController::updateSpace( bool forceUpdate )
24782516
{
24792517
return;
24802518
}
2519+
if ( ( abs( m_offsetX ) + abs( m_offsetY ) + abs( m_offsetZ )
2520+
+ abs( static_cast<float>( m_rotation ) ) )
2521+
== 0
2522+
&& !forceUpdate )
2523+
{
2524+
if ( m_chaperoneHasCommit )
2525+
{
2526+
m_chaperoneHasCommit = true;
2527+
updateChaperoneResetData();
2528+
}
2529+
}
2530+
m_chaperoneHasCommit = false;
24812531

24822532
vr::HmdMatrix34_t offsetUniverseCenter;
24832533

src/tabcontrollers/MoveCenterTabController.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class MoveCenterTabController : public QObject
196196
unsigned m_dragComfortFrameSkipCounter = 0;
197197
unsigned m_turnComfortFrameSkipCounter = 0;
198198
int m_recenterStages = 0;
199+
int m_chaperoneHasCommit = false;
199200

200201
// Matrix used For Center Marker
201202
vr::HmdMatrix34_t m_offsetmatrix = utils::k_forwardUpMatrix;
@@ -279,6 +280,8 @@ class MoveCenterTabController : public QObject
279280
Q_INVOKABLE unsigned getOffsetProfileCount();
280281
Q_INVOKABLE QString getOffsetProfileName( unsigned index );
281282

283+
void addOffset( float offset[3] );
284+
282285
// actions:
283286
void leftHandSpaceDrag( bool leftHandDragActive );
284287
void rightHandSpaceDrag( bool rightHandDragActive );
@@ -353,6 +356,7 @@ public slots:
353356
void addOffsetProfile( QString name );
354357
void applyOffsetProfile( unsigned index );
355358
void deleteOffsetProfile( unsigned index );
359+
void addCurOffsetAsCenter();
356360

357361
signals:
358362
void trackingUniverseChanged( int value );

ver/versioncheck.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "major": 5, "minor": 8, "patch": 9, "updateMessage": "", "optionalMessage": "" }
1+
{ "major": 5, "minor": 8, "patch": 11, "updateMessage": "", "optionalMessage": "" }

0 commit comments

Comments
 (0)