Space Plunder
Loading...
Searching...
No Matches
UALSCharacterAnimInstance Class Reference

#include <ALSCharacterAnimInstance.h>

Inheritance diagram for UALSCharacterAnimInstance:
ICustomAnimInstance IALSAnimInterface UCustomCharacterAnimInstance

Public Member Functions

virtual void NativeInitializeAnimation () override
 
virtual void NativeBeginPlay () override
 
virtual void NativeUpdateAnimation (float DeltaSeconds) override
 
virtual void NativeThreadSafeUpdateAnimation (float DeltaSeconds) override
 
void PlayTransition (const FALSDynamicMontageParams &Parameters)
 
void PlayTransitionChecked (const FALSDynamicMontageParams &Parameters)
 
void PlayDynamicTransition (float ReTriggerDelay, FALSDynamicMontageParams Parameters)
 
void OnJumped ()
 
void OnPivot ()
 
virtual void SetFiringWeapon (const bool bValue) override
 
virtual void SetRecoilTransform (const FTransform &Transform) override
 
virtual void SetPivotPoint (const FTransform &Transform) override
 
virtual void DisableFootIK (const float DelayTime) override
 
virtual void SetInjured (const EBodyPartName BodyPartName, const float InjuredAmount) override
 
void OnDisableFootIK (const float DelayTime)
 
void OnInjured (const EBodyPartName BodyPartName, const float InjuredAmount)
 
bool GetFiringWeapon () const
 
virtual void SetEssentialInfo (const FALSAnimValues &Value) override
 
virtual void SetOptimize (const bool bValue) override
 
virtual void SetMovementState (const FALSMovementState &Value) override
 
virtual void SetOverlayOverrideState (const int32 Value) override
 
virtual void SetGait (const FALSGait &Value) override
 
virtual void SetStance (const FALSStance &Value) override
 
virtual void SetViewMode (const EALSViewMode Value) override
 
virtual void SetOverlayState (const FALSOverlayState &Value) override
 
virtual void SetNewGroundedEntryState (const FALSGroundedEntryState &Value) override
 
virtual void SetRotationMode (const FALSRotationMode Value) override
 
FRotator GetRecoilRotation () const
 
FVector GetPivotPointLocation () const
 
bool GetShouldOverlayStateUsePRASIK () const
 
 UPROPERTY (VisibleDefaultsOnly, BlueprintReadOnly, Category="Read Only Data|Character Information", Meta=(ShowOnlyInnerProperties)) FALSAnimCharacterInformation CharacterInformation
 
 UPROPERTY (VisibleDefaultsOnly, BlueprintReadOnly, Category="Read Only Data|Anim Graph - Grounded", Meta=(ShowOnlyInnerProperties)) FALSAnimGraphGrounded Grounded
 
 UPROPERTY (VisibleDefaultsOnly, BlueprintReadOnly, Category="Read Only Data|Anim Graph - In Air", Meta=(ShowOnlyInnerProperties)) FALSAnimGraphInAir InAir
 
 UPROPERTY (VisibleDefaultsOnly, BlueprintReadOnly, Category="Read Only Data|Anim Graph - Aiming Values", Meta=(ShowOnlyInnerProperties)) FALSAnimGraphAimingValues AimingValues
 
 UPROPERTY (VisibleDefaultsOnly, BlueprintReadOnly, Category="Read Only Data|Anim Graph - Layer Blending", Meta=(ShowOnlyInnerProperties)) FALSAnimGraphLayerBlending LayerBlendingValues
 
 UPROPERTY (VisibleDefaultsOnly, BlueprintReadOnly, Category="Read Only Data|Anim Graph - Foot IK", Meta=(ShowOnlyInnerProperties)) FALSAnimGraphFootIK FootIKValues
 
 UPROPERTY (EditDefaultsOnly, BlueprintReadOnly, Category="Configuration|Turn In Place", Meta=(ShowOnlyInnerProperties)) FALSAnimTurnInPlace TurnInPlaceValues
 
 UPROPERTY (EditDefaultsOnly, BlueprintReadOnly, Category="Configuration|Rotate In Place", Meta=(ShowOnlyInnerProperties)) FALSAnimRotateInPlace RotateInPlace
 
 UPROPERTY (EditDefaultsOnly, BlueprintReadOnly, Category="Configuration|Main Configuration", Meta=(ShowOnlyInnerProperties)) FALSAnimConfiguration Config
 

Public Attributes

bool bOptimize = false
 
TObjectPtr< AALSBaseCharacterCharacter = nullptr
 
FALSMovementState MovementState = EALSMovementState::None
 
FALSMovementAction MovementAction = EALSMovementAction::None
 
FALSRotationMode RotationMode = EALSRotationMode::VelocityDirection
 
FALSGait Gait = EALSGait::Walking
 
FALSStance Stance = EALSStance::Standing
 
FALSOverlayState OverlayState = EALSOverlayState::Default
 
FALSVelocityBlend VelocityBlend
 
FALSLeanAmount LeanAmount
 
FVector RelativeAccelerationAmount = FVector::ZeroVector
 
FALSGroundedEntryState GroundedEntryState = EALSGroundedEntryState::None
 
FALSMovementDirection MovementDirection = EALSMovementDirection::Forward
 
FVector2D SmoothedAimingAngle = FVector2D::ZeroVector
 
float FlailRate = 0.0f
 
TObjectPtr< UCurveFloat > DiagonalScaleAmountCurve = nullptr
 
TObjectPtr< UCurveFloat > StrideBlend_N_Walk = nullptr
 
TObjectPtr< UCurveFloat > StrideBlend_N_Run = nullptr
 
TObjectPtr< UCurveFloat > StrideBlend_C_Walk = nullptr
 
TObjectPtr< UCurveFloat > LandPredictionCurve = nullptr
 
TObjectPtr< UCurveFloat > LeanInAirCurve = nullptr
 
TObjectPtr< UCurveVector > YawOffset_FB = nullptr
 
TObjectPtr< UCurveVector > YawOffset_LR = nullptr
 
TObjectPtr< UAnimSequenceBase > TransitionAnim_R = nullptr
 
TObjectPtr< UAnimSequenceBase > TransitionAnim_L = nullptr
 
FName IkFootL_BoneName = FName(TEXT("ik_foot_l"))
 
FName IkFootR_BoneName = FName(TEXT("ik_foot_r"))
 
FVector GunOffset = FVector::ZeroVector
 
FTransform RecoilTransform
 
FTransform PivotPoint
 
bool bFiringWeapon = false
 
EBodyPartName InjuredBodyPart = EBodyPartName::Pelvis
 
float InjuredAlpha = 0.0f
 

Protected Member Functions

void SetTrackedHipsDirection (EALSHipsDirection HipsDirection)
 
void SetGroundedEntryState (EALSGroundedEntryState NewState)
 
bool ShouldMoveCheck () const
 
bool CanRotateInPlace () const
 
bool CanTurnInPlace () const
 
bool CanDynamicTransition () const
 

Private Member Functions

void PlayDynamicTransitionDelay ()
 
void OnJumpedDelay ()
 
void OnPivotDelay ()
 
void UpdateAimingValues (float DeltaSeconds)
 
void UpdateLayerValues ()
 
void UpdateFootIK (float DeltaSeconds)
 
void UpdateMovementValues (float DeltaSeconds)
 
void UpdateRotationValues ()
 
void UpdateInAirValues (float DeltaSeconds)
 
void UpdateRagdollValues ()
 
void SetFootLocking (float DeltaSeconds, FName EnableFootIKCurve, FName FootLockCurve, FName IKFootBone, float &CurFootLockAlpha, bool &UseFootLockCurve, FVector &CurFootLockLoc, FRotator &CurFootLockRot) const
 
void SetFootLockOffsets (float DeltaSeconds, FVector &LocalLoc, FRotator &LocalRot) const
 
void SetPelvisIKOffset (float DeltaSeconds, FVector FootOffsetLTarget, FVector FootOffsetRTarget)
 
void ResetIKOffsets (float DeltaSeconds)
 
void SetFootOffsets (float DeltaSeconds, FName EnableFootIKCurve, FName IKFootBone, FName RootBone, FVector &CurLocationTarget, FVector &CurLocationOffset, FRotator &CurRotationOffset) const
 
void RotateInPlaceCheck ()
 
void TurnInPlaceCheck (float DeltaSeconds)
 
void DynamicTransitionCheck ()
 
FALSVelocityBlend CalculateVelocityBlend () const
 
void TurnInPlace (FRotator TargetRotation, float PlayRateScale, float StartTime, bool OverrideCurrent)
 
FVector CalculateRelativeAccelerationAmount () const
 
float CalculateStrideBlend () const
 
float CalculateWalkRunBlend () const
 
float CalculateStandingPlayRate () const
 
float CalculateDiagonalScaleAmount () const
 
float CalculateCrouchingPlayRate () const
 
float CalculateLandPrediction () const
 
FALSLeanAmount CalculateAirLeanAmount () const
 
EALSMovementDirection CalculateMovementDirection () const
 
float GetAnimCurveClamped (const FName &Name, float Bias, float ClampMin, float ClampMax) const
 

Private Attributes

FTimerHandle OnPivotTimer
 
FTimerHandle PlayDynamicTransitionTimer
 
FTimerHandle OnJumpedTimer
 
bool bCanPlayDynamicTransition = true
 
TObjectPtr< UALSDebugComponentALSDebugComponent = nullptr
 

Detailed Description

Main anim instance class for character

Member Function Documentation

◆ CalculateAirLeanAmount()

FALSLeanAmount UALSCharacterAnimInstance::CalculateAirLeanAmount ( ) const
private
1160{
1161 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1162 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::CalculateAirLeanAmount);
1163 // Use the relative Velocity direction and amount to determine how much the character should lean while in air.
1164 // The Lean In Air curve gets the Fall Speed and is used as a multiplier to smoothly reverse the leaning direction
1165 // when transitioning from moving upwards to moving downwards.
1166 FALSLeanAmount CalcLeanAmount;
1167 if(ensure(LeanInAirCurve))
1168 {
1169 const FVector& UnrotatedVel = CharacterInformation.CharacterActorRotation.UnrotateVector(
1170 CharacterInformation.Velocity) / 350.0f;
1171 FVector2D InversedVect(UnrotatedVel.Y, UnrotatedVel.X);
1172 InversedVect *= LeanInAirCurve->GetFloatValue(InAir.FallSpeed);
1173 CalcLeanAmount.LR = InversedVect.X;
1174 CalcLeanAmount.FB = InversedVect.Y;
1175 }
1176 return CalcLeanAmount;
1177}
TObjectPtr< UCurveFloat > LeanInAirCurve
Definition ALSCharacterAnimInstance.h:322
FALSLeanAmount CalculateAirLeanAmount() const
Definition ALSCharacterAnimInstance.cpp:1159
Definition ALSAnimationStructLibrary.h:40
float LR
Definition ALSAnimationStructLibrary.h:44
float FB
Definition ALSAnimationStructLibrary.h:47

◆ CalculateCrouchingPlayRate()

float UALSCharacterAnimInstance::CalculateCrouchingPlayRate ( ) const
private
1092{
1093 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1094 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::CalculateCrouchingPlayRate);
1095 // Calculate the Crouching Play Rate by dividing the Character's speed by the Animated Speed.
1096 // This value needs to be separate from the standing play rate to improve the blend from crouch to stand while in motion.
1097 return FMath::Clamp(
1098 CharacterInformation.Speed / Config.AnimatedCrouchSpeed / Grounded.StrideBlend / GetOwningComponent()->
1099 GetComponentScale().Z,
1100 0.0f, 2.0f);
1101}
float CalculateCrouchingPlayRate() const
Definition ALSCharacterAnimInstance.cpp:1091

◆ CalculateDiagonalScaleAmount()

