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

#include <ALSBaseCharacter.h>

Inheritance diagram for AALSBaseCharacter:
AInteractableCharacter IALSCharacterInterface ACharacterBase ICharacterBaseInterface ISaveLoad IBaseInterface AALSCharacter ACustomCharacterBase ACustomAICharacter ACustomPlayerCharacter ACampaignAICharacter AHordeAICharacter ACampaignPlayerCharacter AMultiplayerPlayerCharacter

Public Member Functions

 AALSBaseCharacter (const FObjectInitializer &ObjectInitializer)
 
FORCEINLINE class UALSCharacterMovementComponentGetALSMovementComponent () const
 
virtual FVector GetLeftHandGoal () const override
 
virtual FVector GetRightHandGoal () const override
 
virtual EALSOverlayState GetCurrentOverlayState () const override
 
virtual bool GetIsMantling () const override
 
virtual FORCEINLINE IALSGravityMovementInterfaceGetALSGravityMovementInterface () const override
 
virtual void Ragdoll () override
 
virtual void Tick (float DeltaTime) override
 
virtual void BeginPlay () override
 
virtual void PostInitializeComponents () override
 
virtual void GetLifetimeReplicatedProps (TArray< FLifetimeProperty > &OutLifetimeProps) const override
 
UAnimMontage * GetGetUpAnimation (bool bRagdollFaceUpState)
 
virtual void RagdollStart ()
 
virtual void RagdollEnd ()
 
void Server_SetMeshLocationDuringRagdoll (FVector MeshLocation)
 
void SetMovementState (EALSMovementState NewState, bool bForce=false)
 
EALSMovementState GetMovementState () const
 
EALSMovementState GetPrevMovementState () const
 
void SetMovementAction (EALSMovementAction NewAction, bool bForce=false)
 
EALSMovementAction GetMovementAction () const
 
void SetStance (EALSStance NewStance, bool bForce=false)
 
EALSStance GetStance () const
 
void SetOverlayOverrideState (int32 NewState)
 
int32 GetOverlayOverrideState () const
 
void SetGait (EALSGait NewGait, bool bForce=false)
 
EALSGait GetGait () const
 
EALSGait GetDesiredGait () const
 
virtual void SetRotationMode (EALSRotationMode NewRotationMode, bool bForce=false)
 
void Server_SetRotationMode (EALSRotationMode NewRotationMode, bool bForce)
 
EALSRotationMode GetRotationMode () const
 
virtual void SetViewMode (EALSViewMode NewViewMode, bool bForce=false)
 
void Server_SetViewMode (EALSViewMode NewViewMode, bool bForce)
 
EALSViewMode GetViewMode () const
 
void SetOverlayState (EALSOverlayState NewState, bool bForce=false)
 
void SetGroundedEntryState (EALSGroundedEntryState NewState)
 
void Server_SetOverlayState (EALSOverlayState NewState, bool bForce)
 
EALSOverlayState GetOverlayState () const
 
EALSGroundedEntryState GetGroundedEntryState () const
 
void EventOnLanded ()
 
void Multicast_OnLanded ()
 
void EventOnJumped ()
 
void Multicast_OnJumped ()
 
void Server_PlayMontage (UAnimMontage *Montage, float PlayRate)
 
void Multicast_PlayMontage (UAnimMontage *Montage, float PlayRate)
 
void Server_StopMontage (const float InBlendOutTime, const UAnimMontage *Montage)
 
void Multicast_StopMontage (const float InBlendOutTime, const UAnimMontage *Montage)
 
void ReplicatedRagdollStart ()
 
void Server_RagdollStart ()
 
void Multicast_RagdollStart ()
 
void ReplicatedRagdollEnd ()
 
void Server_RagdollEnd (FVector CharacterLocation)
 
void Multicast_RagdollEnd (FVector CharacterLocation)
 
EALSStance GetDesiredStance () const
 
void SetDesiredStance (EALSStance NewStance)
 
void Server_SetDesiredStance (EALSStance NewStance)
 
void SetDesiredGait (EALSGait NewGait)
 
void Server_SetDesiredGait (EALSGait NewGait)
 
EALSRotationMode GetDesiredRotationMode () const
 
virtual void SetDesiredRotationMode (EALSRotationMode NewRotMode)
 
void Server_SetDesiredRotationMode (EALSRotationMode NewRotMode)
 
void SetActorLocationAndTargetRotation (FVector NewLocation, FRotator NewRotation)
 
bool HasMovementInput () const
 
FALSMovementSettings GetTargetMovementSettings () const
 
virtual EALSGait GetAllowedGait () const
 
EALSGait GetActualGait (EALSGait AllowedGait) const
 
virtual bool CanSprint () const
 
void OnBreakfall ()
 
virtual void OnBreakfall_Implementation ()
 
virtual float PlayReplicatedMontage (UAnimMontage *MontageToPlay, const float InPlayRate, const EMontagePlayReturnType ReturnValueType, const float InTimeToStartMontageAt, const bool bStopAllMontages) override
 
virtual void StopReplicatedMontage (const float InBlendOutTime, const UAnimMontage *Montage) override
 
void Replicated_PlayMontage (UAnimMontage *Montage, float PlayRate)
 
virtual void Replicated_PlayMontage_Implementation (UAnimMontage *Montage, float PlayRate)
 
UAnimMontage * GetRollAnimation ()
 
float GetAnimCurveValue (FName CurveName) const
 
void SetVisibleMesh (USkeletalMesh *NewSkeletalMesh)
 
void Server_SetVisibleMesh (USkeletalMesh *NewSkeletalMesh)
 
bool IsRightShoulder () const
 
void SetRightShoulder (const bool bNewRightShoulder)
 
bool IsAimingDownSights () const
 
virtual bool GetCanAimDownSights () const
 
void SetAimDownSights (const bool bNewAimDownSights)
 
virtual ECollisionChannel GetThirdPersonTraceParams (FVector &TraceOrigin, float &TraceRadius)
 
virtual FTransform GetThirdPersonPivotTarget ()
 
virtual FVector GetFirstPersonCameraTarget ()
 
virtual FVector GetAimDownSightCameraTarget () const
 
virtual float GetAimDownSightFOV () const
 
void GetCameraParameters (float &TPFOVOut, float &FPFOVOut, bool &bRightShoulderOut) const
 
void SetCameraBehavior (UALSPlayerCameraBehavior *CamBeh)
 
FVector GetAcceleration () const
 
bool IsMoving () const
 
bool GetIsFlying () const
 
FVector GetMovementInput () const
 
float GetMovementInputAmount () const
 
float GetSpeed () const
 
FRotator GetAimingRotation () const
 
float GetAimYawRate () const
 
virtual void ForwardMovementAction (float Value)
 
virtual void RightMovementAction (float Value)
 
void CameraUpAction (float Value)
 
void CameraRightAction (float Value)
 
virtual void JumpAction (bool bValue)
 
virtual void SprintAction (bool bValue)
 
virtual void AimAction (bool bValue)
 
virtual void CameraTapAction ()
 
virtual void CameraHeldAction ()
 
virtual void StanceAction ()
 
void WalkAction ()
 
void RagdollAction ()
 
void VelocityDirectionAction ()
 
void LookingDirectionAction ()
 
- Public Member Functions inherited from AInteractableCharacter
 AInteractableCharacter (const FObjectInitializer &ObjectInitializer)
 
virtual USceneComponent * GetThrowPoint () const override
 
virtual void ReceiveStartFocus (AActor *Caller)
 
virtual void ReceiveEndFocus (AActor *Caller)
 
virtual void ReceiveOnInteract (AActor *Caller, const EInteractionType InteractionType)
 
virtual void ReceiveOnEndInteract (AActor *Caller)
 
virtual void ReceiveOnOverlap (AActor *Caller)
 
virtual void ReceiveOnEndOverlap (AActor *Caller)
 
virtual void ReceiveToggleSwitch (AActor *Caller, const bool bOn)
 
- Public Member Functions inherited from ACharacterBase
 ACharacterBase (const FObjectInitializer &ObjectInitializer)
 
virtual void SetupPlayerInputComponent (class UInputComponent *PlayerInputComponent) override
 
virtual bool SaveGame () override
 
virtual bool LoadGame () override
 
virtual USkeletalMeshComponent * GetCharacterMesh () const override
 
virtual UPrimitiveComponent * GetPrimitiveComponent () override
 
virtual void RagdollStop () override
 
virtual bool GetCharacterHealth (float &Health, float &MaxHealth) const override
 
virtual FCharacterBaseSkillsGetCharacterSkills () override
 
virtual bool GetAudioSocketLocation (const FName &AudioSocket, FVector &Location) const override
 
virtual FCharacterInfo GetCharacterInfo () const override
 
virtual void GetThrowStats (FTransform &OutTransform, FVector &OutThrowForce) const override
 
virtual void CharacterModeChanged (const FGameplayTag &NewMode) override
 
virtual int32 GetStrength () const
 
virtual int32 GetPerception () const
 
virtual int32 GetEndurance () const
 
virtual int32 GetCharisma () const
 
virtual int32 GetIntelligence () const
 
virtual int32 GetAgility () const
 
virtual int32 GetWeaponSkill () const
 
virtual int32 GetStealth () const
 
virtual int32 GetLuck () const
 
virtual int32 GetSkillPoints () const
 

Public Attributes

float GravityMultiplier = 9.8f
 
FJumpPressedSignature JumpPressedDelegate
 
FOnJumpedSignature OnJumpedDelegate
 
FRagdollStateChangedSignature RagdollStateChangedDelegate
 
- Public Attributes inherited from ACharacterBase
FOnCharacterDeath OnCharacterDeath
 

Protected Member Functions

void RagdollUpdate (float DeltaTime)
 
void SetActorLocationDuringRagdoll (float DeltaTime)
 
virtual void OnMovementModeChanged (EMovementMode PrevMovementMode, uint8 PreviousCustomMode=0) override
 
virtual void OnMovementStateChanged (EALSMovementState PreviousState)
 
virtual void OnMovementActionChanged (EALSMovementAction PreviousAction)
 
virtual void OnStanceChanged (EALSStance PreviousStance)
 
virtual void OnRotationModeChanged (EALSRotationMode PreviousRotationMode)
 
virtual void OnGaitChanged (EALSGait PreviousGait)
 
virtual void OnViewModeChanged (EALSViewMode PreviousViewMode)
 
virtual void OnOverlayStateChanged (EALSOverlayState PreviousState)
 
virtual void OnVisibleMeshChanged (const USkeletalMesh *PreviousSkeletalMesh)
 
virtual void OnStartCrouch (float HalfHeightAdjust, float ScaledHalfHeightAdjust) override
 
virtual void OnEndCrouch (float HalfHeightAdjust, float ScaledHalfHeightAdjust) override
 
virtual void OnJumped_Implementation () override
 
virtual void Landed (const FHitResult &Hit) override
 
void OnLandFrictionReset ()
 
void SetEssentialValues (float DeltaTime)
 
void UpdateCharacterMovement ()
 
void UpdateGroundedRotation (float DeltaTime)
 
void UpdateInAirRotation (float DeltaTime)
 
void SmoothCharacterRotation (FRotator Target, float TargetInterpSpeed, float ActorInterpSpeed, float DeltaTime)
 
float CalculateGroundedRotationRate () const
 
void LimitRotation (float AimYawMin, float AimYawMax, float InterpSpeed, float DeltaTime)
 
void SetMovementModel ()
 
void ForceUpdateCharacterState ()
 
void OnRep_RotationMode (EALSRotationMode PrevRotMode)
 
void OnRep_ViewMode (EALSViewMode PrevViewMode)
 
void OnRep_OverlayState (EALSOverlayState PrevOverlayState)
 
void OnRep_VisibleMesh (const USkeletalMesh *PreviousSkeletalMesh)
 
void HandleNonMovingRotation (float DeltaTime)
 
- Protected Member Functions inherited from AInteractableCharacter
virtual void OnPawnSpawned () override
 
virtual void InteractionDataUpdated ()
 
- Protected Member Functions inherited from ACharacterBase
virtual void NotifyHit (UPrimitiveComponent *MyComp, AActor *Other, UPrimitiveComponent *OtherComp, bool bSelfMoved, FVector HitLocation, FVector HitNormal, FVector NormalImpulse, const FHitResult &Hit) override
 
virtual void FallOver (const float WaitTime)
 
void OnFallOver (const float WaitTime)
 
virtual void GetUpFromFall ()
 
void OnGetUpFromFall ()
 
void OnRep_CharacterDeath ()
 
IPlayerControllerInterfaceGetPlayerControllerInterface ()
 
IPlayerStateInterfaceGetPlayerStateInterface ()
 
void LogDebugError (const FString &Message) const
 
void LogDebugError (const FString &Message, const int32 Value) const
 
void LogDebugError (const FString &Message, const float Value) const
 
void LogDebugWarning (const FString &Message) const
 
void LogDebugWarning (const FString &Message, const int32 Value) const
 
void LogDebugWarning (const FString &Message, const float Value) const
 
void LogDebugMessage (const FString &Message, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const int32 Value, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const float Value, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const bool bValue, const bool bWarning, const bool bError) const
 
void LogOnScreenMessage (const int32 Key, const FString &Message, FColor Color=FColor::Green) const
 
void SetCategoryName (const FLogCategoryBase &Category)
 

Protected Attributes

TObjectPtr< UALSCharacterMovementComponentMyCharacterMovementComponent
 
bool bOptimizeGroundRotation = true
 
bool bOptimizeAnimValues = true
 
FALSAnimValues AnimValues
 
IALSAnimInterfaceAnimInstanceInterface
 
EALSRotationMode DesiredRotationMode = EALSRotationMode::LookingDirection
 
EALSGait DesiredGait = EALSGait::Running
 
EALSStance DesiredStance = EALSStance::Standing
 
float LookUpDownRate = 1.25f
 
float LookLeftRightRate = 1.25f
 
float RollDoubleTapTimeout = 0.3f
 
bool bBreakFall = false
 
bool bSprintHeld = false
 
float ThirdPersonFOV = 90.0f
 
float FirstPersonFOV = 90.0f
 
bool bRightShoulder = false
 
bool bAimDownSights = false
 
FDataTableRowHandle MovementModel
 
FVector Acceleration = FVector::ZeroVector
 
bool bIsMoving = false
 
bool bIsFlying = false
 
