You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Moved all skeletal control nodes to start out Upgrade Note: Modules containing custom animation nodes will need to have a dependency on the new "AnimGraphRuntime" module added to their Build.cs file #codereview lina.halper [CL 2582755 by Michael Noland in Main branch]
79 lines
2.4 KiB
C++
79 lines
2.4 KiB
C++
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "AnimNode_SkeletalControlBase.h"
|
|
#include "AnimNode_BoneDrivenController.generated.h"
|
|
|
|
// Evaluation of the bone transforms relies on the size and ordering of this
|
|
// enum, if this needs to change make sure EvaluateBoneTransforms is updated.
|
|
UENUM()
|
|
namespace EComponentType
|
|
{
|
|
enum Type
|
|
{
|
|
None = 0,
|
|
TranslationX,
|
|
TranslationY,
|
|
TranslationZ,
|
|
RotationX,
|
|
RotationY,
|
|
RotationZ,
|
|
Scale
|
|
};
|
|
}
|
|
|
|
USTRUCT()
|
|
struct ANIMGRAPHRUNTIME_API FAnimNode_BoneDrivenController : public FAnimNode_SkeletalControlBase
|
|
{
|
|
GENERATED_USTRUCT_BODY()
|
|
|
|
// Bone to use as controller input
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Bones)
|
|
FBoneReference SourceBone;
|
|
|
|
// Bone to drive using controller input
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Bones)
|
|
FBoneReference TargetBone;
|
|
|
|
// Transform component to use as input
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Controller)
|
|
TEnumAsByte<EComponentType::Type> SourceComponent;
|
|
|
|
// Transform component to write to
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Controller)
|
|
TEnumAsByte<EComponentType::Type> TargetComponent;
|
|
|
|
// Multiplier to apply to the input value
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Controller)
|
|
float Multiplier;
|
|
|
|
// Whether or not to use the range limits
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Range)
|
|
bool bUseRange;
|
|
|
|
// Min limit of the output value
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Range)
|
|
float RangeMin;
|
|
|
|
// Max limit of the output value
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Range)
|
|
float RangeMax;
|
|
|
|
FAnimNode_BoneDrivenController();
|
|
|
|
// FAnimNode_Base interface
|
|
virtual void GatherDebugData(FNodeDebugData& DebugData) override;
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// FAnimNode_SkeletalControlBase interface
|
|
virtual void EvaluateBoneTransforms(USkeletalMeshComponent* SkelComp, FCSPose<FCompactPose>& MeshBases, TArray<FBoneTransform>& OutBoneTransforms) override;
|
|
virtual bool IsValidToEvaluate(const USkeleton* Skeleton, const FBoneContainer& RequiredBones) override;
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
protected:
|
|
|
|
// FAnimNode_SkeletalControlBase interface
|
|
virtual void InitializeBoneReferences(const FBoneContainer& RequiredBones) override;
|
|
//////////////////////////////////////////////////////////////////////////
|
|
}; |