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

#include <CharacterMotionWarpingComponentBase.h>

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

Public 멤버 함수

 UCharacterMotionWarpingComponentBase (const FObjectInitializer &ObjectInitializer=FObjectInitializer::Get())
 
void StopMotionWarp (FName WarpTargetName=NAME_None)
 
void UpdateMotionWarpTarget (FName WarpTargetName, const FVector &TargetLocation, const FRotator &TargetRotation, bool bRestart=false)
 
void UpdateMotionWarpToTarget (FName WarpTargetName, ITargetableInterface *Target, float CorrectionRange, float DesiredRange, float InnerOffset)
 
void RotateCharacterToNearestTarget (FName WarpTargetName=FName("Target"), float TargetRange=450.0f)
 
bool UpdateMotionWarpTargetToNearestTargetAtRange (FName WarpTargetName, float CorrectionRange, float DesiredRange, float InnerOffset)
 
virtual void ResetLockOnTarget ()
 
FORCEINLINE FVector GetWarpSteeringDirection () const
 

Protected 멤버 함수

virtual FVector GetWarpFallbackDirection () const
 

Protected 속성

virtual bool FindWarpTargetLocation (float MaxRange, FVector &OutTargetLocation) PURE_VIRTUAL(UCharacterMotionWarpingComponentBase
 

Private 멤버 함수

void UpdateWarpTargetWithRangeCorrection (FName WarpTargetName, const FVector &TargetLocation, float CorrectionRange, float DesiredRange, float InnerOffset)
 

생성자 & 소멸자 문서화

◆ UCharacterMotionWarpingComponentBase()

UCharacterMotionWarpingComponentBase::UCharacterMotionWarpingComponentBase ( const FObjectInitializer &  ObjectInitializer = FObjectInitializer::Get())
10 : Super(ObjectInitializer)
11{
12
13}

멤버 함수 문서화

◆ GetWarpFallbackDirection()

FVector UCharacterMotionWarpingComponentBase::GetWarpFallbackDirection ( ) const
protectedvirtual

워프 대상이 없거나 대상과 겹쳐 있을 때 사용할 기본 방향. 기본 구현은 소유 액터의 전방.

UPlayerMotionWarpingComponent에서 재구현되었습니다.

110{
111 const AActor* OwnerActor = GetOwner();
112 return OwnerActor ? OwnerActor->GetActorForwardVector() : FVector::ForwardVector;
113}

다음에 의해서 참조됨 : RotateCharacterToNearestTarget(), UpdateMotionWarpTargetToNearestTargetAtRange(), UpdateWarpTargetWithRangeCorrection().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ GetWarpSteeringDirection()

FORCEINLINE FVector UCharacterMotionWarpingComponentBase::GetWarpSteeringDirection ( ) const
inline

조향 방향(플레이어: 이동 입력, 적: 전방)을 반환한다. AnimNotifyState 등 외부 조향용.

34 {
36 }
virtual FVector GetWarpFallbackDirection() const
Definition CharacterMotionWarpingComponentBase.cpp:109

◆ ResetLockOnTarget()

void UCharacterMotionWarpingComponentBase::ResetLockOnTarget ( )
virtual

락온 상태 초기화. 락온 개념이 없는 파생 클래스는 기본 구현(no-op)을 그대로 사용한다.

UPlayerMotionWarpingComponent에서 재구현되었습니다.

104{
105 // 락온 개념이 있는 파생 클래스에서만 구현한다.
106}

◆ RotateCharacterToNearestTarget()

void UCharacterMotionWarpingComponentBase::RotateCharacterToNearestTarget ( FName  WarpTargetName = FName("Target"),
float  TargetRange = 450.0f 
)
51{
52 const AActor* OwnerActor = GetOwner();
53
54 if (OwnerActor == nullptr)
55 {
56 return;
57 }
58
59 FVector TargetLocation;
60
61 if (FindWarpTargetLocation(TargetRange, TargetLocation))
62 {
63 FVector LookVector = TargetLocation - OwnerActor->GetActorLocation();
64 LookVector.Z = 0.0f;
65 UpdateMotionWarpTarget(WarpTargetName, TargetLocation, LookVector.Rotation());
66 }
67 else
68 {
69 const FVector FallbackDirection = GetWarpFallbackDirection();
70 const FVector FallbackLocation = OwnerActor->GetActorLocation() + FallbackDirection * TargetRange;
71 UpdateMotionWarpTarget(WarpTargetName, FallbackLocation, FallbackDirection.Rotation(), true);
72 }
73}
static const FName WarpTargetName(TEXT("KnockDown"))
void UpdateMotionWarpTarget(FName WarpTargetName, const FVector &TargetLocation, const FRotator &TargetRotation, bool bRestart=false)
Definition CharacterMotionWarpingComponentBase.cpp:28
virtual bool FindWarpTargetLocation(float MaxRange, FVector &OutTargetLocation) PURE_VIRTUAL(UCharacterMotionWarpingComponentBase
Definition CharacterMotionWarpingComponentBase.h:40

다음을 참조함 : FindWarpTargetLocation, GetWarpFallbackDirection(), UpdateMotionWarpTarget(), WarpTargetName().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ StopMotionWarp()

void UCharacterMotionWarpingComponentBase::StopMotionWarp ( FName  WarpTargetName = NAME_None)
17{
18 if (WarpTargetName.IsNone())
19 {
20 RemoveAllWarpTargets();
21 return;
22 }
23
24 RemoveWarpTarget(WarpTargetName);
25}

다음을 참조함 : WarpTargetName().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ UpdateMotionWarpTarget()

void UCharacterMotionWarpingComponentBase::UpdateMotionWarpTarget ( FName  WarpTargetName,
const FVector &  TargetLocation,
const FRotator &  TargetRotation,
bool  bRestart = false 
)
29{
30 if (bRestart)
31 {
32 RemoveAllWarpTargets();
33 }
34
35 AddOrUpdateWarpTargetFromLocationAndRotation(WarpTargetName, TargetLocation, TargetRotation);
36}

다음을 참조함 : WarpTargetName().

다음에 의해서 참조됨 : RotateCharacterToNearestTarget(), UGA_KnockDown::SetupKnockdownMotionWarp(), UpdateMotionWarpTargetToNearestTargetAtRange(), UpdateWarpTargetWithRangeCorrection().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ UpdateMotionWarpTargetToNearestTargetAtRange()

bool UCharacterMotionWarpingComponentBase::UpdateMotionWarpTargetToNearestTargetAtRange ( FName  WarpTargetName,
float  CorrectionRange,
float  DesiredRange,
float  InnerOffset 
)
77{
78 const AActor* OwnerActor = GetOwner();
79
80 if (OwnerActor == nullptr)
81 {
82 return false;
83 }
84
85 const float SafeDesiredRange = FMath::Max(DesiredRange, 0.0f);
86 const float MaxCorrectionRange = SafeDesiredRange + FMath::Max(CorrectionRange, 0.0f);
87 FVector TargetLocation;
88
89 if (FindWarpTargetLocation(MaxCorrectionRange, TargetLocation))
90 {
91 UpdateWarpTargetWithRangeCorrection(WarpTargetName, TargetLocation, CorrectionRange, DesiredRange, InnerOffset);
92 return true;
93 }
94
95 // 대상이 없으면 기존처럼 기본 방향 기준 WarpTarget만 갱신한다.
96 const FVector FallbackDirection = GetWarpFallbackDirection();
97 const FVector FallbackLocation = OwnerActor->GetActorLocation() + FallbackDirection * SafeDesiredRange;
98 UpdateMotionWarpTarget(WarpTargetName, FallbackLocation, FallbackDirection.Rotation(), true);
99 return true;
100}
void UpdateWarpTargetWithRangeCorrection(FName WarpTargetName, const FVector &TargetLocation, float CorrectionRange, float DesiredRange, float InnerOffset)
Definition CharacterMotionWarpingComponentBase.cpp:116

다음을 참조함 : FindWarpTargetLocation, GetWarpFallbackDirection(), UpdateMotionWarpTarget(), UpdateWarpTargetWithRangeCorrection(), WarpTargetName().

다음에 의해서 참조됨 : UGA_CombatBase::UpdateAttackWarpTargetForRange().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ UpdateMotionWarpToTarget()

void UCharacterMotionWarpingComponentBase::UpdateMotionWarpToTarget ( FName  WarpTargetName,
ITargetableInterface *  Target,
float  CorrectionRange,
float  DesiredRange,
float  InnerOffset 
)
40{
41 if (Target == nullptr)
42 {
43 return;
44 }
45
46 UpdateWarpTargetWithRangeCorrection(WarpTargetName, Target->GetTargetedActorLocation(), CorrectionRange, DesiredRange, InnerOffset);
47}
virtual FVector GetTargetedActorLocation()
Definition TargetableInterface.cpp:95

다음을 참조함 : ITargetableInterface::GetTargetedActorLocation(), UpdateWarpTargetWithRangeCorrection(), WarpTargetName().

다음에 의해서 참조됨 : UGA_CombatBase::UpdateAttackWarpTargetForRange().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ UpdateWarpTargetWithRangeCorrection()

void UCharacterMotionWarpingComponentBase::UpdateWarpTargetWithRangeCorrection ( FName  WarpTargetName,
const FVector &  TargetLocation,
float  CorrectionRange,
float  DesiredRange,
float  InnerOffset 
)
private
117{
118 const AActor* OwnerActor = GetOwner();
119
120 if (OwnerActor == nullptr)
121 {
122 return;
123 }
124
125 const FVector OwnerLocation = OwnerActor->GetActorLocation();
126 FVector ToTarget = TargetLocation - OwnerLocation;
127 ToTarget.Z = 0.0f;
128
129 // 공격 사거리는 수평 거리 기준으로만 판정한다.
130 const float CurrentDistance = ToTarget.Size();
131
132 if (CurrentDistance < KINDA_SMALL_NUMBER)
133 {
134 UpdateMotionWarpTarget(WarpTargetName, OwnerLocation, GetWarpFallbackDirection().Rotation(), true);
135 return;
136 }
137
138 const float SafeDesiredRange = FMath::Max(DesiredRange, 0.0f);
139 const float MaxCorrectionRange = SafeDesiredRange + FMath::Max(CorrectionRange, 0.0f);
140 const float CorrectedDesiredRange = FMath::Max(SafeDesiredRange - FMath::Max(InnerOffset, 0.0f), 0.0f);
141 const FVector ToTargetDirection = ToTarget / CurrentDistance;
142
143 // 기본 공격 범위 밖이면서 무기별 보정 범위 안에 있을 때만 위치를 당긴다.
144 if (CurrentDistance > SafeDesiredRange && CurrentDistance <= MaxCorrectionRange)
145 {
146 FVector WarpLocation = TargetLocation - ToTargetDirection * CorrectedDesiredRange;
147 WarpLocation.Z = OwnerLocation.Z;
148 UpdateMotionWarpTarget(WarpTargetName, WarpLocation, ToTargetDirection.Rotation());
149 return;
150 }
151
152 // 이미 공격 범위 안이거나 보정 범위 밖이면 기존처럼 대상 위치를 WarpTarget으로 사용한다.
153 UpdateMotionWarpTarget(WarpTargetName, TargetLocation, ToTargetDirection.Rotation());
154}

다음을 참조함 : GetWarpFallbackDirection(), UpdateMotionWarpTarget(), WarpTargetName().

다음에 의해서 참조됨 : UpdateMotionWarpTargetToNearestTargetAtRange(), UpdateMotionWarpToTarget().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ FindWarpTargetLocation

virtual bool UCharacterMotionWarpingComponentBase::FindWarpTargetLocation(float MaxRange, FVector &OutTargetLocation) PURE_VIRTUAL(UCharacterMotionWarpingComponentBase
protected

파생 클래스가 자신(플레이어/적)의 기준에 맞는 워프 대상 위치를 탐색한다.

다음에 의해서 참조됨 : RotateCharacterToNearestTarget(), UpdateMotionWarpTargetToNearestTargetAtRange().


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