merged master to brightness
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
 
|
||||

|
||||
|
||||
@@ -23,6 +24,7 @@
|
||||
> * [Space Fix Page](#space_fix_page)
|
||||
> * [Audio Page](#audio_page)
|
||||
> * [Utilities Page](#utilities_page)
|
||||
> * [Desktop Overlay Page](#desktop_overlay_page)
|
||||
> * [Statistics Page](#statistics_page)
|
||||
> * [Settings Page](#settings_page)
|
||||
> * [How To Compile](#how_to_compile)
|
||||
@@ -329,6 +331,19 @@ Allows users to temporarily move and rotate the center of the playspace. This al
|
||||
|
||||
- **Media Control Keys:** Allows controlling a media player through the media keys. This is the same as having a keyboard with media keys and then pressing them. Should support most common media players.
|
||||
|
||||
<a name="desktop_overlay_page"></a>
|
||||
## - Desktop Overlay Page
|
||||
|
||||

|
||||
|
||||
-**Overlay Width:** The width of the overlay in meters. Multi screen setups need larger values to see any difference.
|
||||
|
||||
-**Up/Down Translation:** Moves the overlay up and down.
|
||||
|
||||
-**Forwards/Backwards Translation:** Moves the overlay forwards and backwards.
|
||||
|
||||
-**Left/Right Translation:** Moves the overlay left or right.
|
||||
|
||||
<a name="statistics_page"></a>
|
||||
## - Statistics Page:
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ DISTFILES += \
|
||||
src/res/qml/utilities_page/* \
|
||||
src/res/qml/utilities_page/media_keys/* \
|
||||
src/res/qml/utilities_page/keyboard_utils/* \
|
||||
src/res/qml/utilities_page/desktop_size/* \
|
||||
src/res/qml/desktop_overlay_page/desktop_size/* \
|
||||
src/res/qml/utilities_page/alarm_clock/* \
|
||||
src/res/qml/audio_page/dialog_boxes/* \
|
||||
src/res/qml/audio_page/device_selector/* \
|
||||
@@ -42,5 +42,9 @@ DISTFILES += \
|
||||
src/res/qml/video_page/* \
|
||||
src/res/qml/video_page/brightness/* \
|
||||
src/res/qml/common/* \
|
||||
src/res/qml/desktop_overlay_page/* \
|
||||
src/res/qml/desktop_overlay_page/translation_left_right/SteamDesktopTranslationLeftRight.qml \
|
||||
src/res/qml/desktop_overlay_page/translation_back_forwards/SteamDesktopTranslationBackForwards.qml \
|
||||
src/res/qml/desktop_overlay_page/translation_up_down/SteamDesktopTranslationUpDown.qml \
|
||||
|
||||
RC_FILE = src/res/icon.rc
|
||||
|
||||
@@ -13,11 +13,11 @@ SOURCES += src/main.cpp\
|
||||
src/tabcontrollers/VideoTabController.cpp \
|
||||
src/utils/ChaperoneUtils.cpp \
|
||||
src/tabcontrollers/audiomanager/AudioManagerDummy.cpp \
|
||||
src/tabcontrollers/keyboardinput/KeyboardInputDummy.cpp \
|
||||
src/openvr/openvr_init.cpp \
|
||||
src/openvr/ivrinput.cpp \
|
||||
src/utils/setup.cpp \
|
||||
src/utils/paths.cpp
|
||||
src/utils/paths.cpp \
|
||||
src/openvr/overlay_utils.cpp
|
||||
|
||||
HEADERS += src/overlaycontroller.h \
|
||||
src/tabcontrollers/AudioTabController.h \
|
||||
@@ -32,12 +32,11 @@ HEADERS += src/overlaycontroller.h \
|
||||
src/tabcontrollers/VideoTabController.h \
|
||||
src/tabcontrollers/AudioManager.h \
|
||||
src/tabcontrollers/PttController.h \
|
||||
src/tabcontrollers/KeyboardInput.h \
|
||||
src/tabcontrollers/keyboardinput/KeyboardInput.h \
|
||||
src/utils/Matrix.h \
|
||||
src/utils/ChaperoneUtils.h \
|
||||
src/quaternion/quaternion.h \
|
||||
src/tabcontrollers/audiomanager/AudioManagerDummy.h \
|
||||
src/tabcontrollers/keyboardinput/KeyboardInputDummy.h \
|
||||
src/openvr/openvr_init.h \
|
||||
src/openvr/ivrinput_action.h \
|
||||
src/openvr/ivrinput_manifest.h \
|
||||
@@ -45,13 +44,17 @@ HEADERS += src/overlaycontroller.h \
|
||||
src/openvr/ivrinput_input_source.h \
|
||||
src/openvr/ivrinput.h \
|
||||
src/utils/setup.h \
|
||||
src/utils/paths.h
|
||||
src/utils/paths.h \
|
||||
src/openvr/overlay_utils.h
|
||||
|
||||
win32 {
|
||||
SOURCES += src/tabcontrollers/audiomanager/AudioManagerWindows.cpp \
|
||||
src/tabcontrollers/keyboardinput/KeyboardInputWindows.cpp
|
||||
HEADERS += src/tabcontrollers/audiomanager/AudioManagerWindows.h \
|
||||
src/tabcontrollers/keyboardinput/KeyboardInputWindows.h
|
||||
HEADERS += src/tabcontrollers/audiomanager/AudioManagerWindows.h
|
||||
}
|
||||
|
||||
!win32 {
|
||||
SOURCES += src/tabcontrollers/keyboardinput/KeyboardInputDummy.cpp
|
||||
}
|
||||
|
||||
win32-msvc {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 37 KiB |
@@ -0,0 +1,192 @@
|
||||
#include "overlay_utils.h"
|
||||
#include "../overlaycontroller.h"
|
||||
|
||||
namespace overlay
|
||||
{
|
||||
vr::VROverlayHandle_t getOverlayHandle()
|
||||
{
|
||||
vr::VROverlayHandle_t pOverlayHandle;
|
||||
vr::VROverlay()->FindOverlay( strings::overlaykey, &pOverlayHandle );
|
||||
return pOverlayHandle;
|
||||
}
|
||||
|
||||
vr::HmdMatrix34_t getDesktopOverlayPositions()
|
||||
{
|
||||
vr::HmdMatrix34_t currentPosition = {};
|
||||
|
||||
const auto overlayHandle = getOverlayHandle();
|
||||
|
||||
vr::ETrackingUniverseOrigin origin
|
||||
= vr::ETrackingUniverseOrigin::TrackingUniverseStanding;
|
||||
|
||||
vr::VROverlay()->GetOverlayTransformAbsolute(
|
||||
overlayHandle, &origin, ¤tPosition );
|
||||
|
||||
return currentPosition;
|
||||
}
|
||||
|
||||
void setDesktopOverlayPositions( vr::HmdMatrix34_t& positions )
|
||||
{
|
||||
const auto overlayHandle = getOverlayHandle();
|
||||
|
||||
// We need to make sure we get the same Universe Origin as before.
|
||||
vr::HmdMatrix34_t currentPosition = {};
|
||||
vr::ETrackingUniverseOrigin origin
|
||||
= vr::ETrackingUniverseOrigin::TrackingUniverseStanding;
|
||||
vr::VROverlay()->GetOverlayTransformAbsolute(
|
||||
overlayHandle, &origin, ¤tPosition );
|
||||
|
||||
vr::VROverlay()->SetOverlayTransformAbsolute(
|
||||
overlayHandle, origin, &positions );
|
||||
}
|
||||
|
||||
void setDesktopOverlayWidth( double width )
|
||||
{
|
||||
const auto overlayHandle = getOverlayHandle();
|
||||
auto error = vr::VROverlay()->SetOverlayWidthInMeters(
|
||||
overlayHandle, static_cast<float>( width ) );
|
||||
if ( error != vr::VROverlayError_None )
|
||||
{
|
||||
LOG( ERROR ) << "Could not modify overlay width of \""
|
||||
<< strings::overlaykey << "\": "
|
||||
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( error );
|
||||
}
|
||||
}
|
||||
|
||||
void setSettingsToValue( const std::string setting, const double value )
|
||||
{
|
||||
QSettings settings( QSettings::Format::IniFormat,
|
||||
QSettings::Scope::UserScope,
|
||||
application_strings::applicationOrganizationName,
|
||||
application_strings::applicationName );
|
||||
settings.beginGroup( strings::settingsGroupName );
|
||||
settings.setValue( setting.c_str(), value );
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
overlay::DesktopOverlay::DesktopOverlay()
|
||||
{
|
||||
QSettings settings( QSettings::Format::IniFormat,
|
||||
QSettings::Scope::UserScope,
|
||||
application_strings::applicationOrganizationName,
|
||||
application_strings::applicationName );
|
||||
|
||||
LOG( INFO ) << settings.fileName();
|
||||
settings.beginGroup( strings::settingsGroupName );
|
||||
m_width = settings.value( strings::widthSettingsName, defaultOverlayWidth )
|
||||
.toDouble();
|
||||
m_forwardsMovement
|
||||
= settings.value( strings::forwardsSettingsName, defaultMovement )
|
||||
.toDouble();
|
||||
m_rightMovement
|
||||
= settings.value( strings::rightMovementSettingsName, defaultMovement )
|
||||
.toDouble();
|
||||
m_upMovement
|
||||
= settings.value( strings::upMovementSettingsName, defaultMovement )
|
||||
.toDouble();
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
void DesktopOverlay::update()
|
||||
{
|
||||
setDesktopOverlayWidth( m_width );
|
||||
|
||||
auto positionMatrix = getDesktopOverlayPositions();
|
||||
|
||||
auto changedPositions = getChangedMatrix( positionMatrix );
|
||||
|
||||
setDesktopOverlayPositions( changedPositions );
|
||||
}
|
||||
|
||||
bool DesktopOverlay::isAvailable() const
|
||||
{
|
||||
vr::VROverlayHandle_t pOverlayHandle = 0;
|
||||
auto error
|
||||
= vr::VROverlay()->FindOverlay( strings::overlaykey, &pOverlayHandle );
|
||||
if ( error != vr::VROverlayError_None )
|
||||
{
|
||||
LOG( INFO ) << "Could not find overlay \"" << strings::overlaykey
|
||||
<< "\": "
|
||||
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( error );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void overlay::DesktopOverlay::setWidth( double width )
|
||||
{
|
||||
if ( width < 0.01 )
|
||||
{
|
||||
width = 0.01;
|
||||
}
|
||||
|
||||
setSettingsToValue( strings::widthSettingsName, width );
|
||||
m_width = width;
|
||||
}
|
||||
|
||||
double DesktopOverlay::getCurrentWidth() const noexcept
|
||||
{
|
||||
return m_width;
|
||||
}
|
||||
|
||||
void DesktopOverlay::setRightMovement( double distance )
|
||||
{
|
||||
setSettingsToValue( strings::rightMovementSettingsName, distance );
|
||||
m_rightMovement = distance;
|
||||
}
|
||||
|
||||
double DesktopOverlay::getCurrentRightMovement() const noexcept
|
||||
{
|
||||
return m_rightMovement;
|
||||
}
|
||||
|
||||
void DesktopOverlay::setForwardsMovement( double distance )
|
||||
{
|
||||
setSettingsToValue( strings::forwardsSettingsName, distance );
|
||||
m_forwardsMovement = distance;
|
||||
}
|
||||
|
||||
double DesktopOverlay::getCurrentForwardsMovement() const noexcept
|
||||
{
|
||||
return m_forwardsMovement;
|
||||
}
|
||||
|
||||
void DesktopOverlay::setHeight( double height )
|
||||
{
|
||||
setSettingsToValue( strings::upMovementSettingsName, height );
|
||||
m_upMovement = height;
|
||||
}
|
||||
|
||||
double DesktopOverlay::getCurrentHeight() const noexcept
|
||||
{
|
||||
return m_upMovement;
|
||||
}
|
||||
|
||||
vr::HmdMatrix34_t
|
||||
DesktopOverlay::getChangedMatrix( vr::HmdMatrix34_t& matrix ) const noexcept
|
||||
{
|
||||
auto position = QVector3D( matrix.m[0][3], matrix.m[1][3], matrix.m[2][3] );
|
||||
|
||||
const auto screenRight
|
||||
= QVector3D( matrix.m[0][0], matrix.m[1][0], matrix.m[2][0] );
|
||||
|
||||
const auto screenForwards
|
||||
= QVector3D( matrix.m[0][2], matrix.m[1][2], matrix.m[2][2] );
|
||||
|
||||
const auto screenUp
|
||||
= QVector3D( matrix.m[0][1], matrix.m[1][1], matrix.m[2][1] );
|
||||
|
||||
position += ( static_cast<float>( m_rightMovement ) * screenRight );
|
||||
|
||||
position += ( static_cast<float>( m_forwardsMovement ) * screenForwards );
|
||||
|
||||
position += ( static_cast<float>( m_upMovement ) * screenUp );
|
||||
|
||||
matrix.m[0][3] = position.x();
|
||||
matrix.m[1][3] = position.y();
|
||||
matrix.m[2][3] = position.z();
|
||||
|
||||
return matrix;
|
||||
}
|
||||
|
||||
} // namespace overlay
|
||||
@@ -0,0 +1,68 @@
|
||||
#pragma once
|
||||
#include <QObject>
|
||||
#include <openvr.h>
|
||||
#include <easylogging++.h>
|
||||
#include <QVector2D>
|
||||
#include <QVector3D>
|
||||
#include <QSettings>
|
||||
|
||||
void outputMat();
|
||||
void transformMat();
|
||||
|
||||
namespace overlay
|
||||
{
|
||||
namespace strings
|
||||
{
|
||||
constexpr auto overlaykey = "valve.steam.desktop";
|
||||
constexpr auto settingsGroupName = "utilitiesSettings";
|
||||
constexpr auto widthSettingsName = "desktopWidth";
|
||||
constexpr auto forwardsSettingsName = "desktopForwardsMovement";
|
||||
constexpr auto rightMovementSettingsName = "desktopRightMovement";
|
||||
constexpr auto upMovementSettingsName = "desktopUpMovement";
|
||||
constexpr auto positionSettingsName = "desktopOverlayPosition";
|
||||
} // namespace strings
|
||||
|
||||
constexpr auto defaultOverlayWidth = 4.0;
|
||||
constexpr auto defaultMovement = 0.0;
|
||||
constexpr auto defaultWidth = 1.0;
|
||||
|
||||
class DesktopOverlay : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Q_PROPERTY( double rightMovement READ getCurrentRightMovement()
|
||||
WRITE setRightMovement )
|
||||
Q_PROPERTY( double forwardsMovement READ getCurrentForwardsMovement WRITE
|
||||
setForwardsMovement )
|
||||
Q_PROPERTY( double width READ getCurrentWidth WRITE setWidth )
|
||||
Q_PROPERTY( double height READ getCurrentHeight WRITE setHeight )
|
||||
|
||||
DesktopOverlay();
|
||||
|
||||
Q_INVOKABLE void update();
|
||||
|
||||
bool isAvailable() const;
|
||||
|
||||
void setWidth( double width );
|
||||
double getCurrentWidth() const noexcept;
|
||||
|
||||
void setRightMovement( double distance );
|
||||
double getCurrentRightMovement() const noexcept;
|
||||
|
||||
void setForwardsMovement( double distance );
|
||||
double getCurrentForwardsMovement() const noexcept;
|
||||
|
||||
void setHeight( double height );
|
||||
double getCurrentHeight() const noexcept;
|
||||
|
||||
private:
|
||||
vr::HmdMatrix34_t getChangedMatrix( vr::HmdMatrix34_t& matrix ) const
|
||||
noexcept;
|
||||
|
||||
double m_width = defaultOverlayWidth;
|
||||
double m_forwardsMovement = defaultMovement;
|
||||
double m_rightMovement = defaultMovement;
|
||||
double m_upMovement = defaultMovement;
|
||||
};
|
||||
|
||||
} // namespace overlay
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <openvr.h>
|
||||
#include <easylogging++.h>
|
||||
#include "utils/Matrix.h"
|
||||
#include "openvr/overlay_utils.h"
|
||||
|
||||
// application namespace
|
||||
namespace advsettings
|
||||
@@ -262,6 +263,16 @@ OverlayController::OverlayController( bool desktopMode,
|
||||
QQmlEngine::setObjectOwnership(obj, QQmlEngine::CppOwnership);
|
||||
return obj;
|
||||
});
|
||||
qmlRegisterSingletonType<overlay::DesktopOverlay>(
|
||||
qmlSingletonImportName,
|
||||
1,
|
||||
0,
|
||||
"DesktopOverlay",
|
||||
[]( QQmlEngine*, QJSEngine* ) {
|
||||
QObject* obj = &( objectAddress->m_desktopOverlay );
|
||||
QQmlEngine::setObjectOwnership( obj, QQmlEngine::CppOwnership );
|
||||
return obj;
|
||||
} );
|
||||
}
|
||||
|
||||
OverlayController::~OverlayController()
|
||||
@@ -711,7 +722,7 @@ void OverlayController::mainEventLoop()
|
||||
LOG( INFO ) << "Received quit request.";
|
||||
vr::VRSystem()->AcknowledgeQuit_Exiting(); // Let us buy some
|
||||
// time just in case
|
||||
m_moveCenterTabController.reset();
|
||||
m_moveCenterTabController.shutdown();
|
||||
// Un-mute mic before Exiting VR, as it is set at system level Not
|
||||
// Vr level.
|
||||
m_audioTabController.setMicMuted( false, false );
|
||||
@@ -727,6 +738,7 @@ void OverlayController::mainEventLoop()
|
||||
case vr::VREvent_DashboardActivated:
|
||||
{
|
||||
LOG( DEBUG ) << "Dashboard activated";
|
||||
m_desktopOverlay.update();
|
||||
m_dashboardVisible = true;
|
||||
}
|
||||
break;
|
||||
@@ -748,6 +760,13 @@ void OverlayController::mainEventLoop()
|
||||
}
|
||||
break;
|
||||
|
||||
case vr::VREvent_SeatedZeroPoseReset:
|
||||
{
|
||||
m_moveCenterTabController.incomingSeatedReset();
|
||||
LOG( INFO ) << "Game Triggered Seated Zero-Position Reset";
|
||||
}
|
||||
break;
|
||||
|
||||
// Multiple ChaperoneUniverseHasChanged are often emitted at the
|
||||
// same time (some with a little bit of delay) There is no sure way
|
||||
// to recognize redundant events, we can only exclude redundant
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "tabcontrollers/VideoTabController.h"
|
||||
|
||||
#include "openvr/ivrinput.h"
|
||||
#include "openvr/overlay_utils.h"
|
||||
|
||||
namespace application_strings
|
||||
{
|
||||
@@ -61,7 +62,7 @@ namespace advsettings
|
||||
// Avoid setting values to the same numbers.
|
||||
constexpr int k_audioSettingsUpdateCounter = 89;
|
||||
constexpr int k_chaperoneSettingsUpdateCounter = 101;
|
||||
constexpr int k_moveCenterSettingsUpdateCounter = 149;
|
||||
constexpr int k_moveCenterSettingsUpdateCounter = 83;
|
||||
constexpr int k_reviveSettingsUpdateCounter = 139;
|
||||
constexpr int k_settingsTabSettingsUpdateCounter = 157;
|
||||
constexpr int k_steamVrSettingsUpdateCounter = 97;
|
||||
@@ -123,6 +124,7 @@ public: // I know it's an ugly hack to make them public to enable external
|
||||
ReviveTabController m_reviveTabController;
|
||||
UtilitiesTabController m_utilitiesTabController;
|
||||
VideoTabController m_videoTabController;
|
||||
overlay::DesktopOverlay m_desktopOverlay;
|
||||
|
||||
private:
|
||||
QPoint getMousePositionForEvent( vr::VREvent_Mouse_t mouse );
|
||||
|
||||
@@ -340,6 +340,30 @@ MyStackViewPage {
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
MyPushButton {
|
||||
id: spaceLogMatrices
|
||||
Layout.preferredWidth: 250
|
||||
visible: MoveCenterTabController.showLogMatricesButton
|
||||
text: "Log Matrices"
|
||||
onClicked: {
|
||||
MoveCenterTabController.outputLogPoses()
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton {
|
||||
id: spaceSeatedRecenter
|
||||
Layout.preferredWidth: 250
|
||||
visible: false
|
||||
text: "Seated Recenter"
|
||||
onClicked: {
|
||||
MoveCenterTabController.updateSeatedResetData()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,19 +380,14 @@ MyStackViewPage {
|
||||
lockXToggle.checked = MoveCenterTabController.lockXToggle
|
||||
lockYToggle.checked = MoveCenterTabController.lockYToggle
|
||||
lockZToggle.checked = MoveCenterTabController.lockZToggle
|
||||
spaceLogMatrices.visible = MoveCenterTabController.showLogMatricesButton
|
||||
|
||||
if (MoveCenterTabController.trackingUniverse === 0) {
|
||||
spaceModeText.text = "Sitting"
|
||||
spaceRotationPlusButton.enabled = false
|
||||
spaceRotationMinusButton.enabled = false
|
||||
spaceRotationSlider.enabled = false
|
||||
spaceRotationText.text = "-"
|
||||
spaceSeatedRecenter.visible = true
|
||||
} else if (MoveCenterTabController.trackingUniverse === 1) {
|
||||
spaceModeText.text = "Standing"
|
||||
spaceRotationPlusButton.enabled = true
|
||||
spaceRotationMinusButton.enabled = true
|
||||
spaceRotationSlider.enabled = true
|
||||
spaceRotationText.text = "0°"
|
||||
spaceSeatedRecenter.visible = false
|
||||
} else {
|
||||
spaceModeText.text = "Unknown(" + MoveCenterTabController.trackingUniverse + ")"
|
||||
}
|
||||
@@ -407,16 +426,10 @@ MyStackViewPage {
|
||||
onTrackingUniverseChanged: {
|
||||
if (MoveCenterTabController.trackingUniverse === 0) {
|
||||
spaceModeText.text = "Sitting"
|
||||
spaceRotationPlusButton.enabled = false
|
||||
spaceRotationMinusButton.enabled = false
|
||||
spaceRotationSlider.enabled = false
|
||||
spaceRotationText.text = "-"
|
||||
spaceSeatedRecenter.visible = true
|
||||
} else if (MoveCenterTabController.trackingUniverse === 1) {
|
||||
spaceModeText.text = "Standing"
|
||||
spaceRotationPlusButton.enabled = true
|
||||
spaceRotationMinusButton.enabled = true
|
||||
spaceRotationSlider.enabled = true
|
||||
spaceRotationText.text = "0°"
|
||||
spaceSeatedRecenter.visible = false
|
||||
} else {
|
||||
spaceModeText.text = "Unknown(" + MoveCenterTabController.trackingUniverse + ")"
|
||||
}
|
||||
|
||||
@@ -115,6 +115,17 @@ MyStackViewPage {
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton {
|
||||
id: desktopOverlayButton
|
||||
activationSoundEnabled: false
|
||||
text: "Desktop Overlay"
|
||||
Layout.fillWidth: true
|
||||
onClicked: {
|
||||
MyResources.playFocusChangedSound()
|
||||
mainView.push(desktopOverlayPage)
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton {
|
||||
id: statisticsButton
|
||||
activationSoundEnabled: false
|
||||
|
||||
@@ -26,6 +26,14 @@ MyStackViewPage {
|
||||
}
|
||||
}
|
||||
|
||||
MyToggleButton {
|
||||
id: allowExternalEditsToggle
|
||||
text: "Allow External App Chaperone Edits (Danger)"
|
||||
onCheckedChanged: {
|
||||
MoveCenterTabController.setAllowExternalEdits(checked, true)
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
@@ -33,6 +41,7 @@ MyStackViewPage {
|
||||
Component.onCompleted: {
|
||||
settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled
|
||||
forceReviveToggle.checked = SettingsTabController.forceRevivePage
|
||||
allowExternalEditsToggle.checked = MoveCenterTabController.allowExternalEdits
|
||||
}
|
||||
|
||||
Connections {
|
||||
@@ -44,5 +53,12 @@ MyStackViewPage {
|
||||
forceReviveToggle.checked = SettingsTabController.forceRevivePage
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: MoveCenterTabController
|
||||
onAllowExternalEditsChanged: {
|
||||
allowExternalEditsToggle.checked = MoveCenterTabController.allowExternalEdits
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
|
||||
GroupBox {
|
||||
// Public properties
|
||||
// Overload
|
||||
property alias headerMessage: headerText.text
|
||||
property alias sliderText: steamDesktopForwardText.text
|
||||
property alias sliderValue: steamDesktopForwardSlider.value
|
||||
property alias lowerLimit: steamDesktopForwardSlider.from
|
||||
property alias upperLimit: steamDesktopForwardSlider.to
|
||||
|
||||
|
||||
function onValueChanged(value) {
|
||||
|
||||
}
|
||||
|
||||
function onComponentComplete() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Private properties
|
||||
id: sliderBox
|
||||
Layout.fillWidth: true
|
||||
label: MyText {
|
||||
id: headerText
|
||||
leftPadding: 10
|
||||
text: "MISSING HEADER TEXT"
|
||||
bottomPadding: -10
|
||||
}
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
border.color: "#ffffff"
|
||||
radius: 8
|
||||
}
|
||||
|
||||
property real sliderStepSize: 0.10
|
||||
readonly property real rightLeftLimit: 4.0
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
LineSeparator {
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
RowLayout {
|
||||
MyPushButton2 {
|
||||
Layout.preferredWidth: 40
|
||||
text: "-"
|
||||
onClicked: {
|
||||
steamDesktopForwardSlider.value -= sliderStepSize
|
||||
}
|
||||
}
|
||||
|
||||
MySlider {
|
||||
id: steamDesktopForwardSlider
|
||||
from: -rightLeftLimit
|
||||
to: rightLeftLimit
|
||||
stepSize: sliderStepSize
|
||||
Layout.fillWidth: true
|
||||
onValueChanged: {
|
||||
sliderBox.onValueChanged(this.value)
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton2 {
|
||||
Layout.preferredWidth: 40
|
||||
text: "+"
|
||||
onClicked: {
|
||||
steamDesktopForwardSlider.value += sliderStepSize
|
||||
}
|
||||
}
|
||||
|
||||
MyTextField {
|
||||
id: steamDesktopForwardText
|
||||
text: "0.0"
|
||||
keyBoardUID: 611
|
||||
Layout.preferredWidth: 100
|
||||
Layout.leftMargin: 10
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Component.onCompleted: {
|
||||
sliderBox.onComponentComplete()
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import "../utilities_page"
|
||||
import "../audio_page"
|
||||
import "../motion_page"
|
||||
import "../video_page"
|
||||
import "../desktop_overlay_page"
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
@@ -76,6 +77,10 @@ Rectangle {
|
||||
stackView: mainView
|
||||
visible:false
|
||||
}
|
||||
property DesktopOverlayPage desktopOverlayPage: DesktopOverlayPage {
|
||||
stackView: mainView
|
||||
visible: false
|
||||
}
|
||||
|
||||
StackView {
|
||||
id: mainView
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "translation_left_right"
|
||||
import "translation_back_forwards"
|
||||
import "translation_up_down"
|
||||
import "desktop_size"
|
||||
import "../common"
|
||||
|
||||
MyStackViewPage {
|
||||
headerText: "Desktop Overlay"
|
||||
|
||||
content: ColumnLayout {
|
||||
spacing: 18
|
||||
|
||||
MyText {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: "Reopen overlay to apply."
|
||||
}
|
||||
|
||||
SteamDesktopGroupBox {
|
||||
}
|
||||
|
||||
SteamDesktopTranslationUpDown {
|
||||
}
|
||||
|
||||
SteamDesktopTranslationBackForwards {
|
||||
}
|
||||
|
||||
SteamDesktopTranslationLeftRight {
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "../../common"
|
||||
|
||||
FullWidthSliderBox {
|
||||
headerMessage: "Overlay Width"
|
||||
|
||||
lowerLimit: 0.0
|
||||
upperLimit: 32.0
|
||||
sliderStepSize: 0.5
|
||||
|
||||
function onValueChanged(value) {
|
||||
DesktopOverlay.width = value
|
||||
sliderText = value.toFixed(2)
|
||||
}
|
||||
function onComponentComplete() {
|
||||
sliderValue = DesktopOverlay.width
|
||||
}
|
||||
}
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "../../common"
|
||||
|
||||
FullWidthSliderBox {
|
||||
headerMessage: "Forwards/Backwards Translation"
|
||||
|
||||
lowerLimit: -4.0
|
||||
upperLimit: 4.0
|
||||
sliderStepSize: 0.10
|
||||
|
||||
function onValueChanged(value) {
|
||||
DesktopOverlay.forwardsMovement = value
|
||||
sliderText = value.toFixed(2)
|
||||
}
|
||||
function onComponentComplete() {
|
||||
sliderValue = DesktopOverlay.forwardsMovement
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "../../common"
|
||||
|
||||
FullWidthSliderBox {
|
||||
headerMessage: "Left/Right Translation"
|
||||
|
||||
lowerLimit: -4.0
|
||||
upperLimit: 4.0
|
||||
sliderStepSize: 0.10
|
||||
|
||||
function onValueChanged(value) {
|
||||
DesktopOverlay.rightMovement = value
|
||||
sliderText = value.toFixed(2)
|
||||
}
|
||||
function onComponentComplete() {
|
||||
sliderValue = DesktopOverlay.rightMovement
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "../../common"
|
||||
|
||||
FullWidthSliderBox {
|
||||
headerMessage: "Up/Down Translation"
|
||||
|
||||
lowerLimit: -4.0
|
||||
upperLimit: 4.0
|
||||
sliderStepSize: 0.10
|
||||
|
||||
function onValueChanged(value) {
|
||||
DesktopOverlay.height = value
|
||||
sliderText = value.toFixed(2)
|
||||
}
|
||||
function onComponentComplete() {
|
||||
sliderValue = DesktopOverlay.height
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "media_keys"
|
||||
import "alarm_clock"
|
||||
import "desktop_size"
|
||||
import "keyboard_utils"
|
||||
import "../common"
|
||||
|
||||
@@ -22,10 +21,6 @@ MyStackViewPage {
|
||||
id: alarmGroupBox
|
||||
}
|
||||
|
||||
SteamDesktopGroupBox {
|
||||
id: steamDesktopGroupBox
|
||||
}
|
||||
|
||||
MediaControllerKeys {
|
||||
id: mediaKeysGroupBox
|
||||
}
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import ovras.advsettings 1.0
|
||||
import "../../common"
|
||||
|
||||
GroupBox {
|
||||
id: steamDesktopGroupBox
|
||||
Layout.fillWidth: true
|
||||
|
||||
label: MyText {
|
||||
leftPadding: 10
|
||||
text: "Steam Desktop Overlay Width"
|
||||
bottomPadding: -10
|
||||
}
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
border.color: "#ffffff"
|
||||
radius: 8
|
||||
}
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
Rectangle {
|
||||
color: "#ffffff"
|
||||
height: 1
|
||||
Layout.fillWidth: true
|
||||
Layout.bottomMargin: 5
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
RowLayout {
|
||||
MyPushButton2 {
|
||||
id: steamDesktopWidthMinusButton
|
||||
Layout.preferredWidth: 40
|
||||
text: "-"
|
||||
onClicked: {
|
||||
steamDesktopWidthSlider.value -= 1.0
|
||||
}
|
||||
}
|
||||
|
||||
MySlider {
|
||||
id: steamDesktopWidthSlider
|
||||
from: 0.1
|
||||
to: 32.0
|
||||
stepSize: 0.1
|
||||
value: 1.0
|
||||
Layout.fillWidth: true
|
||||
onPositionChanged: {
|
||||
var val = this.from + ( this.position * (this.to - this.from))
|
||||
steamDesktopWidthText.text = val.toFixed(1)
|
||||
}
|
||||
onValueChanged: {
|
||||
UtilitiesTabController.setSteamDesktopOverlayWidth(value, false)
|
||||
steamDesktopWidthText.text = value.toFixed(1)
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton2 {
|
||||
id: steamDesktopWidthPlusButton
|
||||
Layout.preferredWidth: 40
|
||||
text: "+"
|
||||
onClicked: {
|
||||
steamDesktopWidthSlider.value += 1.0
|
||||
}
|
||||
}
|
||||
|
||||
MyTextField {
|
||||
id: steamDesktopWidthText
|
||||
text: "0.0"
|
||||
keyBoardUID: 611
|
||||
Layout.preferredWidth: 100
|
||||
Layout.leftMargin: 10
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
function onInputEvent(input) {
|
||||
var val = parseFloat(input)
|
||||
if (!isNaN(val)) {
|
||||
if (val < 0.1) {
|
||||
val = 0.1
|
||||
}
|
||||
steamDesktopWidthSlider.value = val
|
||||
UtilitiesTabController.setSteamDesktopOverlayWidth(val, false)
|
||||
}
|
||||
text = UtilitiesTabController.steamDesktopOverlayWidth.toFixed(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Component.onCompleted: {
|
||||
steamDesktopGroupBox.visible = UtilitiesTabController.steamDesktopOverlayAvailable
|
||||
if (steamDesktopGroupBox.visible) {
|
||||
steamDesktopWidthSlider.value = UtilitiesTabController.steamDesktopOverlayWidth
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: UtilitiesTabController
|
||||
onSteamDesktopOverlayAvailableChanged: {
|
||||
steamDesktopGroupBox.visible = UtilitiesTabController.steamDesktopOverlayAvailable
|
||||
if (steamDesktopGroupBox.visible) {
|
||||
steamDesktopWidthSlider.value = UtilitiesTabController.steamDesktopOverlayWidth
|
||||
}
|
||||
}
|
||||
onSteamDesktopOverlayWidthChanged: {
|
||||
steamDesktopWidthSlider.value = UtilitiesTabController.steamDesktopOverlayWidth
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <QString>
|
||||
|
||||
// application namespace
|
||||
namespace advsettings
|
||||
{
|
||||
class AudioTabController;
|
||||
|
||||
class KeyboardInput
|
||||
{
|
||||
public:
|
||||
virtual ~KeyboardInput() {}
|
||||
|
||||
virtual void sendKeyboardInput( QString input ) = 0;
|
||||
virtual void sendKeyboardEnter() = 0;
|
||||
virtual void sendKeyboardBackspace( const int count ) = 0;
|
||||
virtual void sendKeyboardAltTab() = 0;
|
||||
virtual void sendKeyboardAltEnter() = 0;
|
||||
virtual void sendMediaNextSong() = 0;
|
||||
virtual void sendMediaPreviousSong() = 0;
|
||||
virtual void sendMediaPausePlay() = 0;
|
||||
virtual void sendMediaStopSong() = 0;
|
||||
};
|
||||
|
||||
} // namespace advsettings
|
||||
@@ -118,6 +118,16 @@ void MoveCenterTabController::initStage1()
|
||||
{
|
||||
m_lockZToggle = value.toBool();
|
||||
}
|
||||
value = settings->value( "showLogMatricesButton", m_showLogMatricesButton );
|
||||
if ( value.isValid() && !value.isNull() )
|
||||
{
|
||||
m_showLogMatricesButton = value.toBool();
|
||||
}
|
||||
value = settings->value( "allowExternalEdits", m_allowExternalEdits );
|
||||
if ( value.isValid() && !value.isNull() )
|
||||
{
|
||||
m_allowExternalEdits = value.toBool();
|
||||
}
|
||||
settings->endGroup();
|
||||
m_lastDragUpdateTimePoint = std::chrono::steady_clock::now();
|
||||
m_lastGravityUpdateTimePoint = std::chrono::steady_clock::now();
|
||||
@@ -131,6 +141,109 @@ void MoveCenterTabController::initStage2( OverlayController* var_parent,
|
||||
this->widget = var_widget;
|
||||
}
|
||||
|
||||
void MoveCenterTabController::outputLogPoses()
|
||||
{
|
||||
vr::TrackedDevicePose_t devicePosesStanding[vr::k_unMaxTrackedDeviceCount];
|
||||
|
||||
vr::VRSystem()->GetDeviceToAbsoluteTrackingPose(
|
||||
vr::TrackingUniverseStanding,
|
||||
0.0f,
|
||||
devicePosesStanding,
|
||||
vr::k_unMaxTrackedDeviceCount );
|
||||
|
||||
vr::HmdMatrix34_t hmdStanding
|
||||
= devicePosesStanding[0].mDeviceToAbsoluteTracking;
|
||||
|
||||
LOG( INFO ) << "HMD POSE (standing universe)";
|
||||
outputLogHmdMatrix( hmdStanding );
|
||||
|
||||
vr::TrackedDevicePose_t devicePosesSeated[vr::k_unMaxTrackedDeviceCount];
|
||||
|
||||
vr::VRSystem()->GetDeviceToAbsoluteTrackingPose(
|
||||
vr::TrackingUniverseSeated,
|
||||
0.0f,
|
||||
devicePosesSeated,
|
||||
vr::k_unMaxTrackedDeviceCount );
|
||||
|
||||
vr::HmdMatrix34_t hmdSeated
|
||||
= devicePosesSeated[0].mDeviceToAbsoluteTracking;
|
||||
|
||||
LOG( INFO ) << "HMD POSE (seated universe)";
|
||||
outputLogHmdMatrix( hmdSeated );
|
||||
|
||||
auto leftHand = vr::VRSystem()->GetTrackedDeviceIndexForControllerRole(
|
||||
vr::TrackedControllerRole_LeftHand );
|
||||
auto rightHand = vr::VRSystem()->GetTrackedDeviceIndexForControllerRole(
|
||||
vr::TrackedControllerRole_RightHand );
|
||||
|
||||
vr::HmdMatrix34_t leftHandMatrix
|
||||
= devicePosesStanding[leftHand].mDeviceToAbsoluteTracking;
|
||||
vr::HmdMatrix34_t rightHandMatrix
|
||||
= devicePosesStanding[rightHand].mDeviceToAbsoluteTracking;
|
||||
|
||||
LOG( INFO ) << "LEFT Hand Controller Pose (standing universe)";
|
||||
outputLogHmdMatrix( leftHandMatrix );
|
||||
|
||||
LOG( INFO ) << "RIGHT Hand Controller Pose (standing universe)";
|
||||
outputLogHmdMatrix( rightHandMatrix );
|
||||
|
||||
vr::HmdMatrix34_t standingZero;
|
||||
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
|
||||
&standingZero );
|
||||
LOG( INFO ) << "GetWorkingStandingZeroPoseToRawTrackingPose";
|
||||
outputLogHmdMatrix( standingZero );
|
||||
|
||||
vr::HmdMatrix34_t seatedZero;
|
||||
vr::VRChaperoneSetup()->GetWorkingSeatedZeroPoseToRawTrackingPose(
|
||||
&seatedZero );
|
||||
LOG( INFO ) << "GetWorkingSeatedZeroPoseToRawTrackingPose";
|
||||
outputLogHmdMatrix( seatedZero );
|
||||
|
||||
vr::HmdMatrix34_t seatedZeroLive;
|
||||
vr::VRChaperoneSetup()->GetLiveSeatedZeroPoseToRawTrackingPose(
|
||||
&seatedZeroLive );
|
||||
LOG( INFO ) << "GetLiveSeatedZeroPoseToRawTrackingPose";
|
||||
outputLogHmdMatrix( seatedZeroLive );
|
||||
|
||||
vr::HmdMatrix34_t seatedToStandingAbsolute
|
||||
= vr::VRSystem()->GetSeatedZeroPoseToStandingAbsoluteTrackingPose();
|
||||
LOG( INFO ) << "GetSeatedZeroPoseToStandingAbsoluteTrackingPose";
|
||||
outputLogHmdMatrix( seatedToStandingAbsolute );
|
||||
|
||||
LOG( INFO ) << "m_universeCenterForReset";
|
||||
outputLogHmdMatrix( m_universeCenterForReset );
|
||||
|
||||
LOG( INFO ) << "m_seatedCenterForReset";
|
||||
outputLogHmdMatrix( m_seatedCenterForReset );
|
||||
}
|
||||
|
||||
void MoveCenterTabController::outputLogHmdMatrix( vr::HmdMatrix34_t hmdMatrix )
|
||||
{
|
||||
LOG( INFO ) << hmdMatrix.m[0][0] << "\t\t\t" << hmdMatrix.m[0][1]
|
||||
<< "\t\t\t" << hmdMatrix.m[0][2] << "\t\t\t"
|
||||
<< hmdMatrix.m[0][3];
|
||||
LOG( INFO ) << hmdMatrix.m[1][0] << "\t\t\t" << hmdMatrix.m[1][1]
|
||||
<< "\t\t\t" << hmdMatrix.m[1][2] << "\t\t\t"
|
||||
<< hmdMatrix.m[1][3];
|
||||
LOG( INFO ) << hmdMatrix.m[2][0] << "\t\t\t" << hmdMatrix.m[2][1]
|
||||
<< "\t\t\t" << hmdMatrix.m[2][2] << "\t\t\t"
|
||||
<< hmdMatrix.m[2][3];
|
||||
|
||||
float atan2Yaw = std::atan2( hmdMatrix.m[0][2], hmdMatrix.m[2][2] );
|
||||
LOG( INFO ) << "atan2 Yaw Calculation: " << atan2Yaw << "radians "
|
||||
<< ( ( static_cast<double>( atan2Yaw )
|
||||
* k_radiansToCentidegrees )
|
||||
/ 100 )
|
||||
<< "degrees";
|
||||
|
||||
vr::HmdQuaternion_t hmdQuat = quaternion::fromHmdMatrix34( hmdMatrix );
|
||||
double hmdQuatYaw = quaternion::getYaw( hmdQuat );
|
||||
LOG( INFO ) << "Quaternion Yaw Calculation: " << hmdQuatYaw << "radians "
|
||||
<< ( ( hmdQuatYaw * k_radiansToCentidegrees ) / 100 )
|
||||
<< "degrees";
|
||||
LOG( INFO ) << "";
|
||||
}
|
||||
|
||||
int MoveCenterTabController::trackingUniverse() const
|
||||
{
|
||||
return static_cast<int>( m_trackingUniverse );
|
||||
@@ -140,7 +253,12 @@ void MoveCenterTabController::setTrackingUniverse( int value, bool notify )
|
||||
{
|
||||
if ( m_trackingUniverse != value )
|
||||
{
|
||||
reset();
|
||||
vr::VRChaperoneSetup()->HideWorkingSetPreview();
|
||||
if ( !m_roomSetupModeDetected && value == vr::TrackingUniverseStanding )
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
m_trackingUniverse = value;
|
||||
if ( notify )
|
||||
{
|
||||
@@ -207,11 +325,25 @@ void MoveCenterTabController::setRotation( int value, bool notify )
|
||||
// Get hmd pose matrix.
|
||||
vr::TrackedDevicePose_t
|
||||
devicePosesForRot[vr::k_unMaxTrackedDeviceCount];
|
||||
vr::VRSystem()->GetDeviceToAbsoluteTrackingPose(
|
||||
vr::TrackingUniverseStanding,
|
||||
0.0f,
|
||||
devicePosesForRot,
|
||||
vr::k_unMaxTrackedDeviceCount );
|
||||
|
||||
// source must be current universe
|
||||
if ( m_trackingUniverse == vr::TrackingUniverseSeated )
|
||||
{
|
||||
vr::VRSystem()->GetDeviceToAbsoluteTrackingPose(
|
||||
vr::TrackingUniverseSeated,
|
||||
0.0f,
|
||||
devicePosesForRot,
|
||||
vr::k_unMaxTrackedDeviceCount );
|
||||
}
|
||||
else
|
||||
{
|
||||
vr::VRSystem()->GetDeviceToAbsoluteTrackingPose(
|
||||
vr::TrackingUniverseStanding,
|
||||
0.0f,
|
||||
devicePosesForRot,
|
||||
vr::k_unMaxTrackedDeviceCount );
|
||||
}
|
||||
|
||||
vr::HmdMatrix34_t oldHmdPos
|
||||
= devicePosesForRot[0].mDeviceToAbsoluteTracking;
|
||||
|
||||
@@ -626,6 +758,45 @@ void MoveCenterTabController::setLockZ( bool value, bool notify )
|
||||
}
|
||||
}
|
||||
|
||||
bool MoveCenterTabController::showLogMatricesButton() const
|
||||
{
|
||||
return m_showLogMatricesButton;
|
||||
}
|
||||
|
||||
void MoveCenterTabController::setShowLogMatricesButton( bool value,
|
||||
bool notify )
|
||||
{
|
||||
m_showLogMatricesButton = value;
|
||||
auto settings = OverlayController::appSettings();
|
||||
settings->beginGroup( "playspaceSettings" );
|
||||
settings->setValue( "showLogMatricesButton", m_showLogMatricesButton );
|
||||
settings->endGroup();
|
||||
settings->sync();
|
||||
if ( notify )
|
||||
{
|
||||
emit showLogMatricesButtonChanged( m_showLogMatricesButton );
|
||||
}
|
||||
}
|
||||
|
||||
bool MoveCenterTabController::allowExternalEdits() const
|
||||
{
|
||||
return m_allowExternalEdits;
|
||||
}
|
||||
|
||||
void MoveCenterTabController::setAllowExternalEdits( bool value, bool notify )
|
||||
{
|
||||
m_allowExternalEdits = value;
|
||||
auto settings = OverlayController::appSettings();
|
||||
settings->beginGroup( "playspaceSettings" );
|
||||
settings->setValue( "allowExternalEdits", m_allowExternalEdits );
|
||||
settings->endGroup();
|
||||
settings->sync();
|
||||
if ( notify )
|
||||
{
|
||||
emit allowExternalEditsChanged( m_allowExternalEdits );
|
||||
}
|
||||
}
|
||||
|
||||
void MoveCenterTabController::modOffsetX( float value, bool notify )
|
||||
{
|
||||
if ( !m_lockXToggle )
|
||||
@@ -662,11 +833,22 @@ void MoveCenterTabController::modOffsetZ( float value, bool notify )
|
||||
}
|
||||
}
|
||||
|
||||
void MoveCenterTabController::shutdown()
|
||||
{
|
||||
reset();
|
||||
vr::VRChaperoneSetup()->HideWorkingSetPreview();
|
||||
}
|
||||
|
||||
void MoveCenterTabController::incomingSeatedReset()
|
||||
{
|
||||
updateSeatedResetData();
|
||||
}
|
||||
|
||||
void MoveCenterTabController::reset()
|
||||
{
|
||||
vr::VRChaperoneSetup()->HideWorkingSetPreview();
|
||||
m_heightToggle = false;
|
||||
emit heightToggleChanged( m_heightToggle );
|
||||
applyChaperoneResetData();
|
||||
m_oldOffsetX = 0.0f;
|
||||
m_oldOffsetY = 0.0f;
|
||||
m_oldOffsetZ = 0.0f;
|
||||
@@ -675,6 +857,7 @@ void MoveCenterTabController::reset()
|
||||
m_offsetY = 0.0f;
|
||||
m_offsetZ = 0.0f;
|
||||
m_rotation = 0;
|
||||
applyChaperoneResetData();
|
||||
emit offsetXChanged( m_offsetX );
|
||||
emit offsetYChanged( m_offsetY );
|
||||
emit offsetZChanged( m_offsetZ );
|
||||
@@ -700,9 +883,20 @@ void MoveCenterTabController::zeroOffsets()
|
||||
emit rotationChanged( m_rotation );
|
||||
updateChaperoneResetData();
|
||||
m_pendingZeroOffsets = false;
|
||||
if ( m_roomSetupModeDetected )
|
||||
{
|
||||
LOG( INFO ) << "room setup EXIT detected";
|
||||
m_roomSetupModeDetected = false;
|
||||
}
|
||||
|
||||
LOG( INFO ) << "SUCCESS: Chaperone Data Updated and Offsets zeroed out";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !m_pendingZeroOffsets )
|
||||
{
|
||||
LOG( INFO ) << "PENDING: Chaperone Data Update and Offsets zeroing";
|
||||
}
|
||||
m_pendingZeroOffsets = true;
|
||||
}
|
||||
}
|
||||
@@ -729,6 +923,46 @@ void MoveCenterTabController::clampVelocity( double* velocity )
|
||||
}
|
||||
}
|
||||
|
||||
void MoveCenterTabController::updateSeatedResetData()
|
||||
{
|
||||
reset();
|
||||
vr::VRChaperoneSetup()->RevertWorkingCopy();
|
||||
vr::TrackedDevicePose_t devicePosesStanding[vr::k_unMaxTrackedDeviceCount];
|
||||
vr::VRSystem()->GetDeviceToAbsoluteTrackingPose(
|
||||
vr::TrackingUniverseStanding,
|
||||
0.0f,
|
||||
devicePosesStanding,
|
||||
vr::k_unMaxTrackedDeviceCount );
|
||||
vr::HmdMatrix34_t hmdMatrix
|
||||
= devicePosesStanding[0].mDeviceToAbsoluteTracking;
|
||||
|
||||
vr::HmdQuaternion_t hmdQuat = quaternion::fromHmdMatrix34( hmdMatrix );
|
||||
double hmdYaw = quaternion::getYaw( hmdQuat );
|
||||
int hmdYawCentideg = static_cast<int>( hmdYaw * k_radiansToCentidegrees );
|
||||
// Keep angle within -18000 ~ 18000 centidegrees
|
||||
if ( hmdYawCentideg > 18000 )
|
||||
{
|
||||
hmdYawCentideg -= 36000;
|
||||
}
|
||||
else if ( hmdYawCentideg < -18000 )
|
||||
{
|
||||
hmdYawCentideg += 36000;
|
||||
}
|
||||
|
||||
m_seatedCenterForReset = m_universeCenterForReset;
|
||||
m_seatedHeight = hmdMatrix.m[1][3];
|
||||
m_seatedCenterForReset.m[1][3] += m_seatedHeight;
|
||||
|
||||
m_offsetX = hmdMatrix.m[0][3];
|
||||
m_offsetY = 0.0f;
|
||||
m_offsetZ = hmdMatrix.m[2][3];
|
||||
m_rotation = hmdYawCentideg;
|
||||
emit offsetXChanged( m_offsetX );
|
||||
emit offsetYChanged( m_offsetY );
|
||||
emit offsetZChanged( m_offsetZ );
|
||||
emit rotationChanged( m_rotation );
|
||||
}
|
||||
|
||||
void MoveCenterTabController::updateChaperoneResetData()
|
||||
{
|
||||
vr::VRChaperoneSetup()->HideWorkingSetPreview();
|
||||
@@ -741,50 +975,76 @@ void MoveCenterTabController::updateChaperoneResetData()
|
||||
m_collisionBoundsCountForReset = currentQuadCount;
|
||||
vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo(
|
||||
m_collisionBoundsForReset, ¤tQuadCount );
|
||||
|
||||
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
|
||||
&m_universeCenterForReset );
|
||||
float universeCenterForResetYaw = std::atan2(
|
||||
m_universeCenterForReset.m[0][2], m_universeCenterForReset.m[2][2] );
|
||||
|
||||
// we want to store m_collisionBoundsForOffset as spacially relative to
|
||||
// m_universeCenterForReset, so:
|
||||
// update seated center to standing offset by current hmd Y value.
|
||||
m_seatedCenterForReset = m_universeCenterForReset;
|
||||
vr::TrackedDevicePose_t devicePosesStanding[vr::k_unMaxTrackedDeviceCount];
|
||||
vr::VRSystem()->GetDeviceToAbsoluteTrackingPose(
|
||||
vr::TrackingUniverseStanding,
|
||||
0.0f,
|
||||
devicePosesStanding,
|
||||
vr::k_unMaxTrackedDeviceCount );
|
||||
vr::HmdMatrix34_t hmdMatrix
|
||||
= devicePosesStanding[0].mDeviceToAbsoluteTracking;
|
||||
m_seatedHeight = hmdMatrix.m[1][3];
|
||||
m_seatedCenterForReset.m[1][3] += m_seatedHeight;
|
||||
|
||||
// for every quad in the chaperone bounds...
|
||||
for ( unsigned quad = 0; quad < m_collisionBoundsCountForReset; quad++ )
|
||||
if ( m_collisionBoundsCountForReset > 0 )
|
||||
{
|
||||
// at every corner in that quad...
|
||||
for ( unsigned corner = 0; corner < 4; corner++ )
|
||||
{
|
||||
// copy from m_collisionBoundsForReset
|
||||
m_collisionBoundsForOffset[quad].vCorners[corner].v[0]
|
||||
= m_collisionBoundsForReset[quad].vCorners[corner].v[0];
|
||||
m_collisionBoundsForOffset[quad].vCorners[corner].v[1]
|
||||
= m_collisionBoundsForReset[quad].vCorners[corner].v[1];
|
||||
m_collisionBoundsForOffset[quad].vCorners[corner].v[2]
|
||||
= m_collisionBoundsForReset[quad].vCorners[corner].v[2];
|
||||
float universeCenterForResetYaw
|
||||
= std::atan2( m_universeCenterForReset.m[0][2],
|
||||
m_universeCenterForReset.m[2][2] );
|
||||
|
||||
// unrotate by universe center's yaw
|
||||
rotateFloatCoordinates(
|
||||
m_collisionBoundsForOffset[quad].vCorners[corner].v,
|
||||
-universeCenterForResetYaw );
|
||||
// we want to store m_collisionBoundsForOffset as spacially relative to
|
||||
// m_universeCenterForReset, so:
|
||||
|
||||
// for every quad in the chaperone bounds...
|
||||
for ( unsigned quad = 0; quad < m_collisionBoundsCountForReset; quad++ )
|
||||
{
|
||||
// at every corner in that quad...
|
||||
for ( unsigned corner = 0; corner < 4; corner++ )
|
||||
{
|
||||
// copy from m_collisionBoundsForReset
|
||||
m_collisionBoundsForOffset[quad].vCorners[corner].v[0]
|
||||
= m_collisionBoundsForReset[quad].vCorners[corner].v[0];
|
||||
m_collisionBoundsForOffset[quad].vCorners[corner].v[1]
|
||||
= m_collisionBoundsForReset[quad].vCorners[corner].v[1];
|
||||
m_collisionBoundsForOffset[quad].vCorners[corner].v[2]
|
||||
= m_collisionBoundsForReset[quad].vCorners[corner].v[2];
|
||||
|
||||
// unrotate by universe center's yaw
|
||||
rotateFloatCoordinates(
|
||||
m_collisionBoundsForOffset[quad].vCorners[corner].v,
|
||||
-universeCenterForResetYaw );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// update the working set preview for potential Oculus and WMR issues
|
||||
vr::VRChaperoneSetup()->ShowWorkingSetPreview();
|
||||
// vr::VRChaperoneSetup()->ShowWorkingSetPreview();
|
||||
}
|
||||
|
||||
void MoveCenterTabController::applyChaperoneResetData()
|
||||
{
|
||||
vr::VRChaperoneSetup()->HideWorkingSetPreview();
|
||||
vr::VRChaperoneSetup()->RevertWorkingCopy();
|
||||
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(
|
||||
m_collisionBoundsForReset, m_collisionBoundsCountForReset );
|
||||
if ( m_collisionBoundsCountForReset > 0 )
|
||||
{
|
||||
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(
|
||||
m_collisionBoundsForReset, m_collisionBoundsCountForReset );
|
||||
}
|
||||
vr::VRChaperoneSetup()->SetWorkingStandingZeroPoseToRawTrackingPose(
|
||||
&m_universeCenterForReset );
|
||||
vr::VRChaperoneSetup()->SetWorkingSeatedZeroPoseToRawTrackingPose(
|
||||
&m_seatedCenterForReset );
|
||||
|
||||
vr::VRChaperoneSetup()->CommitWorkingCopy( vr::EChaperoneConfigFile_Live );
|
||||
// update the working set preview otherwise Oculus and WMR users may not see
|
||||
// results of the reset
|
||||
vr::VRChaperoneSetup()->ShowWorkingSetPreview();
|
||||
// vr::VRChaperoneSetup()->ShowWorkingSetPreview();
|
||||
}
|
||||
|
||||
// START of drag bindings:
|
||||
@@ -1492,10 +1752,14 @@ void MoveCenterTabController::saveUncommittedChaperone()
|
||||
{
|
||||
if ( !m_chaperoneCommitted )
|
||||
{
|
||||
// double commit... once to ensure before we HideWorkingSetPreview the
|
||||
// working set is synced. Commit a second time as a workaround for WMR
|
||||
// and Rift not getting the commit during active ShowWorkingSetPreview
|
||||
vr::VRChaperoneSetup()->CommitWorkingCopy(
|
||||
vr::EChaperoneConfigFile_Live );
|
||||
vr::VRChaperoneSetup()->HideWorkingSetPreview();
|
||||
vr::VRChaperoneSetup()->CommitWorkingCopy(
|
||||
vr::EChaperoneConfigFile_Live );
|
||||
// test removal for oculus and WMR users
|
||||
// vr::VRChaperoneSetup()->HideWorkingSetPreview();
|
||||
m_chaperoneCommitted = true;
|
||||
}
|
||||
}
|
||||
@@ -1855,6 +2119,15 @@ void MoveCenterTabController::updateSpace()
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_allowExternalEdits && m_oldOffsetX == 0.0f && m_oldOffsetY == 0.0f
|
||||
&& m_oldOffsetZ == 0.0f && m_oldRotation == 0 )
|
||||
{
|
||||
vr::VRChaperoneSetup()->ReloadFromDisk( vr::EChaperoneConfigFile_Live );
|
||||
vr::VRChaperoneSetup()->CommitWorkingCopy(
|
||||
vr::EChaperoneConfigFile_Live );
|
||||
updateChaperoneResetData();
|
||||
}
|
||||
|
||||
vr::HmdMatrix34_t offsetUniverseCenter;
|
||||
|
||||
// set offsetUniverseCenter to the current angle
|
||||
@@ -1892,6 +2165,17 @@ void MoveCenterTabController::updateSpace()
|
||||
offsetUniverseCenter.m[2][3]
|
||||
+= m_universeCenterForReset.m[2][2] * m_offsetZ;
|
||||
|
||||
// keep the seated origin synced with offsets if in seated mode
|
||||
if ( m_trackingUniverse == vr::TrackingUniverseSeated )
|
||||
{
|
||||
vr::HmdMatrix34_t offsetSeatedCenter = offsetUniverseCenter;
|
||||
|
||||
offsetSeatedCenter.m[1][3] += m_seatedHeight;
|
||||
|
||||
vr::VRChaperoneSetup()->SetWorkingSeatedZeroPoseToRawTrackingPose(
|
||||
&offsetSeatedCenter );
|
||||
}
|
||||
|
||||
if ( m_adjustChaperone )
|
||||
{
|
||||
// make a copy of our bounds and
|
||||
@@ -1950,9 +2234,14 @@ void MoveCenterTabController::updateSpace()
|
||||
}
|
||||
vr::VRChaperoneSetup()->SetWorkingStandingZeroPoseToRawTrackingPose(
|
||||
&offsetUniverseCenter );
|
||||
|
||||
vr::VRChaperoneSetup()->ShowWorkingSetPreview();
|
||||
m_chaperoneCommitted = false;
|
||||
|
||||
// loadChaperoneData( false ), false so that we don't load live data, and
|
||||
// reference the working set instead.
|
||||
parent->chaperoneUtils().loadChaperoneData( false );
|
||||
|
||||
m_oldOffsetX = m_offsetX;
|
||||
m_oldOffsetY = m_offsetY;
|
||||
m_oldOffsetZ = m_offsetZ;
|
||||
@@ -1964,28 +2253,58 @@ void MoveCenterTabController::eventLoopTick(
|
||||
vr::TrackedDevicePose_t* devicePoses )
|
||||
|
||||
{
|
||||
if ( settingsUpdateCounter >= k_moveCenterSettingsUpdateCounter )
|
||||
// detect if room setup is running
|
||||
if ( universe == vr::TrackingUniverseRawAndUncalibrated )
|
||||
{
|
||||
if ( parent->isDashboardVisible() )
|
||||
if ( !m_roomSetupModeDetected )
|
||||
{
|
||||
setTrackingUniverse( int( universe ) );
|
||||
m_roomSetupModeDetected = true;
|
||||
|
||||
// give up on any pending zero offsets so they aren't applied in the
|
||||
// middle of room setup.
|
||||
m_pendingZeroOffsets = false;
|
||||
|
||||
LOG( INFO ) << "room setup ENTRY detected";
|
||||
vr::VRChaperoneSetup()->HideWorkingSetPreview();
|
||||
reset();
|
||||
vr::VRChaperoneSetup()->RevertWorkingCopy();
|
||||
}
|
||||
settingsUpdateCounter = 0;
|
||||
setTrackingUniverse( int( universe ) );
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
// detect entering seated mode
|
||||
if ( universe == vr::TrackingUniverseSeated && !m_seatedModeDetected )
|
||||
{
|
||||
settingsUpdateCounter++;
|
||||
m_seatedModeDetected = true;
|
||||
LOG( INFO ) << "seated mode ENTRY detected";
|
||||
}
|
||||
|
||||
// detect exiting seated mode
|
||||
if ( universe == vr::TrackingUniverseStanding && m_seatedModeDetected )
|
||||
{
|
||||
m_seatedModeDetected = false;
|
||||
reset();
|
||||
LOG( INFO ) << "seated mode EXIT detected";
|
||||
}
|
||||
|
||||
// If we're trying to redifine the origin point, but can't becaues of bad
|
||||
// chaperone calibration, we keep trying and hold off on motion features
|
||||
// until we get ChaperoneCalibrationState_OK
|
||||
if ( m_pendingZeroOffsets )
|
||||
|
||||
// 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 )
|
||||
{
|
||||
zeroOffsets();
|
||||
// m_roomSetupModeDetected is set to false in zeroOffsets() if it's
|
||||
// successful.
|
||||
}
|
||||
else
|
||||
{
|
||||
setTrackingUniverse( int( universe ) );
|
||||
|
||||
// get current space rotation in radians
|
||||
double angle = m_rotation * k_centidegreesToRadians;
|
||||
|
||||
|
||||
@@ -68,6 +68,11 @@ class MoveCenterTabController : public QObject
|
||||
requireLockYChanged )
|
||||
Q_PROPERTY( bool lockZToggle READ lockZToggle WRITE setLockZ NOTIFY
|
||||
requireLockZChanged )
|
||||
Q_PROPERTY(
|
||||
bool showLogMatricesButton READ showLogMatricesButton WRITE
|
||||
setShowLogMatricesButton NOTIFY showLogMatricesButtonChanged )
|
||||
Q_PROPERTY( bool allowExternalEdits READ allowExternalEdits WRITE
|
||||
setAllowExternalEdits NOTIFY allowExternalEditsChanged )
|
||||
|
||||
private:
|
||||
OverlayController* parent;
|
||||
@@ -100,6 +105,7 @@ private:
|
||||
float m_gravityFloor = 0.0f;
|
||||
float m_gravityStrength = 9.8f;
|
||||
float m_flingStrength = 1.0f;
|
||||
float m_seatedHeight = 1.0f;
|
||||
bool m_momentumSave = false;
|
||||
bool m_lockXToggle = false;
|
||||
bool m_lockYToggle = false;
|
||||
@@ -138,6 +144,10 @@ private:
|
||||
bool m_chaperoneCommitted = true;
|
||||
bool m_pendingZeroOffsets = true;
|
||||
bool m_dashWasOpenPreviousFrame = false;
|
||||
bool m_roomSetupModeDetected = false;
|
||||
bool m_seatedModeDetected = false;
|
||||
bool m_showLogMatricesButton = false;
|
||||
bool m_allowExternalEdits = false;
|
||||
unsigned settingsUpdateCounter = 0;
|
||||
int m_hmdRotationStatsUpdateCounter = 0;
|
||||
unsigned m_dragComfortFrameSkipCounter = 0;
|
||||
@@ -148,6 +158,7 @@ private:
|
||||
vr::HmdQuad_t* m_collisionBoundsForReset;
|
||||
uint32_t m_collisionBoundsCountForReset = 0;
|
||||
vr::HmdMatrix34_t m_universeCenterForReset;
|
||||
vr::HmdMatrix34_t m_seatedCenterForReset;
|
||||
vr::HmdQuad_t* m_collisionBoundsForOffset;
|
||||
|
||||
void updateHmdRotationCounter( vr::TrackedDevicePose_t hmdPose,
|
||||
@@ -160,6 +171,7 @@ private:
|
||||
void updateChaperoneResetData();
|
||||
void applyChaperoneResetData();
|
||||
void saveUncommittedChaperone();
|
||||
void outputLogHmdMatrix( vr::HmdMatrix34_t hmdMatrix );
|
||||
|
||||
public:
|
||||
void initStage1();
|
||||
@@ -190,8 +202,11 @@ public:
|
||||
bool lockXToggle() const;
|
||||
bool lockYToggle() const;
|
||||
bool lockZToggle() const;
|
||||
bool showLogMatricesButton() const;
|
||||
bool allowExternalEdits() const;
|
||||
double getHmdYawTotal();
|
||||
void resetHmdYawTotal();
|
||||
void incomingSeatedReset();
|
||||
|
||||
// actions:
|
||||
void leftHandSpaceDrag( bool leftHandDragActive );
|
||||
@@ -247,8 +262,13 @@ public slots:
|
||||
void setLockX( bool value, bool notify = true );
|
||||
void setLockY( bool value, bool notify = true );
|
||||
void setLockZ( bool value, bool notify = true );
|
||||
void setShowLogMatricesButton( bool value, bool notify = true );
|
||||
void setAllowExternalEdits( bool value, bool notify = true );
|
||||
|
||||
void shutdown();
|
||||
void reset();
|
||||
void updateSeatedResetData();
|
||||
void outputLogPoses();
|
||||
void zeroOffsets();
|
||||
|
||||
signals:
|
||||
@@ -275,6 +295,8 @@ signals:
|
||||
void requireLockXChanged( bool value );
|
||||
void requireLockYChanged( bool value );
|
||||
void requireLockZChanged( bool value );
|
||||
void showLogMatricesButtonChanged( bool value );
|
||||
void allowExternalEditsChanged( bool value );
|
||||
};
|
||||
|
||||
} // namespace advsettings
|
||||
|
||||
@@ -4,37 +4,22 @@
|
||||
#include "../overlaycontroller.h"
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#ifdef _WIN32
|
||||
# include "keyboardinput/KeyboardInputWindows.h"
|
||||
#else
|
||||
# include "keyboardinput/KeyboardInputDummy.h"
|
||||
#endif
|
||||
|
||||
// application namespace
|
||||
namespace advsettings
|
||||
{
|
||||
constexpr auto steamDesktopOverlaykey = "valve.steam.desktop";
|
||||
|
||||
void UtilitiesTabController::initStage1()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
keyboardInput.reset( new KeyboardInputWindows() );
|
||||
#else
|
||||
keyboardInput.reset( new KeyboardInputDummy() );
|
||||
#endif
|
||||
auto settings = OverlayController::appSettings();
|
||||
settings->beginGroup( "utilitiesSettings" );
|
||||
auto qAlarmEnabled = settings->value( "alarmEnabled", m_alarmEnabled );
|
||||
auto qAlarmIsModal = settings->value( "alarmIsModal", m_alarmIsModal );
|
||||
auto qAlarmHour = settings->value( "alarmHour", 0 );
|
||||
auto qAlarmMinute = settings->value( "alarmMinute", 0 );
|
||||
auto qDesktopWidth = settings->value( "desktopWidth", 4.0 );
|
||||
settings->endGroup();
|
||||
m_alarmEnabled = qAlarmEnabled.toBool();
|
||||
m_alarmIsModal = qAlarmIsModal.toBool();
|
||||
m_alarmTime = QTime( qAlarmHour.toInt(), qAlarmMinute.toInt() );
|
||||
|
||||
setUpDesktopOverlay( qDesktopWidth.toFloat() );
|
||||
}
|
||||
|
||||
void UtilitiesTabController::initStage2( OverlayController* var_parent,
|
||||
@@ -46,44 +31,44 @@ void UtilitiesTabController::initStage2( OverlayController* var_parent,
|
||||
|
||||
void UtilitiesTabController::sendKeyboardInput( QString input )
|
||||
{
|
||||
keyboardInput->sendKeyboardInput( input );
|
||||
keyboardinput::sendKeyboardInput( input );
|
||||
}
|
||||
|
||||
void UtilitiesTabController::sendKeyboardEnter()
|
||||
{
|
||||
keyboardInput->sendKeyboardEnter();
|
||||
keyboardinput::sendKeyboardEnter();
|
||||
}
|
||||
|
||||
void UtilitiesTabController::sendKeyboardAltEnter()
|
||||
{
|
||||
keyboardInput->sendKeyboardAltEnter();
|
||||
keyboardinput::sendKeyboardAltEnter();
|
||||
}
|
||||
|
||||
void UtilitiesTabController::sendKeyboardAltTab()
|
||||
{
|
||||
keyboardInput->sendKeyboardAltTab();
|
||||
keyboardinput::sendKeyboardAltTab();
|
||||
}
|
||||
|
||||
void UtilitiesTabController::sendKeyboardBackspace( const int count )
|
||||
{
|
||||
keyboardInput->sendKeyboardBackspace( count );
|
||||
keyboardinput::sendKeyboardBackspace( count );
|
||||
}
|
||||
|
||||
void UtilitiesTabController::sendMediaNextSong()
|
||||
{
|
||||
keyboardInput->sendMediaNextSong();
|
||||
keyboardinput::sendMediaNextSong();
|
||||
}
|
||||
void UtilitiesTabController::sendMediaPreviousSong()
|
||||
{
|
||||
keyboardInput->sendMediaPreviousSong();
|
||||
keyboardinput::sendMediaPreviousSong();
|
||||
}
|
||||
void UtilitiesTabController::sendMediaPausePlay()
|
||||
{
|
||||
keyboardInput->sendMediaPausePlay();
|
||||
keyboardinput::sendMediaPausePlay();
|
||||
}
|
||||
void UtilitiesTabController::sendMediaStopSong()
|
||||
{
|
||||
keyboardInput->sendMediaStopSong();
|
||||
keyboardinput::sendMediaStopSong();
|
||||
}
|
||||
|
||||
bool UtilitiesTabController::alarmEnabled() const
|
||||
@@ -311,42 +296,6 @@ void UtilitiesTabController::eventLoopTick()
|
||||
{
|
||||
if ( settingsUpdateCounter >= k_utilitiesSettingsUpdateCounter )
|
||||
{
|
||||
vr::VROverlayHandle_t pOverlayHandle;
|
||||
auto error = vr::VROverlay()->FindOverlay( steamDesktopOverlaykey,
|
||||
&pOverlayHandle );
|
||||
if ( error == vr::VROverlayError_None )
|
||||
{
|
||||
if ( !m_steamDesktopOverlayAvailable )
|
||||
{
|
||||
m_steamDesktopOverlayAvailable = true;
|
||||
emit steamDesktopOverlayAvailableChanged(
|
||||
m_steamDesktopOverlayAvailable );
|
||||
}
|
||||
float width;
|
||||
error = vr::VROverlay()->GetOverlayWidthInMeters( pOverlayHandle,
|
||||
&width );
|
||||
if ( error != vr::VROverlayError_None )
|
||||
{
|
||||
LOG( ERROR )
|
||||
<< "Could not read overlay width of \""
|
||||
<< steamDesktopOverlaykey << "\": "
|
||||
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( error );
|
||||
}
|
||||
else
|
||||
{
|
||||
setSteamDesktopOverlayWidth( width, true, false );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( m_steamDesktopOverlayAvailable )
|
||||
{
|
||||
m_steamDesktopOverlayAvailable = false;
|
||||
emit steamDesktopOverlayAvailableChanged(
|
||||
m_steamDesktopOverlayAvailable );
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_alarmEnabled && m_alarmTime.isValid() )
|
||||
{
|
||||
auto now = QTime::currentTime();
|
||||
@@ -558,104 +507,4 @@ void UtilitiesTabController::eventLoopTick()
|
||||
}
|
||||
}
|
||||
|
||||
bool steamDesktopOverlayExists()
|
||||
{
|
||||
vr::VROverlayHandle_t pOverlayHandle = 0;
|
||||
auto error = vr::VROverlay()->FindOverlay( steamDesktopOverlaykey,
|
||||
&pOverlayHandle );
|
||||
if ( error != vr::VROverlayError_None )
|
||||
{
|
||||
LOG( DEBUG ) << "Could not find overlay \"" << steamDesktopOverlaykey
|
||||
<< "\": "
|
||||
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( error );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void UtilitiesTabController::setUpDesktopOverlay( float desktopWidthInMeters )
|
||||
{
|
||||
auto setOverlayVariablesSuccess = [this, desktopWidthInMeters]() {
|
||||
m_steamDesktopOverlayAvailable = true;
|
||||
setSteamDesktopOverlayWidth( desktopWidthInMeters, true, true );
|
||||
LOG( INFO ) << "Found overlay \"" << steamDesktopOverlaykey << "\".";
|
||||
};
|
||||
|
||||
if ( steamDesktopOverlayExists() )
|
||||
{
|
||||
setOverlayVariablesSuccess();
|
||||
return;
|
||||
}
|
||||
|
||||
constexpr auto timeBetweenAdditionalAttempts = std::chrono::seconds( 1 );
|
||||
constexpr auto maxAttempts = 7;
|
||||
for ( int attempts = 0; attempts < maxAttempts; ++attempts )
|
||||
{
|
||||
std::this_thread::sleep_for( timeBetweenAdditionalAttempts );
|
||||
if ( steamDesktopOverlayExists() )
|
||||
{
|
||||
setOverlayVariablesSuccess();
|
||||
return;
|
||||
}
|
||||
}
|
||||
LOG( INFO ) << "Could not find overlay \"" << steamDesktopOverlaykey
|
||||
<< "\" after " << maxAttempts << " extra attempts.";
|
||||
}
|
||||
|
||||
bool UtilitiesTabController::steamDesktopOverlayAvailable() const
|
||||
{
|
||||
return m_steamDesktopOverlayAvailable;
|
||||
}
|
||||
|
||||
float UtilitiesTabController::steamDesktopOverlayWidth() const
|
||||
{
|
||||
return m_steamDesktopOverlayWidth;
|
||||
}
|
||||
|
||||
void UtilitiesTabController::setSteamDesktopOverlayWidth( float width,
|
||||
bool notify,
|
||||
bool notifyOpenVr )
|
||||
{
|
||||
if ( std::abs( m_steamDesktopOverlayWidth - width ) > 0.01f )
|
||||
{
|
||||
m_steamDesktopOverlayWidth = width;
|
||||
|
||||
auto settings = OverlayController::appSettings();
|
||||
settings->beginGroup( "utilitiesSettings" );
|
||||
settings->setValue( "desktopWidth", m_steamDesktopOverlayWidth );
|
||||
settings->endGroup();
|
||||
|
||||
if ( notifyOpenVr )
|
||||
{
|
||||
vr::VROverlayHandle_t pOverlayHandle;
|
||||
auto error = vr::VROverlay()->FindOverlay( steamDesktopOverlaykey,
|
||||
&pOverlayHandle );
|
||||
if ( error != vr::VROverlayError_None )
|
||||
{
|
||||
LOG( ERROR )
|
||||
<< "Could not find overlay \"" << steamDesktopOverlaykey
|
||||
<< "\": "
|
||||
<< vr::VROverlay()->GetOverlayErrorNameFromEnum( error );
|
||||
}
|
||||
else
|
||||
{
|
||||
error = vr::VROverlay()->SetOverlayWidthInMeters(
|
||||
pOverlayHandle, m_steamDesktopOverlayWidth );
|
||||
if ( error != vr::VROverlayError_None )
|
||||
{
|
||||
LOG( ERROR )
|
||||
<< "Could not modify overlay width of \""
|
||||
<< steamDesktopOverlaykey << "\": "
|
||||
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
|
||||
error );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( notify )
|
||||
{
|
||||
emit steamDesktopOverlayWidthChanged( m_steamDesktopOverlayWidth );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace advsettings
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <QTime>
|
||||
#include <openvr.h>
|
||||
#include <memory>
|
||||
#include "KeyboardInput.h"
|
||||
#include "keyboardinput/KeyboardInput.h"
|
||||
|
||||
class QQuickWindow;
|
||||
// application namespace
|
||||
@@ -25,16 +25,8 @@ class UtilitiesTabController : public QObject
|
||||
NOTIFY alarmTimeHourChanged )
|
||||
Q_PROPERTY( int alarmTimeMinute READ alarmTimeMinute WRITE
|
||||
setAlarmTimeMinute NOTIFY alarmTimeMinuteChanged )
|
||||
Q_PROPERTY(
|
||||
bool steamDesktopOverlayAvailable READ steamDesktopOverlayAvailable
|
||||
NOTIFY steamDesktopOverlayAvailableChanged )
|
||||
Q_PROPERTY(
|
||||
float steamDesktopOverlayWidth READ steamDesktopOverlayWidth WRITE
|
||||
setSteamDesktopOverlayWidth NOTIFY steamDesktopOverlayWidthChanged )
|
||||
|
||||
private:
|
||||
void setUpDesktopOverlay( float desktopWidthInMeters );
|
||||
|
||||
OverlayController* m_parent;
|
||||
QQuickWindow* m_widget;
|
||||
|
||||
@@ -44,15 +36,12 @@ private:
|
||||
bool m_alarmIsModal = true;
|
||||
QTime m_alarmTime;
|
||||
QTime m_alarmLastCheckTime;
|
||||
bool m_steamDesktopOverlayAvailable = false;
|
||||
float m_steamDesktopOverlayWidth = 4.0f;
|
||||
|
||||
vr::VROverlayHandle_t m_batteryOverlayHandles[vr::k_unMaxTrackedDeviceCount]
|
||||
= { 0 };
|
||||
int m_batteryState[vr::k_unMaxTrackedDeviceCount];
|
||||
bool m_batteryVisible[vr::k_unMaxTrackedDeviceCount];
|
||||
|
||||
std::unique_ptr<KeyboardInput> keyboardInput;
|
||||
|
||||
public:
|
||||
void initStage1();
|
||||
void initStage2( OverlayController* var_parent, QQuickWindow* var_widget );
|
||||
@@ -64,9 +53,6 @@ public:
|
||||
int alarmTimeHour() const;
|
||||
int alarmTimeMinute() const;
|
||||
|
||||
bool steamDesktopOverlayAvailable() const;
|
||||
float steamDesktopOverlayWidth() const;
|
||||
|
||||
public slots:
|
||||
void sendKeyboardInput( QString input );
|
||||
void sendKeyboardEnter();
|
||||
@@ -86,18 +72,11 @@ public slots:
|
||||
void modAlarmTimeHour( int value, bool notify = true );
|
||||
void modAlarmTimeMinute( int value, bool notify = true );
|
||||
|
||||
void setSteamDesktopOverlayWidth( float width,
|
||||
bool notify = true,
|
||||
bool notifyOpenVr = true );
|
||||
|
||||
signals:
|
||||
void alarmEnabledChanged( bool enabled );
|
||||
void alarmIsModalChanged( bool modal );
|
||||
void alarmTimeHourChanged( int hour );
|
||||
void alarmTimeMinuteChanged( int min );
|
||||
|
||||
void steamDesktopOverlayAvailableChanged( bool available );
|
||||
void steamDesktopOverlayWidthChanged( float width );
|
||||
};
|
||||
|
||||
} // namespace advsettings
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <QString>
|
||||
|
||||
namespace keyboardinput
|
||||
{
|
||||
void sendKeyboardInput( QString input );
|
||||
void sendKeyboardEnter();
|
||||
void sendKeyboardBackspace( const int count );
|
||||
void sendKeyboardAltTab();
|
||||
void sendKeyboardAltEnter();
|
||||
void sendMediaNextSong();
|
||||
void sendMediaPreviousSong();
|
||||
void sendMediaPausePlay();
|
||||
void sendMediaStopSong();
|
||||
|
||||
} // namespace keyboardinput
|
||||
@@ -1,56 +1,56 @@
|
||||
#include "KeyboardInputDummy.h"
|
||||
#include "KeyboardInput.h"
|
||||
|
||||
// Used to get the compiler to shut up about C4100: unreferenced formal
|
||||
// parameter. The cast is to get GCC to shut up about it.
|
||||
#define UNREFERENCED_PARAMETER( P ) static_cast<void>( ( P ) )
|
||||
|
||||
namespace advsettings
|
||||
namespace keyboardinput
|
||||
{
|
||||
void KeyboardInputDummy::sendKeyboardInput( QString input )
|
||||
void sendKeyboardInput( QString input )
|
||||
{
|
||||
// noop
|
||||
UNREFERENCED_PARAMETER( input );
|
||||
}
|
||||
|
||||
void KeyboardInputDummy::sendKeyboardEnter()
|
||||
void sendKeyboardEnter()
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
void KeyboardInputDummy::sendKeyboardBackspace( const int count )
|
||||
void sendKeyboardBackspace( const int count )
|
||||
{
|
||||
// noop
|
||||
UNREFERENCED_PARAMETER( count );
|
||||
}
|
||||
|
||||
void KeyboardInputDummy::sendKeyboardAltTab()
|
||||
void sendKeyboardAltTab()
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
void KeyboardInputDummy::sendKeyboardAltEnter()
|
||||
void sendKeyboardAltEnter()
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
void KeyboardInputDummy::sendMediaNextSong()
|
||||
void sendMediaNextSong()
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
void KeyboardInputDummy::sendMediaPreviousSong()
|
||||
void sendMediaPreviousSong()
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
void KeyboardInputDummy::sendMediaPausePlay()
|
||||
void sendMediaPausePlay()
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
void KeyboardInputDummy::sendMediaStopSong()
|
||||
void sendMediaStopSong()
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
} // namespace advsettings
|
||||
} // namespace keyboardinput
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#ifndef KEYBOARDINPUTDUMMY_H
|
||||
#define KEYBOARDINPUTDUMMY_H
|
||||
|
||||
#include "../KeyboardInput.h"
|
||||
|
||||
// application namespace
|
||||
namespace advsettings
|
||||
{
|
||||
class KeyboardInputDummy : public KeyboardInput
|
||||
{
|
||||
public:
|
||||
virtual void sendKeyboardInput( QString input ) override;
|
||||
virtual void sendKeyboardEnter() override;
|
||||
virtual void sendKeyboardBackspace( const int count ) override;
|
||||
virtual void sendKeyboardAltTab() override;
|
||||
virtual void sendKeyboardAltEnter() override;
|
||||
virtual void sendMediaNextSong() override;
|
||||
virtual void sendMediaPreviousSong() override;
|
||||
virtual void sendMediaPausePlay() override;
|
||||
virtual void sendMediaStopSong() override;
|
||||
};
|
||||
|
||||
} // namespace advsettings
|
||||
|
||||
#endif // KEYBOARDINPUTDUMMY_H
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "KeyboardInputWindows.h"
|
||||
#include "KeyboardInput.h"
|
||||
#include <Windows.h>
|
||||
#include "easylogging++.h"
|
||||
|
||||
namespace advsettings
|
||||
namespace keyboardinput
|
||||
{
|
||||
/*!
|
||||
Represents the state of a keyboard button press. Can be either Up or Down.
|
||||
@@ -127,7 +127,7 @@ void sendKeyPressAndRelease( const WORD virtualKeyCode )
|
||||
sendKeyboardInputRaw( numberOfActions, actions );
|
||||
}
|
||||
|
||||
void KeyboardInputWindows::sendKeyboardInput( QString input )
|
||||
void sendKeyboardInput( QString input )
|
||||
{
|
||||
int len = input.length();
|
||||
if ( len > 0 )
|
||||
@@ -202,7 +202,7 @@ void KeyboardInputWindows::sendKeyboardInput( QString input )
|
||||
/*!
|
||||
Sends a single Enter keypress to Windows.
|
||||
*/
|
||||
void KeyboardInputWindows::sendKeyboardEnter()
|
||||
void sendKeyboardEnter()
|
||||
{
|
||||
sendKeyPressAndRelease( VK_RETURN );
|
||||
}
|
||||
@@ -211,7 +211,7 @@ void KeyboardInputWindows::sendKeyboardEnter()
|
||||
Sends count amount of backspaces to Windows. count of 0 or below will do
|
||||
nothing.
|
||||
*/
|
||||
void KeyboardInputWindows::sendKeyboardBackspace( const int count )
|
||||
void sendKeyboardBackspace( const int count )
|
||||
{
|
||||
// We can only send a positive amount of key presses.
|
||||
if ( count <= 0 )
|
||||
@@ -232,7 +232,7 @@ Used for tabbing out of game windows blocking other programs on desktop while in
|
||||
VR. At least one use case was tabbing out of a fullscreen game to be able to use
|
||||
a music player.
|
||||
*/
|
||||
void KeyboardInputWindows::sendKeyboardAltTab()
|
||||
void sendKeyboardAltTab()
|
||||
{
|
||||
constexpr auto altKey = VK_MENU;
|
||||
constexpr auto tabKey = VK_TAB;
|
||||
@@ -256,7 +256,7 @@ Sends an Alt + Tab combination to Windows.
|
||||
Used for toggling full screen on games and various applications that appear on
|
||||
the desktop.
|
||||
*/
|
||||
void KeyboardInputWindows::sendKeyboardAltEnter()
|
||||
void sendKeyboardAltEnter()
|
||||
{
|
||||
constexpr auto altKey = VK_MENU;
|
||||
constexpr auto enterKey = VK_RETURN;
|
||||
@@ -277,7 +277,7 @@ void KeyboardInputWindows::sendKeyboardAltEnter()
|
||||
/*!
|
||||
Sends a media key Next Song button to Windows.
|
||||
*/
|
||||
void KeyboardInputWindows::sendMediaNextSong()
|
||||
void sendMediaNextSong()
|
||||
{
|
||||
sendKeyPressAndRelease( VK_MEDIA_NEXT_TRACK );
|
||||
}
|
||||
@@ -285,7 +285,7 @@ void KeyboardInputWindows::sendMediaNextSong()
|
||||
/*!
|
||||
Sends a media key Previous Song button to Windows.
|
||||
*/
|
||||
void KeyboardInputWindows::sendMediaPreviousSong()
|
||||
void sendMediaPreviousSong()
|
||||
{
|
||||
sendKeyPressAndRelease( VK_MEDIA_PREV_TRACK );
|
||||
}
|
||||
@@ -293,7 +293,7 @@ void KeyboardInputWindows::sendMediaPreviousSong()
|
||||
/*!
|
||||
Sends a media key Play/Pause button to Windows.
|
||||
*/
|
||||
void KeyboardInputWindows::sendMediaPausePlay()
|
||||
void sendMediaPausePlay()
|
||||
{
|
||||
sendKeyPressAndRelease( VK_MEDIA_PLAY_PAUSE );
|
||||
}
|
||||
@@ -301,9 +301,9 @@ void KeyboardInputWindows::sendMediaPausePlay()
|
||||
/*!
|
||||
Sends a media key Stop button to Windows.
|
||||
*/
|
||||
void KeyboardInputWindows::sendMediaStopSong()
|
||||
void sendMediaStopSong()
|
||||
{
|
||||
sendKeyPressAndRelease( VK_MEDIA_STOP );
|
||||
}
|
||||
|
||||
} // namespace advsettings
|
||||
} // namespace keyboardinput
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#ifndef KEYBOARDINPUTWINDOWS_H
|
||||
#define KEYBOARDINPUTWINDOWS_H
|
||||
|
||||
#include "../KeyboardInput.h"
|
||||
|
||||
// application namespace
|
||||
namespace advsettings
|
||||
{
|
||||
class KeyboardInputWindows : public KeyboardInput
|
||||
{
|
||||
public:
|
||||
virtual void sendKeyboardInput( QString input ) override;
|
||||
virtual void sendKeyboardEnter() override;
|
||||
virtual void sendKeyboardBackspace( const int count ) override;
|
||||
virtual void sendKeyboardAltTab() override;
|
||||
virtual void sendKeyboardAltEnter() override;
|
||||
virtual void sendMediaNextSong() override;
|
||||
virtual void sendMediaPreviousSong() override;
|
||||
virtual void sendMediaPausePlay() override;
|
||||
virtual void sendMediaStopSong() override;
|
||||
};
|
||||
|
||||
} // namespace advsettings
|
||||
|
||||
#endif // KEYBOARDINPUTWINDOWS_H
|
||||
@@ -74,10 +74,21 @@ float ChaperoneUtils::_getDistanceToChaperone(
|
||||
return distance;
|
||||
}
|
||||
|
||||
void ChaperoneUtils::loadChaperoneData()
|
||||
void ChaperoneUtils::loadChaperoneData( bool fromLiveBounds )
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock( _mutex );
|
||||
vr::VRChaperoneSetup()->GetLiveCollisionBoundsInfo( nullptr, &_quadsCount );
|
||||
|
||||
if ( fromLiveBounds )
|
||||
{
|
||||
vr::VRChaperoneSetup()->GetLiveCollisionBoundsInfo( nullptr,
|
||||
&_quadsCount );
|
||||
}
|
||||
else
|
||||
{
|
||||
vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo( nullptr,
|
||||
&_quadsCount );
|
||||
}
|
||||
|
||||
if ( _quadsCount > 0 )
|
||||
{
|
||||
std::unique_ptr<vr::HmdQuad_t> quadsBuffer(
|
||||
@@ -86,8 +97,17 @@ void ChaperoneUtils::loadChaperoneData()
|
||||
_corners.reset( reinterpret_cast<vr::HmdVector3_t*>(
|
||||
new vr::HmdQuad_t[_quadsCount] ) );
|
||||
vr::HmdVector3_t* _cornersPtr = _corners.get();
|
||||
vr::VRChaperoneSetup()->GetLiveCollisionBoundsInfo( quadsBufferPtr,
|
||||
&_quadsCount );
|
||||
if ( fromLiveBounds )
|
||||
{
|
||||
vr::VRChaperoneSetup()->GetLiveCollisionBoundsInfo( quadsBufferPtr,
|
||||
&_quadsCount );
|
||||
}
|
||||
else
|
||||
{
|
||||
vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo(
|
||||
quadsBufferPtr, &_quadsCount );
|
||||
}
|
||||
|
||||
for ( uint32_t i = 0; i < _quadsCount; i++ )
|
||||
{
|
||||
_cornersPtr[i] = quadsBufferPtr[i].vCorners[0];
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
return _mutex;
|
||||
}
|
||||
|
||||
void loadChaperoneData();
|
||||
void loadChaperoneData( bool fromLiveBounds = true );
|
||||
|
||||
float getDistanceToChaperone( const vr::HmdVector3_t& point,
|
||||
vr::HmdVector3_t* projectedPoint = nullptr,
|
||||
|
||||
+9
-10
@@ -7,28 +7,27 @@ void mainQtMessageHandler( QtMsgType type,
|
||||
const QMessageLogContext& context,
|
||||
const QString& msg )
|
||||
{
|
||||
// context contains null pointers on release builds. Cast to get rid of
|
||||
// unreferenced formal parameter warnings.
|
||||
static_cast<void>( context );
|
||||
|
||||
QByteArray localMsg = msg.toLocal8Bit();
|
||||
switch ( type )
|
||||
{
|
||||
case QtDebugMsg:
|
||||
LOG( DEBUG ) << localMsg.constData() << " (" << context.file << ":"
|
||||
<< context.line << ")";
|
||||
LOG( DEBUG ) << "QTMSGH: " << localMsg.constData();
|
||||
break;
|
||||
case QtInfoMsg:
|
||||
LOG( INFO ) << localMsg.constData() << " (" << context.file << ":"
|
||||
<< context.line << ")";
|
||||
LOG( INFO ) << "QTMSGH: " << localMsg.constData();
|
||||
break;
|
||||
case QtWarningMsg:
|
||||
LOG( WARNING ) << localMsg.constData() << " (" << context.file << ":"
|
||||
<< context.line << ")";
|
||||
LOG( WARNING ) << "QTMSGH: " << localMsg.constData();
|
||||
break;
|
||||
case QtCriticalMsg:
|
||||
LOG( ERROR ) << localMsg.constData() << " (" << context.file << ":"
|
||||
<< context.line << ")";
|
||||
LOG( ERROR ) << "QTMSGH: " << localMsg.constData();
|
||||
break;
|
||||
case QtFatalMsg:
|
||||
LOG( FATAL ) << localMsg.constData() << " (" << context.file << ":"
|
||||
<< context.line << ")";
|
||||
LOG( FATAL ) << "QTMSGH: " << localMsg.constData();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user