Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
UAT_ApplyVelocityCurve 클래스 참조

#include <AT_ApplyVelocityCurve.h>

UAT_ApplyVelocityCurve에 대한 상속 다이어그램 :
Inheritance graph
UAT_ApplyVelocityCurve에 대한 협력 다이어그램:
Collaboration graph

Public 멤버 함수

 UAT_ApplyVelocityCurve ()
 
virtual void Activate () override
 
virtual void TickTask (float DeltaTime) override
 
virtual void OnDestroy (bool bInOwnerFinished) override
 

정적 Public 멤버 함수

static UAT_ApplyVelocityCurveApplyVelocityCurve (UGameplayAbility *OwningAbility, UCurveFloat *InProgressCurve, FVector Direction, float NormalizationFactor, float Duration, float Distance)
 

Protected 속성

TObjectPtr< UCurveFloat > ProgressCurve
 
TObjectPtr< ACharacter > OwnerCharacter
 
TObjectPtr< UCharacterMovementComponent > MovementComponent
 
FVector NormalizedDirection = FVector::ZeroVector
 
FVector ExtraVelocity = FVector::ZeroVector
 
float Elapsed = 0.0f
 
float TaskDuration = 0.0f
 
float TargetDistance = 0.0f
 
float NormalizationFactor = 0.0f
 
bool bOriginalUseControllerRotationYaw = false
 
bool bOriginalOrientRotationToMovement = false
 
bool bOriginalUseControllerDesiredRotation = false
 

생성자 & 소멸자 문서화

◆ UAT_ApplyVelocityCurve()

UAT_ApplyVelocityCurve::UAT_ApplyVelocityCurve ( )
14{
15 bTickingTask = true;
16}

멤버 함수 문서화

◆ Activate()

void UAT_ApplyVelocityCurve::Activate ( )
overridevirtual
32{
33 Super::Activate();
34
35 OwnerCharacter = CastChecked<ACharacter>(GetAvatarActor());
36 MovementComponent = OwnerCharacter->GetCharacterMovement();
37
38 bOriginalUseControllerRotationYaw = OwnerCharacter->bUseControllerRotationYaw;
39 bOriginalOrientRotationToMovement = MovementComponent->bOrientRotationToMovement;
40 bOriginalUseControllerDesiredRotation = MovementComponent->bUseControllerDesiredRotation;
41
42 OwnerCharacter->bUseControllerRotationYaw = false;
43 MovementComponent->bOrientRotationToMovement = false;
44 MovementComponent->bUseControllerDesiredRotation = false;
45}
bool bOriginalOrientRotationToMovement
Definition AT_ApplyVelocityCurve.h:53
bool bOriginalUseControllerDesiredRotation
Definition AT_ApplyVelocityCurve.h:54
bool bOriginalUseControllerRotationYaw
Definition AT_ApplyVelocityCurve.h:52
TObjectPtr< UCharacterMovementComponent > MovementComponent
Definition AT_ApplyVelocityCurve.h:40
TObjectPtr< ACharacter > OwnerCharacter
Definition AT_ApplyVelocityCurve.h:37

◆ ApplyVelocityCurve()

UAT_ApplyVelocityCurve * UAT_ApplyVelocityCurve::ApplyVelocityCurve ( UGameplayAbility *  OwningAbility,
UCurveFloat *  InProgressCurve,
FVector  Direction,
float  NormalizationFactor,
float  Duration,
float  Distance 
)
static
20{
21 UAT_ApplyVelocityCurve* NewTask = NewAbilityTask<UAT_ApplyVelocityCurve>(OwningAbility);
22 NewTask->NormalizedDirection = Direction.GetSafeNormal();
24 NewTask->ProgressCurve = InProgressCurve;
25 NewTask->TaskDuration = Duration;
26 NewTask->TargetDistance = Distance;
27 return NewTask;
28}
Definition AT_ApplyVelocityCurve.h:18
float TaskDuration
Definition AT_ApplyVelocityCurve.h:48
float NormalizationFactor
Definition AT_ApplyVelocityCurve.h:50
float TargetDistance
Definition AT_ApplyVelocityCurve.h:49
TObjectPtr< UCurveFloat > ProgressCurve
Definition AT_ApplyVelocityCurve.h:34
FVector NormalizedDirection
Definition AT_ApplyVelocityCurve.h:43
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ OnDestroy()