float UALSCharacterAnimInstance::CalculateDiagonalScaleAmount ( ) const
private
1078{
1079 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1080 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::CalculateDiagonalScaleAmount);
1081 // Calculate the Diagonal Scale Amount. This value is used to scale the Foot IK Root bone to make the Foot IK bones
1082 // cover more distance on the diagonal blends. Without scaling, the feet would not move far enough on the diagonal
1083 // direction due to the linear translational blending of the IK bones. The curve is used to easily map the value.
1084 if (ensure(IsValid(DiagonalScaleAmountCurve)))
1085 {
1086 return DiagonalScaleAmountCurve->GetFloatValue(FMath::Abs(VelocityBlend.F + VelocityBlend.B));
1087 }
1088 return 0.0f;
1089}
TObjectPtr< UCurveFloat > DiagonalScaleAmountCurve
Definition ALSCharacterAnimInstance.h:307
float CalculateDiagonalScaleAmount() const
Definition ALSCharacterAnimInstance.cpp:1077
FALSVelocityBlend VelocityBlend
Definition ALSCharacterAnimInstance.h:248
float F
Definition ALSAnimationStructLibrary.h:56
float B
Definition ALSAnimationStructLibrary.h:59

◆ CalculateLandPrediction()

float UALSCharacterAnimInstance::CalculateLandPrediction ( ) const
private
1104{
1105 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1106 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::CalculateLandPrediction);
1107 // Calculate the land prediction weight by tracing in the velocity direction to find a walkable surface the character
1108 // is falling toward, and getting the 'Time' (range of 0-1, 1 being maximum, 0 being about to land) till impact.
1109 // The Land Prediction Curve is used to control how the time affects the final weight for a smooth blend.
1110 if (InAir.FallSpeed >= -200.0f)
1111 {
1112 return 0.0f;
1113 }
1114
1115 const UCapsuleComponent* CapsuleComp = Character->GetCapsuleComponent();
1116 const FVector& CapsuleWorldLoc = CapsuleComp->GetComponentLocation();
1117 const float VelocityZ = CharacterInformation.Velocity.Z;
1118 FVector VelocityClamped = CharacterInformation.Velocity;
1119 VelocityClamped.Z = FMath::Clamp(VelocityZ, -4000.0f, -200.0f);
1120 VelocityClamped.Normalize();
1121
1122 const FVector TraceLength = VelocityClamped * FMath::GetMappedRangeValueClamped<float, float>(
1123 {0.0f, -4000.0f}, {50.0f, 2000.0f}, VelocityZ);
1124
1125 UWorld* World = GetWorld();
1126 check(World);
1127
1128 FCollisionQueryParams Params;
1129 Params.AddIgnoredActor(Character);
1130
1131 FHitResult HitResult;
1132 const FCollisionShape CapsuleCollisionShape = FCollisionShape::MakeCapsule(CapsuleComp->GetUnscaledCapsuleRadius(),
1133 CapsuleComp->GetUnscaledCapsuleHalfHeight());
1134 const bool bHit = World->SweepSingleByChannel(HitResult, CapsuleWorldLoc, CapsuleWorldLoc + TraceLength, FQuat::Identity,
1135 ECC_Visibility, CapsuleCollisionShape, Params);
1136
1137 if (ALSDebugComponent && ALSDebugComponent->GetShowTraces())
1138 {
1140 CapsuleWorldLoc,
1141 CapsuleWorldLoc + TraceLength,
1142 CapsuleCollisionShape,
1143 EDrawDebugTrace::Type::ForOneFrame,
1144 bHit,
1145 HitResult,
1146 FLinearColor::Red,
1147 FLinearColor::Green,
1148 5.0f);
1149 }
1150
1151 if (Character->GetCharacterMovement() != nullptr && Character->GetCharacterMovement()->IsWalkable(HitResult) && ensure(IsValid(LandPredictionCurve)))
1152 {
1153 return FMath::Lerp(LandPredictionCurve->GetFloatValue(HitResult.Time), 0.0f,GetCurveValue(NAME_Mask_LandPrediction));
1154 }
1155
1156 return 0.0f;
1157}
static const FName NAME_Mask_LandPrediction(TEXT("Mask_LandPrediction"))
TObjectPtr< AALSBaseCharacter > Character
Definition ALSCharacterAnimInstance.h:217
float CalculateLandPrediction() const
Definition ALSCharacterAnimInstance.cpp:1103
TObjectPtr< UCurveFloat > LandPredictionCurve
Definition ALSCharacterAnimInstance.h:319
TObjectPtr< UALSDebugComponent > ALSDebugComponent
Definition ALSCharacterAnimInstance.h:370
static void DrawDebugCapsuleTraceSingle(const UWorld *World, const FVector &Start, const FVector &End, const FCollisionShape &CollisionShape, EDrawDebugTrace::Type DrawDebugType, bool bHit, const FHitResult &OutHit, FLinearColor TraceColor, FLinearColor TraceHitColor, float DrawTime)
Definition ALSDebugComponent.cpp:275

◆ CalculateMovementDirection()

EALSMovementDirection UALSCharacterAnimInstance::CalculateMovementDirection ( ) const
private
1180{
1181 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1182 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::CalculateMovementDirection);
1183 // Calculate the Movement Direction. This value represents the direction the character is moving relative to the camera
1184 // during the Looking Direction / Aiming rotation modes, and is used in the Cycle Blending Anim Layers to blend to the
1185 // appropriate directional states.
1187 {
1189 }
1190
1191 FRotator Delta = CharacterInformation.Velocity.ToOrientationRotator() - CharacterInformation.AimingRotation;
1192 Delta.Normalize();
1193 return UALSMathLibrary::CalculateQuadrant(MovementDirection, 70.0f, -70.0f, 110.0f, -110.0f, 5.0f, Delta.Yaw);
1194}
EALSMovementDirection CalculateMovementDirection() const
Definition ALSCharacterAnimInstance.cpp:1179
FALSMovementDirection MovementDirection
Definition ALSCharacterAnimInstance.h:260
FALSRotationMode RotationMode
Definition ALSCharacterAnimInstance.h:231
FALSGait Gait
Definition ALSCharacterAnimInstance.h:234
static EALSMovementDirection CalculateQuadrant(EALSMovementDirection Current, float FRThreshold, float FLThreshold, float BRThreshold, float BLThreshold, float Buffer, float Angle)
Definition ALSMathLibrary.cpp:83
const bool & Sprinting() const
Definition ALSStructEnumLibrary.h:265
const bool & VelocityDirection() const
Definition ALSStructEnumLibrary.h:122

◆ CalculateRelativeAccelerationAmount()

FVector UALSCharacterAnimInstance::CalculateRelativeAccelerationAmount ( ) const
private

Movement

1007{
1008 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1010 // Calculate the Relative Acceleration Amount. This value represents the current amount of acceleration / deceleration
1011 // relative to the actor rotation. It is normalized to a range of -1 to 1 so that -1 equals the Max Braking Deceleration,
1012 // and 1 equals the Max Acceleration of the Character Movement Component.
1013 if (FVector::DotProduct(CharacterInformation.Acceleration, CharacterInformation.Velocity) > 0.0f)
1014 {
1015 if(Character->GetCharacterMovement() != nullptr)
1016 {
1017 const float MaxAcc = Character->GetCharacterMovement()->GetMaxAcceleration();
1018 return CharacterInformation.CharacterActorRotation.UnrotateVector(
1019 CharacterInformation.Acceleration.GetClampedToMaxSize(MaxAcc) / MaxAcc);
1020 }
1021 }
1022 float MaxBrakingDec = 0.0f;
1023 if(Character->GetCharacterMovement() != nullptr)
1024 {
1025 MaxBrakingDec = Character->GetCharacterMovement()->GetMaxBrakingDeceleration();
1026 }
1027 return
1028 CharacterInformation.CharacterActorRotation.UnrotateVector(
1029 CharacterInformation.Acceleration.GetClampedToMaxSize(MaxBrakingDec) / MaxBrakingDec);
1030}
FVector CalculateRelativeAccelerationAmount() const
Definition ALSCharacterAnimInstance.cpp:1006

◆ CalculateStandingPlayRate()

float UALSCharacterAnimInstance::CalculateStandingPlayRate ( ) const
private
1059{
1060 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1061 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::CalculateStandingPlayRate);
1062 // Calculate the Play Rate by dividing the Character's speed by the Animated Speed for each gait.
1063 // The lerps are determined by the "W_Gait" anim curve that exists on every locomotion cycle so
1064 // that the play rate is always in sync with the currently blended animation.
1065 // The value is also divided by the Stride Blend and the mesh scale so that the play rate increases as the stride or scale gets smaller
1066 const float LerpedSpeed = FMath::Lerp(CharacterInformation.Speed / Config.AnimatedWalkSpeed,
1067 CharacterInformation.Speed / Config.AnimatedRunSpeed,
1068 GetAnimCurveClamped(NAME_W_Gait, -1.0f, 0.0f, 1.0f));
1069
1070 const float SprintAffectedSpeed = FMath::Lerp(LerpedSpeed, CharacterInformation.Speed / Config.AnimatedSprintSpeed,
1071 GetAnimCurveClamped(NAME_W_Gait, -2.0f, 0.0f, 1.0f));
1072
1073 return FMath::Clamp((SprintAffectedSpeed / Grounded.StrideBlend) / GetOwningComponent()->GetComponentScale().Z,
1074 0.0f, 3.0f);
1075}
static const FName NAME_W_Gait(TEXT("W_Gait"))
float GetAnimCurveClamped(const FName &Name, float Bias, float ClampMin, float ClampMax) const
Definition ALSCharacterAnimInstance.cpp:978
float CalculateStandingPlayRate() const
Definition ALSCharacterAnimInstance.cpp:1058

◆ CalculateStrideBlend()

float UALSCharacterAnimInstance::CalculateStrideBlend ( ) const
private
1033{
1034 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1035 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::CalculateStrideBlend);
1036 // Calculate the Stride Blend. This value is used within the blendspaces to scale the stride (distance feet travel)
1037 // so that the character can walk or run at different movement speeds.
1038 // It also allows the walk or run gait animations to blend independently while still matching the animation speed to
1039 // the movement speed, preventing the character from needing to play a half walk+half run blend.
1040 // The curves are used to map the stride amount to the speed for maximum control.
1041 const float CurveTime = CharacterInformation.Speed / GetOwningComponent()->GetComponentScale().Z;
1042 const float ClampedGait = GetAnimCurveClamped(NAME_W_Gait, -1.0, 0.0f, 1.0f);
1043 const float LerpedStrideBlend =
1044 FMath::Lerp(StrideBlend_N_Walk->GetFloatValue(CurveTime), StrideBlend_N_Run->GetFloatValue(CurveTime),
1045 ClampedGait);
1046 return FMath::Lerp(LerpedStrideBlend, StrideBlend_C_Walk->GetFloatValue(CharacterInformation.Speed),
1047 GetCurveValue(NAME_BasePose_CLF));
1048}
static const FName NAME_BasePose_CLF(TEXT("BasePose_CLF"))
TObjectPtr< UCurveFloat > StrideBlend_N_Run
Definition ALSCharacterAnimInstance.h:313
TObjectPtr< UCurveFloat > StrideBlend_C_Walk
Definition ALSCharacterAnimInstance.h:316
float CalculateStrideBlend() const
Definition ALSCharacterAnimInstance.cpp:1032
TObjectPtr< UCurveFloat > StrideBlend_N_Walk
Definition ALSCharacterAnimInstance.h:310

◆ CalculateVelocityBlend()

FALSVelocityBlend UALSCharacterAnimInstance::CalculateVelocityBlend ( ) const
private
987{
988 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
989 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::CalculateVelocityBlend);
990 // Calculate the Velocity Blend. This value represents the velocity amount of the actor in each direction (normalized so that
991 // diagonals equal .5 for each direction), and is used in a BlendMulti node to produce better
992 // directional blending than a standard blendspace.
993 const FVector LocRelativeVelocityDir =
994 CharacterInformation.CharacterActorRotation.UnrotateVector(CharacterInformation.Velocity.GetSafeNormal(0.1f));
995 const float Sum = FMath::Abs(LocRelativeVelocityDir.X) + FMath::Abs(LocRelativeVelocityDir.Y) +
996 FMath::Abs(LocRelativeVelocityDir.Z);
997 const FVector RelativeDir = LocRelativeVelocityDir / Sum;
998 FALSVelocityBlend Result;
999 Result.F = FMath::Clamp(RelativeDir.X, 0.0f, 1.0f);
1000 Result.B = FMath::Abs(FMath::Clamp(RelativeDir.X, -1.0f, 0.0f));
1001 Result.L = FMath::Abs(FMath::Clamp(RelativeDir.Y, -1.0f, 0.0f));
1002 Result.R = FMath::Clamp(RelativeDir.Y, 0.0f, 1.0f);
1003 return Result;
1004}
FALSVelocityBlend CalculateVelocityBlend() const
Definition ALSCharacterAnimInstance.cpp:986
Definition ALSAnimationStructLibrary.h:52
float R
Definition ALSAnimationStructLibrary.h:65
float L
Definition ALSAnimationStructLibrary.h:62

◆ CalculateWalkRunBlend()

float UALSCharacterAnimInstance::CalculateWalkRunBlend ( ) const
private
1051{
1052 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1053 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::CalculateWalkRunBlend);
1054 // Calculate the Walk Run Blend. This value is used within the Blendspaces to blend between walking and running.
1055 return Gait.Walking() ? 0.0f : 1.0;
1056}
float CalculateWalkRunBlend() const
Definition ALSCharacterAnimInstance.cpp:1050
const bool & Walking() const
Definition ALSStructEnumLibrary.h:263

◆ CanDynamicTransition()

bool UALSCharacterAnimInstance::CanDynamicTransition ( ) const
protected

Only perform a Dynamic Transition check if the "Enable Transition" curve is fully weighted. The Enable_Transition curve is modified within certain states of the AnimBP so that the character can only transition while in those states.

459{
460 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
461 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::CanDynamicTransition);
462 return GetCurveValue(NAME_Enable_Transition) >= 0.99f;
463}
static const FName NAME_Enable_Transition(TEXT("Enable_Transition"))
bool CanDynamicTransition() const
Definition ALSCharacterAnimInstance.cpp:458

◆ CanRotateInPlace()

bool UALSCharacterAnimInstance::CanRotateInPlace ( ) const
protected

Only perform a Rotate In Place Check if the character is Aiming or in First Person.

442{
443 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
444 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::CanRotateInPlace);
445 return RotationMode.Aiming() ||
446 CharacterInformation.ViewMode == EALSViewMode::FirstPerson;
447}
bool CanRotateInPlace() const
Definition ALSCharacterAnimInstance.cpp:441
const bool & Aiming() const
Definition ALSStructEnumLibrary.h:124

◆ CanTurnInPlace()

bool UALSCharacterAnimInstance::CanTurnInPlace ( ) const
protected

Only perform a Turn In Place check if the character is looking toward the camera in Third Person, and if the "Enable Transition" curve is fully weighted. The Enable_Transition curve is modified within certain states of the AnimBP so that the character can only turn while in those states..

450{
451 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
452 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::CanTurnInPlace);
454 CharacterInformation.ViewMode == EALSViewMode::ThirdPerson &&
455 GetCurveValue(NAME_Enable_Transition) >= 0.99f;
456}
bool CanTurnInPlace() const
Definition ALSCharacterAnimInstance.cpp:449
const bool & LookingDirection() const
Definition ALSStructEnumLibrary.h:123

◆ DisableFootIK()

void UALSCharacterAnimInstance::DisableFootIK ( const float DelayTime)
overridevirtual

For When the feet get stuck and need disabling

Implements ICustomAnimInstance.

1301{
1302 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1303 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::DisableFootIK);
1304 OnDisableFootIK(DelayTime);
1305}
virtual void DisableFootIK(const float DelayTime) override
Definition ALSCharacterAnimInstance.cpp:1300
void OnDisableFootIK(const float DelayTime)

◆ DynamicTransitionCheck()

void UALSCharacterAnimInstance::DynamicTransitionCheck ( )
private
861{
862 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
863 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::DynamicTransitionCheck);
864 DECLARE_SCOPE_CYCLE_COUNTER(TEXT("ALS DynamicTransitionCheck"), STAT_ALS_DynamicTransitionCheck, STATGROUP_ALS);
865
866 // Check each foot to see if the location difference between the IK_Foot bone and its desired / target location
867 // (determined via a virtual bone) exceeds a threshold. If it does, play an additive transition animation on that foot.
868 // The currently set transition plays the second half of a 2 foot transition animation, so that only a single foot moves.
869 // Because only the IK_Foot bone can be locked, the separate virtual bone allows the system to know its desired location when locked.
870 FTransform SocketTransformA = GetOwningComponent()->GetSocketTransform(IkFootL_BoneName, RTS_Component);
871 FTransform SocketTransformB = GetOwningComponent()->GetSocketTransform(
872 NAME_VB___foot_target_l, RTS_Component);
873 float Distance = (SocketTransformB.GetLocation() - SocketTransformA.GetLocation()).Size();
874 if (Distance > Config.DynamicTransitionThreshold)
875 {
878 Params.BlendInTime = 0.2f;
879 Params.BlendOutTime = 0.2f;
880 Params.PlayRate = 1.5f;
881 Params.StartTime = 0.8f;
882 PlayDynamicTransition(0.1f, Params);
883 }
884
885 SocketTransformA = GetOwningComponent()->GetSocketTransform(IkFootR_BoneName, RTS_Component);
886 SocketTransformB = GetOwningComponent()->GetSocketTransform(NAME_VB___foot_target_r, RTS_Component);
887 Distance = (SocketTransformB.GetLocation() - SocketTransformA.GetLocation()).Size();
888 if (Distance > Config.DynamicTransitionThreshold)
889 {
892 Params.BlendInTime = 0.2f;
893 Params.BlendOutTime = 0.2f;
894 Params.PlayRate = 1.5f;
895 Params.StartTime = 0.8f;
896 PlayDynamicTransition(0.1f, Params);
897 }
898}
static const FName NAME_VB___foot_target_r(TEXT("VB foot_target_r"))
static const FName NAME_VB___foot_target_l(TEXT("VB foot_target_l"))
FName IkFootR_BoneName
Definition ALSCharacterAnimInstance.h:341
FName IkFootL_BoneName
Definition ALSCharacterAnimInstance.h:338
TObjectPtr< UAnimSequenceBase > TransitionAnim_L
Definition ALSCharacterAnimInstance.h:334
void PlayDynamicTransition(float ReTriggerDelay, FALSDynamicMontageParams Parameters)
Definition ALSCharacterAnimInstance.cpp:383
TObjectPtr< UAnimSequenceBase > TransitionAnim_R
Definition ALSCharacterAnimInstance.h:331
void DynamicTransitionCheck()
Definition ALSCharacterAnimInstance.cpp:860
Definition ALSAnimationStructLibrary.h:19
TObjectPtr< UAnimSequenceBase > Animation
Definition ALSAnimationStructLibrary.h:23
float BlendOutTime
Definition ALSAnimationStructLibrary.h:29
float StartTime
Definition ALSAnimationStructLibrary.h:35
float PlayRate
Definition ALSAnimationStructLibrary.h:32
float BlendInTime
Definition ALSAnimationStructLibrary.h:26

◆ GetAnimCurveClamped()

float UALSCharacterAnimInstance::GetAnimCurveClamped ( const FName & Name,
float Bias,
float ClampMin,
float ClampMax ) const
private

Util

980{
981 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
982 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::GetAnimCurveClamped);
983 return FMath::Clamp(GetCurveValue(Name) + Bias, ClampMin, ClampMax);
984}

◆ GetFiringWeapon()

bool UALSCharacterAnimInstance::GetFiringWeapon ( ) const
inline
78{return bFiringWeapon;};
bool bFiringWeapon
Definition ALSCharacterAnimInstance.h:352

◆ GetPivotPointLocation()

FVector UALSCharacterAnimInstance::GetPivotPointLocation ( ) const
inline
98{return PivotPoint.GetLocation() + GunOffset;};
FVector GunOffset
Definition ALSCharacterAnimInstance.h:346
FTransform PivotPoint
Definition ALSCharacterAnimInstance.h:350

◆ GetRecoilRotation()

FRotator UALSCharacterAnimInstance::GetRecoilRotation ( ) const
inline
96{return RecoilTransform.Rotator();};
FTransform RecoilTransform
Definition ALSCharacterAnimInstance.h:348

◆ GetShouldOverlayStateUsePRASIK()

bool UALSCharacterAnimInstance::GetShouldOverlayStateUsePRASIK ( ) const
404{
405 switch (OverlayState) {
415 return false;
428 default:
429 return true;
430 }
431}
FALSOverlayState OverlayState
Definition ALSCharacterAnimInstance.h:240

◆ NativeBeginPlay()

void UALSCharacterAnimInstance::NativeBeginPlay ( )
overridevirtual
68{
69 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
70 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::NativeBeginPlay);
71 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
72
73 // it seems to be that the player pawn components are not really initialized
74 // when the call to NativeInitializeAnimation() happens.
75 // This is the reason why it is tried here to get the ALS debug component.
76 if (const APawn* Owner = TryGetPawnOwner())
77 {
78 ALSDebugComponent = Owner->FindComponentByClass<UALSDebugComponent>();
79 }
80
81}
virtual void NativeBeginPlay() override
Definition ALSCharacterAnimInstance.cpp:67
Definition ALSDebugComponent.h:17

◆ NativeInitializeAnimation()

void UALSCharacterAnimInstance::NativeInitializeAnimation ( )
overridevirtual
55{
56 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
57 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::NativeInitializeAnimation);
58
59 Super::NativeInitializeAnimation();
60 Character = Cast<AALSBaseCharacter>(TryGetPawnOwner());
61 if (Character)
62 {
63 Character->OnJumpedDelegate.AddUniqueDynamic(this, &UALSCharacterAnimInstance::OnJumped);
64 }
65}
virtual void NativeInitializeAnimation() override
Definition ALSCharacterAnimInstance.cpp:54
void OnJumped()
Definition ALSCharacterAnimInstance.cpp:1258

◆ NativeThreadSafeUpdateAnimation()

