// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "AnimNode_SkeletalControlBase.h" 
#include "BoneContainer.h"
#include "Animation/AnimNodeBase.h"
#include "FOHEARTBPLibrary.h"
#include "FOHEARTNetWorkManager.h"
#include "FOHEARTAnimNode.generated.h" 


USTRUCT()
struct FFOHEARTAnimNode : public FAnimNode_Base
{
	GENERATED_USTRUCT_BODY()


public:
	virtual  void Initialize_AnyThread(const FAnimationInitializeContext& Context) override;
	virtual  void Update_AnyThread(const FAnimationUpdateContext& Context) override;
	virtual  void Evaluate_AnyThread(FPoseContext& Output) override;
	//virtual  void EvaluateComponentSpace_AnyThread(FComponentSpacePoseContext& Output) override;

public:
	//  Constructor  
	FFOHEARTAnimNode();

	//UPROPERTY(EditAnywhere, Category = Links)
	//	FPoseLink BasePose;

	//Actor Name
	UPROPERTY(EditAnywhere, Category = "ActorInfo")
		FString ActorName="";

	//Foheart Actor's bone "Hips" height 95.2. Example 95.2 * scale = TargetActorHips's height.
	UPROPERTY(EditAnywhere, Category = "ActorInfo")
		float ScaleBasicFoheart = 1.0f;

	//Match Actor's bones name
	UPROPERTY(EditAnywhere, Category = "BoneMatchInfo")
		TArray<FFOHEART_C1BoneMapStruct> BoneMap;


private:
	
	AFOHEARTNetWorkManager* pNetWorkManager = nullptr;

	TMap<EFOHEART_C1BonesEnum, FCompactPoseBoneIndex> MapBoneIndex;

	AActor * OwningActor;
	TArray<FVector>		AdditionalTranslateArray;
	TArray<FRotator>	AdditionalRotatorArray;

	FVector		ActorInitialLocation;
	FRotator	ActorInitialRotation;

};