bool bHasMovementInput = false
 
FRotator LastVelocityRotation
 
FRotator LastMovementInputRotation
 
float Speed = 0.0f
 
float MovementInputAmount = 0.0f
 
float AimYawRate = 0.0f
 
float EasedMaxAcceleration = 0.0f
 
FVector ReplicatedCurrentAcceleration = FVector::ZeroVector
 
FRotator ReplicatedControlRotation = FRotator::ZeroRotator
 
TObjectPtr< USkeletalMesh > VisibleMesh = nullptr
 
EALSOverlayState OverlayState = EALSOverlayState::Default
 
EALSGroundedEntryState GroundedEntryState
 
EALSMovementState MovementState = EALSMovementState::None
 
EALSMovementState PrevMovementState = EALSMovementState::None
 
EALSMovementAction MovementAction = EALSMovementAction::None
 
EALSRotationMode RotationMode = EALSRotationMode::LookingDirection
 
EALSGait Gait = EALSGait::Walking
 
EALSStance Stance = EALSStance::Standing
 
EALSViewMode ViewMode = EALSViewMode::ThirdPerson
 
int32 OverlayOverrideState = 0
 
FALSMovementStateSettings MovementData
 
FRotator TargetRotation = FRotator::ZeroRotator
 
FRotator InAirRotation = FRotator::ZeroRotator
 
float YawOffset = 0.0f
 
bool bBreakfallOnLand = true
 
float BreakfallOnLandVelocity = 700.0f
 
bool bReversedPelvis = false
 
bool bRagdollOnLand = false
 
float RagdollOnLandVelocity = 1000.0f
 
bool bRagdollOnGround = false
 
bool bRagdollFaceUp = false
 
FVector LastRagdollVelocity = FVector::ZeroVector
 
FVector TargetRagdollLocation = FVector::ZeroVector
 
float ServerRagdollPull = 0.0f
 
EVisibilityBasedAnimTickOption DefVisBasedTickOp
 
bool bPreRagdollURO = false
 
FVector PreviousVelocity = FVector::ZeroVector
 
float PreviousAimYaw = 0.0f
 
TObjectPtr< UALSPlayerCameraBehaviorCameraBehavior
 
float LastStanceInputTime = 0.0f
 
FTimerHandle OnLandedFrictionResetTimer
 
FRotator AimingRotation = FRotator::ZeroRotator
 
bool bEnableNetworkOptimizations = false
 
bool bForceEnableNetworkOptimizationsOff = false
 
- Protected Attributes inherited from AInteractableCharacter
USceneComponent * ThrowPoint
 
class UInteractionComponent * InteractionComponent
 
class UInteractableActorComponent * InteractableActorComponent
 
class USphereComponent * InteractionSphere
 
class UInventoryComponent * InventoryComponent
 
class UAudioReactionComponent * AudioReactionComponent
 
bool bAlwaysShowOutline = false
 
- Protected Attributes inherited from ACharacterBase
bool bDebuggingMode = false
 
FCharacterBaseSkills CharacterSkills
 
FCharacterInfo CharacterInfo
 
bool bDead = false
 
float PickupThrowIntensity = 500.0f
 
bool bCanBePushed = false
 
float HitVelocityThreshold = 50.0f
 
float HitVelocityMultiplier = 5.0f
 
float HitReactionMultiplier = 0.01f
 
bool bPushHitReaction = true
 
bool bAddMovementInput = true
 
bool bAddCharacterMovement = true
 
float PushFallVelocityThreshold = 200.0f
 
float PushedFallVelocityThreshold = 500.0f
 
float PushedFallOverWaitTime = 2.0f
 

Private Member Functions

void SetupCapsuleComponent () const
 
void SetupMeshComponent () const
 

Private Attributes

TObjectPtr< UALSDebugComponentALSDebugComponent = nullptr
 

Constructor & Destructor Documentation

◆ AALSBaseCharacter()

AALSBaseCharacter::AALSBaseCharacter ( const FObjectInitializer & ObjectInitializer)
42 : Super(ObjectInitializer.SetDefaultSubobjectClass<UALSCharacterMovementComponent>(CharacterMovementComponentName))
43{
44 PrimaryActorTick.bCanEverTick = true;
45 bUseControllerRotationYaw = false;
46 bReplicates = true;
47 SetReplicatingMovement(true);
48
51 UDataTable* MovementDT = UBaseHelpersBPLib::GetDefaultDataTable("/ALSV4_CPP/AdvancedLocomotionV4/Data/DataTables/MovementModelTable");
52 MovementModel.DataTable = MovementDT;
53 MovementModel.RowName = FName("Normal");
54}
void SetupMeshComponent() const
Definition ALSBaseCharacter.cpp:2030
void SetupCapsuleComponent() const
Definition ALSBaseCharacter.cpp:2016
FDataTableRowHandle MovementModel
Definition ALSBaseCharacter.h:543
Definition ALSCharacterMovementComponent.h:23
static UDataTable * GetDefaultDataTable(const FString &Location)
Definition BaseHelpersBPLib.cpp:237

Member Function Documentation

◆ AimAction()

void AALSBaseCharacter::AimAction ( bool bValue)
virtual

Reimplemented in AMultiplayerPlayerCharacter, and ACustomPlayerCharacter.

1838{
1839 if(bValue)
1840 {
1841 // AimAction: Hold "AimAction" to enter the aiming mode, release to revert back the desired rotation mode.
1843 }
1844 else
1845 {
1847 {
1849 }
1851 {
1853 }
1854 }
1855}
EALSRotationMode DesiredRotationMode
Definition ALSBaseCharacter.h:502
EALSViewMode ViewMode
Definition ALSBaseCharacter.h:616
virtual void SetRotationMode(EALSRotationMode NewRotationMode, bool bForce=false)
Definition ALSBaseCharacter.cpp:522

◆ BeginPlay()

void AALSBaseCharacter::BeginPlay ( )
overridevirtual

Reimplemented from AInteractableCharacter.

Reimplemented in AALSCharacter, ACampaignAICharacter, ACampaignPlayerCharacter, ACustomAICharacter, ACustomCharacterBase, ACustomPlayerCharacter, and AMultiplayerPlayerCharacter.

162{
163 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::BeginPlay);
164 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
165 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
166
167 Super::BeginPlay();
168 //@ TEST Optimizations
169 if(GetMesh() != nullptr && GetMesh()->GetAnimInstance() != nullptr)
170 {
171 AnimInstanceInterface = Cast<IALSAnimInterface>(GetMesh()->GetAnimInstance());
172 }
173
174 // If we're in networked game, disable curved movement
175 bEnableNetworkOptimizations = !IsNetMode(NM_Standalone);
177
178 // Make sure the mesh and animbp update after the CharacterBP to ensure it gets the most recent values.
179 GetMesh()->AddTickPrerequisiteActor(this);
180
181 // Set the Movement Model
183
184 // Force update states to use the initial desired values.
186
188 {
189 UnCrouch();
190 }
191 else if (Stance == EALSStance::Crouching)
192 {
193 Crouch();
194 }
195
196 // Set default rotation values.
197 TargetRotation = GetActorRotation();
200
201 if (GetMesh()->GetAnimInstance() && GetLocalRole() == ROLE_SimulatedProxy)
202 {
203 GetMesh()->GetAnimInstance()->SetRootMotionMode(ERootMotionMode::IgnoreRootMotion);
204 }
205
207
208 ALSDebugComponent = FindComponentByClass<UALSDebugComponent>();
209}
bool bEnableNetworkOptimizations
Definition ALSBaseCharacter.h:700
FALSMovementSettings GetTargetMovementSettings() const
Definition ALSBaseCharacter.cpp:793
virtual void BeginPlay() override
Definition ALSBaseCharacter.cpp:161
void SetMovementModel()
Definition ALSBaseCharacter.cpp:758
IALSAnimInterface * AnimInstanceInterface
Definition ALSBaseCharacter.h:495
EALSStance Stance
Definition ALSBaseCharacter.h:613
bool bForceEnableNetworkOptimizationsOff
Definition ALSBaseCharacter.h:703
FRotator TargetRotation
Definition ALSBaseCharacter.h:629
TObjectPtr< UALSDebugComponent > ALSDebugComponent
Definition ALSBaseCharacter.h:708
void ForceUpdateCharacterState()
Definition ALSBaseCharacter.cpp:777
TObjectPtr< UALSCharacterMovementComponent > MyCharacterMovementComponent
Definition ALSBaseCharacter.h:484
FRotator LastVelocityRotation
Definition ALSBaseCharacter.h:560
FRotator LastMovementInputRotation
Definition ALSBaseCharacter.h:563

◆ CalculateGroundedRotationRate()

float AALSBaseCharacter::CalculateGroundedRotationRate ( ) const
protected
1726{
1727 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1728
1729 // Calculate the rotation rate by using the current Rotation Rate Curve in the Movement Settings.
1730 // Using the curve in conjunction with the mapped speed gives you a high level of control over the rotation
1731 // rates for each speed. Increase the speed if the camera is rotating quickly for more responsive rotation.
1732 if (ensure(IsValid(MyCharacterMovementComponent) && ensure(IsValid(MyCharacterMovementComponent->CurrentMovementSettings.RotationRateCurve))))
1733 {
1734 const float MappedSpeedVal = MyCharacterMovementComponent->GetMappedSpeed();
1735 const float CurveVal =
1736 MyCharacterMovementComponent->CurrentMovementSettings.RotationRateCurve->GetFloatValue(MappedSpeedVal);
1737 const float ClampedAimYawRate = FMath::GetMappedRangeValueClamped<float, float>({0.0f, 300.0f}, {1.0f, 3.0f}, AimYawRate);
1738 return CurveVal * ClampedAimYawRate;
1739 }
1740 return 0.0f;
1741}
float AimYawRate
Definition ALSBaseCharacter.h:572

◆ CameraHeldAction()

void AALSBaseCharacter::CameraHeldAction ( )
virtual

Reimplemented in AMultiplayerPlayerCharacter.

1870{
1871 // Switch camera mode
1873 {
1875 }
1877 {
1879 }
1880}
virtual void SetViewMode(EALSViewMode NewViewMode, bool bForce=false)
Definition ALSBaseCharacter.cpp:554

◆ CameraRightAction()

void AALSBaseCharacter::CameraRightAction ( float Value)

◆ CameraTapAction()

void AALSBaseCharacter::CameraTapAction ( )
virtual

Reimplemented in AMultiplayerPlayerCharacter.

1858{
1860 {
1861 // Don't swap shoulders on first person mode
1862 return;
1863 }
1864
1865 // Switch shoulders
1867}
bool bRightShoulder
Definition ALSBaseCharacter.h:534
void SetRightShoulder(const bool bNewRightShoulder)
Definition ALSBaseCharacter.cpp:915

◆ CameraUpAction()

void AALSBaseCharacter::CameraUpAction ( float Value)

◆ CanSprint()

bool AALSBaseCharacter::CanSprint ( ) const
virtual

Reimplemented in ACustomAICharacter, and ACustomCharacterBase.

839{
840 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::CanSprint);
841 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
842 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
843
844
845 // Determine if the character is currently able to sprint based on the Rotation mode and current acceleration
846 // (input) rotation. If the character is in the Looking Rotation mode, only allow sprinting if there is full
847 // movement input and it is faced forward relative to the camera + or - 50 degrees.
848
850 {
851 return false;
852 }
853
854 const bool bValidInputAmount = MovementInputAmount > 0.9f;
855
857 {
858 return bValidInputAmount;
859 }
860
862 {
863 const FRotator AccRot = ReplicatedCurrentAcceleration.ToOrientationRotator();
864 FRotator Delta = AccRot - AimingRotation;
865 Delta.Normalize();
866
867 return bValidInputAmount && FMath::Abs(Delta.Yaw) < 50.0f;
868 }
869
870 return false;
871}
bool bHasMovementInput
Definition ALSBaseCharacter.h:557
virtual bool CanSprint() const
Definition ALSBaseCharacter.cpp:838
FVector ReplicatedCurrentAcceleration
Definition ALSBaseCharacter.h:580
float MovementInputAmount
Definition ALSBaseCharacter.h:569
FRotator AimingRotation
Definition ALSBaseCharacter.h:697
EALSRotationMode RotationMode
Definition ALSBaseCharacter.h:607

◆ EventOnJumped()

void AALSBaseCharacter::EventOnJumped ( )

On Jumped

670{
671 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
672
673 // Set the new In Air Rotation to the velocity rotation if speed is greater than 100.
674 InAirRotation = Speed > 100.0f ? LastVelocityRotation : GetActorRotation();
675
676 OnJumpedDelegate.Broadcast();
677}
float Speed
Definition ALSBaseCharacter.h:566
FRotator InAirRotation
Definition ALSBaseCharacter.h:632
FOnJumpedSignature OnJumpedDelegate
Definition ALSBaseCharacter.h:217

◆ EventOnLanded()

void AALSBaseCharacter::EventOnLanded ( )

Landed, Jumped, Rolling, Mantling and Ragdoll On Landed

633{
634 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::EventOnLanded);
635 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
636 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
637
638
639 const float VelZ = FMath::Abs(GetCharacterMovement()->Velocity.Z);
640
642 {
644 }
646 {
647 OnBreakfall();
648 }
649 else
650 {
651 GetCharacterMovement()->BrakingFrictionFactor = bHasMovementInput ? 0.5f : 3.0f;
652
653 // After 0.5 secs, reset braking friction factor to zero
654 GetWorldTimerManager().SetTimer(OnLandedFrictionResetTimer, this,
656 }
657}
void OnLandFrictionReset()
Definition ALSBaseCharacter.cpp:1323
void ReplicatedRagdollStart()
Definition ALSBaseCharacter.cpp:1971
bool bBreakfallOnLand
Definition ALSBaseCharacter.h:641
float RagdollOnLandVelocity
Definition ALSBaseCharacter.h:659
void EventOnLanded()
Definition ALSBaseCharacter.cpp:632
bool bRagdollOnLand
Definition ALSBaseCharacter.h:655
float BreakfallOnLandVelocity
Definition ALSBaseCharacter.h:645
FTimerHandle OnLandedFrictionResetTimer
Definition ALSBaseCharacter.h:694

◆ ForceUpdateCharacterState()

void AALSBaseCharacter::ForceUpdateCharacterState ( )
protected
778{
779 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::ForceUpdateCharacterState);
780 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
781 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
782
783
784 SetGait(DesiredGait, true);
787 SetViewMode(ViewMode, true);
791}
void SetMovementState(EALSMovementState NewState, bool bForce=false)
Definition ALSBaseCharacter.cpp:367
void SetOverlayState(EALSOverlayState NewState, bool bForce=false)
Definition ALSBaseCharacter.cpp:587
EALSGait DesiredGait
Definition ALSBaseCharacter.h:505
EALSMovementState MovementState
Definition ALSBaseCharacter.h:598
EALSMovementAction MovementAction
Definition ALSBaseCharacter.h:604
EALSStance DesiredStance
Definition ALSBaseCharacter.h:508
EALSOverlayState OverlayState
Definition ALSBaseCharacter.h:592
void SetMovementAction(EALSMovementAction NewAction, bool bForce=false)
Definition ALSBaseCharacter.cpp:385
void SetGait(EALSGait NewGait, bool bForce=false)
Definition ALSBaseCharacter.cpp:429
void SetStance(EALSStance NewStance, bool bForce=false)
Definition ALSBaseCharacter.cpp:398

◆ ForwardMovementAction()

void AALSBaseCharacter::ForwardMovementAction ( float Value)
virtual

Input

Reimplemented in ACustomCharacterBase.

1761{
1763 {
1764 // Default camera relative movement behavior
1765 const FRotator DirRotator(0.0f, AimingRotation.Yaw, 0.0f);
1766 AddMovementInput(UKismetMathLibrary::GetForwardVector(DirRotator), Value);
1767 }
1768}

◆ GetAcceleration()

FVector AALSBaseCharacter::GetAcceleration ( ) const
inline

Essential Information Getters/Setters

341{ return Acceleration; }
FVector Acceleration
Definition ALSBaseCharacter.h:548

◆ GetActualGait()

EALSGait AALSBaseCharacter::GetActualGait ( EALSGait AllowedGait) const
1687{
1688 // Get the Actual Gait. This is calculated by the actual movement of the character, and so it can be different
1689 // from the desired gait or allowed gait. For instance, if the Allowed Gait becomes walking,
1690 // the Actual gait will still be running until the character decelerates to the walking speed.
1691
1692 const float LocWalkSpeed = MyCharacterMovementComponent->CurrentMovementSettings.WalkSpeed;
1693 const float LocRunSpeed = MyCharacterMovementComponent->CurrentMovementSettings.RunSpeed;
1694
1695 if (Speed > LocRunSpeed + 10.0f)
1696 {
1697 if (AllowedGait == EALSGait::Sprinting)
1698 {
1699 return EALSGait::Sprinting;
1700 }
1701 return EALSGait::Running;
1702 }
1703
1704 if (Speed >= LocWalkSpeed + 10.0f)
1705 {
1706 return EALSGait::Running;
1707 }
1708
1709 return EALSGait::Walking;
1710}

◆ GetAimDownSightCameraTarget()

FVector AALSBaseCharacter::GetAimDownSightCameraTarget ( ) const
virtual

Reimplemented in ACustomPlayerCharacter.

974{
975 if(GetMesh() == nullptr){return FVector::ZeroVector;}
976 return GetMesh()->GetSocketLocation(NAME_ADS_Camera);
977}
const FName NAME_ADS_Camera(TEXT("ADS_Camera"))

◆ GetAimDownSightFOV()

float AALSBaseCharacter::GetAimDownSightFOV ( ) const
virtual

Reimplemented in ACustomPlayerCharacter.

980{
981 return FirstPersonFOV;
982}
float FirstPersonFOV
Definition ALSBaseCharacter.h:531

◆ GetAimingRotation()

FRotator AALSBaseCharacter::GetAimingRotation ( ) const
inline
360{ return AimingRotation; }

◆ GetAimYawRate()

float AALSBaseCharacter::GetAimYawRate ( ) const
inline
363{ return AimYawRate; }

◆ GetAllowedGait()

EALSGait AALSBaseCharacter::GetAllowedGait ( ) const
virtual

Reimplemented in ACustomCharacterBase, ACustomPlayerCharacter, and AMultiplayerPlayerCharacter.

1659{
1660 // Calculate the Allowed Gait. This represents the maximum Gait the character is currently allowed to be in,
1661 // and can be determined by the desired gait, the rotation mode, the stance, etc. For example,
1662 // if you wanted to force the character into a walking state while indoors, this could be done here.
1663
1665 {
1667 {
1669 {
1671 }
1672 return DesiredGait;
1673 }
1674 }
1675
1676 // Crouching stance & Aiming rot mode has same behaviour
1677
1679 {
1680 return EALSGait::Running;
1681 }
1682
1683 return DesiredGait;
1684}

◆ GetALSGravityMovementInterface()

virtual FORCEINLINE IALSGravityMovementInterface * AALSBaseCharacter::GetALSGravityMovementInterface ( ) const
inlineoverridevirtual

Implements IALSCharacterInterface.

59 {
60 return Cast<IALSGravityMovementInterface>(MyCharacterMovementComponent);
61 }

◆ GetALSMovementComponent()

FORCEINLINE class UALSCharacterMovementComponent * AALSBaseCharacter::GetALSMovementComponent ( ) const
inline
46 {
48 }

◆ GetAnimCurveValue()

float AALSBaseCharacter::GetAnimCurveValue ( FName CurveName) const

Utility

879{
880 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::GetAnimCurveValue);
881 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
882 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
883
884
885 if(GetMesh() != nullptr && GetMesh()->GetAnimInstance())
886 {
887 return GetMesh()->GetAnimInstance()->GetCurveValue(CurveName);
888 }
889
890 return 0.0f;
891}
float GetAnimCurveValue(FName CurveName) const
Definition ALSBaseCharacter.cpp:878

◆ GetCameraParameters()

void AALSBaseCharacter::GetCameraParameters ( float & TPFOVOut,
float & FPFOVOut,
bool & bRightShoulderOut ) const
985{
986 TPFOVOut = ThirdPersonFOV;
987 FPFOVOut = FirstPersonFOV;
988 bRightShoulderOut = bRightShoulder;
989}
float ThirdPersonFOV
Definition ALSBaseCharacter.h:528

◆ GetCanAimDownSights()

bool AALSBaseCharacter::GetCanAimDownSights ( ) const
virtual

Reimplemented in ACustomPlayerCharacter.

925{
927 {
928 return false;
929 }
930 return true;
931}

◆ GetCurrentOverlayState()

virtual EALSOverlayState AALSBaseCharacter::GetCurrentOverlayState ( ) const
inlineoverridevirtual

Implements IALSCharacterInterface.

51{return OverlayState;};

◆ GetDesiredGait()

EALSGait AALSBaseCharacter::GetDesiredGait ( ) const
inline
129{ return DesiredGait; }

◆ GetDesiredRotationMode()

EALSRotationMode AALSBaseCharacter::GetDesiredRotationMode ( ) const
inline
238{ return DesiredRotationMode; }

◆ GetDesiredStance()

EALSStance AALSBaseCharacter::GetDesiredStance ( ) const
inline
223{ return DesiredStance; }

◆ GetFirstPersonCameraTarget()

FVector AALSBaseCharacter::GetFirstPersonCameraTarget ( )
virtual

Reimplemented in AALSCharacter.

967{
968 if(GetMesh() == nullptr){return FVector::ZeroVector;}
969 return GetMesh()->GetSocketLocation(NAME_FP_Camera);
970}
const FName NAME_FP_Camera(TEXT("FP_Camera"))

◆ GetGait()

EALSGait AALSBaseCharacter::GetGait ( ) const
inline
126{ return Gait; }
EALSGait Gait
Definition ALSBaseCharacter.h:610

◆ GetGetUpAnimation()

UAnimMontage * AALSBaseCharacter::GetGetUpAnimation ( bool bRagdollFaceUpState)

Ragdoll System Implement on BP to get required get up animation according to character's state

◆ GetGroundedEntryState()

EALSGroundedEntryState AALSBaseCharacter::GetGroundedEntryState ( ) const
inline
162{ return GroundedEntryState; }
EALSGroundedEntryState GroundedEntryState
Definition ALSBaseCharacter.h:595

◆ GetIsFlying()

bool AALSBaseCharacter::GetIsFlying ( ) const
inline
347{ return bIsFlying; }
bool bIsFlying
Definition ALSBaseCharacter.h:554

◆ GetIsMantling()

bool AALSBaseCharacter::GetIsMantling ( ) const
overridevirtual

Implements IALSCharacterInterface.

75{
77}
EALSMovementState GetMovementState() const
Definition ALSBaseCharacter.h:99

◆ GetLeftHandGoal()

FVector AALSBaseCharacter::GetLeftHandGoal ( ) const
overridevirtual

Implements IALSCharacterInterface.

57{
58 if(GetMesh() != nullptr)
59 {
60 return GetMesh()->GetSocketLocation("Hand_L");
61 }
62 return FVector::ZeroVector;
63}

◆ GetLifetimeReplicatedProps()

void AALSBaseCharacter::GetLifetimeReplicatedProps ( TArray< FLifetimeProperty > & OutLifetimeProps) const
overridevirtual
91{
92 Super::GetLifetimeReplicatedProps(OutLifetimeProps);
93
95 DOREPLIFETIME_CONDITION(AALSBaseCharacter, ReplicatedCurrentAcceleration, COND_SkipOwner);
96 DOREPLIFETIME_CONDITION(AALSBaseCharacter, ReplicatedControlRotation, COND_SkipOwner);
97
98 DOREPLIFETIME(AALSBaseCharacter, DesiredGait);
99 DOREPLIFETIME_CONDITION(AALSBaseCharacter, DesiredStance, COND_SkipOwner);
100 DOREPLIFETIME_CONDITION(AALSBaseCharacter, DesiredRotationMode, COND_SkipOwner);
101
102 DOREPLIFETIME_CONDITION(AALSBaseCharacter, RotationMode, COND_SkipOwner);
103 DOREPLIFETIME_CONDITION(AALSBaseCharacter, OverlayState, COND_SkipOwner);
104 DOREPLIFETIME_CONDITION(AALSBaseCharacter, ViewMode, COND_SkipOwner);
105 DOREPLIFETIME_CONDITION(AALSBaseCharacter, VisibleMesh, COND_SkipOwner);
106}
Definition ALSBaseCharacter.h:38
FRotator ReplicatedControlRotation
Definition ALSBaseCharacter.h:583
TObjectPtr< USkeletalMesh > VisibleMesh
Definition ALSBaseCharacter.h:587
FVector TargetRagdollLocation
Definition ALSBaseCharacter.h:671

◆ GetMovementAction()

EALSMovementAction AALSBaseCharacter::GetMovementAction ( ) const
inline
108{ return MovementAction; }

◆ GetMovementInput()

FVector AALSBaseCharacter::GetMovementInput ( ) const
874{
876}

◆ GetMovementInputAmount()

float AALSBaseCharacter::GetMovementInputAmount ( ) const
inline
354{ return MovementInputAmount; }

◆ GetMovementState()

EALSMovementState AALSBaseCharacter::GetMovementState ( ) const
inline
99{ return MovementState; }

◆ GetOverlayOverrideState()

int32 AALSBaseCharacter::GetOverlayOverrideState ( ) const
inline
120{ return OverlayOverrideState; }
int32 OverlayOverrideState
Definition ALSBaseCharacter.h:619

◆ GetOverlayState()

EALSOverlayState AALSBaseCharacter::GetOverlayState ( ) const
inline
159{ return OverlayState; }

◆ GetPrevMovementState()

EALSMovementState AALSBaseCharacter::GetPrevMovementState ( ) const
inline
102{ return PrevMovementState; }
EALSMovementState PrevMovementState
Definition ALSBaseCharacter.h:601

◆ GetRightHandGoal()

FVector AALSBaseCharacter::GetRightHandGoal ( ) const
overridevirtual

Implements IALSCharacterInterface.

66{
67 if(GetMesh() != nullptr)
68 {
69 return GetMesh()->GetSocketLocation("Hand_R");
70 }
71 return FVector::ZeroVector;
72}

◆ GetRollAnimation()

UAnimMontage * AALSBaseCharacter::GetRollAnimation ( )

Implement on BP to get required roll animation according to character's state

◆ GetRotationMode()

EALSRotationMode AALSBaseCharacter::GetRotationMode ( ) const
inline
138{ return RotationMode; }

◆ GetSpeed()

float AALSBaseCharacter::GetSpeed ( ) const
inline
357{ return Speed; }

◆ GetStance()

EALSStance AALSBaseCharacter::GetStance ( ) const
inline
114{ return Stance; }

◆ GetTargetMovementSettings()

FALSMovementSettings AALSBaseCharacter::GetTargetMovementSettings ( ) const
794{
795 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::GetTargetMovementSettings);
796 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
797 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
798
799
801 {
803 {
805 }
807 {
809 }
810 }
812 {
814 {
816 }
818 {
820 }
821 }
823 {
825 {
827 }
829 {
831 }
832 }
833
834 // Default to velocity dir standing
836}
FALSMovementStateSettings MovementData
Definition ALSBaseCharacter.h:624
FALSMovementSettings Standing
Definition ALSCharacterStructLibrary.h:221
FALSMovementSettings Crouching
Definition ALSCharacterStructLibrary.h:224
FALSMovementStanceSettings Aiming
Definition ALSCharacterStructLibrary.h:243
FALSMovementStanceSettings LookingDirection
Definition ALSCharacterStructLibrary.h:240
FALSMovementStanceSettings VelocityDirection
Definition ALSCharacterStructLibrary.h:237

◆ GetThirdPersonPivotTarget()

FTransform AALSBaseCharacter::GetThirdPersonPivotTarget ( )
virtual

Reimplemented in AALSCharacter.

962{
963 return GetActorTransform();
964}

◆ GetThirdPersonTraceParams()

ECollisionChannel AALSBaseCharacter::GetThirdPersonTraceParams ( FVector & TraceOrigin,
float & TraceRadius )
virtual

Reimplemented in AALSCharacter.

955{
956 TraceOrigin = GetActorLocation();
957 TraceRadius = 10.0f;
958 return ECC_Visibility;
959}

◆ GetViewMode()

EALSViewMode AALSBaseCharacter::GetViewMode ( ) const
inline
147{ return ViewMode; }

