2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-07-22 14:37:24 -04:00
|
|
|
#include "AnimGraphRuntimePrivatePCH.h"
|
|
|
|
|
#include "AnimNodes/AnimNode_RotationOffsetBlendSpace.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////
|
|
|
|
|
// FAnimNode_RotationOffsetBlendSpace
|
|
|
|
|
|
|
|
|
|
void FAnimNode_RotationOffsetBlendSpace::Initialize(const FAnimationInitializeContext& Context)
|
|
|
|
|
{
|
|
|
|
|
FAnimNode_BlendSpacePlayer::Initialize(Context);
|
|
|
|
|
BasePose.Initialize(Context);
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-01 14:45:04 -04:00
|
|
|
void FAnimNode_RotationOffsetBlendSpace::CacheBones(const FAnimationCacheBonesContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
FAnimNode_BlendSpacePlayer::CacheBones(Context);
|
|
|
|
|
BasePose.CacheBones(Context);
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-11 08:47:18 -04:00
|
|
|
void FAnimNode_RotationOffsetBlendSpace::UpdateAssetPlayer(const FAnimationUpdateContext& Context)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-06-11 08:47:18 -04:00
|
|
|
FAnimNode_BlendSpacePlayer::UpdateAssetPlayer(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
BasePose.Update(Context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FAnimNode_RotationOffsetBlendSpace::Evaluate(FPoseContext& Context)
|
|
|
|
|
{
|
2015-05-20 18:27:57 -04:00
|
|
|
// Evaluate base pose
|
|
|
|
|
BasePose.Evaluate(Context);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-05-20 18:27:57 -04:00
|
|
|
// Evaluate MeshSpaceRotation additive blendspace
|
|
|
|
|
FPoseContext MeshSpaceRotationAdditivePoseContext(Context);
|
|
|
|
|
FAnimNode_BlendSpacePlayer::Evaluate(MeshSpaceRotationAdditivePoseContext);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-05-20 18:27:57 -04:00
|
|
|
// Accumulate poses together
|
2015-06-26 12:27:57 -04:00
|
|
|
FAnimationRuntime::AccumulateMeshSpaceRotationAdditiveToLocalPose(Context.Pose, MeshSpaceRotationAdditivePoseContext.Pose, Context.Curve, MeshSpaceRotationAdditivePoseContext.Curve, 1.f);
|
2015-05-20 18:27:57 -04:00
|
|
|
|
|
|
|
|
// Resulting rotations are not normalized, so normalize here.
|
|
|
|
|
Context.Pose.NormalizeRotations();
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2014-04-23 18:35:21 -04:00
|
|
|
void FAnimNode_RotationOffsetBlendSpace::GatherDebugData(FNodeDebugData& DebugData)
|
|
|
|
|
{
|
|
|
|
|
FString DebugLine = DebugData.GetNodeName(this);
|
|
|
|
|
|
|
|
|
|
DebugLine += FString::Printf(TEXT("(Play Time: %.3f)"), InternalTimeAccumulator);
|
|
|
|
|
DebugData.AddDebugItem(DebugLine);
|
|
|
|
|
|
|
|
|
|
BasePose.GatherDebugData(DebugData);
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
FAnimNode_RotationOffsetBlendSpace::FAnimNode_RotationOffsetBlendSpace()
|
|
|
|
|
{
|
|
|
|
|
}
|