Files
UnrealEngineUWP/Engine/Source/Runtime/AnimGraphRuntime/Public/BoneControllers/BoneControllerSolvers.h
koray hagen 69e1b8a18e Stride and Orientation Warping interface cleanup for UE5 Release
#jira UE-131667, UE-132489, UE-131666
#rb aaron.cox, braeden.shosa, cesar.castro
#robomerge 5.0
#preflight 61941dbbc80d0ce51aaee5ee

[CL 18213783 by koray hagen in ue5-main branch]
2021-11-16 17:16:24 -05:00

45 lines
2.1 KiB
C

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Containers/ArrayView.h"
#include "Engine/SpringInterpolator.h"
#include "UObject/ObjectMacros.h"
#include "BoneControllerSolvers.generated.h"
USTRUCT(BlueprintInternalUseOnly)
struct ANIMGRAPHRUNTIME_API FIKFootPelvisPullDownSolver
{
GENERATED_BODY()
// Specifies the spring interpolation parameters applied during pelvis adjustment
UPROPERTY(EditAnywhere, Category = Settings)
FVectorRK4SpringInterpolator PelvisAdjustmentInterp;
// Specifies an alpha between the original and final adjusted pelvis locations
// This is used to retain some degree of the original pelvis motion
UPROPERTY(EditAnywhere, Category=Settings, meta=(ClampMin="0.0", ClampMax="1.0"))
float PelvisAdjustmentInterpAlpha = 0.5f;
// Specifies the maximum displacement the pelvis can be adjusted relative to its original location
UPROPERTY(EditAnywhere, Category=Settings, meta=(ClampMin="0.0"))
float PelvisAdjustmentMaxDistance = 10.f;
// Specifies the pelvis adjustment distance error that is tolerated for each iteration of the solver
//
// When it is detected that the pelvis adjustment distance is incrementing at a value lower or equal
// to this value for each iteration, the solve will halt. Lower values will marginally increase visual
// quality at the cost of performance, but may require a higher PelvisAdjustmentMaxIter to be specified
//
// The default value of 0.01 specifies 1 centimeter of error
UPROPERTY(EditAnywhere, Category=Advanced, meta=(ClampMin="0.001"))
float PelvisAdjustmentErrorTolerance = 0.01f;
// Specifies the maximum number of iterations to run for the pelvis adjustment solver
// Higher iterations will guarantee closer PelvisAdjustmentErrorTolerance convergence at the cost of performance
UPROPERTY(EditAnywhere, Category=Advanced, meta=(ClampMin="0"))
int32 PelvisAdjustmentMaxIter = 3;
// Iteratively pulls the character pelvis towards the ground based on the relationship of driven IK foot targets versus FK foot limits
FTransform Solve(FTransform PelvisTransform, TArrayView<const float> FKFootDistancesToPelvis, TArrayView<const FVector> IKFootLocations, float DeltaTime);
};