void UAT_ApplyVelocityCurve::OnDestroy ( bool  bInOwnerFinished)
overridevirtual
49{
50 if (OwnerCharacter != nullptr)
51 {
52 OwnerCharacter->bUseControllerRotationYaw = bOriginalUseControllerRotationYaw;
53 }
54
55 if (MovementComponent != nullptr)
56 {
57 MovementComponent->bOrientRotationToMovement = bOriginalOrientRotationToMovement;
58 MovementComponent->bUseControllerDesiredRotation = bOriginalUseControllerDesiredRotation;
59 }
60
61 Super::OnDestroy(bInOwnerFinished);
62}

◆ TickTask()

void UAT_ApplyVelocityCurve::TickTask ( float  DeltaTime)
overridevirtual
66{
67 Super::TickTask(DeltaTime);
68
69 const FVector LastInputVector = OwnerCharacter->GetLastMovementInputVector();
70 Elapsed = FMath::Clamp(Elapsed + DeltaTime, 0.0f, TaskDuration);
71 const float DashSpeed = ProgressCurve->GetFloatValue(Elapsed / TaskDuration) * NormalizationFactor;
72
73 if (LastInputVector.SquaredLength() > 0.0f)
74 {
75 const FGameplayAttribute MoveSpeedAttribute = UPlayerAttributeSet::GetMoveSpeedAttribute();
76 const float MoveSpeed = AbilitySystemComponent->GetNumericAttributeBase(MoveSpeedAttribute);
77 ExtraVelocity = NormalizedDirection * FMath::Max(DashSpeed, MoveSpeed);
78 }
79 else
80 {
82 }
83
85}
FVector ExtraVelocity
Definition AT_ApplyVelocityCurve.h:44
float Elapsed
Definition AT_ApplyVelocityCurve.h:47

멤버 데이터 문서화

◆ bOriginalOrientRotationToMovement

bool UAT_ApplyVelocityCurve::bOriginalOrientRotationToMovement = false
protected

◆ bOriginalUseControllerDesiredRotation

bool UAT_ApplyVelocityCurve::bOriginalUseControllerDesiredRotation = false
protected

◆ bOriginalUseControllerRotationYaw

bool UAT_ApplyVelocityCurve::bOriginalUseControllerRotationYaw = false
protected

◆ Elapsed

float UAT_ApplyVelocityCurve::Elapsed = 0.0f
protected

◆ ExtraVelocity

FVector UAT_ApplyVelocityCurve::ExtraVelocity = FVector::ZeroVector
protected

◆ MovementComponent

TObjectPtr<UCharacterMovementComponent> UAT_ApplyVelocityCurve::MovementComponent
protected

◆ NormalizationFactor

float UAT_ApplyVelocityCurve::NormalizationFactor = 0.0f
protected

◆ NormalizedDirection

FVector UAT_ApplyVelocityCurve::NormalizedDirection = FVector::ZeroVector
protected

◆ OwnerCharacter

TObjectPtr<ACharacter> UAT_ApplyVelocityCurve::OwnerCharacter
protected

◆ ProgressCurve

TObjectPtr<UCurveFloat> UAT_ApplyVelocityCurve::ProgressCurve
protected

◆ TargetDistance

float UAT_ApplyVelocityCurve::TargetDistance = 0.0f
protected

◆ TaskDuration

float UAT_ApplyVelocityCurve::TaskDuration = 0.0f
protected

이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: