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
+101 -32
View File
@@ -511,6 +511,31 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
}
qWarning() << "Profile Not Found for Auto Apply Chaperone!";
}
auto indexList = ovr_system_wrapper::getAllConnectedDevices();
//Logging for troubleshooting
for (auto device : indexList)
{
auto info = ovr_system_wrapper::getInt32TrackedProperty(device, vr::Prop_ControllerRoleHint_Int32);
//auto error = info.first;
auto ctrlRole = info.second;
if ( vr::TrackedDeviceClass_HMD == ctrlRole )
{
LOG(INFO) << "HMD is: " << ovr_system_wrapper::getDeviceName(device);
continue;
}
if ( vr::TrackedControllerRole_LeftHand == ctrlRole )
{
LOG(INFO) << "Controller (L) is: " << ovr_system_wrapper::getDeviceName(device);
continue;
}
if ( vr::TrackedControllerRole_RightHand == ctrlRole )
{
LOG(INFO) << "Controller (R) is: " << ovr_system_wrapper::getDeviceName(device);
continue;
}
}
LOG(INFO)<< "Initilizaion is complete--------------------------------------------------";
}
void OverlayController::OnRenderRequest()
@@ -1115,7 +1140,7 @@ void OverlayController::mainEventLoop()
processInputBindings();
vr::VREvent_t vrEvent;
bool chaperoneDataAlreadyUpdated = false;
//bool chaperoneDataAlreadyUpdated = false;
while ( pollNextEvent( m_ulOverlayHandle, &vrEvent ) )
{
switch ( vrEvent.eventType )
@@ -1223,17 +1248,39 @@ void OverlayController::mainEventLoop()
qDebug() << "Dashboard deactivated";
m_dashboardVisible = false;
settings::saveChangedSettings();
if(0UL != m_lastTextUID){
submitLastTextField(m_lastTextUID);
m_lastTextUID = 0;
}
}
break;
case vr::VREvent_KeyboardDone:
case vr::VREvent_HideKeyboard:
{
char keyboardBuffer[1024];
vr::VROverlay()->GetKeyboardText( keyboardBuffer, 1024 );
if(0UL != m_lastTextUID){
submitLastTextField(m_lastTextUID);
m_lastTextUID = 0;
}
}
break;
case vr::VREvent_KeyboardCharInput:
{
char keyboardBuffer[64];
vr::VROverlay()->GetKeyboardText( keyboardBuffer, 64 );
emit keyBoardInputSignal( QString( keyboardBuffer ),
static_cast<unsigned long>(
vrEvent.data.keyboard.uUserValue ) );
m_lastTextUID = static_cast<unsigned long>(vrEvent.data.keyboard.uUserValue);
}
// case vr::VREvent_KeyboardDone:
// {
// char keyboardBuffer[1024];
// vr::VROverlay()->GetKeyboardText( keyboardBuffer, 1024 );
// emit keyBoardInputSignal( QString( keyboardBuffer ),
// static_cast<unsigned long>(
// vrEvent.data.keyboard.uUserValue ) );
// }
break;
case vr::VREvent_SeatedZeroPoseReset:
@@ -1243,6 +1290,7 @@ void OverlayController::mainEventLoop()
}
break;
//TODO 8/6/2025, I don't this is necessary anymore, but marking until further testing
// Multiple ChaperoneUniverseHasChanged are often
// emitted at the same time (some with a little bit of
// delay) There is no sure way to recognize redundant
@@ -1250,29 +1298,33 @@ void OverlayController::mainEventLoop()
// the same call of OnTimeoutPumpEvents() INFO Removed
// logging on play space mover for possible crashing
// issues.
case vr::VREvent_ChaperoneUniverseHasChanged:
{
uint64_t previousUniverseId
= vrEvent.data.chaperone.m_nPreviousUniverse;
uint64_t currentUniverseId
= vrEvent.data.chaperone.m_nCurrentUniverse;
qInfo() << "(VREvent) ChaperoneUniverseHasChanged... Previous : "
<< previousUniverseId << " Current:" << currentUniverseId;
if ( !chaperoneDataAlreadyUpdated )
{
m_chaperoneUtils.loadChaperoneData();
chaperoneDataAlreadyUpdated = true;
}
if ( previousUniverseId == 0
&& !m_moveCenterTabController.isInitComplete() )
{
m_moveCenterTabController.zeroOffsets();
}
}
// case vr::VREvent_ChaperoneUniverseHasChanged:
// {
// uint64_t previousUniverseId
// = vrEvent.data.chaperone.m_nPreviousUniverse;
// uint64_t currentUniverseId
// = vrEvent.data.chaperone.m_nCurrentUniverse;
// LOG( INFO )
// << "(VREvent) ChaperoneUniverseHasChanged... Previous : "
// << previousUniverseId << " Current:" << currentUniverseId;
// if ( !chaperoneDataAlreadyUpdated )
// {
// m_chaperoneUtils.loadChaperoneData();
// chaperoneDataAlreadyUpdated = true;
// }
// //TODO 8/3/2026 With newer steamvr Updates, this is not same reliable behavior.
// //Valve thought they saw issue, but Moving away from a potentially un-reliable metric is preffered
// //Additionally, some of the related effects are marked as deprected via openvr
// //It appears, as vavle would prefer to deprecate the whole stack or already has.
// // if ( previousUniverseId == 0
// // && !m_moveCenterTabController.isInitComplete() )
// // {
// // m_moveCenterTabController.zeroOffsets();
// // }
// }
break;
case vr::VREvent_Input_ActionManifestReloaded:
{
// qWarning() << "Action Manifest Reloaded";
if ( m_steamVRTabController.perAppBindEnabled() )
{
m_steamVRTabController.applyAllCustomBindings();
@@ -1286,7 +1338,6 @@ void OverlayController::mainEventLoop()
if ( m_incomingReset )
{
m_incomingReset = false;
qInfo() << "Reset zero event recorded";
m_moveCenterTabController.incomingZeroReset();
}
@@ -1367,22 +1418,31 @@ void OverlayController::RotateUniverseCenter(
{
if ( yAngle != 0.0f )
{
if ( commit )
{
vr::VRChaperoneSetup()->HideWorkingSetPreview();
vr::VRChaperoneSetup()->RevertWorkingCopy();
}
// if ( commit )
// {
// vr::VRChaperoneSetup()->HideWorkingSetPreview();
// vr::VRChaperoneSetup()->RevertWorkingCopy();
// }
vr::HmdMatrix34_t curPos;
auto calState = vr::VRChaperone()->GetCalibrationState();
LOG( INFO ) << "Calibration State on Rotate is: " << calState;
if ( universe == vr::TrackingUniverseStanding )
{
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
&curPos );
}
else
else if(universe == vr::TrackingUniverseSeated)
{
vr::VRChaperoneSetup()->GetWorkingSeatedZeroPoseToRawTrackingPose(
&curPos );
}
else
{
//TODO 8/3/26, will see if this causes issues
//should exclusively happen with openxr
LOG(INFO) << "rotating on undefined tracking universe probably openxr";
vr::VRChaperoneSetup()->GetLiveSeatedZeroPoseToRawTrackingPose(&curPos);
}
vr::HmdMatrix34_t rotMat;
vr::HmdMatrix34_t newPos;
@@ -1547,11 +1607,20 @@ const vr::VROverlayHandle_t& OverlayController::overlayThumbnailHandle()
void OverlayController::showKeyboard( QString existingText,
unsigned long userValue )
{
// vr::VROverlay()->ShowKeyboardForOverlay(
// m_ulOverlayHandle,
// vr::k_EGamepadTextInputModeNormal,
// vr::k_EGamepadTextInputLineModeSingleLine,
// 0,
// "Advanced Settings Overlay",
// 1024,
// existingText.toStdString().c_str(),
// userValue );
vr::VROverlay()->ShowKeyboardForOverlay(
m_ulOverlayHandle,
vr::k_EGamepadTextInputModeNormal,
vr::k_EGamepadTextInputLineModeSingleLine,
0,
vr::KeyboardFlag_Modal+vr::KeyboardFlag_Minimal+vr::KeyboardFlag_HideDoneKey,
"Advanced Settings Overlay",
1024,
existingText.toStdString().c_str(),
+2
View File
@@ -145,6 +145,7 @@ private:
QString m_updateMessage = "";
QString m_optionalMessage = "";
QString m_versionCheckText = "";
unsigned long m_lastTextUID = 0;
QUrl m_runtimePathUrl;
@@ -314,6 +315,7 @@ signals:
void autoApplyChaperoneEnabledChanged( bool value );
void soundVolumeChanged( double value );
void desktopModeToggleChanged( bool value );
void submitLastTextField(unsigned long value = 0);
};
} // namespace advsettings
+4
View File
@@ -23,6 +23,10 @@
{
"controller_type": "generic_hmd",
"binding_url": "default_action_manifests/ovras-team.advancedsettings_default_hmd.json"
},
{
"controller_type": "frame_controller",
"binding_url": "default_action_manifests/ovras-team.advancedsettings_default_frame.json"
}
],
@@ -0,0 +1,158 @@
{
"action_manifest_version" : 0,
"alias_info" : {},
"app_key" : "steam.overlay.1009850",
"bindings" : {
"/actions/haptic" : {
"haptics" : [
{
"output" : "/actions/haptic/out/hapticsleft",
"path" : "/user/hand/left/output/haptic"
},
{
"output" : "/actions/haptic/out/hapticsright",
"path" : "/user/hand/right/output/haptic"
}
],
"poses" : [],
"skeleton" : [],
"sources" : [
{
"inputs" : {},
"mode" : "none",
"parameters" : {},
"path" : "/user/hand/left/input/dpad_left"
},
{
"inputs" : {},
"mode" : "none",
"parameters" : {},
"path" : "/user/hand/left/input/dpad_right"
},
{
"inputs" : {},
"mode" : "none",
"parameters" : {},
"path" : "/user/hand/left/input/dpad_up"
},
{
"inputs" : {},
"mode" : "none",
"parameters" : {},
"path" : "/user/hand/right/input/b"
},
{
"inputs" : {},
"mode" : "none",
"parameters" : {},
"path" : "/user/hand/right/input/x"
},
{
"inputs" : {},
"mode" : "none",
"parameters" : {},
"path" : "/user/hand/right/input/y"
}
]
},
"/actions/motion" : {
"chords" : [
{
"inputs" : [
[ "/user/hand/left/input/dpad_down", "single" ],
[ "/user/hand/right/input/x", "touch" ],
[ "/user/hand/right/input/a", "touch" ]
],
"output" : "/actions/motion/in/resetoffsets"
}
],
"poses" : [],
"skeleton" : [],
"sources" : [
{
"inputs" : {
"click" : {
"output" : "/actions/motion/in/lefthandspaceturn"
}
},
"mode" : "button",
"parameters" : {},
"path" : "/user/hand/left/input/dpad_up"
},
{
"inputs" : {
"click" : {
"output" : "/actions/motion/in/optionaloverridelefthandspacedrag"
}
},
"mode" : "button",
"parameters" : {},
"path" : "/user/hand/left/input/dpad_up"
},
{
"inputs" : {
"click" : {
"output" : "/actions/motion/in/swapspacedragtolefthandoverride"
}
},
"mode" : "button",
"parameters" : {},
"path" : "/user/hand/left/input/dpad_up"
},
{
"inputs" : {
"click" : {
"output" : "/actions/motion/in/righthandspaceturn"
}
},
"mode" : "button",
"parameters" : {},
"path" : "/user/hand/right/input/y"
},
{
"inputs" : {
"click" : {
"output" : "/actions/motion/in/optionaloverriderighthandspacedrag"
}
},
"mode" : "button",
"parameters" : {},
"path" : "/user/hand/right/input/y"
},
{
"inputs" : {
"click" : {
"output" : "/actions/motion/in/swapspacedragtorighthandoverride"
}
},
"mode" : "button",
"parameters" : {},
"path" : "/user/hand/right/input/y"
}
]
},
"/actions/system" : {
"poses" : [],
"skeleton" : [],
"sources" : [
{
"inputs" : {
"click" : {
"output" : "/actions/system/in/pushtotalk"
}
},
"mode" : "button",
"parameters" : {},
"path" : "/user/hand/left/input/bumper"
}
]
}
},
"category" : "steamvr_input",
"controller_type" : "frame_controller",
"description" : "",
"interaction_profile" : "",
"name" : "OVRAS Frame Default",
"options" : {},
"simulated_actions" : []
}
+17 -17
View File
@@ -165,15 +165,15 @@ MyStackViewPage {
Connections {
target: MoveCenterTabController
function onTrackingUniverseChanged() {
if (MoveCenterTabController.trackingUniverse === 0) {
fixButton.enabled = false
recenterButton.enabled = false
zeroSpaceButton.enabled = false
revertButton.enabled = false
undoFixButton.enabled = false
seatedWarningText.visible = true
} else if (MoveCenterTabController.trackingUniverse === 1) {
onTrackingUniverseChanged: {
// if (MoveCenterTabController.trackingUniverse === 0) {
// fixButton.enabled = false
// recenterButton.enabled = false
// zeroSpaceButton.enabled = false
// revertButton.enabled = false
// undoFixButton.enabled = false
// seatedWarningText.visible = true
// } else if (MoveCenterTabController.trackingUniverse === 1) {
fixButton.enabled = true
recenterButton.enabled = true
zeroSpaceButton.enabled = true
@@ -181,14 +181,14 @@ MyStackViewPage {
// undoFixButton.enabled = true
// TODO Fix Undo Feature -^
seatedWarningText.visible = false
} else {
fixButton.enabled = false
recenterButton.enabled = false
zeroSpaceButton.enabled = false
revertButton.enabled = false
undoFixButton.enabled = false
seatedWarningText.visible = false
}
// } else {
// fixButton.enabled = false
// recenterButton.enabled = false
// zeroSpaceButton.enabled = false
// revertButton.enabled = false
// undoFixButton.enabled = false
// seatedWarningText.visible = false
// }
}
}
+52 -5
View File
@@ -5,6 +5,7 @@ import ovras.advsettings 1.0
TextField {
property int keyBoardUID: 0
property string savedText: ""
property bool active: false
id: myTextField
color: "#d9dbe0"
text: ""
@@ -18,19 +19,25 @@ TextField {
}
onClicked: {
myTextField.forceActiveFocus()
active = true;
}
}
onActiveFocusChanged: {
if (activeFocus) {
active = true;
if (!OverlayController.desktopMode) {
OverlayController.showKeyboard(text, keyBoardUID)
} else {
savedText = text
}
//savedText = text
}
//When box loses focus apply changes
else{
myTextField.onInputEvent(text)
active = false;
}
}
onEditingFinished: {
if (OverlayController.desktopMode && savedText !== text) {
if(OverlayController.desktopMode){
myTextField.onInputEvent(text)
}
}
@@ -39,11 +46,51 @@ TextField {
}
Connections {
target: OverlayController
<<<<<<< HEAD
function onKeyBoardInputSignal() {
=======
onSubmitLastTextField:{
//value here is UID
if(value == 0){
active = false;
return;
}
if(value == keyBoardUID && active == true){
myTextField.onInputEvent(text)
active = false;
}
}
onKeyBoardInputSignal: {
>>>>>>> origin/master
if (userValue == keyBoardUID) {
if (myTextField.text !== input) {
myTextField.onInputEvent(input)
if(input == '\b'){
myTextField.text = text.slice(0,-1)
return
}
else if(input == '\e'){
myTextField.text = text.slice(0,cursorPosition)+text.slice(cursorposition+1)
return;
}
//Execute input
else if(input == '\n'){
if(!OverlayController.desktopMode){
//myTextField.onInputEvent(input)
myTextField.focus = false;
}
return;
}
else if(input=='\r'){
return;
}
else{
myTextField.text = text + input;
}
//if (myTextField.text !== input) {
// myTextField.onInputEvent(input)
//}
}
}
}
@@ -1500,6 +1500,7 @@ void ChaperoneTabController::createNewAutosaveProfile()
true,
true,
true );
LOG(INFO) <<"Chaperone Automatic Chaperone Profile Saved";
}
void ChaperoneTabController::applyAutosavedProfile()
+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
@@ -197,6 +197,7 @@ private:
unsigned m_turnComfortFrameSkipCounter = 0;
int m_recenterStages = 0;
int m_chaperoneHasCommit = false;
int m_openXRSkip = 0;
// Matrix used For Center Marker
vr::HmdMatrix34_t m_offsetmatrix = utils::k_forwardUpMatrix;
+3 -4
View File
@@ -509,14 +509,13 @@ void SteamVRTabController::launchBindingUI()
qCritical()
<< "failed to get input handle? is your right controller on?";
}
bool desktopShow = false;
if ( parent->isDesktopMode() )
{
QDesktopServices::openUrl(
QUrl( "http://127.0.0.1:27062/dashboard/controllerbinding.html" ) );
return;
desktopShow = true;
}
auto error = vr::VRInput()->OpenBindingUI(
application_strings::applicationKey, actionHandle, inputHandle, false );
application_strings::applicationKey, actionHandle, inputHandle, desktopShow );
if ( error != vr::VRInputError_None )
{
qCritical() << "Input Error: " << error;