merge mainline changes into qt6
This commit is contained in:
+101
-32
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user