UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AnimNode_TwistCorrectiveNode.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "BoneContainer.h"
9#include "CommonAnimTypes.h"
10#include "BonePose.h"
12#include "AnimNode_TwistCorrectiveNode.generated.h"
13
15USTRUCT()
17{
19
20 UPROPERTY(EditAnywhere, Category = "FReferenceBoneFrame")
22
23 UPROPERTY(EditAnywhere, Category = "FReferenceBoneFrame")
25
27};
28
35USTRUCT()
37{
39
40
41 UPROPERTY(EditAnywhere, Category="Reference Frame")
43
44 // Transform component to use as input
45 UPROPERTY(EditAnywhere, Category="Reference Frame")
47
49 UPROPERTY(EditAnywhere, Category = "Reference Frame")
50 FAxis TwistPlaneNormalAxis;
51
52 // @todo since this isn't used yet, I'm commenting it out.
53 // The plan is to support mapping curve between input to output
54 //UPROPERTY(EditAnywhere, Category = "Mapping")
55 //FAlphaBlend MappingCurve;
56
57 // Maximum limit of the input value (mapped to RemappedMax, only used when limiting the source range)
58 // We can't go more than 180 right now because this is dot product driver
59 UPROPERTY(EditAnywhere, Category = "Mapping", meta = (UIMin = 0.f, ClampMin = 0.f, UIMax = 90.f, ClampMax = 90.f, DisplayName = "Max Angle In Degree"))
60 float RangeMax;
61
62 // Minimum value to apply to the destination (remapped from the input range)
63 UPROPERTY(EditAnywhere, Category = "Mapping", meta = (EditCondition = bUseRange, DisplayName = "Mapped Range Min"))
64 float RemappedMin;
65
66 // Maximum value to apply to the destination (remapped from the input range)
67 UPROPERTY(EditAnywhere, Category = "Mapping", meta = (EditCondition = bUseRange, DisplayName = "Mapped Range Max"))
68 float RemappedMax;
69
70#if WITH_EDITORONLY_DATA
71 UPROPERTY()
73#endif
74
75 UPROPERTY(EditAnywhere, Category = "Output Curve")
76 FName CurveName;
77
78public:
80
81 // FAnimNode_Base interface
82 ANIMGRAPHRUNTIME_API virtual void GatherDebugData(FNodeDebugData& DebugData) override;
85 // End of FAnimNode_Base interface
86
87 // FAnimNode_SkeletalControlBase interface
88 ANIMGRAPHRUNTIME_API virtual void EvaluateComponentSpaceInternal(FComponentSpacePoseContext& Context) override;
89 ANIMGRAPHRUNTIME_API virtual bool IsValidToEvaluate(const USkeleton* Skeleton, const FBoneContainer& RequiredBones) override;
90 // End of FAnimNode_SkeletalControlBase interface
91
92 // Type traits support
94 ANIMGRAPHRUNTIME_API void PostSerialize(const FArchive& Ar);
95
97
98 // FAnimNode_SkeletalControlBase protected interface
99 ANIMGRAPHRUNTIME_API virtual void InitializeBoneReferences(const FBoneContainer& RequiredBones) override;
100
101private:
102 // Reference Pose Angle
103 float ReferenceAngle;
104 // Ranged Max in Radian, so that we don't keep having to convert
105 float RangeMaxInRadian;
106
107 // Get Reference Axis from the MeshBases
108 FVector GetReferenceAxis(FCSPose<FCompactPose>& MeshBases, const FReferenceBoneFrame& Reference) const;
109 // Get Angle of Base, and Twist from Reference Bone Transform
110 float GetAngle(const FVector& Base, const FVector& Twist, const FTransform& ReferencetBoneTransform) const;
111};
112
113template<>
115{
116 enum
117 {
118 WithSerializer = true,
119 WithPostSerialize = true
120 };
121};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
Definition Archive.h:1208
Definition NameTypes.h:617
Definition Skeleton.h:295
Definition AnimCurveTypes.h:66
Definition AnimNode_SkeletalControlBase.h:22
Definition AnimNode_TwistCorrectiveNode.h:37
Definition AnimNodeBase.h:337
Definition AnimNodeBase.h:324
Definition CommonAnimTypes.h:14
Definition BoneContainer.h:192
Definition BoneReference.h:14
Definition BonePose.h:408
Definition BonePose.h:347
Definition AnimNodeBase.h:600
Definition AnimNodeBase.h:642
Definition AnimNode_TwistCorrectiveNode.h:17
Definition StructOpsTypeTraits.h:11
Definition StructOpsTypeTraits.h:46