void UALSCharacterAnimInstance::NativeThreadSafeUpdateAnimation ( float DeltaSeconds)
overridevirtual
291{
292 Super::NativeThreadSafeUpdateAnimation(DeltaSeconds);
293 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
294 DECLARE_SCOPE_CYCLE_COUNTER(TEXT("ALS ThreadSafeUpdateAnimation"), STAT_ALS_NativeThreadSafeUpdateAnimation, STATGROUP_ALS)
296 if(bOptimize)
297 {
298 UpdateAimingValues(DeltaSeconds);
300
302 {
303 // Check If Moving Or Not & Enable Movement Animations if IsMoving and HasMovementInput, or if the Speed is greater than 150.
304 const bool bPrevShouldMove = Grounded.bShouldMove;
305 Grounded.bShouldMove = ShouldMoveCheck();
306
307 if (bPrevShouldMove == false && Grounded.bShouldMove)
308 {
309 // Do When Starting To Move
310 TurnInPlaceValues.ElapsedDelayTime = 0.0f;
311 Grounded.bRotateL = false;
312 Grounded.bRotateR = false;
313 }
314
315 if (Grounded.bShouldMove)
316 {
317 // Do While Moving
318 UpdateMovementValues(DeltaSeconds);
320 }
321 else
322 {
323 // Do While Not Moving
324 if (CanRotateInPlace())
325 {
327 }
328 else
329 {
330 Grounded.bRotateL = false;
331 Grounded.bRotateR = false;
332 }
333 if (CanTurnInPlace())
334 {
335 TurnInPlaceCheck(DeltaSeconds);
336 }
337 else
338 {
339 TurnInPlaceValues.ElapsedDelayTime = 0.0f;
340 }
341 // if (CanDynamicTransition())
342 // {
343 // DynamicTransitionCheck();
344 // }
345 }
346 }
347 else if (MovementState.InAir())
348 {
349 // Do While InAir
350 UpdateInAirValues(DeltaSeconds);
351 }
352 else if (MovementState.Ragdoll())
353 {
354 // Do While Ragdolling
356 }
357
358
359 }
360 // UpdateFootIK(DeltaSeconds);
361
362}
void UpdateInAirValues(float DeltaSeconds)
Definition ALSCharacterAnimInstance.cpp:952
void UpdateRagdollValues()
Definition ALSCharacterAnimInstance.cpp:969
virtual void NativeThreadSafeUpdateAnimation(float DeltaSeconds) override
Definition ALSCharacterAnimInstance.cpp:290
void UpdateRotationValues()
Definition ALSCharacterAnimInstance.cpp:932
FALSMovementState MovementState
Definition ALSCharacterAnimInstance.h:225
void UpdateMovementValues(float DeltaSeconds)
Definition ALSCharacterAnimInstance.cpp:900
bool ShouldMoveCheck() const
Definition ALSCharacterAnimInstance.cpp:433
void UpdateLayerValues()
Definition ALSCharacterAnimInstance.cpp:545
void TurnInPlaceCheck(float DeltaSeconds)
Definition ALSCharacterAnimInstance.cpp:828
void UpdateAimingValues(float DeltaSeconds)
Definition ALSCharacterAnimInstance.cpp:486
void RotateInPlaceCheck()
Definition ALSCharacterAnimInstance.cpp:809
bool bOptimize
Definition ALSCharacterAnimInstance.h:93
const bool & Ragdoll() const
Definition ALSStructEnumLibrary.h:47
const bool & Grounded() const
Definition ALSStructEnumLibrary.h:44
const bool & InAir() const
Definition ALSStructEnumLibrary.h:45

◆ NativeUpdateAnimation()

void UALSCharacterAnimInstance::NativeUpdateAnimation ( float DeltaSeconds)
overridevirtual
84{
85 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
86 DECLARE_SCOPE_CYCLE_COUNTER(TEXT("ALS NativeUpdateAnimation"), STAT_ALS_NativeUpdateAnimation, STATGROUP_ALS)
87 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::NativeUpdateAnimation);
88 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
89
90 Super::NativeUpdateAnimation(DeltaSeconds);
91
92 if(!Character || DeltaSeconds == 0.0f)
93 {
94 return;
95 }
96 if(bOptimize)
97 {
98 UpdateFootIK(DeltaSeconds);
100 {
101 const bool bPrevShouldMove = Grounded.bShouldMove;
102 Grounded.bShouldMove = ShouldMoveCheck();
103 if (bPrevShouldMove == false && Grounded.bShouldMove)
104 {
105 // Do When Starting To Move
106 TurnInPlaceValues.ElapsedDelayTime = 0.0f;
107 Grounded.bRotateL = false;
108 Grounded.bRotateR = false;
109 }
110
111 if (Grounded.bShouldMove)
112 {
113 }
114 else
115 {
117 {
119 }
120 }
121
122 }
123 }
124 else
125 {
126 // Update rest of character information. Others are reflected into anim bp when they're set inside character class
127 CharacterInformation.MovementInputAmount = Character->GetMovementInputAmount();
128 CharacterInformation.bHasMovementInput = Character->HasMovementInput();
129 CharacterInformation.bIsMoving = Character->IsMoving();
130 CharacterInformation.Acceleration = Character->GetAcceleration();
131 CharacterInformation.AimYawRate = Character->GetAimYawRate();
132 CharacterInformation.Speed = Character->GetSpeed();
133 if(Character->GetCharacterMovement() != nullptr)
134 {
135 CharacterInformation.Velocity = Character->GetCharacterMovement()->Velocity;
136 }
137 CharacterInformation.MovementInput = Character->GetMovementInput();
138 CharacterInformation.AimingRotation = Character->GetAimingRotation();
139 CharacterInformation.CharacterActorRotation = Character->GetActorRotation();
140 CharacterInformation.ViewMode = Character->GetViewMode();
141 CharacterInformation.PrevMovementState = Character->GetPrevMovementState();
142 LayerBlendingValues.OverlayOverrideState = Character->GetOverlayOverrideState();
143 MovementState = Character->GetMovementState();
144 MovementAction = Character->GetMovementAction();
145 Stance = Character->GetStance();
146 RotationMode = Character->GetRotationMode();
147 Gait = Character->GetGait();
148 OverlayState = Character->GetOverlayState();
149 GroundedEntryState = Character->GetGroundedEntryState();
150
151
152 UpdateAimingValues(DeltaSeconds);
154 UpdateFootIK(DeltaSeconds);
155
157 {
158 // Check If Moving Or Not & Enable Movement Animations if IsMoving and HasMovementInput, or if the Speed is greater than 150.
159 const bool bPrevShouldMove = Grounded.bShouldMove;
160 Grounded.bShouldMove = ShouldMoveCheck();
161
162 if (bPrevShouldMove == false && Grounded.bShouldMove)
163 {
164 // Do When Starting To Move
165 TurnInPlaceValues.ElapsedDelayTime = 0.0f;
166 Grounded.bRotateL = false;
167 Grounded.bRotateR = false;
168 }
169 if (Grounded.bShouldMove)
170 {
171 // Do While Moving
172 UpdateMovementValues(DeltaSeconds);
174 }
175 else
176 {
177 // Do While Not Moving
178 if (CanRotateInPlace())
179 {
181 }
182 else
183 {
184 Grounded.bRotateL = false;
185 Grounded.bRotateR = false;
186 }
187 if (CanTurnInPlace())
188 {
189 TurnInPlaceCheck(DeltaSeconds);
190 }
191 else
192 {
193 TurnInPlaceValues.ElapsedDelayTime = 0.0f;
194 }
196 {
198 }
199 }
200 }
201 else if (MovementState.InAir())
202 {
203 // Do While InAir
204 UpdateInAirValues(DeltaSeconds);
205 }
206 else if (MovementState.Ragdoll())
207 {
208 // Do While Ragdolling
210 }
211 }
212
213
214 // UpdateAimingValues(DeltaSeconds);
215 // UpdateLayerValues();
216 // UpdateFootIK(DeltaSeconds);
217
218}
FALSGroundedEntryState GroundedEntryState
Definition ALSCharacterAnimInstance.h:257
void UpdateFootIK(float DeltaSeconds)
Definition ALSCharacterAnimInstance.cpp:575
FALSStance Stance
Definition ALSCharacterAnimInstance.h:237
FALSMovementAction MovementAction
Definition ALSCharacterAnimInstance.h:228
virtual void NativeUpdateAnimation(float DeltaSeconds) override
Definition ALSCharacterAnimInstance.cpp:83

◆ OnDisableFootIK()

void UALSCharacterAnimInstance::OnDisableFootIK ( const float DelayTime)

◆ OnInjured()

void UALSCharacterAnimInstance::OnInjured ( const EBodyPartName BodyPartName,
const float InjuredAmount )

◆ OnJumped()

void UALSCharacterAnimInstance::OnJumped ( )
1259{
1260 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1261 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::OnJumped);
1262 InAir.bJumped = true;
1263 InAir.JumpPlayRate = FMath::GetMappedRangeValueClamped<float, float>({0.0f, 600.0f}, {1.2f, 1.5f}, CharacterInformation.Speed);
1264
1265 GetWorld()->GetTimerManager().SetTimer(OnJumpedTimer, this,
1267}
FTimerHandle OnJumpedTimer
Definition ALSCharacterAnimInstance.h:365
void OnJumpedDelay()
Definition ALSCharacterAnimInstance.cpp:472

◆ OnJumpedDelay()

void UALSCharacterAnimInstance::OnJumpedDelay ( )
private
473{
474 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
475 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::OnJumpedDelay);
476 InAir.bJumped = false;
477}

◆ OnPivot()

void UALSCharacterAnimInstance::OnPivot ( )
1270{
1271 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1272 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::OnPivot);
1273 Grounded.bPivot = CharacterInformation.Speed < Config.TriggerPivotSpeedLimit;
1274 GetWorld()->GetTimerManager().SetTimer(OnPivotTimer, this,
1276}
FTimerHandle OnPivotTimer
Definition ALSCharacterAnimInstance.h:361
void OnPivot()
Definition ALSCharacterAnimInstance.cpp:1269
void OnPivotDelay()
Definition ALSCharacterAnimInstance.cpp:479

◆ OnPivotDelay()

void UALSCharacterAnimInstance::OnPivotDelay ( )
private
480{
481 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
482 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::OnPivotDelay);
483 Grounded.bPivot = false;
484}

◆ PlayDynamicTransition()

void UALSCharacterAnimInstance::PlayDynamicTransition ( float ReTriggerDelay,
FALSDynamicMontageParams Parameters )
384{
385 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
386 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::PlayDynamicTransition);
388 {
390
391 // Play Dynamic Additive Transition Animation
392 PlayTransition(Parameters);
393
394 UWorld* World = GetWorld();
395 check(World);
396 World->GetTimerManager().SetTimer(PlayDynamicTransitionTimer, this,
398 ReTriggerDelay, false);
399 }
400}
FTimerHandle PlayDynamicTransitionTimer
Definition ALSCharacterAnimInstance.h:363
void PlayDynamicTransitionDelay()
Definition ALSCharacterAnimInstance.cpp:465
void PlayTransition(const FALSDynamicMontageParams &Parameters)
Definition ALSCharacterAnimInstance.cpp:364
bool bCanPlayDynamicTransition
Definition ALSCharacterAnimInstance.h:367

◆ PlayDynamicTransitionDelay()

void UALSCharacterAnimInstance::PlayDynamicTransitionDelay ( )
private
466{
467 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
468 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::PlayDynamicTransitionDelay);
470}

◆ PlayTransition()

void UALSCharacterAnimInstance::PlayTransition ( const FALSDynamicMontageParams & Parameters)
365{
366 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
367 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::PlayTransition);
368 PlaySlotAnimationAsDynamicMontage(Parameters.Animation, NAME_Grounded___Slot,
369 Parameters.BlendInTime, Parameters.BlendOutTime, Parameters.PlayRate, 1,
370 0.0f, Parameters.StartTime);
371}
static const FName NAME_Grounded___Slot(TEXT("Grounded Slot"))

◆ PlayTransitionChecked()

void UALSCharacterAnimInstance::PlayTransitionChecked ( const FALSDynamicMontageParams & Parameters)
374{
375 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
376 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::PlayTransitionChecked);
377 if (Stance.Standing() && !Grounded.bShouldMove)
378 {
379 PlayTransition(Parameters);
380 }
381}
void PlayTransitionChecked(const FALSDynamicMontageParams &Parameters)
Definition ALSCharacterAnimInstance.cpp:373
const bool & Standing() const
Definition ALSStructEnumLibrary.h:84

◆ ResetIKOffsets()

void UALSCharacterAnimInstance::ResetIKOffsets ( float DeltaSeconds)
private
718{
719 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
720 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::ResetIKOffsets);
721 // Interp Foot IK offsets back to 0
722 FootIKValues.FootOffset_L_Location = FMath::VInterpTo(FootIKValues.FootOffset_L_Location,
723 FVector::ZeroVector, DeltaSeconds, 15.0f);
724 FootIKValues.FootOffset_R_Location = FMath::VInterpTo(FootIKValues.FootOffset_R_Location,
725 FVector::ZeroVector, DeltaSeconds, 15.0f);
726 FootIKValues.FootOffset_L_Rotation = FMath::RInterpTo(FootIKValues.FootOffset_L_Rotation,
727 FRotator::ZeroRotator, DeltaSeconds, 15.0f);
728 FootIKValues.FootOffset_R_Rotation = FMath::RInterpTo(FootIKValues.FootOffset_R_Rotation,
729 FRotator::ZeroRotator, DeltaSeconds, 15.0f);
730}
void ResetIKOffsets(float DeltaSeconds)
Definition ALSCharacterAnimInstance.cpp:717

