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
This commit is contained in:
@@ -207,8 +207,7 @@ void FixFloorTabController::dashboardLoopTick(
|
||||
offset[0] = floorOffsetX;
|
||||
offset[2] = floorOffsetZ;
|
||||
}
|
||||
parent->AddOffsetToUniverseCenter(
|
||||
vr::TrackingUniverseStanding, offset, true );
|
||||
parent->m_moveCenterTabController.addOffset( offset );
|
||||
statusMessage
|
||||
= ( state == 2 ) ? "Recentering ... Ok" : "Fixing ... OK";
|
||||
statusMessageTimeout = 1.0;
|
||||
@@ -302,24 +301,13 @@ void FixFloorTabController::fixFloorClicked()
|
||||
|
||||
void FixFloorTabController::recenterClicked()
|
||||
{
|
||||
parent->m_moveCenterTabController.reset();
|
||||
statusMessage = "Fixing ...";
|
||||
statusMessageTimeout = 1.0;
|
||||
emit statusMessageSignal();
|
||||
emit measureStartSignal();
|
||||
measurementCount = 0;
|
||||
state = 2;
|
||||
parent->m_moveCenterTabController.sendSeatedRecenter();
|
||||
}
|
||||
|
||||
void FixFloorTabController::undoFixFloorClicked()
|
||||
{
|
||||
parent->m_moveCenterTabController.reset();
|
||||
parent->AddOffsetToUniverseCenter(
|
||||
vr::TrackingUniverseStanding, 0, -floorOffsetX, false );
|
||||
parent->AddOffsetToUniverseCenter(
|
||||
vr::TrackingUniverseStanding, 1, -floorOffsetY, false );
|
||||
parent->AddOffsetToUniverseCenter(
|
||||
vr::TrackingUniverseStanding, 2, -floorOffsetZ, false );
|
||||
float off[3] = { -floorOffsetX, -floorOffsetY, -floorOffsetZ };
|
||||
parent->m_moveCenterTabController.addOffset( off );
|
||||
LOG( INFO ) << "Fix Floor: Undo Floor Offset = [" << -floorOffsetX << ", "
|
||||
<< -floorOffsetY << ", " << -floorOffsetZ << "]";
|
||||
floorOffsetY = 0.0f;
|
||||
|
||||
@@ -123,6 +123,27 @@ void MoveCenterTabController::applyOffsetProfile( unsigned index )
|
||||
}
|
||||
}
|
||||
|
||||
void MoveCenterTabController::addOffset( float offset[] )
|
||||
{
|
||||
m_universeCenterForReset.m[0][3] += offset[0];
|
||||
m_universeCenterForReset.m[1][3] += offset[1];
|
||||
m_universeCenterForReset.m[2][3] += offset[2];
|
||||
|
||||
m_seatedCenterForReset.m[0][3] += offset[0];
|
||||
m_seatedCenterForReset.m[1][3] += offset[1];
|
||||
m_seatedCenterForReset.m[2][3] += offset[2];
|
||||
|
||||
updateSpace( true );
|
||||
}
|
||||
|
||||
void MoveCenterTabController::addCurOffsetAsCenter()
|
||||
{
|
||||
float off[3] = { -m_offsetX, m_offsetY, -m_offsetZ };
|
||||
// zeroOffsets();
|
||||
resetOffsets( true );
|
||||
addOffset( off );
|
||||
}
|
||||
|
||||
void MoveCenterTabController::deleteOffsetProfile( unsigned index )
|
||||
{
|
||||
if ( index < m_offsetProfiles.size() )
|
||||
@@ -1097,18 +1118,25 @@ void MoveCenterTabController::zeroOffsets()
|
||||
setTrackingUniverse( vr::VRCompositor()->GetTrackingSpace() );
|
||||
if ( parent->isPreviousShutdownSafe() )
|
||||
{
|
||||
// all init complete, safe to autosave chaperone profile
|
||||
parent->m_chaperoneTabController.createNewAutosaveProfile();
|
||||
m_initComplete = true;
|
||||
auto calState = vr::VRChaperone()->GetCalibrationState();
|
||||
LOG( INFO ) << "Calibration State after autosave profile is: "
|
||||
<< calState;
|
||||
if ( calState == 200 )
|
||||
{
|
||||
LOG( WARNING )
|
||||
<< "Chaperone State Does Not Exist Yet, will wait for "
|
||||
"universe change to finish initialization";
|
||||
}
|
||||
else
|
||||
{
|
||||
// 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;
|
||||
m_initComplete = false;
|
||||
if ( !parent->crashRecoveryDisabled() )
|
||||
{
|
||||
parent->m_chaperoneTabController.applyAutosavedProfile();
|
||||
@@ -1165,8 +1193,18 @@ void MoveCenterTabController::clampVelocity( double* velocity )
|
||||
|
||||
void MoveCenterTabController::updateChaperoneResetData()
|
||||
{
|
||||
// TODO
|
||||
// vr::VRChaperoneSetup()->RevertWorkingCopy();
|
||||
auto cstate = vr::VRChaperone()->GetCalibrationState();
|
||||
if ( cstate > 199 )
|
||||
{
|
||||
LOG( WARNING ) << "Chaperone Calibration State is error: " << cstate
|
||||
<< " While Trying to Update Reset Data";
|
||||
}
|
||||
else
|
||||
{
|
||||
vr::VRChaperoneSetup()->CommitWorkingCopy(
|
||||
vr::EChaperoneConfigFile_Live );
|
||||
vr::VRChaperoneSetup()->RevertWorkingCopy();
|
||||
}
|
||||
unsigned currentQuadCount = 0;
|
||||
vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo( nullptr,
|
||||
¤tQuadCount );
|
||||
@@ -1857,16 +1895,6 @@ void MoveCenterTabController::resetOffsets( bool resetOffsetsJustPressed )
|
||||
// of keyboard input.
|
||||
if ( resetOffsetsJustPressed )
|
||||
{
|
||||
auto calState = vr::VRChaperone()->GetCalibrationState();
|
||||
LOG( INFO ) << "Calibration State on Reset Offsets is: " << calState;
|
||||
|
||||
if ( calState > 199 && m_initComplete )
|
||||
{
|
||||
LOG( INFO ) << "Chaperone calibration state is error, attempting "
|
||||
"to apply autosaved profile to fix issue";
|
||||
parent->m_chaperoneTabController.applyAutosavedProfile();
|
||||
}
|
||||
|
||||
m_offsetX = 0.0f;
|
||||
m_offsetY = 0.0f;
|
||||
m_offsetZ = 0.0f;
|
||||
@@ -1876,6 +1904,16 @@ void MoveCenterTabController::resetOffsets( bool resetOffsetsJustPressed )
|
||||
emit offsetZChanged( m_offsetZ );
|
||||
emit rotationChanged( m_rotation );
|
||||
updateSpace( true );
|
||||
auto calState = vr::VRChaperone()->GetCalibrationState();
|
||||
LOG( INFO ) << "Calibration State on Reset Offsets is: " << calState;
|
||||
|
||||
// if ( calState > 199 && m_initComplete )
|
||||
// {
|
||||
// LOG( INFO ) << "Chaperone calibration state is error,
|
||||
// attempting "
|
||||
// "to apply autosaved profile to fix issue";
|
||||
// parent->m_chaperoneTabController.applyAutosavedProfile();
|
||||
// }
|
||||
// reset();
|
||||
}
|
||||
}
|
||||
@@ -2478,6 +2516,18 @@ void MoveCenterTabController::updateSpace( bool forceUpdate )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ( ( abs( m_offsetX ) + abs( m_offsetY ) + abs( m_offsetZ )
|
||||
+ abs( static_cast<float>( m_rotation ) ) )
|
||||
== 0
|
||||
&& !forceUpdate )
|
||||
{
|
||||
if ( m_chaperoneHasCommit )
|
||||
{
|
||||
m_chaperoneHasCommit = true;
|
||||
updateChaperoneResetData();
|
||||
}
|
||||
}
|
||||
m_chaperoneHasCommit = false;
|
||||
|
||||
vr::HmdMatrix34_t offsetUniverseCenter;
|
||||
|
||||
|
||||
@@ -196,6 +196,7 @@ private:
|
||||
unsigned m_dragComfortFrameSkipCounter = 0;
|
||||
unsigned m_turnComfortFrameSkipCounter = 0;
|
||||
int m_recenterStages = 0;
|
||||
int m_chaperoneHasCommit = false;
|
||||
|
||||
// Matrix used For Center Marker
|
||||
vr::HmdMatrix34_t m_offsetmatrix = utils::k_forwardUpMatrix;
|
||||
@@ -279,6 +280,8 @@ public:
|
||||
Q_INVOKABLE unsigned getOffsetProfileCount();
|
||||
Q_INVOKABLE QString getOffsetProfileName( unsigned index );
|
||||
|
||||
void addOffset( float offset[3] );
|
||||
|
||||
// actions:
|
||||
void leftHandSpaceDrag( bool leftHandDragActive );
|
||||
void rightHandSpaceDrag( bool rightHandDragActive );
|
||||
@@ -353,6 +356,7 @@ public slots:
|
||||
void addOffsetProfile( QString name );
|
||||
void applyOffsetProfile( unsigned index );
|
||||
void deleteOffsetProfile( unsigned index );
|
||||
void addCurOffsetAsCenter();
|
||||
|
||||
signals:
|
||||
void trackingUniverseChanged( int value );
|
||||
|
||||
Reference in New Issue
Block a user