You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UE-130693 #rb thomas.sarkanen, jurre.debaare, timothy.daoust #preflight 6214e672a97c2c3348cbda4c [CL 19071787 by daniel holden in ue5-main branch]
41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "AnimNodes/AnimNode_BlendSpaceEvaluator.h"
|
|
#include "Animation/BlendSpace.h"
|
|
#include "Animation/AnimTrace.h"
|
|
|
|
/////////////////////////////////////////////////////
|
|
// FAnimNode_BlendSpaceEvaluator
|
|
|
|
FAnimNode_BlendSpaceEvaluator::FAnimNode_BlendSpaceEvaluator()
|
|
: FAnimNode_BlendSpacePlayer()
|
|
, NormalizedTime(0.f)
|
|
{
|
|
}
|
|
|
|
void FAnimNode_BlendSpaceEvaluator::UpdateAssetPlayer(const FAnimationUpdateContext& Context)
|
|
{
|
|
GetEvaluateGraphExposedInputs().Execute(Context);
|
|
InternalTimeAccumulator = FMath::Clamp(NormalizedTime, 0.f, 1.f);
|
|
|
|
UpdateInternal(Context);
|
|
|
|
TRACE_ANIM_NODE_VALUE(Context, TEXT("Name"), GetBlendSpace() ? *GetBlendSpace()->GetName() : TEXT("None"));
|
|
TRACE_ANIM_NODE_VALUE(Context, TEXT("Blend Space"), GetBlendSpace());
|
|
TRACE_ANIM_NODE_VALUE(Context, TEXT("Playback Time"), InternalTimeAccumulator);
|
|
}
|
|
|
|
void FAnimNode_BlendSpaceEvaluator::GatherDebugData(FNodeDebugData& DebugData)
|
|
{
|
|
DECLARE_SCOPE_HIERARCHICAL_COUNTER_ANIMNODE(GatherDebugData)
|
|
FString DebugLine = DebugData.GetNodeName(this);
|
|
|
|
DebugLine += FString::Printf(TEXT("('%s' Play Time: %.3f)"), *GetBlendSpace()->GetName(), InternalTimeAccumulator);
|
|
DebugData.AddDebugItem(DebugLine, true);
|
|
}
|
|
|
|
float FAnimNode_BlendSpaceEvaluator::GetPlayRate() const
|
|
{
|
|
return bTeleportToNormalizedTime ? 0.0f : 1.0f;;
|
|
}
|