◆ RotateInPlaceCheck()

void UALSCharacterAnimInstance::RotateInPlaceCheck ( )
private

Grounded

810{
811 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
812 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::RotateInPlaceCheck);
813 // Step 1: Check if the character should rotate left or right by checking if the Aiming Angle exceeds the threshold.
814 Grounded.bRotateL = AimingValues.AimingAngle.X < RotateInPlace.RotateMinThreshold;
815 Grounded.bRotateR = AimingValues.AimingAngle.X > RotateInPlace.RotateMaxThreshold;
816
817 // Step 2: If the character should be rotating, set the Rotate Rate to scale with the Aim Yaw Rate.
818 // This makes the character rotate faster when moving the camera faster.
819 if (Grounded.bRotateL || Grounded.bRotateR)
820 {
821 Grounded.RotateRate = FMath::GetMappedRangeValueClamped<float, float>(
822 {RotateInPlace.AimYawRateMinRange, RotateInPlace.AimYawRateMaxRange},
823 {RotateInPlace.MinPlayRate, RotateInPlace.MaxPlayRate},
824 CharacterInformation.AimYawRate);
825 }
826}

◆ SetEssentialInfo()

void UALSCharacterAnimInstance::SetEssentialInfo ( const FALSAnimValues & Value)
overridevirtual

Implements IALSAnimInterface.

226{
227 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
228 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations_SetValues);
229
230 CharacterInformation.MovementInputAmount = Value.CharacterInfo.MovementInputAmount;
231 CharacterInformation.bHasMovementInput = Value.CharacterInfo.bHasMovementInput;
232 CharacterInformation.bIsMoving = Value.CharacterInfo.bIsMoving;
233 CharacterInformation.Acceleration = Value.CharacterInfo.Acceleration;
234 CharacterInformation.AimYawRate = Value.CharacterInfo.AimYawRate;
235 CharacterInformation.Speed = Value.CharacterInfo.Speed;
236 CharacterInformation.MovementInput = Value.CharacterInfo.MovementInput;
237 CharacterInformation.AimingRotation = Value.CharacterInfo.AimingRotation;
238 CharacterInformation.CharacterActorRotation = Value.ActorRotation;
239 CharacterInformation.PrevMovementState = Value.CharacterInfo.PrevMovementState;
240 CharacterInformation.Velocity = Value.CharacterInfo.Velocity;
241 // MovementState = Value.MovementState;
243}
float MovementInputAmount
Definition ALSAnimationStructLibrary.h:125
EALSMovementState PrevMovementState
Definition ALSAnimationStructLibrary.h:134
FVector Acceleration
Definition ALSAnimationStructLibrary.h:107
FVector Velocity
Definition ALSAnimationStructLibrary.h:101
FVector MovementInput
Definition ALSAnimationStructLibrary.h:110
FRotator AimingRotation
Definition ALSAnimationStructLibrary.h:95
float AimYawRate
Definition ALSAnimationStructLibrary.h:128
bool bIsMoving
Definition ALSAnimationStructLibrary.h:113
float Speed
Definition ALSAnimationStructLibrary.h:122
bool bHasMovementInput
Definition ALSAnimationStructLibrary.h:119
FRotator ActorRotation
Definition ALSAnimationStructLibrary.h:148
FALSMovementAction MovementAction
Definition ALSAnimationStructLibrary.h:151
FALSAnimCharacterInformation CharacterInfo
Definition ALSAnimationStructLibrary.h:147

◆ SetFiringWeapon()

void UALSCharacterAnimInstance::SetFiringWeapon ( const bool bValue)
overridevirtual

For Setting the characters blind fire

Implements ICustomAnimInstance.

1279{
1280 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1281 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::SetFiringWeapon);
1282 bFiringWeapon = bValue;
1283}
virtual void SetFiringWeapon(const bool bValue) override
Definition ALSCharacterAnimInstance.cpp:1278

◆ SetFootLocking()

void UALSCharacterAnimInstance::SetFootLocking ( float DeltaSeconds,
FName EnableFootIKCurve,
FName FootLockCurve,
FName IKFootBone,
float & CurFootLockAlpha,
bool & UseFootLockCurve,
FVector & CurFootLockLoc,
FRotator & CurFootLockRot ) const
private

Foot IK

613{
614 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
615 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::SetFootLocking);
616 if (GetCurveValue(EnableFootIKCurve) <= 0.0f)
617 {
618 return;
619 }
620
621 // Step 1: Set Local FootLock Curve value
622 float FootLockCurveVal;
623
624 if (UseFootLockCurve)
625 {
626 UseFootLockCurve = FMath::Abs(GetCurveValue(NAME__ALSCharacterAnimInstance__RotationAmount)) <= 0.001f ||
627 Character->GetLocalRole() != ROLE_AutonomousProxy;
628 FootLockCurveVal = GetCurveValue(FootLockCurve) * (1.f / GetSkelMeshComponent()->AnimUpdateRateParams->UpdateRate);
629 }
630 else
631 {
632 UseFootLockCurve = GetCurveValue(FootLockCurve) >= 0.99f;
633 FootLockCurveVal = 0.0f;
634 }
635
636 // Step 2: Only update the FootLock Alpha if the new value is less than the current, or it equals 1. This makes it
637 // so that the foot can only blend out of the locked position or lock to a new position, and never blend in.
638 if (FootLockCurveVal >= 0.99f || FootLockCurveVal < CurFootLockAlpha)
639 {
640 CurFootLockAlpha = FootLockCurveVal;
641 }
642
643 // Step 3: If the Foot Lock curve equals 1, save the new lock location and rotation in component space as the target.
644 if (CurFootLockAlpha >= 0.99f)
645 {
646 const FTransform& OwnerTransform =
647 GetOwningComponent()->GetSocketTransform(IKFootBone, RTS_Component);
648 CurFootLockLoc = OwnerTransform.GetLocation();
649 CurFootLockRot = OwnerTransform.Rotator();
650 }
651
652 // Step 4: If the Foot Lock Alpha has a weight,
653 // update the Foot Lock offsets to keep the foot planted in place while the capsule moves.
654 if (CurFootLockAlpha > 0.0f)
655 {
656 SetFootLockOffsets(DeltaSeconds, CurFootLockLoc, CurFootLockRot);
657 }
658}
static const FName NAME__ALSCharacterAnimInstance__RotationAmount(TEXT("RotationAmount"))
void SetFootLockOffsets(float DeltaSeconds, FVector &LocalLoc, FRotator &LocalRot) const
Definition ALSCharacterAnimInstance.cpp:660
void SetFootLocking(float DeltaSeconds, FName EnableFootIKCurve, FName FootLockCurve, FName IKFootBone, float &CurFootLockAlpha, bool &UseFootLockCurve, FVector &CurFootLockLoc, FRotator &CurFootLockRot) const
Definition ALSCharacterAnimInstance.cpp:610

◆ SetFootLockOffsets()

void UALSCharacterAnimInstance::SetFootLockOffsets ( float DeltaSeconds,
FVector & LocalLoc,
FRotator & LocalRot ) const
private
661{
662 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
663 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::SetFootLockOffsets);
664 DECLARE_SCOPE_CYCLE_COUNTER(TEXT("ALS SetFootLockOffsets"), STAT_ALS_SetFootLockOffsets, STATGROUP_ALS)
665
666 FRotator RotationDifference = FRotator::ZeroRotator;
667 // Use the delta between the current and last updated rotation to find how much the foot should be rotated
668 // to remain planted on the ground.
669 if (Character->GetCharacterMovement() != nullptr && Character->GetCharacterMovement()->IsMovingOnGround())
670 {
671 RotationDifference = CharacterInformation.CharacterActorRotation - Character->GetCharacterMovement()->
672 GetLastUpdateRotation();
673 RotationDifference.Normalize();
674 }
675
676 // Get the distance traveled between frames relative to the mesh rotation
677 // to find how much the foot should be offset to remain planted on the ground.
678 const FVector& LocationDifference = GetOwningComponent()->GetComponentRotation().UnrotateVector(
679 CharacterInformation.Velocity * DeltaSeconds);
680
681 // Subtract the location difference from the current local location and rotate
682 // it by the rotation difference to keep the foot planted in component space.
683 LocalLoc = (LocalLoc - LocationDifference).RotateAngleAxis(RotationDifference.Yaw, FVector::DownVector);
684
685 // Subtract the Rotation Difference from the current Local Rotation to get the new local rotation.
686 FRotator Delta = LocalRot - RotationDifference;
687 Delta.Normalize();
688 LocalRot = Delta;
689}

◆ SetFootOffsets()

void UALSCharacterAnimInstance::SetFootOffsets ( float DeltaSeconds,
FName EnableFootIKCurve,
FName IKFootBone,
FName RootBone,
FVector & CurLocationTarget,
FVector & CurLocationOffset,
FRotator & CurRotationOffset ) const
private
735{
736 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
737 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::SetFootOffsets);
738 DECLARE_SCOPE_CYCLE_COUNTER(TEXT("ALS SetFootOffsets"), STAT_ALS_SetFootOffsets, STATGROUP_ALS)
739
740 // Only update Foot IK offset values if the Foot IK curve has a weight. If it equals 0, clear the offset values.
741 if (GetCurveValue(EnableFootIKCurve) <= 0)
742 {
743 CurLocationOffset = FVector::ZeroVector;
744 CurRotationOffset = FRotator::ZeroRotator;
745 return;
746 }
747
748 // Step 1: Trace downward from the foot location to find the geometry.
749 // If the surface is walkable, save the Impact Location and Normal.
750 USkeletalMeshComponent* OwnerComp = GetOwningComponent();
751 FVector IKFootFloorLoc = OwnerComp->GetSocketLocation(IKFootBone);
752 IKFootFloorLoc.Z = OwnerComp->GetSocketLocation(RootBone).Z;
753
754 UWorld* World = GetWorld();
755 check(World);
756
757 FCollisionQueryParams Params;
758 Params.AddIgnoredActor(Character);
759
760 const FVector TraceStart = IKFootFloorLoc + FVector(0.0, 0.0, Config.IK_TraceDistanceAboveFoot);
761 const FVector TraceEnd = IKFootFloorLoc - FVector(0.0, 0.0, Config.IK_TraceDistanceBelowFoot);
762
763 FHitResult HitResult;
764 const bool bHit = World->LineTraceSingleByChannel(HitResult,
765 TraceStart,
766 TraceEnd,
767 ECC_Visibility, Params);
768
769 if (ALSDebugComponent && ALSDebugComponent->GetShowTraces())
770 {
772 World,
773 TraceStart,
774 TraceEnd,
775 EDrawDebugTrace::Type::ForOneFrame,
776 bHit,
777 HitResult,
778 FLinearColor::Red,
779 FLinearColor::Green,
780 5.0f);
781 }
782
783 FRotator TargetRotOffset = FRotator::ZeroRotator;
784 if (Character->GetCharacterMovement() != nullptr && Character->GetCharacterMovement()->IsWalkable(HitResult))
785 {
786 FVector ImpactPoint = HitResult.ImpactPoint;
787 FVector ImpactNormal = HitResult.ImpactNormal;
788
789 // Step 1.1: Find the difference in location from the Impact point and the expected (flat) floor location.
790 // These values are offset by the normal multiplied by the
791 // foot height to get better behavior on angled surfaces.
792 CurLocationTarget = (ImpactPoint + ImpactNormal * Config.FootHeight) -
793 (IKFootFloorLoc + FVector(0, 0, Config.FootHeight));
794
795 // Step 1.2: Calculate the Rotation offset by getting the Atan2 of the Impact Normal.
796 TargetRotOffset.Pitch = -FMath::RadiansToDegrees(FMath::Atan2(ImpactNormal.X, ImpactNormal.Z));
797 TargetRotOffset.Roll = FMath::RadiansToDegrees(FMath::Atan2(ImpactNormal.Y, ImpactNormal.Z));
798 }
799
800 // Step 2: Interp the Current Location Offset to the new target value.
801 // Interpolate at different speeds based on whether the new target is above or below the current one.
802 const float InterpSpeed = CurLocationOffset.Z > CurLocationTarget.Z ? 30.f : 15.0f;
803 CurLocationOffset = FMath::VInterpTo(CurLocationOffset, CurLocationTarget, DeltaSeconds, InterpSpeed);
804
805 // Step 3: Interp the Current Rotation Offset to the new target value.
806 CurRotationOffset = FMath::RInterpTo(CurRotationOffset, TargetRotOffset, DeltaSeconds, 30.0f);
807}
void SetFootOffsets(float DeltaSeconds, FName EnableFootIKCurve, FName IKFootBone, FName RootBone, FVector &CurLocationTarget, FVector &CurLocationOffset, FRotator &CurRotationOffset) const
Definition ALSCharacterAnimInstance.cpp:732
static void DrawDebugLineTraceSingle(const UWorld *World, const FVector &Start, const FVector &End, EDrawDebugTrace::Type DrawDebugType, bool bHit, const FHitResult &OutHit, FLinearColor TraceColor, FLinearColor TraceHitColor, float DrawTime)
Definition ALSDebugComponent.cpp:241

