Misc Fixes (#404)
* fixed qml error for input * fixed settings save bug, fixed rotation direct input, disabled chaperone force floor bounds via profile, made some dialog boxed round @ 2 digits
This commit is contained in:
@@ -79,9 +79,9 @@ GroupBox {
|
|||||||
} else if (val > 22) {
|
} else if (val > 22) {
|
||||||
val = 22
|
val = 22
|
||||||
}
|
}
|
||||||
activationSlider.value = v;
|
activationSlider.value = val.toFixed(2);
|
||||||
}
|
}
|
||||||
text = RotationTabController.autoTurnActivationDistance;
|
text = RotationTabController.autoTurnActivationDistance.toFixed(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -136,9 +136,9 @@ GroupBox {
|
|||||||
} else if (val > 22) {
|
} else if (val > 22) {
|
||||||
val = 22
|
val = 22
|
||||||
}
|
}
|
||||||
deactivationSlider.value = v;
|
deactivationSlider.value = val.toFixed(2);
|
||||||
}
|
}
|
||||||
text = RotationTabController.autoTurnDeactivationDistance;
|
text = RotationTabController.autoTurnDeactivationDistance.toFixed(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -200,7 +200,7 @@ GroupBox {
|
|||||||
} else if (val > 1000) {
|
} else if (val > 1000) {
|
||||||
val = 1000
|
val = 1000
|
||||||
}
|
}
|
||||||
speedSlider.value = v;
|
speedSlider.value = val;
|
||||||
}
|
}
|
||||||
//converts the centidegrees to degrees
|
//converts the centidegrees to degrees
|
||||||
text = (((RotationTabController.autoTurnSpeed)/100).toFixed());
|
text = (((RotationTabController.autoTurnSpeed)/100).toFixed());
|
||||||
@@ -280,9 +280,9 @@ GroupBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
activationSlider.value = RotationTabController.autoTurnActivationDistance
|
activationSlider.value = RotationTabController.autoTurnActivationDistance.toFixed(2)
|
||||||
autoTurn.checked = RotationTabController.autoTurnEnabled
|
autoTurn.checked = RotationTabController.autoTurnEnabled
|
||||||
deactivationSlider.value = RotationTabController.autoTurnDeactivationDistance
|
deactivationSlider.value = RotationTabController.autoTurnDeactivationDistance.toFixed(2)
|
||||||
cornerAngle.checked = RotationTabController.autoTurnUseCornerAngle
|
cornerAngle.checked = RotationTabController.autoTurnUseCornerAngle
|
||||||
speedSlider.value = (RotationTabController.autoTurnSpeed/100).toFixed()
|
speedSlider.value = (RotationTabController.autoTurnSpeed/100).toFixed()
|
||||||
if(RotationTabController.autoTurnMode === 1){
|
if(RotationTabController.autoTurnMode === 1){
|
||||||
@@ -304,10 +304,10 @@ GroupBox {
|
|||||||
autoTurn.checked = RotationTabController.autoTurnEnabled
|
autoTurn.checked = RotationTabController.autoTurnEnabled
|
||||||
}
|
}
|
||||||
onAutoTurnActivationDistanceChanged: {
|
onAutoTurnActivationDistanceChanged: {
|
||||||
activationSlider.value = RotationTabController.autoTurnActivationDistance
|
activationSlider.value = RotationTabController.autoTurnActivationDistance.toFixed(2)
|
||||||
}
|
}
|
||||||
onAutoTurnDeactivationDistanceChanged:{
|
onAutoTurnDeactivationDistanceChanged:{
|
||||||
deactivationSlider.value = RotationTabController.autoTurnDeactivationDistance
|
deactivationSlider.value = RotationTabController.autoTurnDeactivationDistance.toFixed(2)
|
||||||
}
|
}
|
||||||
onAutoTurnUseCornerAngleChanged:{
|
onAutoTurnUseCornerAngleChanged:{
|
||||||
cornerAngle.checked = RotationTabController.autoTurnUseCornerAngle
|
cornerAngle.checked = RotationTabController.autoTurnUseCornerAngle
|
||||||
|
|||||||
@@ -129,6 +129,18 @@ public:
|
|||||||
{
|
{
|
||||||
setting.saveValue();
|
setting.saveValue();
|
||||||
}
|
}
|
||||||
|
for ( auto& setting : m_doubleSettings )
|
||||||
|
{
|
||||||
|
setting.saveValue();
|
||||||
|
}
|
||||||
|
for ( auto& setting : m_stringSettings )
|
||||||
|
{
|
||||||
|
setting.saveValue();
|
||||||
|
}
|
||||||
|
for ( auto& setting : m_intSettings )
|
||||||
|
{
|
||||||
|
setting.saveValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename ReturnType, typename Setting>
|
template <typename ReturnType, typename Setting>
|
||||||
|
|||||||
@@ -968,7 +968,8 @@ void ChaperoneTabController::addChaperoneProfile(
|
|||||||
profile->includesFloorBoundsMarker = includeFloorBounds;
|
profile->includesFloorBoundsMarker = includeFloorBounds;
|
||||||
if ( includeFloorBounds )
|
if ( includeFloorBounds )
|
||||||
{
|
{
|
||||||
profile->floorBoundsMarker = vr::VRSettings()->GetBool(
|
// TODO disabled until we add support on page back in
|
||||||
|
/*profile->floorBoundsMarker = vr::VRSettings()->GetBool(
|
||||||
vr::k_pch_CollisionBounds_Section,
|
vr::k_pch_CollisionBounds_Section,
|
||||||
vr::k_pch_CollisionBounds_GroundPerimeterOn_Bool,
|
vr::k_pch_CollisionBounds_GroundPerimeterOn_Bool,
|
||||||
&vrSettingsError );
|
&vrSettingsError );
|
||||||
@@ -979,7 +980,7 @@ void ChaperoneTabController::addChaperoneProfile(
|
|||||||
<< "\" setting: "
|
<< "\" setting: "
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
||||||
vrSettingsError );
|
vrSettingsError );
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
profile->includesBoundsColor = includeBoundsColor;
|
profile->includesBoundsColor = includeBoundsColor;
|
||||||
if ( includeBoundsColor )
|
if ( includeBoundsColor )
|
||||||
@@ -1107,10 +1108,12 @@ void ChaperoneTabController::applyChaperoneProfile( unsigned index )
|
|||||||
}
|
}
|
||||||
if ( profile.includesFloorBoundsMarker )
|
if ( profile.includesFloorBoundsMarker )
|
||||||
{
|
{
|
||||||
vr::VRSettings()->SetBool(
|
// TODO disabled until we control it better.
|
||||||
|
/* vr::VRSettings()->SetBool(
|
||||||
vr::k_pch_CollisionBounds_Section,
|
vr::k_pch_CollisionBounds_Section,
|
||||||
vr::k_pch_CollisionBounds_GroundPerimeterOn_Bool,
|
vr::k_pch_CollisionBounds_GroundPerimeterOn_Bool,
|
||||||
profile.floorBoundsMarker );
|
profile.floorBoundsMarker );
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
if ( profile.includesBoundsColor )
|
if ( profile.includesBoundsColor )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -520,8 +520,7 @@ void RotationTabController::setAutoTurnSpeed( int value, bool notify )
|
|||||||
}
|
}
|
||||||
void RotationTabController::setAutoTurnMode( int value, bool notify )
|
void RotationTabController::setAutoTurnMode( int value, bool notify )
|
||||||
{
|
{
|
||||||
settings::setSetting( settings::IntSetting::ROTATION_autoturnMode,
|
settings::setSetting( settings::IntSetting::ROTATION_autoturnMode, value );
|
||||||
static_cast<int>( value ) );
|
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
emit autoTurnModeChanged( value );
|
emit autoTurnModeChanged( value );
|
||||||
|
|||||||
@@ -25,74 +25,6 @@ enum class AutoTurnModes
|
|||||||
LINEAR_SMOOTH_TURN
|
LINEAR_SMOOTH_TURN
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RotationProfile : settings::ISettingsObject
|
|
||||||
{
|
|
||||||
std::string profileName;
|
|
||||||
|
|
||||||
// Settings
|
|
||||||
bool autoTurnEnabled = true;
|
|
||||||
float activationDistance
|
|
||||||
= 0.4f; // TODO: Have some indicator in UI that lower values are
|
|
||||||
// more walking space
|
|
||||||
float deactivateDistance = 0.15f;
|
|
||||||
bool autoTurnUseCornerAngle = true; // Turn the exact corner of the
|
|
||||||
// angle, rather than the headset
|
|
||||||
double cordDetanglingAngle = 1000 * k_centidegreesToRadians;
|
|
||||||
double autoTurnMinCordTangle = 2 * M_PI;
|
|
||||||
int autoTurnLinearTurnSpeed = 9000; // centidegrees/sec
|
|
||||||
|
|
||||||
AutoTurnModes autoTurnMode = AutoTurnModes::LINEAR_SMOOTH_TURN;
|
|
||||||
|
|
||||||
/* 22.0: generally considered imperceptable to humans
|
|
||||||
* 11.0: light
|
|
||||||
* 5.5: strong
|
|
||||||
* 1.0: extreme
|
|
||||||
*/
|
|
||||||
bool autoTurnVestibularMotionEnabled = false;
|
|
||||||
double autoTurnVestibularMotionRadius = 11.0;
|
|
||||||
|
|
||||||
virtual settings::SettingsObjectData saveSettings() const override
|
|
||||||
{
|
|
||||||
settings::SettingsObjectData o;
|
|
||||||
o.addValue( autoTurnEnabled );
|
|
||||||
o.addValue( static_cast<double>( activationDistance ) );
|
|
||||||
o.addValue( static_cast<double>( deactivateDistance ) );
|
|
||||||
o.addValue( autoTurnUseCornerAngle );
|
|
||||||
o.addValue( cordDetanglingAngle );
|
|
||||||
o.addValue( autoTurnMinCordTangle );
|
|
||||||
o.addValue( autoTurnLinearTurnSpeed );
|
|
||||||
o.addValue( static_cast<int>( autoTurnMode ) );
|
|
||||||
o.addValue( autoTurnVestibularMotionEnabled );
|
|
||||||
o.addValue( autoTurnVestibularMotionRadius );
|
|
||||||
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void loadSettings( settings::SettingsObjectData& obj ) override
|
|
||||||
{
|
|
||||||
// Settings
|
|
||||||
autoTurnEnabled = obj.getNextValueOrDefault( true );
|
|
||||||
activationDistance
|
|
||||||
= static_cast<float>( obj.getNextValueOrDefault( 0.4 ) );
|
|
||||||
deactivateDistance
|
|
||||||
= static_cast<float>( obj.getNextValueOrDefault( 0.15 ) );
|
|
||||||
autoTurnUseCornerAngle = obj.getNextValueOrDefault( true );
|
|
||||||
cordDetanglingAngle
|
|
||||||
= obj.getNextValueOrDefault( 1000 * k_centidegreesToRadians );
|
|
||||||
autoTurnMinCordTangle = obj.getNextValueOrDefault( 2 * M_PI );
|
|
||||||
autoTurnLinearTurnSpeed = obj.getNextValueOrDefault( 9000 );
|
|
||||||
autoTurnMode = static_cast<AutoTurnModes>( obj.getNextValueOrDefault(
|
|
||||||
static_cast<int>( AutoTurnModes::LINEAR_SMOOTH_TURN ) ) );
|
|
||||||
autoTurnVestibularMotionEnabled = obj.getNextValueOrDefault( false );
|
|
||||||
autoTurnVestibularMotionRadius = obj.getNextValueOrDefault( 11.0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual std::string settingsName() const override
|
|
||||||
{
|
|
||||||
return "RotationTabController::RotationProfile";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class RotationTabController : public QObject
|
class RotationTabController : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|||||||
Reference in New Issue
Block a user