◆ HandleNonMovingRotation()

void AALSBaseCharacter::HandleNonMovingRotation ( float DeltaTime)
protected
1608{
1609 DECLARE_SCOPE_CYCLE_COUNTER(TEXT("ALS HandleNonMovingRotation"), STAT_ALS_HandleNonMovingRotation, STATGROUP_ALS)
1610 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1611
1612 // Handle Aiming or First-Person View rotation limits
1615 {
1616 LimitRotation(-100.0f, 100.0f, 20.0f, DeltaTime);
1617 }
1618
1619 const float RotAmountCurve = GetAnimCurveValue(NAME_RotationAmount);
1620 if (FMath::Abs(RotAmountCurve) > 0.001f)
1621 {
1622 const float RotationDelta = RotAmountCurve * (DeltaTime / (1.0f / 30.0f));
1623
1624 if (GetLocalRole() == ROLE_AutonomousProxy)
1625 {
1626 TargetRotation.Yaw = UKismetMathLibrary::NormalizeAxis(TargetRotation.Yaw + RotationDelta);
1627 SetActorRotation(TargetRotation);
1628 }
1629 else
1630 {
1631 AddActorWorldRotation({0, RotationDelta, 0});
1632 }
1633 TargetRotation = GetActorRotation(); // Cache the updated rotation
1634 }
1635}
const FName NAME_RotationAmount(TEXT("RotationAmount"))
void LimitRotation(float AimYawMin, float AimYawMax, float InterpSpeed, float DeltaTime)
Definition ALSBaseCharacter.cpp:1743

◆ HasMovementInput()

bool AALSBaseCharacter::HasMovementInput ( ) const
inline

Movement System

254{ return bHasMovementInput; }

◆ IsAimingDownSights()

bool AALSBaseCharacter::IsAimingDownSights ( ) const
inline
309{ return bAimDownSights; }
bool bAimDownSights
Definition ALSBaseCharacter.h:537

◆ IsMoving()

bool AALSBaseCharacter::IsMoving ( ) const
inline
344{ return bIsMoving; }
bool bIsMoving
Definition ALSBaseCharacter.h:551

◆ IsRightShoulder()

bool AALSBaseCharacter::IsRightShoulder ( ) const
inline

Camera System

303{ return bRightShoulder; }

◆ JumpAction()

void AALSBaseCharacter::JumpAction ( bool bValue)
virtual

Reimplemented in ACustomCharacterBase.

1791{
1792 if (bValue)
1793 {
1794 // Jump Action: Press "Jump Action" to end the ragdoll if ragdolling, stand up if crouching, or jump if standing.
1795 if (JumpPressedDelegate.IsBound())
1796 {
1797 JumpPressedDelegate.Broadcast();
1798 }
1799
1801 {
1803 {
1805 {
1806 Jump();
1807 }
1808 else if (Stance == EALSStance::Crouching)
1809 {
1810 UnCrouch();
1811 }
1812 }
1814 {
1816 }
1817 }
1818 }
1819 else
1820 {
1821 StopJumping();
1822 }
1823}
FJumpPressedSignature JumpPressedDelegate
Definition ALSBaseCharacter.h:214
void ReplicatedRagdollEnd()
Definition ALSBaseCharacter.cpp:1983

◆ Landed()

void AALSBaseCharacter::Landed ( const FHitResult & Hit)
overrideprotectedvirtual

Reimplemented in ACustomCharacterBase.

1310{
1311 Super::Landed(Hit);
1312
1313 if (IsLocallyControlled())
1314 {
1315 EventOnLanded();
1316 }
1317 if (HasAuthority())
1318 {
1320 }
1321}
void Multicast_OnLanded()

◆ LimitRotation()

void AALSBaseCharacter::LimitRotation ( float AimYawMin,
float AimYawMax,
float InterpSpeed,
float DeltaTime )
protected
1744{
1745 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1746
1747 // Prevent the character from rotating past a certain angle.
1748 FRotator Delta = AimingRotation - GetActorRotation();
1749 Delta.Normalize();
1750 const float RangeVal = Delta.Yaw;
1751
1752 if (RangeVal < AimYawMin || RangeVal > AimYawMax)
1753 {
1754 const float ControlRotYaw = AimingRotation.Yaw;
1755 const float TargetYaw = ControlRotYaw + (RangeVal > 0.0f ? AimYawMin : AimYawMax);
1756 SmoothCharacterRotation({0.0f, TargetYaw, 0.0f}, 0.0f, InterpSpeed, DeltaTime);
1757 }
1758}
void SmoothCharacterRotation(FRotator Target, float TargetInterpSpeed, float ActorInterpSpeed, float DeltaTime)
Definition ALSBaseCharacter.cpp:1712

◆ LookingDirectionAction()

void AALSBaseCharacter::LookingDirectionAction ( )

◆ Multicast_OnJumped()

void AALSBaseCharacter::Multicast_OnJumped ( )

◆ Multicast_OnLanded()

void AALSBaseCharacter::Multicast_OnLanded ( )

◆ Multicast_PlayMontage()

void AALSBaseCharacter::Multicast_PlayMontage ( UAnimMontage * Montage,
float PlayRate )

◆ Multicast_RagdollEnd()

void AALSBaseCharacter::Multicast_RagdollEnd ( FVector CharacterLocation)

◆ Multicast_RagdollStart()

void AALSBaseCharacter::Multicast_RagdollStart ( )

◆ Multicast_StopMontage()

void AALSBaseCharacter::Multicast_StopMontage ( const float InBlendOutTime,
const UAnimMontage * Montage )

◆ OnBreakfall()

void AALSBaseCharacter::OnBreakfall ( )

BP implementable function that called when Breakfall starts

◆ OnBreakfall_Implementation()

void AALSBaseCharacter::OnBreakfall_Implementation ( )
virtual
109{
110 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::OnBreakfall_Implementation);
111 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
112 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
113
114
116}
virtual void OnBreakfall_Implementation()
Definition ALSBaseCharacter.cpp:108
void Replicated_PlayMontage(UAnimMontage *Montage, float PlayRate)
UAnimMontage * GetRollAnimation()

◆ OnEndCrouch()

void AALSBaseCharacter::OnEndCrouch ( float HalfHeightAdjust,
float ScaledHalfHeightAdjust )
overrideprotectedvirtual
1290{
1291 Super::OnEndCrouch(HalfHeightAdjust, ScaledHalfHeightAdjust);
1292
1294}

◆ OnGaitChanged()

void AALSBaseCharacter::OnGaitChanged ( EALSGait PreviousGait)
protectedvirtual
1227{
1228 if (CameraBehavior)
1229 {
1230 CameraBehavior->Gait = Gait;
1231 }
1232}
TObjectPtr< UALSPlayerCameraBehavior > CameraBehavior
Definition ALSBaseCharacter.h:688

◆ OnJumped_Implementation()

void AALSBaseCharacter::OnJumped_Implementation ( )
overrideprotectedvirtual

Reimplemented in ACustomCharacterBase.

1297{
1298 Super::OnJumped_Implementation();
1299 if (IsLocallyControlled())
1300 {
1301 EventOnJumped();
1302 }
1303 if (HasAuthority())
1304 {
1306 }
1307}
void Multicast_OnJumped()
void EventOnJumped()
Definition ALSBaseCharacter.cpp:669

◆ OnLandFrictionReset()

void AALSBaseCharacter::OnLandFrictionReset ( )
protected
1324{
1325 // Reset the braking friction
1326 GetCharacterMovement()->BrakingFrictionFactor = 0.0f;
1327}

◆ OnMovementActionChanged()

void AALSBaseCharacter::OnMovementActionChanged ( EALSMovementAction PreviousAction)
protectedvirtual
1162{
1163 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::OnMovementActionChanged);
1164 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
1165 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1166
1167 // Make the character crouch if performing a roll.
1169 {
1170 Crouch();
1171 }
1172
1173 if (PreviousAction == EALSMovementAction::Rolling)
1174 {
1176 {
1177 UnCrouch();
1178 }
1180 {
1181 Crouch();
1182 }
1183 }
1184
1185 if (CameraBehavior)
1186 {
1187 CameraBehavior->MovementAction = MovementAction;
1188 }
1189}
virtual void OnMovementActionChanged(EALSMovementAction PreviousAction)
Definition ALSBaseCharacter.cpp:1161

◆ OnMovementModeChanged()

void AALSBaseCharacter::OnMovementModeChanged ( EMovementMode PrevMovementMode,
uint8 PreviousCustomMode = 0 )
overrideprotectedvirtual

State Changes

1110{
1111 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::OnMovementModeChanged);
1112 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
1113 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1114
1115 Super::OnMovementModeChanged(PrevMovementMode, PreviousCustomMode);
1116
1117 // Use the Character Movement Mode changes to set the Movement States to the right values. This allows you to have
1118 // a custom set of movement states but still use the functionality of the default character movement component.
1119
1120 if (GetCharacterMovement()->MovementMode == MOVE_Walking ||
1121 GetCharacterMovement()->MovementMode == MOVE_NavWalking)
1122 {
1124 }
1125 else if (GetCharacterMovement()->MovementMode == MOVE_Falling)
1126 {
1128 }
1129}
virtual void OnMovementModeChanged(EMovementMode PrevMovementMode, uint8 PreviousCustomMode=0) override
Definition ALSBaseCharacter.cpp:1109

◆ OnMovementStateChanged()

void AALSBaseCharacter::OnMovementStateChanged ( EALSMovementState PreviousState)
protectedvirtual
1132{
1133 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::OnMovementStateChanged);
1134 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
1135 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1136
1138 {
1140 {
1141 // If the character enters the air, set the In Air Rotation and uncrouch if crouched.
1142 InAirRotation = GetActorRotation();
1144 {
1145 UnCrouch();
1146 }
1147 }
1149 {
1150 // If the character is currently rolling, enable the ragdoll.
1152 }
1153 }
1154
1155 if (CameraBehavior)
1156 {
1157 CameraBehavior->MovementState = MovementState;
1158 }
1159}
virtual void OnMovementStateChanged(EALSMovementState PreviousState)
Definition ALSBaseCharacter.cpp:1131

◆ OnOverlayStateChanged()

void AALSBaseCharacter::OnOverlayStateChanged ( EALSOverlayState PreviousState)
protectedvirtual

Reimplemented in AALSCharacter.

1261{
1262}

◆ OnRep_OverlayState()

void AALSBaseCharacter::OnRep_OverlayState ( EALSOverlayState PrevOverlayState)
protected
2006{
2007 OnOverlayStateChanged(PrevOverlayState);
2008}
virtual void OnOverlayStateChanged(EALSOverlayState PreviousState)
Definition ALSBaseCharacter.cpp:1260

◆ OnRep_RotationMode()

void AALSBaseCharacter::OnRep_RotationMode ( EALSRotationMode PrevRotMode)
protected

Replication

1996{
1997 OnRotationModeChanged(PrevRotMode);
1998}
virtual void OnRotationModeChanged(EALSRotationMode PreviousRotationMode)
Definition ALSBaseCharacter.cpp:1205

◆ OnRep_ViewMode()

void AALSBaseCharacter::OnRep_ViewMode ( EALSViewMode PrevViewMode)
protected
2001{
2002 OnViewModeChanged(PrevViewMode);
2003}
virtual void OnViewModeChanged(EALSViewMode PreviousViewMode)
Definition ALSBaseCharacter.cpp:1234

◆ OnRep_VisibleMesh()

void AALSBaseCharacter::OnRep_VisibleMesh ( const USkeletalMesh * PreviousSkeletalMesh)
protected
2011{
2012 OnVisibleMeshChanged(PreviousSkeletalMesh);
2013}
virtual void OnVisibleMeshChanged(const USkeletalMesh *PreviousSkeletalMesh)
Definition ALSBaseCharacter.cpp:1264

◆ OnRotationModeChanged()

void AALSBaseCharacter::OnRotationModeChanged ( EALSRotationMode PreviousRotationMode)
protectedvirtual

Reimplemented in ACustomPlayerCharacter.

1206{
1207 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::OnRotationModeChanged);
1208 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
1209 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1210
1212 {
1213 // If the new rotation mode is Velocity Direction and the character is in First Person,
1214 // set the viewmode to Third Person.
1216 }
1217
1218 if (CameraBehavior)
1219 {
1220 CameraBehavior->SetRotationMode(RotationMode);
1221 }
1222
1224}

◆ OnStanceChanged()

void AALSBaseCharacter::OnStanceChanged ( EALSStance PreviousStance)
protectedvirtual
1192{
1193 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::OnStanceChanged);
1194 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
1195 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1196
1197 if (CameraBehavior)
1198 {
1199 CameraBehavior->Stance = Stance;
1200 }
1201
1203}
virtual void OnStanceChanged(EALSStance PreviousStance)
Definition ALSBaseCharacter.cpp:1191

◆ OnStartCrouch()

void AALSBaseCharacter::OnStartCrouch ( float HalfHeightAdjust,
float ScaledHalfHeightAdjust )
overrideprotectedvirtual
1283{
1284 Super::OnStartCrouch(HalfHeightAdjust, ScaledHalfHeightAdjust);
1285
1287}

◆ OnViewModeChanged()

void AALSBaseCharacter::OnViewModeChanged ( EALSViewMode PreviousViewMode)
protectedvirtual
1235{
1236 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::OnViewModeChanged);
1237 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
1238 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1239
1241 {
1243 {
1244 // If Third Person, set the rotation mode back to the desired mode.
1246 }
1247 }
1249 {
1250 // If First Person, set the rotation mode to looking direction if currently in the velocity direction mode.
1252 }
1253
1254 if (CameraBehavior)
1255 {
1256 CameraBehavior->ViewMode = ViewMode;
1257 }
1258}

◆ OnVisibleMeshChanged()

void AALSBaseCharacter::OnVisibleMeshChanged ( const USkeletalMesh * PreviousSkeletalMesh)
protectedvirtual
1265{
1266 // Update the Skeletal Mesh before we update materials and anim bp variables
1267 GetMesh()->SetSkeletalMesh(VisibleMesh);
1268
1269 // Reset materials to their new mesh defaults
1270 if (GetMesh() != nullptr)
1271 {
1272 for (int32 MaterialIndex = 0; MaterialIndex < GetMesh()->GetNumMaterials(); ++MaterialIndex)
1273 {
1274 GetMesh()->SetMaterial(MaterialIndex, nullptr);
1275 }
1276 }
1277
1278 // Force set variables. This ensures anim instance & character stay synchronized on mesh changes
1280}

◆ PlayReplicatedMontage()

float AALSBaseCharacter::PlayReplicatedMontage ( UAnimMontage * MontageToPlay,
const float InPlayRate,
const EMontagePlayReturnType ReturnValueType,
const float InTimeToStartMontageAt,
const bool bStopAllMontages )
overridevirtual

Reimplemented from ACharacterBase.

120{
121 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::PlayReplicatedMontage);
122 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
123 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
124 Super::PlayReplicatedMontage(MontageToPlay, InPlayRate, ReturnValueType, InTimeToStartMontageAt, bStopAllMontages);
125 float AnimDuration = 0.0f;
126 if(GetMesh() != nullptr && GetMesh()->GetAnimInstance() != nullptr)
127 {
128 AnimDuration = GetMesh()->GetAnimInstance()->Montage_Play(MontageToPlay, InPlayRate, ReturnValueType, InTimeToStartMontageAt, bStopAllMontages);
129 }
130 Server_PlayMontage(MontageToPlay, InPlayRate);
131 return AnimDuration;
132}
virtual float PlayReplicatedMontage(UAnimMontage *MontageToPlay, const float InPlayRate, const EMontagePlayReturnType ReturnValueType, const float InTimeToStartMontageAt, const bool bStopAllMontages) override
Definition ALSBaseCharacter.cpp:118
void Server_PlayMontage(UAnimMontage *Montage, float PlayRate)

◆ PostInitializeComponents()

void AALSBaseCharacter::PostInitializeComponents ( )
overridevirtual
81{
82 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::PostInitializeComponents);
83 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
84 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
85
86 Super::PostInitializeComponents();
87 MyCharacterMovementComponent = Cast<UALSCharacterMovementComponent>(Super::GetMovementComponent());
88}
virtual void PostInitializeComponents() override
Definition ALSBaseCharacter.cpp:80

◆ Ragdoll()

void AALSBaseCharacter::Ragdoll ( )
overridevirtual

Reimplemented from ACharacterBase.

212{
213 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
214 Super::Ragdoll();
215 RagdollStart();
216}
virtual void RagdollStart()
Definition ALSBaseCharacter.cpp:257

◆ RagdollAction()

void AALSBaseCharacter::RagdollAction ( )

◆ RagdollEnd()

void AALSBaseCharacter::RagdollEnd ( )
virtual

Re-enable Replicate Movement and if the host is a dedicated server set mesh visibility based anim tick option back to default

Reimplemented in AALSCharacter, ACustomAICharacter, and ACustomCharacterBase.

306{
307 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::RagdollEnd);
308 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
309 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
311
312
313 if (UKismetSystemLibrary::IsDedicatedServer(GetWorld()))
314 {
315 GetMesh()->VisibilityBasedAnimTickOption = DefVisBasedTickOp;
316 }
317
318 GetMesh()->bEnableUpdateRateOptimizations = bPreRagdollURO;
319
320 // Revert back to default settings
321 MyCharacterMovementComponent->bIgnoreClientMovementErrorChecksAndCorrection = 0;
322 GetMesh()->bOnlyAllowAutonomousTickPose = false;
323 SetReplicateMovement(true);
324
325 // Step 1: Save a snapshot of the current Ragdoll Pose for use in AnimGraph to blend out of the ragdoll
326 if (GetMesh()->GetAnimInstance())
327 {
328 GetMesh()->GetAnimInstance()->SavePoseSnapshot(NAME_RagdollPose);
329 }
330
331 // Step 2: If the ragdoll is on the ground, set the movement mode to walking and play a Get Up animation.
332 // If not, set the movement mode to falling and update the character movement velocity to match the last ragdoll velocity.
334 {
335 GetCharacterMovement()->SetMovementMode(MOVE_Walking);
336 if (GetMesh()->GetAnimInstance())
337 {
338 GetMesh()->GetAnimInstance()->Montage_Play(GetGetUpAnimation(bRagdollFaceUp), 1.0f, EMontagePlayReturnType::MontageLength, 0.0f, true);
339 }
340 }
341 else
342 {
343 GetCharacterMovement()->SetMovementMode(MOVE_Falling);
344 GetCharacterMovement()->Velocity = LastRagdollVelocity;
345 }
346
347 // Step 3: Re-Enable capsule collision, and disable physics simulation on the mesh.
348 GetCapsuleComponent()->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
349 GetMesh()->SetCollisionObjectType(ECC_Pawn);
350 GetMesh()->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
351 GetMesh()->SetAllBodiesSimulatePhysics(false);
352
353 if (RagdollStateChangedDelegate.IsBound())
354 {
355 RagdollStateChangedDelegate.Broadcast(false);
356 }
357}
const FName NAME_RagdollPose(TEXT("RagdollPose"))
bool bRagdollFaceUp
Definition ALSBaseCharacter.h:665
FRagdollStateChangedSignature RagdollStateChangedDelegate
Definition ALSBaseCharacter.h:220
virtual void RagdollEnd()
Definition ALSBaseCharacter.cpp:305
EVisibilityBasedAnimTickOption DefVisBasedTickOp
Definition ALSBaseCharacter.h:677
bool bRagdollOnGround
Definition ALSBaseCharacter.h:662
bool bPreRagdollURO
Definition ALSBaseCharacter.h:679
UAnimMontage * GetGetUpAnimation(bool bRagdollFaceUpState)
FVector LastRagdollVelocity
Definition ALSBaseCharacter.h:668

◆ RagdollStart()

void AALSBaseCharacter::RagdollStart ( )
virtual

When Networked, disables replicate movement reset TargetRagdollLocation and ServerRagdollPull variable and if the host is a dedicated server, change character mesh optimisation option to avoid z-location bug

Reimplemented in AALSCharacter, ACustomAICharacter, and ACustomCharacterBase.

258{
259 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::RagdollStart);
260 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
261 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
262 if(GetWorld() == nullptr){return;} //- Added world Check..
263 if (RagdollStateChangedDelegate.IsBound())
264 {
265 RagdollStateChangedDelegate.Broadcast(true);
266 }
267
269
270 MyCharacterMovementComponent->bIgnoreClientMovementErrorChecksAndCorrection = 1;
271 if (UKismetSystemLibrary::IsDedicatedServer(GetWorld()))
272 {
273 DefVisBasedTickOp = GetMesh()->VisibilityBasedAnimTickOption;
274 GetMesh()->VisibilityBasedAnimTickOption = EVisibilityBasedAnimTickOption::AlwaysTickPoseAndRefreshBones;
275 }
276 TargetRagdollLocation = GetMesh()->GetSocketLocation(NAME_Pelvis);
278
279 // Disable URO
280 bPreRagdollURO = GetMesh()->bEnableUpdateRateOptimizations;
281 GetMesh()->bEnableUpdateRateOptimizations = false;
282
283 // Step 1: Clear the Character Movement Mode and set the Movement State to Ragdoll
284 GetCharacterMovement()->SetMovementMode(MOVE_None);
286
287 // Step 2: Disable capsule collision and enable mesh physics simulation starting from the pelvis.
288 GetCapsuleComponent()->SetCollisionEnabled(ECollisionEnabled::NoCollision);
289 GetMesh()->SetCollisionObjectType(ECC_PhysicsBody);
290 GetMesh()->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
291 GetMesh()->SetAllBodiesBelowSimulatePhysics(NAME_Pelvis, true, true);
292
293 // Step 3: Stop any active montages.
294 if (GetMesh()->GetAnimInstance())
295 {
296 GetMesh()->GetAnimInstance()->Montage_Stop(0.2f);
297 }
298
299 // Fixes character mesh is showing default A pose for a split-second just before ragdoll ends in listen server games
300 GetMesh()->bOnlyAllowAutonomousTickPose = true;
301
302 SetReplicateMovement(false);
303}
const FName NAME_Pelvis(TEXT("Pelvis"))
float ServerRagdollPull
Definition ALSBaseCharacter.h:674

◆ RagdollUpdate()

void AALSBaseCharacter::RagdollUpdate ( float DeltaTime)
protected

Ragdoll System

992{
993 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::RagdollUpdate);
994 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
995 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character_RagdollUpdate);
996 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
997
998 GetMesh()->bOnlyAllowAutonomousTickPose = false;
999
1000 // Set the Last Ragdoll Velocity.
1001 const FVector NewRagdollVel = GetMesh()->GetPhysicsLinearVelocity(NAME_root);
1002 LastRagdollVelocity = (NewRagdollVel != FVector::ZeroVector || IsLocallyControlled())
1003 ? NewRagdollVel
1004 : LastRagdollVelocity / 2;
1005
1006 // Use the Ragdoll Velocity to scale the ragdoll's joint strength for physical animation.
1007 const float SpringValue = FMath::GetMappedRangeValueClamped<float, float>({0.0f, 1000.0f}, {0.0f, 25000.0f},
1008 LastRagdollVelocity.Size());
1009 GetMesh()->SetAllMotorsAngularDriveParams(SpringValue, 0.0f, 0.0f, false);
1010
1011 //@ TODO Needs to be properly Tested, currently don't work as required //
1012 // GetMesh()->SetEnableGravity(false); // Disable default gravity
1013 // // Get the current gravity direction from the movement component (assuming this is set based on the room's gravity).
1014 // const FVector GravityDirection = GetALSMovementComponent()->GetGravityDirection(); // Assuming you have a method for this
1015 // const FVector GravityForce = GravityDirection * (GetCharacterMovement()->GravityScale * GravityMultiplier); // 980.0f is Earth's gravity
1016 // UE_LOG(LogGravity, Warning, TEXT("Gravity Direction: %s Force: %s "), *GravityDirection.ToString(), *GravityForce.ToString());
1017 // GetMesh()->AddForce(GravityForce * GetMesh()->GetMass(), NAME_Pelvis, true);
1018
1019
1020 // // Disable Gravity if falling faster than -4000 to prevent continual acceleration.
1021 // // This also prevents the ragdoll from going through the floor.
1022 const bool bEnableGrav = LastRagdollVelocity.Z > -4000.0f;
1023 GetMesh()->SetEnableGravity(bEnableGrav);
1024
1025 // Update the Actor location to follow the ragdoll.
1027}
const FName NAME_root(TEXT("root"))
void SetActorLocationDuringRagdoll(float DeltaTime)
Definition ALSBaseCharacter.cpp:1029
void RagdollUpdate(float DeltaTime)
Definition ALSBaseCharacter.cpp:991

◆ Replicated_PlayMontage()

void AALSBaseCharacter::Replicated_PlayMontage ( UAnimMontage * Montage,
float PlayRate )

BP implementable function that called when A Montage starts, e.g. during rolling

◆ Replicated_PlayMontage_Implementation()

void AALSBaseCharacter::Replicated_PlayMontage_Implementation ( UAnimMontage * Montage,
float PlayRate )
virtual
148{
150 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
151 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
152 // Roll: Simply play a Root Motion Montage.
153 if (GetMesh()->GetAnimInstance())
154 {
155 GetMesh()->GetAnimInstance()->Montage_Play(Montage, PlayRate);
156 }
157
158 Server_PlayMontage(Montage, PlayRate);
159}
virtual void Replicated_PlayMontage_Implementation(UAnimMontage *Montage, float PlayRate)
Definition ALSBaseCharacter.cpp:147

◆ ReplicatedRagdollEnd()

void AALSBaseCharacter::ReplicatedRagdollEnd ( )
1984{
1985 if (HasAuthority())
1986 {
1987 Multicast_RagdollEnd(GetActorLocation());
1988 }
1989 else
1990 {
1991 Server_RagdollEnd(GetActorLocation());
1992 }
1993}
void Multicast_RagdollEnd(FVector CharacterLocation)
void Server_RagdollEnd(FVector CharacterLocation)

◆ ReplicatedRagdollStart()

void AALSBaseCharacter::ReplicatedRagdollStart ( )

Ragdolling

1972{
1973 if (HasAuthority())
1974 {
1976 }
1977 else
1978 {
1980 }
1981}
void Server_RagdollStart()
void Multicast_RagdollStart()

◆ RightMovementAction()

void AALSBaseCharacter::RightMovementAction ( float Value)
virtual

Reimplemented in ACustomCharacterBase.

1771{
1773 {
1774 // Default camera relative movement behavior
1775 const FRotator DirRotator(0.0f, AimingRotation.Yaw, 0.0f);
1776 AddMovementInput(UKismetMathLibrary::GetRightVector(DirRotator), Value);
1777 }
1778}

◆ Server_PlayMontage()

void AALSBaseCharacter::Server_PlayMontage ( UAnimMontage * Montage,
float PlayRate )

Rolling Montage Play Replication

◆ Server_RagdollEnd()

void AALSBaseCharacter::Server_RagdollEnd ( FVector CharacterLocation)

◆ Server_RagdollStart()

void AALSBaseCharacter::Server_RagdollStart ( )

◆ Server_SetDesiredGait()

void AALSBaseCharacter::Server_SetDesiredGait ( EALSGait NewGait)

◆ Server_SetDesiredRotationMode()

void AALSBaseCharacter::Server_SetDesiredRotationMode ( EALSRotationMode NewRotMode)

◆ Server_SetDesiredStance()

void AALSBaseCharacter::Server_SetDesiredStance ( EALSStance NewStance)

◆ Server_SetMeshLocationDuringRagdoll()

void AALSBaseCharacter::Server_SetMeshLocationDuringRagdoll ( FVector MeshLocation)

◆ Server_SetOverlayState()

void AALSBaseCharacter::Server_SetOverlayState ( EALSOverlayState NewState,
bool bForce )

◆ Server_SetRotationMode()

void AALSBaseCharacter::Server_SetRotationMode ( EALSRotationMode NewRotationMode,
bool bForce )

◆ Server_SetViewMode()

void AALSBaseCharacter::Server_SetViewMode ( EALSViewMode NewViewMode,
bool bForce )

◆ Server_SetVisibleMesh()

void AALSBaseCharacter::Server_SetVisibleMesh ( USkeletalMesh * NewSkeletalMesh)

◆ Server_StopMontage()

void AALSBaseCharacter::Server_StopMontage ( const float InBlendOutTime,
const UAnimMontage * Montage )