◆ SetGait()

void UALSCharacterAnimInstance::SetGait ( const FALSGait & Value)
overridevirtual

Implements IALSAnimInterface.

261{
262 Gait = Value;
263}

◆ SetGroundedEntryState()

void UALSCharacterAnimInstance::SetGroundedEntryState ( EALSGroundedEntryState NewState)
inlineprotected
112 {
113 GroundedEntryState = NewState;
114 }

◆ SetInjured()

void UALSCharacterAnimInstance::SetInjured ( const EBodyPartName BodyPartName,
const float InjuredAmount )
overridevirtual

Sets the Injured body part

Implements ICustomAnimInstance.

1308{
1309 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1310 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::SetInjured);
1311 InjuredBodyPart = BodyPartName;
1312 InjuredAlpha = InjuredAmount;
1313 OnInjured(BodyPartName, InjuredAmount);
1314}
void OnInjured(const EBodyPartName BodyPartName, const float InjuredAmount)
EBodyPartName InjuredBodyPart
Definition ALSCharacterAnimInstance.h:354
virtual void SetInjured(const EBodyPartName BodyPartName, const float InjuredAmount) override
Definition ALSCharacterAnimInstance.cpp:1307
float InjuredAlpha
Definition ALSCharacterAnimInstance.h:356

◆ SetMovementState()

void UALSCharacterAnimInstance::SetMovementState ( const FALSMovementState & Value)
overridevirtual

Implements IALSAnimInterface.

251{
252 MovementState = Value;
253}

◆ SetNewGroundedEntryState()

void UALSCharacterAnimInstance::SetNewGroundedEntryState ( const FALSGroundedEntryState & Value)
overridevirtual

Implements IALSAnimInterface.

281{
282 GroundedEntryState = Value;
283}

◆ SetOptimize()

void UALSCharacterAnimInstance::SetOptimize ( const bool bValue)
overridevirtual

Implements IALSAnimInterface.

246{
247 bOptimize = bValue;
248}

◆ SetOverlayOverrideState()

void UALSCharacterAnimInstance::SetOverlayOverrideState ( const int32 Value)
overridevirtual

Implements IALSAnimInterface.

256{
257 LayerBlendingValues.OverlayOverrideState = Value;
258}

◆ SetOverlayState()

void UALSCharacterAnimInstance::SetOverlayState ( const FALSOverlayState & Value)
overridevirtual

Implements IALSAnimInterface.

276{
277 OverlayState = Value;
278}

◆ SetPelvisIKOffset()

void UALSCharacterAnimInstance::SetPelvisIKOffset ( float DeltaSeconds,
FVector FootOffsetLTarget,
FVector FootOffsetRTarget )
private
693{
694 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
695 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::SetPelvisIKOffset);
696 // Calculate the Pelvis Alpha by finding the average Foot IK weight. If the alpha is 0, clear the offset.
697 FootIKValues.PelvisAlpha =
698 (GetCurveValue(NAME_Enable_FootIK_L) + GetCurveValue(NAME_Enable_FootIK_R)) / 2.0f;
699
700 if (FootIKValues.PelvisAlpha > 0.0f)
701 {
702 // Step 1: Set the new Pelvis Target to be the lowest Foot Offset
703 const FVector PelvisTarget = FootOffsetLTarget.Z < FootOffsetRTarget.Z ? FootOffsetLTarget : FootOffsetRTarget;
704
705 // Step 2: Interp the Current Pelvis Offset to the new target value.
706 //Interpolate at different speeds based on whether the new target is above or below the current one.
707 const float InterpSpeed = PelvisTarget.Z > FootIKValues.PelvisOffset.Z ? 10.0f : 15.0f;
708 FootIKValues.PelvisOffset =
709 FMath::VInterpTo(FootIKValues.PelvisOffset, PelvisTarget, DeltaSeconds, InterpSpeed);
710 }
711 else
712 {
713 FootIKValues.PelvisOffset = FVector::ZeroVector;
714 }
715}
static const FName NAME_Enable_FootIK_R(TEXT("Enable_FootIK_R"))
static const FName NAME_Enable_FootIK_L(TEXT("Enable_FootIK_L"))
void SetPelvisIKOffset(float DeltaSeconds, FVector FootOffsetLTarget, FVector FootOffsetRTarget)
Definition ALSCharacterAnimInstance.cpp:691

◆ SetPivotPoint()

void UALSCharacterAnimInstance::SetPivotPoint ( const FTransform & Transform)
overridevirtual

Setting the Pivot Point for the Gun to Rotate Around when Recoiling

Implements ICustomAnimInstance.

1294{
1295 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1296 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::SetPivotPoint);
1297 PivotPoint = Transform;
1298}
virtual void SetPivotPoint(const FTransform &Transform) override
Definition ALSCharacterAnimInstance.cpp:1293

◆ SetRecoilTransform()

void UALSCharacterAnimInstance::SetRecoilTransform ( const FTransform & Transform)
overridevirtual

Setting The Location and Rotation of the Recoil

Implements ICustomAnimInstance.

1286{
1287 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1288 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::SetRecoilTransform);
1289 RecoilTransform.SetLocation(Transform.GetLocation());
1290 RecoilTransform.SetRotation(Transform.GetRotation());
1291}
virtual void SetRecoilTransform(const FTransform &Transform) override
Definition ALSCharacterAnimInstance.cpp:1285

◆ SetRotationMode()

void UALSCharacterAnimInstance::SetRotationMode ( const FALSRotationMode Value)
overridevirtual

Implements IALSAnimInterface.

286{
287 RotationMode = Value;
288}

◆ SetStance()

void UALSCharacterAnimInstance::SetStance ( const FALSStance & Value)
overridevirtual

Implements IALSAnimInterface.

266{
267 Stance = Value;
268}

◆ SetTrackedHipsDirection()

void UALSCharacterAnimInstance::SetTrackedHipsDirection ( EALSHipsDirection HipsDirection)
inlineprotected
106 {
107 Grounded.TrackedHipsDirection = HipsDirection;
108 }

◆ SetViewMode()

void UALSCharacterAnimInstance::SetViewMode ( const EALSViewMode Value)
overridevirtual

Implements IALSAnimInterface.

271{
272 CharacterInformation.ViewMode = Value;
273}

◆ ShouldMoveCheck()

bool UALSCharacterAnimInstance::ShouldMoveCheck ( ) const
protected

Enable Movement Animations if IsMoving and HasMovementInput, or if the Speed is greater than 150.

434{
435 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
436 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::ShouldMoveCheck);
437 return (CharacterInformation.bIsMoving && CharacterInformation.bHasMovementInput) ||
438 CharacterInformation.Speed > 150.0f;
439}

◆ TurnInPlace()

void UALSCharacterAnimInstance::TurnInPlace ( FRotator TargetRotation,
float PlayRateScale,
float StartTime,
bool OverrideCurrent )
private
1198{
1199 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
1200 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::TurnInPlace);
1201 // Step 1: Set Turn Angle
1202 FRotator Delta = TargetRotation - CharacterInformation.CharacterActorRotation;
1203 Delta.Normalize();
1204 const float TurnAngle = Delta.Yaw;
1205
1206 // Step 2: Choose Turn Asset based on the Turn Angle and Stance
1207 FALSTurnInPlaceAsset TargetTurnAsset;
1208 if (Stance.Standing())
1209 {
1210 if (FMath::Abs(TurnAngle) < TurnInPlaceValues.Turn180Threshold)
1211 {
1212 TargetTurnAsset = TurnAngle < 0.0f
1213 ? TurnInPlaceValues.N_TurnIP_L90
1214 : TurnInPlaceValues.N_TurnIP_R90;
1215 }
1216 else
1217 {
1218 TargetTurnAsset = TurnAngle < 0.0f
1219 ? TurnInPlaceValues.N_TurnIP_L180
1220 : TurnInPlaceValues.N_TurnIP_R180;
1221 }
1222 }
1223 else
1224 {
1225 if (FMath::Abs(TurnAngle) < TurnInPlaceValues.Turn180Threshold)
1226 {
1227 TargetTurnAsset = TurnAngle < 0.0f
1228 ? TurnInPlaceValues.CLF_TurnIP_L90
1229 : TurnInPlaceValues.CLF_TurnIP_R90;
1230 }
1231 else
1232 {
1233 TargetTurnAsset = TurnAngle < 0.0f
1234 ? TurnInPlaceValues.CLF_TurnIP_L180
1235 : TurnInPlaceValues.CLF_TurnIP_R180;
1236 }
1237 }
1238
1239 // Step 3: If the Target Turn Animation is not playing or set to be overriden, play the turn animation as a dynamic montage.
1240 if (!OverrideCurrent && IsPlayingSlotAnimation(TargetTurnAsset.Animation, TargetTurnAsset.SlotName))
1241 {
1242 return;
1243 }
1244 PlaySlotAnimationAsDynamicMontage(TargetTurnAsset.Animation, TargetTurnAsset.SlotName, 0.2f, 0.2f,
1245 TargetTurnAsset.PlayRate * PlayRateScale, 1, 0.0f, StartTime);
1246
1247 // Step 4: Scale the rotation amount (gets scaled in AnimGraph) to compensate for turn angle (If Allowed) and play rate.
1248 if (TargetTurnAsset.ScaleTurnAngle)
1249 {
1250 Grounded.RotationScale = (TurnAngle / TargetTurnAsset.AnimatedAngle) * TargetTurnAsset.PlayRate * PlayRateScale;
1251 }
1252 else
1253 {
1254 Grounded.RotationScale = TargetTurnAsset.PlayRate * PlayRateScale;
1255 }
1256}
void TurnInPlace(FRotator TargetRotation, float PlayRateScale, float StartTime, bool OverrideCurrent)
Definition ALSCharacterAnimInstance.cpp:1196
Definition ALSAnimationStructLibrary.h:70
float AnimatedAngle
Definition ALSAnimationStructLibrary.h:77
TObjectPtr< UAnimSequenceBase > Animation
Definition ALSAnimationStructLibrary.h:74
float PlayRate
Definition ALSAnimationStructLibrary.h:83
FName SlotName
Definition ALSAnimationStructLibrary.h:80
bool ScaleTurnAngle
Definition ALSAnimationStructLibrary.h:86

◆ TurnInPlaceCheck()

