| 510 | } |
| 511 | |
| 512 | void UAlsxtAnimationInstance::RefreshAlsxtPose() |
| 513 | { |
| 514 | const auto& Curves{ GetProxyOnAnyThread<FAlsxtAnimationInstanceProxy>().GetAnimationCurves(EAnimCurveType::AttributeCurve) }; |
| 515 | |
| 516 | static const auto GetCurveValue{ |
| 517 | [](const TMap<FName, float>& Curves, const FName& CurveName) -> float |
| 518 | { |
| 519 | const auto* Value{Curves.Find(CurveName)}; |
| 520 | |
| 521 | return Value != nullptr ? *Value : 0.0f; |
| 522 | } |
| 523 | }; |
| 524 | |
| 525 | if (GetOwningActor()->Implements<UAlsxtCharacterInterface>()) |
| 526 | { |
| 527 | ALSXTPoseState.LeanDirection = IAlsxtCharacterInterface::Execute_GetCharacterPoseState(GetOwningActor()).LeanDirection; |
| 528 | } |
| 529 | |
| 530 | ALSXTPoseState.LeanLeftAmount = GetCurveValue(Curves, UAlsxtConstants::PoseLeanLeftCurveName()); |
| 531 | ALSXTPoseState.LeanRightAmount = GetCurveValue(Curves, UAlsxtConstants::PoseLeanRightCurveName()); |
| 532 | |
| 533 | ALSXTPoseState.CantedAmount = GetCurveValue(Curves, UAlsxtConstants::PoseCantedCurveName()); |
| 534 | |
| 535 | ALSXTPoseState.VaultingAmount = GetCurveValue(Curves, UAlsxtConstants::PoseVaultingCurveName()); |
| 536 | ALSXTPoseState.SlidingAmount = GetCurveValue(Curves, UAlsxtConstants::PoseSlidingCurveName()); |
| 537 | |
| 538 | ALSXTPoseState.WallJumpAmount = GetCurveValue(Curves, UAlsxtConstants::PoseWallJumpCurveName()); |
| 539 | ALSXTPoseState.WallRunAmount = GetCurveValue(Curves, UAlsxtConstants::PoseWallRunCurveName()); |
| 540 | |
| 541 | ALSXTPoseState.StationaryAmount = GetCurveValue(Curves, UAlsxtConstants::PoseStationaryCurveName()); |
| 542 | ALSXTPoseState.SeatedAmount = GetCurveValue(Curves, UAlsxtConstants::PoseSeatedCurveName()); |
| 543 | |
| 544 | // Use the grounded pose curve value to "unweight" the gait pose curve. This is used to |
| 545 | // instantly get the full gait value from the very beginning of transitions to grounded states. |
| 546 | |
| 547 | // PoseState.UnweightedGaitAmount = PoseState.GroundedAmount > 0.0f |
| 548 | // ? PoseState.GaitAmount / PoseState.GroundedAmount |
| 549 | // : PoseState.GaitAmount; |
| 550 | // |
| 551 | // PoseState.UnweightedGaitWalkingAmount = UAlsMath::Clamp01(PoseState.UnweightedGaitAmount); |
| 552 | // PoseState.UnweightedGaitRunningAmount = UAlsMath::Clamp01(PoseState.UnweightedGaitAmount - 1.0f); |
| 553 | // PoseState.UnweightedGaitSprintingAmount = UAlsMath::Clamp01(PoseState.UnweightedGaitAmount - 2.0f); |
| 554 | } |
| 555 | |
| 556 | void UAlsxtAnimationInstance::UpdateStatusState() |
| 557 | { |
nothing calls this directly
no outgoing calls
no test coverage detected