static constexpr to constexpr changes
static constexpr to constexpr changes for update counters and invalid quaternions and radians conversion
This commit is contained in:
@@ -117,7 +117,7 @@ void AccessibilityTabController::eventLoopTick(
|
||||
return;
|
||||
}
|
||||
|
||||
if ( settingsUpdateCounter >= parent->k_accessibilitySettingsUpdateCounter )
|
||||
if ( settingsUpdateCounter >= k_accessibilitySettingsUpdateCounter )
|
||||
{
|
||||
if ( parent->isDashboardVisible() )
|
||||
{
|
||||
|
||||
@@ -169,7 +169,7 @@ void AudioTabController::eventLoopTick()
|
||||
return;
|
||||
}
|
||||
|
||||
if ( settingsUpdateCounter >= parent->k_audioSettingsUpdateCounter )
|
||||
if ( settingsUpdateCounter >= k_audioSettingsUpdateCounter )
|
||||
{
|
||||
if ( m_micProximitySensorCanMute )
|
||||
{
|
||||
|
||||
@@ -649,7 +649,7 @@ void ChaperoneTabController::eventLoopTick(
|
||||
}
|
||||
}
|
||||
|
||||
if ( settingsUpdateCounter >= parent->k_chaperoneSettingsUpdateCounter )
|
||||
if ( settingsUpdateCounter >= k_chaperoneSettingsUpdateCounter )
|
||||
{
|
||||
if ( parent->isDashboardVisible() )
|
||||
{
|
||||
|
||||
@@ -862,7 +862,7 @@ void MoveCenterTabController::eventLoopTick(
|
||||
vr::ETrackingUniverseOrigin universe,
|
||||
vr::TrackedDevicePose_t* devicePoses )
|
||||
{
|
||||
if ( settingsUpdateCounter >= parent->k_moveCenterSettingsUpdateCounter )
|
||||
if ( settingsUpdateCounter >= k_moveCenterSettingsUpdateCounter )
|
||||
{
|
||||
if ( parent->isDashboardVisible() )
|
||||
{
|
||||
@@ -899,7 +899,7 @@ void MoveCenterTabController::eventLoopTick(
|
||||
|
||||
// Get rotation change of hmd
|
||||
// Checking if set to -1000.0 placeholder for invalid hmd pose.
|
||||
if ( m_lastHmdQuaternion.w < -900.0 )
|
||||
if ( m_lastHmdQuaternion.w < k_quaternionUnderIsInvalidValueThreshold )
|
||||
{
|
||||
m_lastHmdQuaternion = m_hmdQuaternion;
|
||||
}
|
||||
@@ -932,27 +932,9 @@ void MoveCenterTabController::eventLoopTick(
|
||||
else
|
||||
{
|
||||
// set lastHmdQuaternion.w to placeholder -1000.0 for invalid
|
||||
m_lastHmdQuaternion.w = -1000.0;
|
||||
m_lastHmdQuaternion.w = k_quaternionInvalidValue;
|
||||
} // END of hmd rotation stats tracking
|
||||
|
||||
/*
|
||||
if ( m_activeMoveHand == vr::TrackedControllerRole_Invalid )
|
||||
{
|
||||
emit offsetXChanged( m_offsetX );
|
||||
emit offsetYChanged( m_offsetY );
|
||||
emit offsetZChanged( m_offsetZ );
|
||||
|
||||
// Set lastHandQuaternion.w to placeholder value for invalid
|
||||
(-1000.0)
|
||||
// when we release move shortcut.
|
||||
if ( m_rotateHand )
|
||||
{
|
||||
lastHandQuaternion.w = -1000.0;
|
||||
}
|
||||
m_lastMoveHand = m_activeMoveHand;
|
||||
return;
|
||||
}
|
||||
*/
|
||||
auto moveHandId = vr::VRSystem()->GetTrackedDeviceIndexForControllerRole(
|
||||
m_activeDragHand );
|
||||
auto rotateHandId = vr::VRSystem()->GetTrackedDeviceIndexForControllerRole(
|
||||
@@ -1063,9 +1045,7 @@ void MoveCenterTabController::eventLoopTick(
|
||||
{
|
||||
if ( m_lastRotateHand != vr::TrackedControllerRole_Invalid )
|
||||
{
|
||||
// Set lastHandQuaternion.w to placeholder value for invalid
|
||||
// (-1000.0)
|
||||
m_lastHandQuaternion.w = -1000.0;
|
||||
m_lastHandQuaternion.w = k_quaternionInvalidValue;
|
||||
}
|
||||
m_lastRotateHand = m_activeTurnHand;
|
||||
}
|
||||
@@ -1101,8 +1081,9 @@ void MoveCenterTabController::eventLoopTick(
|
||||
if ( m_lastRotateHand == m_activeTurnHand )
|
||||
{
|
||||
// Get rotation change of hand.
|
||||
// Checking if set to -1000.0 placeholder for invalid hand.
|
||||
if ( m_lastHandQuaternion.w < -900.0 )
|
||||
// Checking if m_lastHandQuaternion is invalid
|
||||
if ( m_lastHandQuaternion.w
|
||||
< k_quaternionUnderIsInvalidValueThreshold )
|
||||
{
|
||||
m_lastHandQuaternion = m_handQuaternion;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,11 @@ class QQuickWindow;
|
||||
namespace advsettings
|
||||
{
|
||||
// forward declaration
|
||||
constexpr double k_centidegreesToRadians = M_PI / 18000.0;
|
||||
constexpr double k_radiansToCentidegrees = 18000.0 / M_PI;
|
||||
constexpr double k_quaternionInvalidValue = -1000.0;
|
||||
constexpr double k_quaternionUnderIsInvalidValueThreshold = -900.0;
|
||||
|
||||
class OverlayController;
|
||||
|
||||
class MoveCenterTabController : public QObject
|
||||
@@ -66,10 +71,12 @@ private:
|
||||
bool m_lockZToggle = false;
|
||||
std::chrono::system_clock::time_point lastMoveButtonClick[2];
|
||||
// Set lastHandQuaternion.w to -1000.0 when last hand is invalid.
|
||||
vr::HmdQuaternion_t m_lastHandQuaternion = { -1000.0, 0.0, 0.0, 0.0 };
|
||||
vr::HmdQuaternion_t m_lastHandQuaternion
|
||||
= { k_quaternionInvalidValue, 0.0, 0.0, 0.0 };
|
||||
vr::HmdQuaternion_t m_handQuaternion;
|
||||
// Set lastHmdQuaternion.w to -1000.0 when last hmd pose is invalid.
|
||||
vr::HmdQuaternion_t m_lastHmdQuaternion = { -1000.0, 0.0, 0.0, 0.0 };
|
||||
vr::HmdQuaternion_t m_lastHmdQuaternion
|
||||
= { k_quaternionInvalidValue, 0.0, 0.0, 0.0 };
|
||||
vr::HmdQuaternion_t m_hmdQuaternion;
|
||||
double m_hmdYawTotal = 0.0;
|
||||
vr::ETrackedControllerRole m_activeDragHand
|
||||
@@ -89,8 +96,6 @@ private:
|
||||
bool m_overrideLeftHandTurnPressed = false;
|
||||
bool m_overrideRightHandTurnPressed = false;
|
||||
unsigned settingsUpdateCounter = 0;
|
||||
static constexpr double k_centidegreesToRadians = M_PI / 18000.0;
|
||||
static constexpr double k_radiansToCentidegrees = 18000.0 / M_PI;
|
||||
|
||||
public:
|
||||
void initStage1();
|
||||
|
||||
@@ -309,7 +309,7 @@ void ReviveTabController::eventLoopTick()
|
||||
if ( m_isOverlayInstalled
|
||||
|| parent->m_settingsTabController.forceRevivePage() )
|
||||
{
|
||||
if ( settingsUpdateCounter >= parent->k_reviveSettingsUpdateCounter )
|
||||
if ( settingsUpdateCounter >= k_reviveSettingsUpdateCounter )
|
||||
{
|
||||
if ( parent->isDashboardVisible() )
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ void SettingsTabController::initStage2( OverlayController* var_parent,
|
||||
|
||||
void SettingsTabController::eventLoopTick()
|
||||
{
|
||||
if ( settingsUpdateCounter >= parent->k_settingsTabSettingsUpdateCounter )
|
||||
if ( settingsUpdateCounter >= k_settingsTabSettingsUpdateCounter )
|
||||
{
|
||||
if ( parent->isDashboardVisible() )
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ void SteamVRTabController::initStage2( OverlayController* var_parent,
|
||||
|
||||
void SteamVRTabController::eventLoopTick()
|
||||
{
|
||||
if ( settingsUpdateCounter >= parent->k_steamVrSettingsUpdateCounter )
|
||||
if ( settingsUpdateCounter >= k_steamVrSettingsUpdateCounter )
|
||||
{
|
||||
if ( parent->isDashboardVisible() )
|
||||
{
|
||||
|
||||
@@ -321,7 +321,7 @@ vr::VROverlayHandle_t createBatteryOverlay( vr::TrackedDeviceIndex_t index )
|
||||
|
||||
void UtilitiesTabController::eventLoopTick()
|
||||
{
|
||||
if ( settingsUpdateCounter >= parent->k_utilitiesSettingsUpdateCounter )
|
||||
if ( settingsUpdateCounter >= k_utilitiesSettingsUpdateCounter )
|
||||
{
|
||||
vr::VROverlayHandle_t pOverlayHandle;
|
||||
auto error = vr::VROverlay()->FindOverlay( steamDesktopOverlaykey,
|
||||
|
||||
Reference in New Issue
Block a user