void UALSCharacterAnimInstance::TurnInPlaceCheck ( float DeltaSeconds)
private
829{
830 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
831 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::TurnInPlaceCheck);
832 // Step 1: Check if Aiming angle is outside of the Turn Check Min Angle, and if the Aim Yaw Rate is below the Aim Yaw Rate Limit.
833 // If so, begin counting the Elapsed Delay Time. If not, reset the Elapsed Delay Time.
834 // This ensures the conditions remain true for a sustained period of time before turning in place.
835 if (FMath::Abs(AimingValues.AimingAngle.X) <= TurnInPlaceValues.TurnCheckMinAngle ||
836 CharacterInformation.AimYawRate >= TurnInPlaceValues.AimYawRateLimit)
837 {
838 TurnInPlaceValues.ElapsedDelayTime = 0.0f;
839 return;
840 }
841
842 TurnInPlaceValues.ElapsedDelayTime += DeltaSeconds;
843 const float ClampedAimAngle = FMath::GetMappedRangeValueClamped<float, float>({TurnInPlaceValues.TurnCheckMinAngle, 180.0f},
844 {
845 TurnInPlaceValues.MinAngleDelay,
846 TurnInPlaceValues.MaxAngleDelay
847 },
848 AimingValues.AimingAngle.X);
849
850 // Step 2: Check if the Elapsed Delay time exceeds the set delay (mapped to the turn angle range). If so, trigger a Turn In Place.
851 if (TurnInPlaceValues.ElapsedDelayTime > ClampedAimAngle)
852 {
853 FRotator TurnInPlaceYawRot = CharacterInformation.AimingRotation;
854 TurnInPlaceYawRot.Roll = 0.0f;
855 TurnInPlaceYawRot.Pitch = 0.0f;
856 TurnInPlace(TurnInPlaceYawRot, 1.0f, 0.0f, false);
857 }
858}

◆ UpdateAimingValues()

void UALSCharacterAnimInstance::UpdateAimingValues ( float DeltaSeconds)
private

Update Values

487{
488 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
489 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::UpdateAimingValues);
490 // Interp the Aiming Rotation value to achieve smooth aiming rotation changes.
491 // Interpolating the rotation before calculating the angle ensures the value is not affected by changes
492 // in actor rotation, allowing slow aiming rotation changes with fast actor rotation changes.
493
494 AimingValues.SmoothedAimingRotation = FMath::RInterpTo(AimingValues.SmoothedAimingRotation,
495 CharacterInformation.AimingRotation, DeltaSeconds,
496 Config.SmoothedAimingRotationInterpSpeed);
497
498 // Calculate the Aiming angle and Smoothed Aiming Angle by getting
499 // the delta between the aiming rotation and the actor rotation.
500 FRotator Delta = CharacterInformation.AimingRotation - CharacterInformation.CharacterActorRotation;
501 Delta.Normalize();
502 AimingValues.AimingAngle.X = Delta.Yaw;
503 AimingValues.AimingAngle.Y = Delta.Pitch;
504
505 Delta = AimingValues.SmoothedAimingRotation - CharacterInformation.CharacterActorRotation;
506 Delta.Normalize();
507 SmoothedAimingAngle.X = Delta.Yaw;
508 SmoothedAimingAngle.Y = Delta.Pitch;
509
511 {
512 // Clamp the Aiming Pitch Angle to a range of 1 to 0 for use in the vertical aim sweeps.
513 AimingValues.AimSweepTime = FMath::GetMappedRangeValueClamped<float, float>({-90.0f, 90.0f}, {1.0f, 0.0f},
514 AimingValues.AimingAngle.Y);
515
516 // Use the Aiming Yaw Angle divided by the number of spine+pelvis bones to get the amount of spine rotation
517 // needed to remain facing the camera direction.
518 AimingValues.SpineRotation.Roll = 0.0f;
519 AimingValues.SpineRotation.Pitch = 0.0f;
520 AimingValues.SpineRotation.Yaw = AimingValues.AimingAngle.X / 4.0f;
521 }
522 else if (CharacterInformation.bHasMovementInput)
523 {
524 // Get the delta between the Movement Input rotation and Actor rotation and map it to a range of 0-1.
525 // This value is used in the aim offset behavior to make the character look toward the Movement Input.
526 Delta = CharacterInformation.MovementInput.ToOrientationRotator() - CharacterInformation.CharacterActorRotation;
527 Delta.Normalize();
528 const float InterpTarget = FMath::GetMappedRangeValueClamped<float, float>({-180.0f, 180.0f}, {0.0f, 1.0f}, Delta.Yaw);
529
530 AimingValues.InputYawOffsetTime = FMath::FInterpTo(AimingValues.InputYawOffsetTime, InterpTarget,
531 DeltaSeconds, Config.InputYawOffsetInterpSpeed);
532 }
533
534 // Separate the Aiming Yaw Angle into 3 separate Yaw Times. These 3 values are used in the Aim Offset behavior
535 // to improve the blending of the aim offset when rotating completely around the character.
536 // This allows you to keep the aiming responsive but still smoothly blend from left to right or right to left.
537 AimingValues.LeftYawTime = FMath::GetMappedRangeValueClamped<float, float>({0.0f, 180.0f}, {0.5f, 0.0f},
538 FMath::Abs(SmoothedAimingAngle.X));
539 AimingValues.RightYawTime = FMath::GetMappedRangeValueClamped<float, float>({0.0f, 180.0f}, {0.5f, 1.0f},
540 FMath::Abs(SmoothedAimingAngle.X));
541 AimingValues.ForwardYawTime = FMath::GetMappedRangeValueClamped<float, float>({-180.0f, 180.0f}, {0.0f, 1.0f},
543}
FVector2D SmoothedAimingAngle
Definition ALSCharacterAnimInstance.h:273

◆ UpdateFootIK()

void UALSCharacterAnimInstance::UpdateFootIK ( float DeltaSeconds)
private
576{
577 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
578 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::UpdateFootIK);
579 DECLARE_SCOPE_CYCLE_COUNTER(TEXT("ALS UpdateFootIK"), STAT_ALS_UpdateFootIK, STATGROUP_ALS)
580 FVector FootOffsetLTarget = FVector::ZeroVector;
581 FVector FootOffsetRTarget = FVector::ZeroVector;
582
583 // Update Foot Locking values.
585 IkFootL_BoneName, FootIKValues.FootLock_L_Alpha, FootIKValues.UseFootLockCurve_L,
586 FootIKValues.FootLock_L_Location, FootIKValues.FootLock_L_Rotation);
588 IkFootR_BoneName, FootIKValues.FootLock_R_Alpha, FootIKValues.UseFootLockCurve_R,
589 FootIKValues.FootLock_R_Location, FootIKValues.FootLock_R_Rotation);
590
591 if (MovementState.InAir())
592 {
593 // Reset IK Offsets if In Air
594 SetPelvisIKOffset(DeltaSeconds, FVector::ZeroVector, FVector::ZeroVector);
595 ResetIKOffsets(DeltaSeconds);
596 }
597 else if (!MovementState.Ragdoll())
598 {
599 // Update all Foot Lock and Foot Offset values when not In Air
601 FootOffsetLTarget,
602 FootIKValues.FootOffset_L_Location, FootIKValues.FootOffset_L_Rotation);
604 FootOffsetRTarget,
605 FootIKValues.FootOffset_R_Location, FootIKValues.FootOffset_R_Rotation);
606 SetPelvisIKOffset(DeltaSeconds, FootOffsetLTarget, FootOffsetRTarget);
607 }
608}
static const FName NAME__ALSCharacterAnimInstance__root(TEXT("root"))
static const FName NAME_FootLock_R(TEXT("FootLock_R"))
static const FName NAME_FootLock_L(TEXT("FootLock_L"))

◆ UpdateInAirValues()

void UALSCharacterAnimInstance::UpdateInAirValues ( float DeltaSeconds)
private
953{
954 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
955 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::UpdateInAirValues);
956 // Update the fall speed. Setting this value only while in the air allows you to use it within the AnimGraph for the landing strength.
957 // If not, the Z velocity would return to 0 on landing.
958 InAir.FallSpeed = CharacterInformation.Velocity.Z;
959
960 // Set the Land Prediction weight.
961 InAir.LandPrediction = CalculateLandPrediction();
962
963 // Interp and set the In Air Lean Amount
964 const FALSLeanAmount& InAirLeanAmount = CalculateAirLeanAmount();
965 LeanAmount.LR = FMath::FInterpTo(LeanAmount.LR, InAirLeanAmount.LR, DeltaSeconds, Config.GroundedLeanInterpSpeed);
966 LeanAmount.FB = FMath::FInterpTo(LeanAmount.FB, InAirLeanAmount.FB, DeltaSeconds, Config.GroundedLeanInterpSpeed);
967}
FALSLeanAmount LeanAmount
Definition ALSCharacterAnimInstance.h:251

◆ UpdateLayerValues()

void UALSCharacterAnimInstance::UpdateLayerValues ( )
private
546{
547 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
548 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::UpdateLayerValues);
549 // Get the Aim Offset weight by getting the opposite of the Aim Offset Mask.
550 LayerBlendingValues.EnableAimOffset = FMath::Lerp(1.0f, 0.0f, GetCurveValue(NAME_Mask_AimOffset));
551 // Set the Base Pose weights
552 LayerBlendingValues.BasePose_N = GetCurveValue(NAME_BasePose_N);
553 LayerBlendingValues.BasePose_CLF = GetCurveValue(NAME_BasePose_CLF);
554 // Set the Additive amount weights for each body part
555 LayerBlendingValues.Spine_Add = GetCurveValue(NAME_Layering_Spine_Add);
556 LayerBlendingValues.Head_Add = GetCurveValue(NAME_Layering_Head_Add);
557 LayerBlendingValues.Arm_L_Add = GetCurveValue(NAME_Layering_Arm_L_Add);
558 LayerBlendingValues.Arm_R_Add = GetCurveValue(NAME_Layering_Arm_R_Add);
559 // Set the Hand Override weights
560 LayerBlendingValues.Hand_R = GetCurveValue(NAME_Layering_Hand_R);
561 LayerBlendingValues.Hand_L = GetCurveValue(NAME_Layering_Hand_L);
562 // Blend and set the Hand IK weights to ensure they only are weighted if allowed by the Arm layers.
563 LayerBlendingValues.EnableHandIK_L = FMath::Lerp(0.0f, GetCurveValue(NAME_Enable_HandIK_L),
564 GetCurveValue(NAME_Layering_Arm_L));
565 LayerBlendingValues.EnableHandIK_R = FMath::Lerp(0.0f, GetCurveValue(NAME_Enable_HandIK_R),
566 GetCurveValue(NAME_Layering_Arm_R));
567 // Set whether the arms should blend in mesh space or local space.
568 // The Mesh space weight will always be 1 unless the Local Space (LS) curve is fully weighted.
569 LayerBlendingValues.Arm_L_LS = GetCurveValue(NAME_Layering_Arm_L_LS);
570 LayerBlendingValues.Arm_L_MS = static_cast<float>(1 - FMath::FloorToInt(LayerBlendingValues.Arm_L_LS));
571 LayerBlendingValues.Arm_R_LS = GetCurveValue(NAME_Layering_Arm_R_LS);
572 LayerBlendingValues.Arm_R_MS = static_cast<float>(1 - FMath::FloorToInt(LayerBlendingValues.Arm_R_LS));
573}
static const FName NAME_Layering_Spine_Add(TEXT("Layering_Spine_Add"))
static const FName NAME_BasePose_N(TEXT("BasePose_N"))
static const FName NAME_Layering_Arm_R_Add(TEXT("Layering_Arm_R_Add"))
static const FName NAME_Layering_Arm_L_LS(TEXT("Layering_Arm_L_LS"))
static const FName NAME_Layering_Hand_L(TEXT("Layering_Hand_L"))
static const FName NAME_Layering_Arm_L_Add(TEXT("Layering_Arm_L_Add"))
static const FName NAME_Layering_Arm_R(TEXT("Layering_Arm_R"))
static const FName NAME_Enable_HandIK_R(TEXT("Enable_HandIK_R"))
static const FName NAME_Layering_Arm_R_LS(TEXT("Layering_Arm_R_LS"))
static const FName NAME_Enable_HandIK_L(TEXT("Enable_HandIK_L"))
static const FName NAME_Mask_AimOffset(TEXT("Mask_AimOffset"))
static const FName NAME_Layering_Head_Add(TEXT("Layering_Head_Add"))
static const FName NAME_Layering_Hand_R(TEXT("Layering_Hand_R"))
static const FName NAME_Layering_Arm_L(TEXT("Layering_Arm_L"))