◆ SetActorLocationAndTargetRotation()

void AALSBaseCharacter::SetActorLocationAndTargetRotation ( FVector NewLocation,
FRotator NewRotation )

Rotation System

753{
754 SetActorLocationAndRotation(NewLocation, NewRotation);
755 TargetRotation = NewRotation;
756}

◆ SetActorLocationDuringRagdoll()

void AALSBaseCharacter::SetActorLocationDuringRagdoll ( float DeltaTime)
protected

Check if Socket exists, if not use other case

1030{
1031 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetActorLocationDuringRagdoll);
1032 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
1033 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1034
1035 if (IsLocallyControlled())
1036 {
1037 // Set the pelvis as the target location.
1038 TargetRagdollLocation = GetMesh()->GetSocketLocation(NAME_Pelvis);
1039 if (!HasAuthority())
1040 {
1042 }
1043 }
1044
1045 // Determine whether the ragdoll is facing up or down and set the target rotation accordingly.
1046 const FRotator PelvisRot = GetMesh()->GetSocketRotation(NAME_Pelvis);
1047
1048 if (bReversedPelvis) {
1049 bRagdollFaceUp = PelvisRot.Roll > 0.0f;
1050 } else
1051 {
1052 bRagdollFaceUp = PelvisRot.Roll < 0.0f;
1053 }
1054
1055
1056 const FRotator TargetRagdollRotation(0.0f, bRagdollFaceUp ? PelvisRot.Yaw - 180.0f : PelvisRot.Yaw, 0.0f);
1057
1058 // Trace downward from the target location to offset the target location,
1059 // preventing the lower half of the capsule from going through the floor when the ragdoll is laying on the ground.
1060 const FVector TraceVect(TargetRagdollLocation.X, TargetRagdollLocation.Y,
1061 TargetRagdollLocation.Z - GetCapsuleComponent()->GetScaledCapsuleHalfHeight());
1062
1063 UWorld* World = GetWorld();
1064 check(World);
1065
1066 FCollisionQueryParams Params;
1067 Params.AddIgnoredActor(this);
1068
1069 FHitResult HitResult;
1070 const bool bHit = World->LineTraceSingleByChannel(HitResult, TargetRagdollLocation, TraceVect,
1071 ECC_Visibility, Params);
1072
1073 if (ALSDebugComponent && ALSDebugComponent->GetShowTraces())
1074 {
1077 TraceVect,
1078 EDrawDebugTrace::Type::ForOneFrame,
1079 bHit,
1080 HitResult,
1081 FLinearColor::Red,
1082 FLinearColor::Green,
1083 1.0f);
1084 }
1085
1086 bRagdollOnGround = HitResult.IsValidBlockingHit();
1087 FVector NewRagdollLoc = TargetRagdollLocation;
1088
1089 if (bRagdollOnGround)
1090 {
1091 const float ImpactDistZ = FMath::Abs(HitResult.ImpactPoint.Z - HitResult.TraceStart.Z);
1092 NewRagdollLoc.Z += GetCapsuleComponent()->GetScaledCapsuleHalfHeight() - ImpactDistZ + 2.0f;
1093 }
1094 if (!IsLocallyControlled())
1095 {
1096 ServerRagdollPull = FMath::FInterpTo(ServerRagdollPull, 750.0f, DeltaTime, 0.6f);
1097 float RagdollSpeed = FVector(LastRagdollVelocity.X, LastRagdollVelocity.Y, 0).Size();
1098
1099 FName RagdollPelvisSocket = GetMesh()->DoesSocketExist(NAME_pelvis) ? NAME_pelvis : NAME_Pelvis;
1100 //FName RagdollSocketPullName = RagdollSpeed > 300 ? NAME_spine_03 : NAME_pelvis;
1101 FName RagdollSocketPullName = RagdollSpeed > 300 ? NAME_spine_03 : RagdollPelvisSocket;
1102 GetMesh()->AddForce(
1103 (TargetRagdollLocation - GetMesh()->GetSocketLocation(RagdollSocketPullName)) * ServerRagdollPull,
1104 RagdollSocketPullName, true);
1105 }
1106 SetActorLocationAndTargetRotation(bRagdollOnGround ? NewRagdollLoc : TargetRagdollLocation, TargetRagdollRotation);
1107}
const FName NAME_pelvis(TEXT("pelvis"))
const FName NAME_spine_03(TEXT("spine_03"))
void Server_SetMeshLocationDuringRagdoll(FVector MeshLocation)
void SetActorLocationAndTargetRotation(FVector NewLocation, FRotator NewRotation)
Definition ALSBaseCharacter.cpp:752
bool bReversedPelvis
Definition ALSBaseCharacter.h:651
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

◆ SetAimDownSights()

void AALSBaseCharacter::SetAimDownSights ( const bool bNewAimDownSights)
934{
935 if(GetCanAimDownSights() && bNewAimDownSights)
936 {
937 bAimDownSights = bNewAimDownSights;
938 if(CameraBehavior != nullptr)
939 {
940 CameraBehavior->bAimDownSights = bAimDownSights;
941 }
942 }
943 else
944 {
945 bAimDownSights = false;
946 if(CameraBehavior != nullptr)
947 {
948 CameraBehavior->bAimDownSights = false;
949 }
950
951 }
952}
virtual bool GetCanAimDownSights() const
Definition ALSBaseCharacter.cpp:924

◆ SetCameraBehavior()

void AALSBaseCharacter::SetCameraBehavior ( UALSPlayerCameraBehavior * CamBeh)
inline
336{ CameraBehavior = CamBeh; }

◆ SetDesiredGait()

void AALSBaseCharacter::SetDesiredGait ( EALSGait NewGait)
475{
476 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetDesiredGait);
477 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
478 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
479
480 DesiredGait = NewGait;
481 if (GetLocalRole() == ROLE_AutonomousProxy)
482 {
483 Server_SetDesiredGait(NewGait);
484 }
485}
void SetDesiredGait(EALSGait NewGait)
Definition ALSBaseCharacter.cpp:474
void Server_SetDesiredGait(EALSGait NewGait)

◆ SetDesiredRotationMode()

void AALSBaseCharacter::SetDesiredRotationMode ( EALSRotationMode NewRotMode)
virtual

Reimplemented in AMultiplayerPlayerCharacter.

497{
498 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetDesiredRotationMode);
499 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
500 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
501
502 DesiredRotationMode = NewRotMode;
503 if (GetLocalRole() == ROLE_AutonomousProxy)
504 {
506 }
507 if(AnimInstanceInterface != nullptr)
508 {
510 }
511}
void Server_SetDesiredRotationMode(EALSRotationMode NewRotMode)
virtual void SetDesiredRotationMode(EALSRotationMode NewRotMode)
Definition ALSBaseCharacter.cpp:496
virtual void SetRotationMode(const FALSRotationMode Value)=0

◆ SetDesiredStance()

void AALSBaseCharacter::SetDesiredStance ( EALSStance NewStance)
450{
451 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetDesiredStance);
452 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
453 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
454
455 DesiredStance = NewStance;
456 if (GetLocalRole() == ROLE_AutonomousProxy)
457 {
458 Server_SetDesiredStance(NewStance);
459 }
460 if(AnimInstanceInterface != nullptr)
461 {
463 }
464}
void SetDesiredStance(EALSStance NewStance)
Definition ALSBaseCharacter.cpp:449
void Server_SetDesiredStance(EALSStance NewStance)
virtual void SetStance(const FALSStance &Value)=0

◆ SetEssentialValues()

void AALSBaseCharacter::SetEssentialValues ( float DeltaTime)
protected
1330{
1331 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetEssentialValues);
1332 DECLARE_SCOPE_CYCLE_COUNTER(TEXT("ALS SetEssentialValues"), STAT_ALS_SetEssentialValues, STATGROUP_ALS)
1333 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
1334 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1335
1336
1337 if (GetLocalRole() != ROLE_SimulatedProxy)
1338 {
1339 if(GetCharacterMovement() != nullptr)
1340 {
1341 ReplicatedCurrentAcceleration = GetCharacterMovement()->GetCurrentAcceleration();
1342 EasedMaxAcceleration = GetCharacterMovement()->GetMaxAcceleration();
1343 }
1344 ReplicatedControlRotation = GetControlRotation();
1345 }
1346 else
1347 {
1348 if(GetCharacterMovement() != nullptr)
1349 {
1350 EasedMaxAcceleration = GetCharacterMovement()->GetMaxAcceleration() != 0
1351 ? GetCharacterMovement()->GetMaxAcceleration()
1353 }
1354 }
1355
1356
1357
1358 // Interp AimingRotation to current control rotation for smooth character rotation movement. Decrease InterpSpeed
1359 // for slower but smoother movement.
1360 AimingRotation = FMath::RInterpTo(AimingRotation, ReplicatedControlRotation, DeltaTime, 30);
1361
1362 // These values represent how the capsule is moving as well as how it wants to move, and therefore are essential
1363 // for any data driven animation system. They are also used throughout the system for various functions,
1364 // so I found it is easiest to manage them all in one place.
1365
1366 const FVector CurrentVel = GetVelocity();
1367
1368 // Set the amount of Acceleration.
1369 const FVector NewAcceleration = (CurrentVel - PreviousVelocity) / DeltaTime;
1370 Acceleration = NewAcceleration.IsNearlyZero() || IsLocallyControlled() ? NewAcceleration : Acceleration / 2;
1371
1372 // Flying
1374
1375
1376
1377 // Determine if the character is moving by getting it's speed. The Speed equals the length of the horizontal (x y)
1378 // velocity, so it does not take vertical movement into account. If the character is moving, update the last
1379 // velocity rotation. This value is saved because it might be useful to know the last orientation of movement
1380 // even after the character has stopped.
1381 Speed = CurrentVel.Size2D();
1382 if(GetIsFlying())
1383 {
1384 Speed = CurrentVel.Size();
1385 }
1386
1387
1388 bIsMoving = Speed > 1.0f;
1389 if (bIsMoving)
1390 {
1391 LastVelocityRotation = CurrentVel.ToOrientationRotator();
1392 }
1393
1394
1395
1396 // Determine if the character has movement input by getting its movement input amount.
1397 // The Movement Input Amount is equal to the current acceleration divided by the max acceleration so that
1398 // it has a range of 0-1, 1 being the maximum possible amount of input, and 0 being none.
1399 // If the character has movement input, update the Last Movement Input Rotation.
1403 {
1405 }
1406
1407 // Set the Aim Yaw rate by comparing the current and previous Aim Yaw value, divided by Delta Seconds.
1408 // This represents the speed the camera is rotating left to right.
1409 AimYawRate = FMath::Abs((AimingRotation.Yaw - PreviousAimYaw) / DeltaTime);
1410
1411 if(AnimInstanceInterface != nullptr)
1412 {
1414 {
1415 // FALSAnimValues AnimValues;
1416 AnimValues.ActorRotation = GetActorRotation();
1424 if(GetCharacterMovement() != nullptr)
1425 {
1426 AnimValues.CharacterInfo.Velocity = GetCharacterMovement()->Velocity;
1427 }
1430 // AnimValues.CharacterInfo.ViewMode = ViewMode;
1432 // AnimValues.OverlayOverrideState = OverlayOverrideState;
1433 // AnimValues.MovementState = MovementState;
1435 // AnimValues.Stance = Stance;
1436 // AnimValues.RotationMode = RotationMode;
1437 // AnimValues.Gait = Gait;
1438 // AnimValues.OverlayState = OverlayState;
1439 // AnimValues.GroundedEntryState = GroundedEntryState;
1441 }
1443 }
1444}
float PreviousAimYaw
Definition ALSBaseCharacter.h:685
bool GetIsFlying() const
Definition ALSBaseCharacter.h:347
FORCEINLINE class UALSCharacterMovementComponent * GetALSMovementComponent() const
Definition ALSBaseCharacter.h:45
bool bOptimizeAnimValues
Definition ALSBaseCharacter.h:490
FALSAnimValues AnimValues
Definition ALSBaseCharacter.h:494
FVector PreviousVelocity
Definition ALSBaseCharacter.h:683
void SetEssentialValues(float DeltaTime)
Definition ALSBaseCharacter.cpp:1329
FVector GetMovementInput() const
Definition ALSBaseCharacter.cpp:873
float EasedMaxAcceleration
Definition ALSBaseCharacter.h:577
virtual void SetOptimize(const bool bValue)=0
virtual void SetEssentialInfo(const FALSAnimValues &Value)=0
float MovementInputAmount
Definition ALSAnimationStructLibrary.h:125
EALSMovementState PrevMovementState
Definition ALSAnimationStructLibrary.h:134
bool bIsFlying
Definition ALSAnimationStructLibrary.h:116
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

◆ SetGait()

void AALSBaseCharacter::SetGait ( EALSGait NewGait,
bool bForce = false )
430{
431 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetGait);
432 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
433 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
434 if (bForce || Gait != NewGait)
435 {
436 const EALSGait Prev = Gait;
437 Gait = NewGait;
438 OnGaitChanged(Prev);
439 //@ TEST Performance
440 if(AnimInstanceInterface != nullptr)
441 {
443 }
444
445 }
446}
EALSGait
Definition ALSCharacterEnumLibrary.h:29
virtual void OnGaitChanged(EALSGait PreviousGait)
Definition ALSBaseCharacter.cpp:1226
virtual void SetGait(const FALSGait &Value)=0

◆ SetGroundedEntryState()

void AALSBaseCharacter::SetGroundedEntryState ( EALSGroundedEntryState NewState)
612{
613 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetGroundedEntryState);
614 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
615 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
616 GroundedEntryState = NewState;
617 if(AnimInstanceInterface != nullptr)
618 {
620 }
621}
void SetGroundedEntryState(EALSGroundedEntryState NewState)
Definition ALSBaseCharacter.cpp:611
virtual void SetNewGroundedEntryState(const FALSGroundedEntryState &Value)=0

◆ SetMovementAction()

void AALSBaseCharacter::SetMovementAction ( EALSMovementAction NewAction,
bool bForce = false )
386{
387 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetMovementAction);
388 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
389 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
390 if (bForce || MovementAction != NewAction)
391 {
393 MovementAction = NewAction;
395 }
396}
EALSMovementAction
Definition ALSCharacterEnumLibrary.h:41

◆ SetMovementModel()

