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:
ykeara
2020-04-12 17:08:23 -05:00
committed by GitHub
parent f138e46ceb
commit e257666085
5 changed files with 28 additions and 82 deletions
@@ -968,7 +968,8 @@ void ChaperoneTabController::addChaperoneProfile(
profile->includesFloorBoundsMarker = 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_GroundPerimeterOn_Bool,
&vrSettingsError );
@@ -979,7 +980,7 @@ void ChaperoneTabController::addChaperoneProfile(
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
}*/
}
profile->includesBoundsColor = includeBoundsColor;
if ( includeBoundsColor )
@@ -1107,10 +1108,12 @@ void ChaperoneTabController::applyChaperoneProfile( unsigned index )
}
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_GroundPerimeterOn_Bool,
profile.floorBoundsMarker );
*/
}
if ( profile.includesBoundsColor )
{
+1 -2
View File
@@ -520,8 +520,7 @@ void RotationTabController::setAutoTurnSpeed( int value, bool notify )
}
void RotationTabController::setAutoTurnMode( int value, bool notify )
{
settings::setSetting( settings::IntSetting::ROTATION_autoturnMode,
static_cast<int>( value ) );
settings::setSetting( settings::IntSetting::ROTATION_autoturnMode, value );
if ( notify )
{
emit autoTurnModeChanged( value );
@@ -25,74 +25,6 @@ enum class AutoTurnModes
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
{
Q_OBJECT