◆ UpdateMovementValues()

void UALSCharacterAnimInstance::UpdateMovementValues ( float DeltaSeconds)
private
901{
902 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
903 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::UpdateMovementValues);
904 // Interp and set the Velocity Blend.
905 const FALSVelocityBlend& TargetBlend = CalculateVelocityBlend();
906 VelocityBlend.F = FMath::FInterpTo(VelocityBlend.F, TargetBlend.F, DeltaSeconds, Config.VelocityBlendInterpSpeed);
907 VelocityBlend.B = FMath::FInterpTo(VelocityBlend.B, TargetBlend.B, DeltaSeconds, Config.VelocityBlendInterpSpeed);
908 VelocityBlend.L = FMath::FInterpTo(VelocityBlend.L, TargetBlend.L, DeltaSeconds, Config.VelocityBlendInterpSpeed);
909 VelocityBlend.R = FMath::FInterpTo(VelocityBlend.R, TargetBlend.R, DeltaSeconds, Config.VelocityBlendInterpSpeed);
910
911 // Set the Diagonal Scale Amount.
912 Grounded.DiagonalScaleAmount = CalculateDiagonalScaleAmount();
913
914 // Set the Relative Acceleration Amount and Interp the Lean Amount.
916 LeanAmount.LR = FMath::FInterpTo(LeanAmount.LR, RelativeAccelerationAmount.Y, DeltaSeconds,
917 Config.GroundedLeanInterpSpeed);
918 LeanAmount.FB = FMath::FInterpTo(LeanAmount.FB, RelativeAccelerationAmount.X, DeltaSeconds,
919 Config.GroundedLeanInterpSpeed);
920
921 // Set the Walk Run Blend
922 Grounded.WalkRunBlend = CalculateWalkRunBlend();
923
924 // Set the Stride Blend
925 Grounded.StrideBlend = CalculateStrideBlend();
926
927 // Set the Standing and Crouching Play Rates
928 Grounded.StandingPlayRate = CalculateStandingPlayRate();
929 Grounded.CrouchingPlayRate = CalculateCrouchingPlayRate();
930}
FVector RelativeAccelerationAmount
Definition ALSCharacterAnimInstance.h:254

◆ UpdateRagdollValues()

void UALSCharacterAnimInstance::UpdateRagdollValues ( )
private
970{
971 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
972 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::UpdateRagdollValues);
973 // Scale the Flail Rate by the velocity length. The faster the ragdoll moves, the faster the character will flail.
974 const float VelocityLength = GetOwningComponent()->GetPhysicsLinearVelocity(NAME__ALSCharacterAnimInstance__root).Size();
975 FlailRate = FMath::GetMappedRangeValueClamped<float, float>({0.0f, 1000.0f}, {0.0f, 1.0f}, VelocityLength);
976}
float FlailRate
Definition ALSCharacterAnimInstance.h:277

◆ UpdateRotationValues()

void UALSCharacterAnimInstance::UpdateRotationValues ( )
private
933{
934 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Animations);
935 TRACE_CPUPROFILER_EVENT_SCOPE(UALSCharacterAnimInstance::UpdateRotationValues);
936 // Set the Movement Direction
938
939 // Set the Yaw Offsets. These values influence the "YawOffset" curve in the AnimGraph and are used to offset
940 // the characters rotation for more natural movement. The curves allow for fine control over how the offset
941 // behaves for each movement direction.
942 FRotator Delta = CharacterInformation.Velocity.ToOrientationRotator() - CharacterInformation.AimingRotation;
943 Delta.Normalize();
944 const FVector& FBOffset = YawOffset_FB->GetVectorValue(Delta.Yaw);
945 Grounded.FYaw = FBOffset.X;
946 Grounded.BYaw = FBOffset.Y;
947 const FVector& LROffset = YawOffset_LR->GetVectorValue(Delta.Yaw);
948 Grounded.LYaw = LROffset.X;
949 Grounded.RYaw = LROffset.Y;
950}
TObjectPtr< UCurveVector > YawOffset_LR
Definition ALSCharacterAnimInstance.h:328
TObjectPtr< UCurveVector > YawOffset_FB
Definition ALSCharacterAnimInstance.h:325

◆ UPROPERTY() [1/9]

UALSCharacterAnimInstance::UPROPERTY ( EditDefaultsOnly ,
BlueprintReadOnly ,
Category = "Configuration|Main Configuration",
Meta = (ShowOnlyInnerProperties) )

Configuration

◆ UPROPERTY() [2/9]

UALSCharacterAnimInstance::UPROPERTY ( EditDefaultsOnly ,
BlueprintReadOnly ,
Category = "Configuration|Rotate In Place",
Meta = (ShowOnlyInnerProperties) )

Rotate In Place

◆ UPROPERTY() [3/9]

UALSCharacterAnimInstance::UPROPERTY ( EditDefaultsOnly ,
BlueprintReadOnly ,
Category = "Configuration|Turn In Place",
Meta = (ShowOnlyInnerProperties) )

Turn In Place

◆ UPROPERTY() [4/9]

UALSCharacterAnimInstance::UPROPERTY ( VisibleDefaultsOnly ,
BlueprintReadOnly ,
Category = "Read Only Data|Anim Graph - Aiming Values",
Meta = (ShowOnlyInnerProperties) )

Anim Graph - Aiming Values

◆ UPROPERTY() [5/9]

UALSCharacterAnimInstance::UPROPERTY ( VisibleDefaultsOnly ,
BlueprintReadOnly ,
Category = "Read Only Data|Anim Graph - Foot IK",
Meta = (ShowOnlyInnerProperties) )

Anim Graph - Foot IK

◆ UPROPERTY() [6/9]

UALSCharacterAnimInstance::UPROPERTY ( VisibleDefaultsOnly ,
BlueprintReadOnly ,
Category = "Read Only Data|Anim Graph - Grounded",
Meta = (ShowOnlyInnerProperties) )

Anim Graph - Grounded

◆ UPROPERTY() [7/9]

UALSCharacterAnimInstance::UPROPERTY ( VisibleDefaultsOnly ,
BlueprintReadOnly ,
Category = "Read Only Data|Anim Graph - In Air",
Meta = (ShowOnlyInnerProperties) )

Anim Graph - In Air

◆ UPROPERTY() [8/9]

UALSCharacterAnimInstance::UPROPERTY ( VisibleDefaultsOnly ,
BlueprintReadOnly ,
Category = "Read Only Data|Anim Graph - Layer Blending",
Meta = (ShowOnlyInnerProperties) )

Anim Graph - Layer Blending

◆ UPROPERTY() [9/9]

UALSCharacterAnimInstance::UPROPERTY ( VisibleDefaultsOnly ,
BlueprintReadOnly ,
Category = "Read Only Data|Character Information",
Meta = (ShowOnlyInnerProperties) )

Character Information

Member Data Documentation

◆ ALSDebugComponent

TObjectPtr<UALSDebugComponent> UALSCharacterAnimInstance::ALSDebugComponent = nullptr
private

◆ bCanPlayDynamicTransition

bool UALSCharacterAnimInstance::bCanPlayDynamicTransition = true
private

◆ bFiringWeapon

bool UALSCharacterAnimInstance::bFiringWeapon = false

◆ bOptimize

bool UALSCharacterAnimInstance::bOptimize = false

◆ Character

TObjectPtr<AALSBaseCharacter> UALSCharacterAnimInstance::Character = nullptr

References

◆ DiagonalScaleAmountCurve

TObjectPtr<UCurveFloat> UALSCharacterAnimInstance::DiagonalScaleAmountCurve = nullptr

Blend Curves

◆ FlailRate

float UALSCharacterAnimInstance::FlailRate = 0.0f

Anim Graph - Ragdoll

◆ Gait

FALSGait UALSCharacterAnimInstance::Gait = EALSGait::Walking

◆ GroundedEntryState

FALSGroundedEntryState UALSCharacterAnimInstance::GroundedEntryState = EALSGroundedEntryState::None

◆ GunOffset

FVector UALSCharacterAnimInstance::GunOffset = FVector::ZeroVector

◆ IkFootL_BoneName

FName UALSCharacterAnimInstance::IkFootL_BoneName = FName(TEXT("ik_foot_l"))

IK Bone Names

◆ IkFootR_BoneName

FName UALSCharacterAnimInstance::IkFootR_BoneName = FName(TEXT("ik_foot_r"))

◆ InjuredAlpha

float UALSCharacterAnimInstance::InjuredAlpha = 0.0f

◆ InjuredBodyPart

EBodyPartName UALSCharacterAnimInstance::InjuredBodyPart = EBodyPartName::Pelvis

◆ LandPredictionCurve

TObjectPtr<UCurveFloat> UALSCharacterAnimInstance::LandPredictionCurve = nullptr

◆ LeanAmount

FALSLeanAmount UALSCharacterAnimInstance::LeanAmount

◆ LeanInAirCurve

TObjectPtr<UCurveFloat> UALSCharacterAnimInstance::LeanInAirCurve = nullptr

◆ MovementAction

FALSMovementAction UALSCharacterAnimInstance::MovementAction = EALSMovementAction::None

◆ MovementDirection

FALSMovementDirection UALSCharacterAnimInstance::MovementDirection = EALSMovementDirection::Forward

◆ MovementState

FALSMovementState UALSCharacterAnimInstance::MovementState = EALSMovementState::None

◆ OnJumpedTimer

FTimerHandle UALSCharacterAnimInstance::OnJumpedTimer
private

◆ OnPivotTimer

FTimerHandle UALSCharacterAnimInstance::OnPivotTimer
private

◆ OverlayState

FALSOverlayState UALSCharacterAnimInstance::OverlayState = EALSOverlayState::Default

◆ PivotPoint

FTransform UALSCharacterAnimInstance::PivotPoint

◆ PlayDynamicTransitionTimer

FTimerHandle UALSCharacterAnimInstance::PlayDynamicTransitionTimer
private

◆ RecoilTransform

FTransform UALSCharacterAnimInstance::RecoilTransform

◆ RelativeAccelerationAmount

FVector UALSCharacterAnimInstance::RelativeAccelerationAmount = FVector::ZeroVector

◆ RotationMode

FALSRotationMode UALSCharacterAnimInstance::RotationMode = EALSRotationMode::VelocityDirection

◆ SmoothedAimingAngle

FVector2D UALSCharacterAnimInstance::SmoothedAimingAngle = FVector2D::ZeroVector

◆ Stance

FALSStance UALSCharacterAnimInstance::Stance = EALSStance::Standing

◆ StrideBlend_C_Walk

TObjectPtr<UCurveFloat> UALSCharacterAnimInstance::StrideBlend_C_Walk = nullptr

◆ StrideBlend_N_Run

TObjectPtr<UCurveFloat> UALSCharacterAnimInstance::StrideBlend_N_Run = nullptr

◆ StrideBlend_N_Walk

TObjectPtr<UCurveFloat> UALSCharacterAnimInstance::StrideBlend_N_Walk = nullptr

◆ TransitionAnim_L

TObjectPtr<UAnimSequenceBase> UALSCharacterAnimInstance::TransitionAnim_L = nullptr

◆ TransitionAnim_R

TObjectPtr<UAnimSequenceBase> UALSCharacterAnimInstance::TransitionAnim_R = nullptr

◆ VelocityBlend

FALSVelocityBlend UALSCharacterAnimInstance::VelocityBlend

◆ YawOffset_FB

TObjectPtr<UCurveVector> UALSCharacterAnimInstance::YawOffset_FB = nullptr

◆ YawOffset_LR

TObjectPtr<UCurveVector> UALSCharacterAnimInstance::YawOffset_LR = nullptr

The documentation for this class was generated from the following files: