Files
UnrealEngineUWP/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Private/StateTreeConsiderationBase.cpp
jacob wang d0a9f7e6de [State Tree] Utility Selector Editor Representation First Pass
- Editor View and Operations(debugger support not yet)
- Basic Utility Consideration Base
- Built-in Float Parameter Consideration
- Basic Blueprint Support
#rb mikko.mononen

[CL 33665793 by jacob wang in ue5-main branch]
2024-05-15 14:50:35 -04:00

19 lines
649 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "StateTreeConsiderationBase.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(StateTreeConsiderationBase)
float FStateTreeConsiderationBase::ComputeNormalizedScore(FStateTreeExecutionContext& Context) const
{
const float RawScore = ComputeRawScore(Context);
const float NormalizedScore = FMath::Clamp<float>(
FMath::GetRangePct(ResponseCurve.RawScoreLowerBound,
ResponseCurve.RawScoreUpperBound,
RawScore),
0.f, 1.f);
constexpr class UCurveFloat* OptionalCurve = nullptr;
return FAlphaBlend::AlphaToBlendOption(NormalizedScore, ResponseCurve.BlendOption, OptionalCurve);
}