Files
UnrealEngineUWP/Engine/Source/Runtime/AnimGraphRuntime/Public/BoneControllers/AnimNode_BoneDrivenController.h

87 lines
2.7 KiB
C
Raw Normal View History

// 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
};
}
/**
* This is the runtime version of a bone driven controller, which maps part of the state from one bone to another (e.g., 2 * source.x -> target.z)
*/
USTRUCT()
struct ANIMGRAPHRUNTIME_API FAnimNode_BoneDrivenController : public FAnimNode_SkeletalControlBase
{
GENERATED_USTRUCT_BODY()
// Bone to use as controller input
UPROPERTY(EditAnywhere, Category="Source (driver)")
FBoneReference SourceBone;
// Transform component to use as input
UPROPERTY(EditAnywhere, Category="Source (driver)")
TEnumAsByte<EComponentType::Type> SourceComponent;
/** Curve used to map from the source attribute to the driven attributes if present (otherwise the Multiplier will be used) */
UPROPERTY(EditAnywhere, Category=Mapping)
UCurveFloat* DrivingCurve;
// Multiplier to apply to the input value
UPROPERTY(EditAnywhere, Category=Mapping)
float Multiplier;
// Whether or not to use the range limits on the multiplied value
UPROPERTY(EditAnywhere, Category=Mapping)
bool bUseRange;
// Minimum limit of the output value
UPROPERTY(EditAnywhere, Category=Mapping, meta=(EditCondition=bUseRange))
float RangeMin;
// Maximum limit of the output value
UPROPERTY(EditAnywhere, Category=Mapping, meta=(EditCondition=bUseRange))
float RangeMax;
// Bone to drive using controller input
UPROPERTY(EditAnywhere, Category="Destination (driven)")
FBoneReference TargetBone;
// Transform component to write to
UPROPERTY(EditAnywhere, Category="Destination (driven)")
TEnumAsByte<EComponentType::Type> TargetComponent;
public:
FAnimNode_BoneDrivenController();
// FAnimNode_Base interface
virtual void GatherDebugData(FNodeDebugData& DebugData) override;
// End of FAnimNode_Base interface
// FAnimNode_SkeletalControlBase interface
Added FCompactPose, contains only the bone transforms needed by RequiredBones. Allows us to do animation evaluation without having to refer to required bones array all the time API Breaking Changes Removed Functions: FA2CSPose::SafeSetCSBoneTransforms FA2CSPose::LocalBlendCSBoneTransforms Member Type Changes: - int32 -> FCompactPoseBoneIndex --- FBoneTransform::BoneIndex --- FABRIKChainLink::BoneIndex - FA2CSPose -> FCSPose<FCompactPose> --- FAnimNode_SkeletalControlBase::ForwardedPose --- FComponentSpacePoseContext::Pose - FA2Pose -> FCompactPose --- FSlotEvaluationPose::Pose --- FAnimNode_TransitionPoseEvaluator::CachedPose --- FAnimNode_SaveCachedPose::CachedPose --- FPoseContext::Pose Paramater Changes: - FA2Pose& -> FCompactPose& --- UAnimSingleNodeInstance::InternalBlendSpaceEvaluatePose (FA2Pose& Pose -> FCompactPose&) --- UAnimInstance::SequenceEvaluatePose --- UAnimInstance::BlendSequences --- UAnimInstance::CopyPose --- UAnimInstance::ApplyAdditiveSequence --- UAnimInstance::BlendSpaceEvaluatePose --- UAnimInstance::BlendRotationOffset --- UAnimInstance::GetSlotWeight --- UAnimInstance::SlotEvaluatePose - FA2CSPose& -> FCSPose<FCompactPose>& --- FAnimNode_SkeletalControlBase::EvaluateBoneTransforms --- UAnimGraphNode_SkeletalControlBase::ConvertCSVectorToBoneSpace --- UAnimGraphNode_SkeletalControlBase::ConvertCSRotationToBoneSpace --- UAnimGraphNode_SkeletalControlBase::ConvertWidgetLocation --- UAnimPreviewInstance::ApplyBoneControllers - TArray<FTransform> -> FCompactPose --- UAnimPreviewInstance::SetKeyImplementation --- UAnimSequence::GetAnimationPose --- UAnimSequence::GetBonePose --- UAnimSequence::GetBonePose_Additive --- UAnimSequence::GetAdditiveBasePose --- UAnimSequence::GetBonePose_AdditiveMeshRotationOnly --- FAnimationRuntime::BlendPosesTogether ( + Removed NumPoses and RequiredBones ) --- FAnimationRuntime::BlendPosesTogetherPerBone ( + Removed NumPoses and RequiredBones ) --- FAnimationRuntime::BlendPosesTogetherPerBoneInMeshSpace ( + Removed NumPoses and RequiredBones ) --- FAnimationRuntime::BlendPosesPerBoneFilter ( + Removed Skeleton and RequiredBones ) --- FAnimationRuntime::GetPoseFromSequence ( + Removed RequiredBones ) --- FAnimationRuntime::GetPoseFromAnimTrack ( + Removed RequiredBones ) --- FAnimationRuntime::FillWithRetargetBaseRefPose ( + Removed RequiredBones ) --- FAnimationRuntime::ConvertPoseToAdditive ( + Removed RequiredBones ) --- FAnimationRuntime::ConvertPoseToMeshRotation ( + Removed RequiredBones ) --- FAnimationRuntime::BlendPosesAccumulate ( + Removed RequiredBones ) --- FAnimationRuntime::BlendAdditivePose ( + Removed RequiredBones ) --- FAnimationRuntime::GetPoseFromBlendSpace ( + Removed RequiredBones ) --- FAnimationRuntime::ConvertCSTransformToBoneSpace --- FAnimationRuntime::ConvertBoneSpaceTransformToCS --- FAnimationRuntime::BlendMeshPosesPerBoneWeights ( + Removed Skeleton and RequiredBones ) --- FAnimationRuntime::BlendLocalPosesPerBoneWeights ( + Removed Skeleton and RequiredBones ) - TArray<FTransform> -> FTransform --- UAnimSequence::ResetRootBoneForRootMotion - int32 -> FCompactPoseBoneIndex --- UAnimSequence::RetargetBoneTransform FAnimationRuntime: Many changes to animation operation functions, removal of NumPoses and RequiredBones, conversion of TArray<FTransform> to FCompactPose Removed USTRUCT markup from FBoneTransform Removed UPROPERTY markup from FAnimNode_TransitionPoseEvaluator::CachedPose [CL 2556671 by Martin Wilson in Main branch]
2015-05-19 06:19:22 -04:00
virtual void EvaluateBoneTransforms(USkeletalMeshComponent* SkelComp, FCSPose<FCompactPose>& MeshBases, TArray<FBoneTransform>& OutBoneTransforms) override;
virtual bool IsValidToEvaluate(const USkeleton* Skeleton, const FBoneContainer& RequiredBones) override;
// End of FAnimNode_SkeletalControlBase interface
protected:
// FAnimNode_SkeletalControlBase protected interface
virtual void InitializeBoneReferences(const FBoneContainer& RequiredBones) override;
// End of FAnimNode_SkeletalControlBase protected interface
};