// Copyright Epic Games, Inc. All Rights Reserved. #include "GameSettingValueScalar.h" #include "Math/UnrealMathUtility.h" #define LOCTEXT_NAMESPACE "GameSetting" //-------------------------------------- // UGameSettingValueScalar //-------------------------------------- UGameSettingValueScalar::UGameSettingValueScalar() { } void UGameSettingValueScalar::SetValueNormalized(double NormalizedValue) { SetValue(FMath::GetMappedRangeValueClamped(TRange(0, 1), GetSourceRange(), NormalizedValue)); } double UGameSettingValueScalar::GetValueNormalized() const { return FMath::GetMappedRangeValueClamped(GetSourceRange(), TRange(0, 1), GetValue()); } #undef LOCTEXT_NAMESPACE