void AALSBaseCharacter::SetMovementModel ( )
protected
759{
760 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
761 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetMovementModel);
762 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
763
764 if (ensureMsgf(!MovementModel.IsNull(), TEXT("Did you forget to fill in MovementModel information?")))
765 {
766 const FString ContextString = GetFullName();
767 FALSMovementStateSettings* OutRow = MovementModel.DataTable->FindRow<FALSMovementStateSettings>(MovementModel.RowName, ContextString);
768 if (ensureMsgf(OutRow, TEXT("Failed to find row")))
769 {
770 MovementData = *OutRow;
771 return;
772 }
773 }
774 MovementData = {};
775}
Definition ALSCharacterStructLibrary.h:233

◆ SetMovementState()

void AALSBaseCharacter::SetMovementState ( EALSMovementState NewState,
bool bForce = false )

Character States

368{
369 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetMovementState);
370 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
371 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
372 if (bForce || MovementState != NewState)
373 {
375 MovementState = NewState;
377 //@ TEST Performance
378 if(AnimInstanceInterface != nullptr)
379 {
381 }
382 }
383}
virtual void SetMovementState(const FALSMovementState &Value)=0

◆ SetOverlayOverrideState()

void AALSBaseCharacter::SetOverlayOverrideState ( int32 NewState)
417{
418 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetOverlayOverrideState);
419 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
420 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
421 OverlayOverrideState = NewState;
422 //@ TEST Performance
423 if(AnimInstanceInterface != nullptr)
424 {
426 }
427}
void SetOverlayOverrideState(int32 NewState)
Definition ALSBaseCharacter.cpp:416
virtual void SetOverlayOverrideState(const int32 Value)=0

◆ SetOverlayState()

void AALSBaseCharacter::SetOverlayState ( EALSOverlayState NewState,
bool bForce = false )
588{
589 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetOverlayState);
590 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
591 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
592
593
594 if (bForce || OverlayState != NewState)
595 {
596 const EALSOverlayState Prev = OverlayState;
597 OverlayState = NewState;
599
600 if (GetLocalRole() == ROLE_AutonomousProxy)
601 {
602 Server_SetOverlayState(NewState, bForce);
603 }
604 if(AnimInstanceInterface != nullptr)
605 {
607 }
608 }
609}
EALSOverlayState
Definition ALSCharacterEnumLibrary.h:68
void Server_SetOverlayState(EALSOverlayState NewState, bool bForce)
virtual void SetOverlayState(const FALSOverlayState &Value)=0

◆ SetRightShoulder()

void AALSBaseCharacter::SetRightShoulder ( const bool bNewRightShoulder)
916{
917 bRightShoulder = bNewRightShoulder;
918 if (CameraBehavior)
919 {
920 CameraBehavior->bRightShoulder = bRightShoulder;
921 }
922}

◆ SetRotationMode()

void AALSBaseCharacter::SetRotationMode ( EALSRotationMode NewRotationMode,
bool bForce = false )
virtual

Reimplemented in AMultiplayerPlayerCharacter.

523{
524 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetRotationMode);
525 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
526 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
527
528 if (bForce || RotationMode != NewRotationMode)
529 {
530 const EALSRotationMode Prev = RotationMode;
531 RotationMode = NewRotationMode;
533
534 if (GetLocalRole() == ROLE_AutonomousProxy)
535 {
536 Server_SetRotationMode(NewRotationMode, bForce);
537 }
538 if(AnimInstanceInterface != nullptr)
539 {
541 }
542 }
543}
EALSRotationMode
Definition ALSCharacterEnumLibrary.h:97
void Server_SetRotationMode(EALSRotationMode NewRotationMode, bool bForce)

◆ SetStance()

void AALSBaseCharacter::SetStance ( EALSStance NewStance,
bool bForce = false )
399{
400 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetStance);
401 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
402 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
403 if (bForce || Stance != NewStance)
404 {
405 const EALSStance Prev = Stance;
406 Stance = NewStance;
407 OnStanceChanged(Prev);
408 //@ TEST Performance
409 if(AnimInstanceInterface != nullptr)
410 {
412 }
413 }
414}
EALSStance
Definition ALSCharacterEnumLibrary.h:108

◆ SetupCapsuleComponent()

void AALSBaseCharacter::SetupCapsuleComponent ( ) const
private
2017{
2018 if(GetCapsuleComponent() == nullptr){UE_LOG(LogTemp, Error, TEXT("AALSBaseCharacter::SetupCapsuleComponent FAILED"));return;}
2019 GetCapsuleComponent()->SetCapsuleHalfHeight(90.0f);
2020 GetCapsuleComponent()->SetCapsuleRadius(35.0f);
2021 GetCapsuleComponent()->SetAreaClassOverride(UNavArea_Obstacle::StaticClass());\
2022 GetCapsuleComponent()->SetCollisionResponseToChannel(ECC_Visibility, ECR_Ignore);
2023 GetCapsuleComponent()->SetCollisionResponseToChannel(ECC_Camera, ECR_Ignore);
2024 GetCapsuleComponent()->SetCollisionResponseToChannel(ECC_GameTraceChannel3, ECR_Ignore); // Climable
2025 GetCapsuleComponent()->SetCollisionResponseToChannel(ECC_GameTraceChannel4, ECR_Ignore); // WeaponTraceChannel
2026 GetCapsuleComponent()->SetCollisionResponseToChannel(ECC_GameTraceChannel5, ECR_Overlap); // Interactable
2027 GetCapsuleComponent()->SetCollisionResponseToChannel(ECC_GameTraceChannel6, ECR_Ignore); // Characters
2028}

◆ SetupMeshComponent()

void AALSBaseCharacter::SetupMeshComponent ( ) const
private
2031{
2032 if(GetMesh() == nullptr){UE_LOG(LogTemp, Error, TEXT("AALSBaseCharacter::SetupMeshComponent FAILED"));return;}
2033 GetMesh()->SetWorldTransform(FTransform(FRotator(0.0f,-90.0f,0.0f), FVector(0.0f,0.0f,-92.0f)));
2034 GetMesh()->SetCollisionResponseToChannel(ECC_Visibility, ECR_Ignore);
2035 GetMesh()->SetCollisionResponseToChannel(ECC_Camera, ECR_Ignore);
2036 GetMesh()->SetCollisionResponseToChannel(ECC_GameTraceChannel3, ECR_Ignore); // Climable
2037 GetMesh()->SetCollisionResponseToChannel(ECC_GameTraceChannel4, ECR_Block); // WeaponTraceChannel
2038 GetMesh()->SetCollisionResponseToChannel(ECC_GameTraceChannel5, ECR_Block); // Interactable
2039 GetMesh()->SetCollisionResponseToChannel(ECC_GameTraceChannel5, ECR_Block); // Characters
2040 GetMesh()->SetGenerateOverlapEvents(true);
2041 //@TODO if Using only one Skeleton, Remove this //
2042 GetMesh()->bUpdateMeshWhenKinematic = true;
2043 GetMesh()->VisibilityBasedAnimTickOption = EVisibilityBasedAnimTickOption::AlwaysTickPoseAndRefreshBones;
2044}

◆ SetViewMode()

void AALSBaseCharacter::SetViewMode ( EALSViewMode NewViewMode,
bool bForce = false )
virtual

Reimplemented in AMultiplayerPlayerCharacter.

555{
556 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::SetViewMode);
557 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
558 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
559
560 if (bForce || ViewMode != NewViewMode)
561 {
562 const EALSViewMode Prev = ViewMode;
563 ViewMode = NewViewMode;
564 OnViewModeChanged(Prev);
565
566 if (GetLocalRole() == ROLE_AutonomousProxy)
567 {
568 Server_SetViewMode(NewViewMode, bForce);
569 }
570 if(AnimInstanceInterface != nullptr)
571 {
573 }
574 }
575}
EALSViewMode
Definition ALSCharacterEnumLibrary.h:119
void Server_SetViewMode(EALSViewMode NewViewMode, bool bForce)
virtual void SetViewMode(const EALSViewMode Value)=0

◆ SetVisibleMesh()

void AALSBaseCharacter::SetVisibleMesh ( USkeletalMesh * NewSkeletalMesh)
894{
895 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
896
897 if (VisibleMesh != NewVisibleMesh)
898 {
899 const USkeletalMesh* Prev = VisibleMesh;
900 VisibleMesh = NewVisibleMesh;
902
903 if (GetLocalRole() != ROLE_Authority)
904 {
905 Server_SetVisibleMesh(NewVisibleMesh);
906 }
907 }
908}
void Server_SetVisibleMesh(USkeletalMesh *NewSkeletalMesh)

◆ SmoothCharacterRotation()

void AALSBaseCharacter::SmoothCharacterRotation ( FRotator Target,
float TargetInterpSpeed,
float ActorInterpSpeed,
float DeltaTime )
protected

Utils

1714{
1715 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character_SmoothCharacterRotation);
1716 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1717
1718 // Interpolate the Target Rotation for extra smooth rotation behavior
1720 FMath::RInterpConstantTo(TargetRotation, Target, DeltaTime, TargetInterpSpeed);
1721 SetActorRotation(
1722 FMath::RInterpTo(GetActorRotation(), TargetRotation, DeltaTime, ActorInterpSpeed));
1723}

◆ SprintAction()

void AALSBaseCharacter::SprintAction ( bool bValue)
virtual

Reimplemented in ACustomCharacterBase.

1826{
1827 if(bValue)
1828 {
1830 }
1831 else
1832 {
1834 }
1835}

◆ StanceAction()

void AALSBaseCharacter::StanceAction ( )
virtual

Reimplemented in ACustomCharacterBase, and ACustomPlayerCharacter.

1883{
1884 // Stance Action: Press "Stance Action" to toggle Standing / Crouching, double tap to Roll.
1885
1887 {
1888 return;
1889 }
1890
1891 UWorld* World = GetWorld();
1892 check(World);
1893
1894 const float PrevStanceInputTime = LastStanceInputTime;
1895 LastStanceInputTime = World->GetTimeSeconds();
1896
1897 if (LastStanceInputTime - PrevStanceInputTime <= RollDoubleTapTimeout)
1898 {
1899 // Roll
1901
1903 {
1905 }
1906 else if (Stance == EALSStance::Crouching)
1907 {
1909 }
1910 return;
1911 }
1912
1914 {
1916 {
1918 Crouch();
1919 }
1920 else if (Stance == EALSStance::Crouching)
1921 {
1923 UnCrouch();
1924 }
1925 }
1926
1927 // Notice: MovementState == EALSMovementState::InAir case is removed
1928}
float LastStanceInputTime
Definition ALSBaseCharacter.h:691
float RollDoubleTapTimeout
Definition ALSBaseCharacter.h:517

◆ StopReplicatedMontage()

void AALSBaseCharacter::StopReplicatedMontage ( const float InBlendOutTime,
const UAnimMontage * Montage )
overridevirtual

Reimplemented from ACharacterBase.

135{
136 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::StopReplicatedMontage);
137 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
138 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
139 Super::StopReplicatedMontage(InBlendOutTime, Montage);
140 if(GetMesh() != nullptr && GetMesh()->GetAnimInstance() != nullptr)
141 {
142 GetMesh()->GetAnimInstance()->Montage_Stop(InBlendOutTime, Montage);
143 }
144 Server_StopMontage(InBlendOutTime, Montage);
145}
virtual void StopReplicatedMontage(const float InBlendOutTime, const UAnimMontage *Montage) override
Definition ALSBaseCharacter.cpp:134
void Server_StopMontage(const float InBlendOutTime, const UAnimMontage *Montage)

◆ Tick()

void AALSBaseCharacter::Tick ( float DeltaTime)
overridevirtual

Reimplemented from ACharacterBase.

Reimplemented in ACustomAICharacter, ACustomCharacterBase, AALSCharacter, ACampaignAICharacter, and ACustomPlayerCharacter.

219{
220 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::Tick);
221 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
222 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character_Tick);
223 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
224
225 Super::Tick(DeltaTime);
226
227 // Set required values
228 SetEssentialValues(DeltaTime);
229
231 {
233 UpdateGroundedRotation(DeltaTime);
234 }
236 {
237 if(GetIsFlying())
238 {
240 UpdateGroundedRotation(DeltaTime);
241 }
242 else
243 {
244 UpdateInAirRotation(DeltaTime);
245 }
246 }
248 {
249 RagdollUpdate(DeltaTime);
250 }
251
252 // Cache values
253 PreviousVelocity = GetVelocity();
255}
virtual void Tick(float DeltaTime) override
Definition ALSBaseCharacter.cpp:218
void UpdateInAirRotation(float DeltaTime)
Definition ALSBaseCharacter.cpp:1638
void UpdateCharacterMovement()
Definition ALSBaseCharacter.cpp:1446
void UpdateGroundedRotation(float DeltaTime)
Definition ALSBaseCharacter.cpp:1470

◆ UpdateCharacterMovement()

void AALSBaseCharacter::UpdateCharacterMovement ( )
protected
1447{
1448 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::UpdateCharacterMovement);
1449 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
1450 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character_UpdateMovement);
1451 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1452
1453
1454 // Set the Allowed Gait
1455 const EALSGait AllowedGait = GetAllowedGait();
1456
1457 // Determine the Actual Gait. If it is different from the current Gait, Set the new Gait Event.
1458 const EALSGait ActualGait = GetActualGait(AllowedGait);
1459
1460 if (ActualGait != Gait)
1461 {
1462 SetGait(ActualGait);
1463 }
1464
1465 // Update the Character Max Walk Speed to the configured speeds based on the currently Allowed Gait.
1466 MyCharacterMovementComponent->SetAllowedGait(AllowedGait);
1467}
EALSGait GetActualGait(EALSGait AllowedGait) const
Definition ALSBaseCharacter.cpp:1686
virtual EALSGait GetAllowedGait() const
Definition ALSBaseCharacter.cpp:1658

◆ UpdateGroundedRotation()

void AALSBaseCharacter::UpdateGroundedRotation ( float DeltaTime)
protected
1471{
1472 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::UpdateGroundedRotation);
1473 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
1474 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character_UpdateGroundedRotation);
1475 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1476
1478 {
1480 {
1481 // Handle Rolling Rotation (skip other actions)
1483 {
1484 SmoothCharacterRotation({0.0f, LastMovementInputRotation.Yaw, 0.0f}, 0.0f, 2.0f, DeltaTime);
1485 }
1486 return;
1487 }
1488
1489 // Check if we can update the moving rotation
1490 const bool bCanUpdateMovingRot = (((bIsMoving && bHasMovementInput) || (Speed > 150.0f || GetIsFlying())) && !HasAnyRootMotion());
1491 if (bCanUpdateMovingRot)
1492 {
1493 const float GroundedRotationRate = CalculateGroundedRotationRate();
1494 FRotator TargetRot{0.0f, 0.0f, 0.0f};
1495
1496 switch (RotationMode)
1497 {
1499 TargetRot.Yaw = LastVelocityRotation.Yaw;
1500 SmoothCharacterRotation(TargetRot, 800.0f, GroundedRotationRate, DeltaTime);
1501 break;
1502
1504 TargetRot.Yaw = (Gait == EALSGait::Sprinting)
1507 SmoothCharacterRotation(TargetRot, 500.0f, GroundedRotationRate, DeltaTime);
1508 break;
1509
1511 TargetRot.Yaw = AimingRotation.Yaw;
1512 SmoothCharacterRotation(TargetRot, 1000.0f, 20.0f, DeltaTime);
1513 break;
1514 }
1515 }
1516 else
1517 {
1518 // if(GetIsFlying())
1519 // {
1520 // // Check for Moving when speed is 0
1521 // return;
1522 // }
1523 // Handle Non-Moving Rotation
1524 HandleNonMovingRotation(DeltaTime);
1525 }
1526 return;
1527 }
1528 //@ TEST Optimizations //
1530 {
1531 const bool bCanUpdateMovingRot = ((bIsMoving && bHasMovementInput) || (Speed > 150.0f || GetIsFlying())) && !HasAnyRootMotion();
1532 if (bCanUpdateMovingRot)
1533 {
1534 const float GroundedRotationRate = CalculateGroundedRotationRate();
1536 {
1537 // Velocity Direction Rotation
1538 SmoothCharacterRotation({0.0f, LastVelocityRotation.Yaw, 0.0f}, 800.0f, GroundedRotationRate,
1539 DeltaTime);
1540 }
1542 {
1543 // Looking Direction Rotation
1544 float YawValue;
1546 {
1547 YawValue = LastVelocityRotation.Yaw;
1548 }
1549 else
1550 {
1551 // Walking or Running..
1552 const float YawOffsetCurveVal = GetAnimCurveValue(NAME_YawOffset);
1553 YawValue = AimingRotation.Yaw + YawOffsetCurveVal;
1554 }
1555 SmoothCharacterRotation({0.0f, YawValue, 0.0f}, 500.0f, GroundedRotationRate, DeltaTime);
1556 }
1558 {
1559 const float ControlYaw = AimingRotation.Yaw;
1560 SmoothCharacterRotation({0.0f, ControlYaw, 0.0f}, 1000.0f, 20.0f, DeltaTime);
1561 }
1562 }
1563 else
1564 {
1565 // Not Moving
1566
1569 {
1570 LimitRotation(-100.0f, 100.0f, 20.0f, DeltaTime);
1571 }
1572
1573 // Apply the RotationAmount curve from Turn In Place Animations.
1574 // The Rotation Amount curve defines how much rotation should be applied each frame,
1575 // and is calculated for animations that are animated at 30fps.
1576
1577 const float RotAmountCurve = GetAnimCurveValue(NAME_RotationAmount);
1578
1579 if (FMath::Abs(RotAmountCurve) > 0.001f)
1580 {
1581 if (GetLocalRole() == ROLE_AutonomousProxy)
1582 {
1583 TargetRotation.Yaw = UKismetMathLibrary::NormalizeAxis(
1584 TargetRotation.Yaw + (RotAmountCurve * (DeltaTime / (1.0f / 30.0f))));
1585 SetActorRotation(TargetRotation);
1586 }
1587 else
1588 {
1589 AddActorWorldRotation({0, RotAmountCurve * (DeltaTime / (1.0f / 30.0f)), 0});
1590 }
1591 TargetRotation = GetActorRotation();
1592 }
1593 }
1594 }
1596 {
1597 // Rolling Rotation (Not allowed on networked games)
1599 {
1600 SmoothCharacterRotation({0.0f, LastMovementInputRotation.Yaw, 0.0f}, 0.0f, 2.0f, DeltaTime);
1601 }
1602 }
1603
1604 // Other actions are ignored...
1605}
const FName NAME_YawOffset(TEXT("YawOffset"))
void HandleNonMovingRotation(float DeltaTime)
Definition ALSBaseCharacter.cpp:1607
bool bOptimizeGroundRotation
Definition ALSBaseCharacter.h:488
float CalculateGroundedRotationRate() const
Definition ALSBaseCharacter.cpp:1725

◆ UpdateInAirRotation()

void AALSBaseCharacter::UpdateInAirRotation ( float DeltaTime)
protected
1639{
1640 TRACE_CPUPROFILER_EVENT_SCOPE(AALSBaseCharacter::UpdateInAirRotation);
1641 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character);
1642 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_Base_Character_AirRotation);
1643 SCOPE_CYCLE_COUNTER(STATGROUP_ALS_All);
1644
1646 {
1647 // Velocity / Looking Direction Rotation
1648 SmoothCharacterRotation({0.0f, InAirRotation.Yaw, 0.0f}, 0.0f, 5.0f, DeltaTime);
1649 }
1651 {
1652 // Aiming Rotation
1653 SmoothCharacterRotation({0.0f, AimingRotation.Yaw, 0.0f}, 0.0f, 15.0f, DeltaTime);
1654 InAirRotation = GetActorRotation();
1655 }
1656}

◆ VelocityDirectionAction()

void AALSBaseCharacter::VelocityDirectionAction ( )

◆ WalkAction()

void AALSBaseCharacter::WalkAction ( )

Member Data Documentation

◆ Acceleration

FVector AALSBaseCharacter::Acceleration = FVector::ZeroVector
protected

Essential Information

◆ AimingRotation

FRotator AALSBaseCharacter::AimingRotation = FRotator::ZeroRotator
protected

◆ AimYawRate

float AALSBaseCharacter::AimYawRate = 0.0f
protected

◆ ALSDebugComponent

TObjectPtr<UALSDebugComponent> AALSBaseCharacter::ALSDebugComponent = nullptr
private

◆ AnimInstanceInterface

IALSAnimInterface* AALSBaseCharacter::AnimInstanceInterface
protected

◆ AnimValues

FALSAnimValues AALSBaseCharacter::AnimValues
protected

◆ bAimDownSights

bool AALSBaseCharacter::bAimDownSights = false
protected

◆ bBreakFall

bool AALSBaseCharacter::bBreakFall = false
protected

◆ bBreakfallOnLand

bool AALSBaseCharacter::bBreakfallOnLand = true
protected

Breakfall System If player hits to the ground with a specified amount of velocity, switch to breakfall state

◆ bEnableNetworkOptimizations

bool AALSBaseCharacter::bEnableNetworkOptimizations = false
protected

We won't use curve based movement and a few other features on networked games

◆ bForceEnableNetworkOptimizationsOff

bool AALSBaseCharacter::bForceEnableNetworkOptimizationsOff = false
protected

◆ bHasMovementInput

bool AALSBaseCharacter::bHasMovementInput = false
protected

◆ bIsFlying

bool AALSBaseCharacter::bIsFlying = false
protected

◆ bIsMoving

bool AALSBaseCharacter::bIsMoving = false
protected

◆ bOptimizeAnimValues

bool AALSBaseCharacter::bOptimizeAnimValues = true
protected

◆ bOptimizeGroundRotation

bool AALSBaseCharacter::bOptimizeGroundRotation = true
protected

Optimizations

◆ bPreRagdollURO

bool AALSBaseCharacter::bPreRagdollURO = false
protected

◆ bRagdollFaceUp

bool AALSBaseCharacter::bRagdollFaceUp = false
protected

◆ bRagdollOnGround

bool AALSBaseCharacter::bRagdollOnGround = false
protected

◆ bRagdollOnLand

bool AALSBaseCharacter::bRagdollOnLand = false
protected

If player hits to the ground with a specified amount of velocity, switch to ragdoll state

◆ BreakfallOnLandVelocity

float AALSBaseCharacter::BreakfallOnLandVelocity = 700.0f
protected

If player hits to the ground with an amount of velocity greater than specified value, switch to breakfall state

◆ bReversedPelvis

bool AALSBaseCharacter::bReversedPelvis = false
protected

Ragdoll System If the skeleton uses a reversed pelvis bone, flip the calculation operator

◆ bRightShoulder

bool AALSBaseCharacter::bRightShoulder = false
protected

◆ bSprintHeld

bool AALSBaseCharacter::bSprintHeld = false
protected

◆ CameraBehavior

TObjectPtr<UALSPlayerCameraBehavior> AALSBaseCharacter::CameraBehavior
protected

◆ DefVisBasedTickOp

EVisibilityBasedAnimTickOption AALSBaseCharacter::DefVisBasedTickOp
protected

◆ DesiredGait

EALSGait AALSBaseCharacter::DesiredGait = EALSGait::Running
protected

◆ DesiredRotationMode

EALSRotationMode AALSBaseCharacter::DesiredRotationMode = EALSRotationMode::LookingDirection
protected

Optimizations
Input

◆ DesiredStance

EALSStance AALSBaseCharacter::DesiredStance = EALSStance::Standing
protected

◆ EasedMaxAcceleration

float AALSBaseCharacter::EasedMaxAcceleration = 0.0f
protected

Replicated Essential Information

◆ FirstPersonFOV

float AALSBaseCharacter::FirstPersonFOV = 90.0f
protected

◆ Gait

EALSGait AALSBaseCharacter::Gait = EALSGait::Walking
protected

◆ GravityMultiplier

float AALSBaseCharacter::GravityMultiplier = 9.8f

◆ GroundedEntryState

EALSGroundedEntryState AALSBaseCharacter::GroundedEntryState
protected

◆ InAirRotation

FRotator AALSBaseCharacter::InAirRotation = FRotator::ZeroRotator
protected

◆ JumpPressedDelegate

FJumpPressedSignature AALSBaseCharacter::JumpPressedDelegate

Input

◆ LastMovementInputRotation

FRotator AALSBaseCharacter::LastMovementInputRotation
protected

◆ LastRagdollVelocity

FVector AALSBaseCharacter::LastRagdollVelocity = FVector::ZeroVector
protected

◆ LastStanceInputTime

float AALSBaseCharacter::LastStanceInputTime = 0.0f
protected

Last time the 'first' crouch/roll button is pressed

◆ LastVelocityRotation

FRotator AALSBaseCharacter::LastVelocityRotation
protected

◆ LookLeftRightRate

float AALSBaseCharacter::LookLeftRightRate = 1.25f
protected

◆ LookUpDownRate

float AALSBaseCharacter::LookUpDownRate = 1.25f
protected

◆ MovementAction

EALSMovementAction AALSBaseCharacter::MovementAction = EALSMovementAction::None
protected

◆ MovementData

FALSMovementStateSettings AALSBaseCharacter::MovementData
protected

Movement System

◆ MovementInputAmount

float AALSBaseCharacter::MovementInputAmount = 0.0f
protected

◆ MovementModel

FDataTableRowHandle AALSBaseCharacter::MovementModel
protected

Movement System

◆ MovementState

EALSMovementState AALSBaseCharacter::MovementState = EALSMovementState::None
protected

◆ MyCharacterMovementComponent

TObjectPtr<UALSCharacterMovementComponent> AALSBaseCharacter::MyCharacterMovementComponent
protected

◆ OnJumpedDelegate

FOnJumpedSignature AALSBaseCharacter::OnJumpedDelegate

◆ OnLandedFrictionResetTimer

FTimerHandle AALSBaseCharacter::OnLandedFrictionResetTimer
protected

◆ OverlayOverrideState

int32 AALSBaseCharacter::OverlayOverrideState = 0
protected

◆ OverlayState

EALSOverlayState AALSBaseCharacter::OverlayState = EALSOverlayState::Default
protected

State Values

◆ PreviousAimYaw

float AALSBaseCharacter::PreviousAimYaw = 0.0f
protected

◆ PreviousVelocity

FVector AALSBaseCharacter::PreviousVelocity = FVector::ZeroVector
protected

Cached Variables

◆ PrevMovementState

EALSMovementState AALSBaseCharacter::PrevMovementState = EALSMovementState::None
protected

◆ RagdollOnLandVelocity

float AALSBaseCharacter::RagdollOnLandVelocity = 1000.0f
protected

If player hits to the ground with an amount of velocity greater than specified value, switch to ragdoll state

◆ RagdollStateChangedDelegate

FRagdollStateChangedSignature AALSBaseCharacter::RagdollStateChangedDelegate

◆ ReplicatedControlRotation

FRotator AALSBaseCharacter::ReplicatedControlRotation = FRotator::ZeroRotator
protected

◆ ReplicatedCurrentAcceleration

FVector AALSBaseCharacter::ReplicatedCurrentAcceleration = FVector::ZeroVector
protected

◆ RollDoubleTapTimeout

float AALSBaseCharacter::RollDoubleTapTimeout = 0.3f
protected

◆ RotationMode

EALSRotationMode AALSBaseCharacter::RotationMode = EALSRotationMode::LookingDirection
protected

◆ ServerRagdollPull

float AALSBaseCharacter::ServerRagdollPull = 0.0f
protected

◆ Speed

float AALSBaseCharacter::Speed = 0.0f
protected

◆ Stance

EALSStance AALSBaseCharacter::Stance = EALSStance::Standing
protected

◆ TargetRagdollLocation

FVector AALSBaseCharacter::TargetRagdollLocation = FVector::ZeroVector
protected

◆ TargetRotation

FRotator AALSBaseCharacter::TargetRotation = FRotator::ZeroRotator
protected

Rotation System

◆ ThirdPersonFOV

float AALSBaseCharacter::ThirdPersonFOV = 90.0f
protected

Camera System

◆ ViewMode

EALSViewMode AALSBaseCharacter::ViewMode = EALSViewMode::ThirdPerson
protected

◆ VisibleMesh

TObjectPtr<USkeletalMesh> AALSBaseCharacter::VisibleMesh = nullptr
protected

Replicated Skeletal Mesh Information

◆ YawOffset

float AALSBaseCharacter::YawOffset = 0.0f
protected

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