5.4.0 Raw Restriction Setting, Apply Offsets (#577)

* Crash Recovery Defaults to Off, add option to use space drag w/ uncalibrated playspace

* increment version 5.3.3

* Feat/apply offsets binding (#576)

* add apply offsets steamvr input

* add new binding to Readme

Co-authored-by: TheMrGong <gongora656@gmail.com>

* increment version 5.4.0

* added LH Console Interface class, WIP TX/RX list via lh console

* switch over to property based dongle information

* add ovr system wrapper

* add use of parameter to avoid warning as error

* openXR fix, and Change Display State of Chaperone Disabled

* update text

* format files

* clang 9.0.0 format

* add documentation update

* remove windows header include

* remove filesystem header

* fix uncal motion switching issue

Co-authored-by: TheMrGong <gongora656@gmail.com>
This commit is contained in:
ykeara
2022-02-23 16:06:03 -06:00
committed by GitHub
co-authored by TheMrGong
parent 522ba46ac6
commit eea713429d
24 changed files with 992 additions and 14 deletions
+42 -5
View File
@@ -892,7 +892,32 @@ void MoveCenterTabController::setEnableSeatedMotion( bool value, bool notify )
if ( notify )
{
emit enableSeatedMotionChanged( value );
emit enableUncalMotionChanged( value );
}
}
bool MoveCenterTabController::enableUncalMotion() const
{
return settings::getSetting(
settings::BoolSetting::PLAYSPACE_enableUncalMotion );
}
void MoveCenterTabController::setEnableUncalMotion( bool value, bool notify )
{
if ( !value && m_initComplete )
{
reset();
}
settings::setSetting( settings::BoolSetting::PLAYSPACE_enableUncalMotion,
value );
if ( !value && m_initComplete )
{
m_pendingZeroOffsets = true;
}
if ( notify )
{
emit enableUncalMotionChanged( value );
}
}
@@ -976,7 +1001,7 @@ void MoveCenterTabController::incomingSeatedReset()
void MoveCenterTabController::reset()
{
if ( !m_chaperoneBasisAcquired )
if ( !m_chaperoneBasisAcquired && !enableUncalMotion() )
{
LOG( WARNING ) << "WARNING: Attempted reset offsets before chaperone "
"basis is acquired!";
@@ -1115,7 +1140,8 @@ void MoveCenterTabController::zeroOffsets()
// finished checking if out of bounds, proceed with normal zeroing offsets
if ( vr::VRChaperone()->GetCalibrationState()
== vr::ChaperoneCalibrationState_OK )
== vr::ChaperoneCalibrationState_OK
|| enableUncalMotion() )
{
m_oldOffsetX = 0.0f;
m_oldOffsetY = 0.0f;
@@ -1131,7 +1157,7 @@ void MoveCenterTabController::zeroOffsets()
emit rotationChanged( m_rotation );
updateChaperoneResetData();
m_pendingZeroOffsets = false;
if ( !m_chaperoneBasisAcquired )
if ( !m_chaperoneBasisAcquired && !enableUncalMotion() )
{
m_chaperoneBasisAcquired = true;
if ( !m_initComplete )
@@ -1962,6 +1988,14 @@ void MoveCenterTabController::resetOffsets( bool resetOffsetsJustPressed )
}
}
void MoveCenterTabController::applyOffsets( bool applyOffsetsJustPressed )
{
if ( applyOffsetsJustPressed )
{
zeroOffsets();
}
}
void MoveCenterTabController::snapTurnLeft( bool snapTurnLeftJustPressed )
{
if ( !snapTurnLeftJustPressed )
@@ -2933,6 +2967,7 @@ void MoveCenterTabController::eventLoopTick(
vr::VRChaperoneSetup()->RevertWorkingCopy();
}
setTrackingUniverse( int( universe ) );
// TODO set to allow.
return;
}
@@ -2958,7 +2993,9 @@ void MoveCenterTabController::eventLoopTick(
// if we were in room setup, but got this far in the loop, universe is no
// longer raw mode and we detect room setup exit and zeroOffsets() to apply
// new setup.
if ( m_pendingZeroOffsets || m_roomSetupModeDetected )
if ( m_pendingZeroOffsets
|| ( m_roomSetupModeDetected && !enableUncalMotion() ) )
{
zeroOffsets();
// m_roomSetupModeDetected is set to false in zeroOffsets() if it's
@@ -139,6 +139,8 @@ class MoveCenterTabController : public QObject
setEnableSeatedMotion NOTIFY enableSeatedMotionChanged )
Q_PROPERTY( bool simpleRecenter READ simpleRecenter WRITE setSimpleRecenter
NOTIFY simpleRecenterChanged )
Q_PROPERTY( bool enableUncalMotion READ enableUncalMotion WRITE
setEnableUncalMotion NOTIFY enableUncalMotionChanged )
private:
OverlayController* parent;
@@ -276,6 +278,7 @@ public:
bool oldStyleMotion() const;
bool universeCenteredRotation() const;
bool enableSeatedMotion() const;
bool enableUncalMotion() const;
bool simpleRecenter() const;
bool isInitComplete() const;
double getHmdYawTotal();
@@ -306,6 +309,7 @@ public:
void gravityReverseAction( bool gravityReverseHeld );
void heightToggleAction( bool heightToggleJustPressed );
void resetOffsets( bool resetOffsetsJustPressed );
void applyOffsets( bool applyOffsetsJustPressed );
void snapTurnLeft( bool snapTurnLeftJustPressed );
void snapTurnRight( bool snapTurnRightJustPressed );
void smoothTurnLeft( bool smoothTurnLeftActive );
@@ -356,6 +360,7 @@ public slots:
void setOldStyleMotion( bool value, bool notify = true );
void setUniverseCenteredRotation( bool value, bool notify = true );
void setEnableSeatedMotion( bool value, bool notify = true );
void setEnableUncalMotion( bool value, bool notify = true );
void setSimpleRecenter( bool value, bool notify = true );
void shutdown();
@@ -403,6 +408,7 @@ signals:
void universeCenteredRotationChanged( bool value );
void enableSeatedMotionChanged( bool value );
void simpleRecenterChanged( bool value );
void enableUncalMotionChanged( bool value );
void offsetProfilesUpdated();
};
+135
View File
@@ -289,6 +289,113 @@ bool SteamVRTabController::cameraDashboard() const
return m_cameraDashboard;
}
void SteamVRTabController::searchRXTX()
{
deviceList.clear();
int hmdIndex = -1;
auto indexList = ovr_system_wrapper::getAllConnectedDevices( true );
m_dongleCountCur = 0;
for ( auto device : indexList )
{
if ( vr::TrackedDeviceClass_HMD
== ovr_system_wrapper::getDeviceClass( device ) )
{
hmdIndex = device;
continue;
}
deviceList.push_back( DeviceInfo{ device } );
GatherDeviceInfo( deviceList.back() );
}
if ( hmdIndex != -1 )
{
auto dongleList
= ovr_system_wrapper::getStringTrackedProperty(
hmdIndex, vr::Prop_AllWirelessDongleDescriptions_String )
.second;
int count = 0;
if ( !dongleList.empty() )
{
count++;
}
for ( auto c : dongleList )
{
if ( c == ';' )
{
count++;
}
}
m_dongleCountMax = count;
}
return;
}
void SteamVRTabController::GatherDeviceInfo( DeviceInfo& device )
{
std::string cd = ovr_system_wrapper::getStringTrackedProperty(
device.index, vr::Prop_ConnectedWirelessDongle_String )
.second;
if ( cd.empty() || cd == " " )
{
cd = "n/a";
device.dongleType = "n/a";
}
else
{
m_dongleCountCur++;
if ( cd.find( "-RYB" ) != std::string::npos
|| cd.find( "-LYM" ) != std::string::npos )
{
device.dongleType = "Headset";
}
// TODO 1yx SN
else if ( std::regex_match( cd, std::regex( "(.*)(-[0-9]YX)" ) ) )
{
device.dongleType = "Tundra Dongle";
}
else
{
device.dongleType = "Standard Dongle";
}
}
device.conDongle = cd;
std::string dd = ovr_system_wrapper::getStringTrackedProperty(
device.index, vr::Prop_SerialNumber_String )
.second;
if ( dd.empty() || dd == " " )
{
dd = "n/a";
}
device.txName = dd;
auto devClass = ovr_system_wrapper::getDeviceClass( device.index );
if ( devClass == vr::TrackedDeviceClass_HMD
|| devClass == vr::TrackedDeviceClass_Controller
|| devClass == vr::TrackedDeviceClass_GenericTracker )
{
device.hasName = true;
device.deviceName = ovr_system_wrapper::getDeviceName( device.index );
}
else
{
if ( device.txName.find( "LHB-" ) != std::string::npos )
{
device.deviceName = "Lighthouse";
}
}
int role = ovr_system_wrapper::getInt32TrackedProperty(
device.index, vr::Prop_ControllerRoleHint_Int32 )
.second;
if ( role == 1 )
{
device.deviceName += " (L)";
}
else if ( role == 2 )
{
device.deviceName += " (R)";
}
}
void SteamVRTabController::launchBindingUI()
{
vr::VRActionSetHandle_t actionHandle = 0;
@@ -335,4 +442,32 @@ void SteamVRTabController::restartSteamVR()
QProcess::startDetached( cmd );
}
Q_INVOKABLE unsigned SteamVRTabController::getRXTXCount()
{
return static_cast<unsigned>( deviceList.size() );
}
Q_INVOKABLE QString SteamVRTabController::getTXList( int i )
{
return QString::fromStdString( deviceList[i].txName );
}
Q_INVOKABLE QString SteamVRTabController::getDeviceName( int i )
{
return QString::fromStdString( deviceList[i].deviceName );
}
Q_INVOKABLE QString SteamVRTabController::getRXList( int i )
{
return QString::fromStdString( deviceList[i].conDongle );
}
Q_INVOKABLE QString SteamVRTabController::getDongleType( int i )
{
return QString::fromStdString( deviceList[i].dongleType );
}
Q_INVOKABLE QString SteamVRTabController::getDongleUsage()
{
return QString::fromStdString( std::to_string( m_dongleCountCur ) + "/"
+ std::to_string( m_dongleCountMax ) );
}
} // namespace advsettings
+34
View File
@@ -4,6 +4,13 @@
#include <QObject>
#include "../utils/FrameRateUtils.h"
#include "../openvr/ovr_settings_wrapper.h"
#include "../openvr/lh_console_util.h"
#include <QStringListModel>
#include <QTableWidget>
#include "../openvr/lh_console_util.h"
#include <QDir>
#include "../openvr/ovr_system_wrapper.h"
#include <regex>
class QQuickWindow;
// application namespace
@@ -12,6 +19,18 @@ namespace advsettings
// forward declaration
class OverlayController;
struct DeviceInfo
{
int index = -1;
std::string conDongle = "";
std::string txName = "";
std::string deviceName = "";
std::string hand = "";
std::string dongleType = "n/a";
std::string serialNumber = "";
bool hasName = false;
};
class SteamVRTabController : public QObject
{
Q_OBJECT
@@ -49,7 +68,13 @@ private:
bool m_cameraBounds = false;
bool m_cameraRoom = false;
bool m_cameraDashboard = false;
bool m_pathRXTXInit = false;
int m_dongleCountCur = 0;
int m_dongleCountMax = 0;
std::vector<DeviceInfo> deviceList;
void GatherDeviceInfo( DeviceInfo& device );
void synchSteamVR();
public:
@@ -70,8 +95,17 @@ public:
bool cameraRoom() const;
bool cameraDashboard() const;
Q_INVOKABLE void searchRXTX();
Q_INVOKABLE void launchBindingUI();
Q_INVOKABLE unsigned getRXTXCount();
Q_INVOKABLE QString getTXList( int i );
Q_INVOKABLE QString getRXList( int i );
Q_INVOKABLE QString getDeviceName( int i );
Q_INVOKABLE QString getDongleType( int i );
Q_INVOKABLE QString getDongleUsage();
public slots:
void setPerformanceGraph( bool value, bool notify = true );