WMR default binding, Toggle Chaperone Action, frame timing graph, prox sensor back-end (#182)

* perf graph overlay/checkbox added

* added toggle Chaperone action

* toggle chaperone non-functional

* fixed chaperone toggle action const to once

* Added Proximity Sensor Action back-end, not implemented via logic Until fixed by valve

* added default WMR controller profile

* formated

* formated steamvrtabcontroller.h

* fixed un-intended change
This commit is contained in:
ykeara
2019-04-27 17:47:46 -05:00
committed by GitHub
parent bf5ccd69ca
commit ef67888405
12 changed files with 268 additions and 4 deletions
+2 -2
View File
@@ -116,9 +116,9 @@ Section "Install" SecInstall
File "${BASEDIR}\*.exe"
;Any action manifests
File "${BASEDIR}\*.json"
File "${PACKAGEDIR}\*.json"
;And their defaults
File /r "${BASEDIR}\default_action_manifests"
File /r "${PACKAGEDIR}\default_action_manifests"
File "${THIRDDIR}\openvr\bin\win64\*.dll"
File "${BASEDIR}\*.dll"
+12
View File
@@ -131,9 +131,11 @@ SteamIVRInput::SteamIVRInput()
m_xAxisLockToggle( action_keys::xAxisLockToggle ),
m_yAxisLockToggle( action_keys::yAxisLockToggle ),
m_zAxisLockToggle( action_keys::zAxisLockToggle ),
m_chaperoneToggle( action_keys::chaperoneToggle ),
m_pushToTalk( action_keys::pushToTalk ),
m_leftHaptic( action_keys::hapticsLeft ),
m_rightHaptic( action_keys::hapticsRight ),
m_proxSensor( action_keys::proxSensor ),
m_leftHand( input_keys::leftHand ), m_rightHand( input_keys::rightHand ),
m_sets( { m_mainSet.activeActionSet(),
m_music.activeActionSet(),
@@ -290,6 +292,16 @@ bool SteamIVRInput::pushToTalk()
return isDigitalActionActivatedConstant( m_pushToTalk );
}
bool SteamIVRInput::chaperoneToggle()
{
return isDigitalActionActivatedOnce( m_chaperoneToggle );
}
bool SteamIVRInput::proxState()
{
return isDigitalActionActivatedConstant( m_pushToTalk );
}
/*!
Returns the action handle of the Left Haptic Action
*/
+11
View File
@@ -51,6 +51,9 @@ namespace action_keys
constexpr auto hapticsLeft = "/actions/haptic/out/HapticsLeft";
constexpr auto hapticsRight = "/actions/haptic/out/HapticsRight";
constexpr auto proxSensor = "/actions/misc/in/ProxSensor";
constexpr auto chaperoneToggle = "/actions/misc/in/ChaperoneToggle";
} // namespace action_keys
@@ -131,6 +134,8 @@ public:
bool xAxisLockToggle();
bool yAxisLockToggle();
bool zAxisLockToggle();
bool chaperoneToggle();
bool proxState();
bool pushToTalk();
@@ -192,6 +197,9 @@ private:
DigitalAction m_yAxisLockToggle;
DigitalAction m_zAxisLockToggle;
// Misc Bindings
DigitalAction m_chaperoneToggle;
// Push To Talk
DigitalAction m_pushToTalk;
@@ -199,6 +207,9 @@ private:
DigitalAction m_leftHaptic;
DigitalAction m_rightHaptic;
// prox Sensor
DigitalAction m_proxSensor;
// input sources
InputSource m_leftHand;
InputSource m_rightHand;
+11
View File
@@ -558,6 +558,15 @@ void OverlayController::processMotionBindings()
m_actions.swapSpaceDragToRightHandOverride() );
}
void OverlayController::processChaperoneBindings()
{
if ( m_actions.chaperoneToggle() )
{
m_chaperoneTabController.setDisableChaperone(
!( m_chaperoneTabController.disableChaperone() ), true );
}
}
void OverlayController::processPushToTalkBindings()
{
const auto pushToTalkCannotChange = !m_audioTabController.pttChangeValid();
@@ -590,6 +599,8 @@ void OverlayController::processInputBindings()
processMotionBindings();
processPushToTalkBindings();
processChaperoneBindings();
}
// vsync implementation:
+1
View File
@@ -134,6 +134,7 @@ private:
void processMediaKeyBindings();
void processMotionBindings();
void processPushToTalkBindings();
void processChaperoneBindings();
public:
OverlayController( bool desktopMode, bool noSound, QQmlEngine& qmlEngine );
+23 -1
View File
@@ -4,10 +4,19 @@
"controller_type": "vive_controller",
"binding_url": "default_action_manifests/ovras-team.advancedsettings_default_vive_controller.json"
},
{
"controller_type": "holographic_controller",
"binding_url": "default_action_manifests/ovras-team.advancedsettings_default_wmr.json"
},
{
"controller_type": "knuckles",
"binding_url": "default_action_manifests/ovras-team.advancedsettings_default_knuckles.json"
},
{
"controller_type": "generic_hmd",
"binding_url": "default_action_manifests/ovras-team.advancedsettings_default_hmd.json"
}
],
"actions": [
{
@@ -141,7 +150,18 @@
"name": "/actions/misc/in/PushToTalk",
"requirement": "optional",
"type": "boolean"
},
{
"name": "/actions/misc/in/ChaperoneToggle",
"requirement": "optional",
"type": "boolean"
},
{
"name": "/actions/misc/in/ProxSensor",
"requirement": "optional",
"type": "boolean"
}
],
"action_sets": [
{
@@ -198,7 +218,9 @@
"/actions/misc/in/XAxisLockToggle" : "X-Axis Lock Toggle",
"/actions/misc/in/YAxisLockToggle" : "Y-Axis Lock Toggle",
"/actions/misc/in/ZAxisLockToggle" : "Z-Axis Lock Toggle",
"/actions/misc/in/PushToTalk" : "Push To Talk"
"/actions/misc/in/PushToTalk" : "Push To Talk",
"/actions/misc/in/ChaperoneToggle" : "Chaperone Toggle",
"/actions/misc/in/ProxSensor" : "Proximity Sensor"
}
]
}
@@ -0,0 +1,23 @@
{
"name": "OVRAS HMD default",
"controller_type": "generic_hmd",
"alias_info" : {},
"app_key" : "ovras-team.advancedsettings",
"bindings":
{
"/actions/misc" : {
"sources" : [
{
"inputs" : {
"click" : {
"output" : "/actions/misc/in/ProxSensor"
}
},
"mode" : "button",
"path" : "/user/head/proximity"
}
]
}
},
"description": ""
}
@@ -0,0 +1,114 @@
{
"alias_info" : {},
"app_key" : "ovras-team.advancedsettings",
"bindings" : {
"/actions/haptic": {
"haptics": [
{
"path": "/user/hand/left/output/haptic",
"output": "/actions/haptic/out/hapticsleft"
},
{
"path": "/user/hand/right/output/haptic",
"output": "/actions/haptic/out/hapticsright"
}
],
"sources": [
{
"path": "/user/hand/right/input/trigger",
"mode": "none",
"inputs": {}
},
{
"path": "/user/hand/left/input/application_menu",
"mode": "none",
"inputs": {}
},
{
"path": "/user/hand/right/input/application_menu",
"mode": "none",
"inputs": {}
}
]
},
"/actions/motion": {
"sources": [
{
"path": "/user/hand/left/input/application_menu",
"mode": "button",
"inputs": {
"click": {
"output": "/actions/motion/in/lefthandspaceturn"
}
}
},
{
"path": "/user/hand/right/input/application_menu",
"mode": "button",
"inputs": {
"click": {
"output": "/actions/motion/in/righthandspaceturn"
}
}
},
{
"path": "/user/hand/left/input/application_menu",
"mode": "button",
"inputs": {
"double": {
"output": "/actions/motion/in/lefthandspacedrag"
}
}
},
{
"path": "/user/hand/left/input/application_menu",
"mode": "button",
"inputs": {
"click": {
"output": "/actions/motion/in/swapspacedragtolefthandoverride"
}
}
},
{
"path": "/user/hand/right/input/application_menu",
"mode": "button",
"inputs": {
"double": {
"output": "/actions/motion/in/righthandspacedrag"
}
}
},
{
"path": "/user/hand/right/input/application_menu",
"mode": "button",
"inputs": {
"click": {
"output": "/actions/motion/in/swapspacedragtorighthandoverride"
}
}
}
]
},
"/actions/misc": {
"sources": [
{
"path": "/user/hand/right/input/trackpad",
"mode": "dpad",
"parameters": {
"sub_mode": "click"
},
"inputs": {
"south": {
"output": "/actions/misc/in/pushtotalk"
}
}
}
]
}
},
"controller_type" : "holographic_controller",
"description" : "",
"name" : "OVRAS WMR Default",
"options" : {},
"simulated_actions" : []
}
+12
View File
@@ -276,6 +276,14 @@ MyStackViewPage {
}
}
MyToggleButton {
id: steamvrPerformanceGraphToggle
text: "Enable timing overlay"
onCheckedChanged: {
SteamVRTabController.setPerformanceGraph(this.checked, false)
}
}
Item { Layout.fillHeight: true; Layout.fillWidth: true}
RowLayout {
@@ -310,6 +318,7 @@ MyStackViewPage {
steamvrAllowSupersampleOverrideToggle.checked = SteamVRTabController.allowSupersampleOverride
steamvrAllowSupersampleFilteringToggle.checked = SteamVRTabController.allowSupersampleFiltering
steamvrMotionSmoothingToggle.checked = SteamVRTabController.motionSmoothing
steamvrPerformanceGraphToggle.checked = SteamVRTabController.performanceGraph
if(!steamvrAllowSupersampleOverrideToggle.checked){
steamvrSupersamplingText.enabled = false
steamvrSupersamplingSlider.enabled = false
@@ -339,6 +348,9 @@ MyStackViewPage {
onMotionSmoothingChanged: {
steamvrMotionSmoothingToggle.checked = SteamVRTabController.motionSmoothing
}
onPerformanceGraphChanged:{
steamvrPerformanceGraphToggle.checked = SteamVRTabController.performanceGraph
}
onSteamVRProfilesUpdated: {
reloadSteamVRProfiles()
@@ -103,6 +103,21 @@ void SteamVRTabController::eventLoopTick()
vrSettingsError );
}
setMotionSmoothing( ms );
// Checks and synchs performance graph
auto pg
= vr::VRSettings()->GetBool( vr::k_pch_Perf_Section,
vr::k_pch_Perf_PerfGraphInHMD_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING )
<< "Could not read \"" << vr::k_pch_Perf_PerfGraphInHMD_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setPerformanceGraph( pg );
}
settingsUpdateCounter = 0;
}
@@ -447,6 +462,31 @@ void SteamVRTabController::initSupersampleOverride()
/*------------------------------------------*/
/* -----------------------------------------*/
bool SteamVRTabController::performanceGraph() const
{
return m_performanceGraphToggle;
}
void SteamVRTabController::setPerformanceGraph( const bool value,
const bool notify )
{
if ( m_performanceGraphToggle != value )
{
m_performanceGraphToggle = value;
vr::VRSettings()->SetBool( vr::k_pch_Perf_Section,
vr::k_pch_Perf_PerfGraphInHMD_Bool,
m_performanceGraphToggle );
vr::VRSettings()->Sync();
if ( notify )
{
emit performanceGraphChanged( m_performanceGraphToggle );
}
}
}
/*------------------------------------------*/
/* -----------------------------------------*/
void SteamVRTabController::reset()
{
vr::EVRSettingsError vrSettingsError;
@@ -516,6 +556,17 @@ void SteamVRTabController::reset()
vrSettingsError );
}
vr::VRSettings()->RemoveKeyInSection( vr::k_pch_Perf_Section,
vr::k_pch_Perf_PerfGraphInHMD_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not remove \""
<< vr::k_pch_Perf_PerfGraphInHMD_Bool << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
vr::VRSettings()->Sync();
settingsUpdateCounter = 999; // Easiest way to get default values
}
@@ -39,6 +39,9 @@ class SteamVRTabController : public QObject
bool allowSupersampleOverride READ allowSupersampleOverride WRITE
setAllowSupersampleOverride NOTIFY allowSupersampleOverrideChanged )
Q_PROPERTY( bool performanceGraph READ performanceGraph WRITE
setPerformanceGraph NOTIFY performanceGraphChanged )
private:
OverlayController* parent;
QQuickWindow* widget;
@@ -47,6 +50,7 @@ private:
bool m_motionSmoothing = true;
bool m_allowSupersampleFiltering = true;
bool m_allowSupersampleOverride = false;
bool m_performanceGraphToggle = false;
void initMotionSmoothing();
void initSupersampleOverride();
@@ -65,6 +69,7 @@ public:
bool motionSmoothing() const;
bool allowSupersampleFiltering() const;
bool allowSupersampleOverride() const;
bool performanceGraph() const;
void reloadSteamVRProfiles();
void saveSteamVRProfiles();
@@ -77,6 +82,7 @@ public slots:
void setMotionSmoothing( bool value, bool notify = true );
void setAllowSupersampleFiltering( bool value, bool notify = true );
void setAllowSupersampleOverride( bool value, bool notify = true );
void setPerformanceGraph( bool value, bool notify = true );
void addSteamVRProfile( QString name,
bool includeSupersampling,
@@ -93,6 +99,7 @@ signals:
void motionSmoothingChanged( bool value );
void allowSupersampleFilteringChanged( bool value );
void allowSupersampleOverrideChanged( bool value );
void performanceGraphChanged( bool value );
void steamVRProfilesUpdated();
void steamVRProfileAdded();
+1 -1
View File
@@ -172,4 +172,4 @@ void VideoTabController::setOpacityValue()
}
emit brightnessValueChanged( m_brightnessValue );
}
} // namespace advsettings
} // namespace advsettings