2022-05-23 18:41:30 +00:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
#include "GameSettingValueScalar.h"
|
|
|
|
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "Math/UnrealMathUtility.h"
|
|
|
|
|
2022-05-23 18:41:30 +00:00
|
|
|
#define LOCTEXT_NAMESPACE "GameSetting"
|
|
|
|
|
|
|
|
//--------------------------------------
|
|
|
|
// UGameSettingValueScalar
|
|
|
|
//--------------------------------------
|
|
|
|
|
|
|
|
UGameSettingValueScalar::UGameSettingValueScalar()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void UGameSettingValueScalar::SetValueNormalized(double NormalizedValue)
|
|
|
|
{
|
|
|
|
SetValue(FMath::GetMappedRangeValueClamped(TRange<double>(0, 1), GetSourceRange(), NormalizedValue));
|
|
|
|
}
|
|
|
|
|
|
|
|
double UGameSettingValueScalar::GetValueNormalized() const
|
|
|
|
{
|
|
|
|
return FMath::GetMappedRangeValueClamped(GetSourceRange(), TRange<double>(0, 1), GetValue());
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|