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

#include <ProjectileMovementLinear.h>

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

Public 멤버 함수

virtual void Activate (const FVector &InStart, const FVector &InTarget) override
 
virtual bool Simulate (float InDeltaTime, AActor *InOwner) override
 
virtual float GetProjectileDuration () const override
 
virtual bool SampleFlightPosition (float Progress, FVector &OutPosition) const override
 
void SynchronizeArrival (UProjectileMovementBase *InTimeSource)
 
- UProjectileMovementBase(으)로부터 상속된 Public 멤버 함수
FORCEINLINE float GetElapsedTime () const
 
FORCEINLINE FVector GetCurrentVelocity () const
 

Public 속성

TObjectPtr< UCurveFloat > PositionCurve
 
float Duration = 1.f
 
- UProjectileMovementBase(으)로부터 상속된 Public 속성
virtual void virtual Activate(const FVector &InStart, const FVector &InDirectionOrTarget) PURE_VIRTUAL(UProjectileMovementBase bool Simulate (float InDeltaTime, AActor *InOwner) PURE_VIRTUAL(UProjectileMovementBase
 

Private 속성

FVector StartLocation = FVector::ZeroVector
 
FVector EndLocation = FVector::ZeroVector
 
float TotalTime = 1.f
 
TWeakObjectPtr< UProjectileMovementBase > FlightTimeSource
 
float SourceStartTime = 0.0f
 

추가로 상속된 멤버들

- UProjectileMovementBase(으)로부터 상속된 Protected 속성
FVector CurrentVelocity = FVector::ZeroVector
 
float ElapsedTime = 0.0f
 

멤버 함수 문서화

◆ Activate()

void UProjectileMovementLinearInterp::Activate ( const FVector &  InStart,
const FVector &  InTarget 
)
overridevirtual
28{
29 StartLocation = InStart;
30 EndLocation = InTarget;
31 TotalTime = FMath::Max(Duration, KINDA_SMALL_NUMBER);
32 ElapsedTime = 0.f;
33 CurrentVelocity = FVector::ZeroVector;
34}
FVector CurrentVelocity
Definition ProjectileMovementBase.h:34
float ElapsedTime
Definition ProjectileMovementBase.h:35
float Duration
Definition ProjectileMovementLinear.h:50
FVector StartLocation
Definition ProjectileMovementLinear.h:53
float TotalTime
Definition ProjectileMovementLinear.h:55
FVector EndLocation
Definition ProjectileMovementLinear.h:54

다음을 참조함 : UProjectileMovementBase::CurrentVelocity, Duration, UProjectileMovementBase::ElapsedTime, EndLocation, StartLocation, TotalTime.

◆ GetProjectileDuration()

virtual float UProjectileMovementLinearInterp::GetProjectileDuration ( ) const
inlineoverridevirtual

UProjectileMovementBase(으)로부터 재구현되었습니다.

39{ return Duration; }

다음에 의해서 참조됨 : UGA_Skill_StarFall::OnThrownWeaponSpawned().

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

◆ SampleFlightPosition()

bool UProjectileMovementLinearInterp::SampleFlightPosition ( float  Progress,
FVector &  OutPosition 
) const
overridevirtual

발사 전 경로 검사에 사용합니다. 목표 지점까지의 궤적을 제공하지 않는 이동은 false를 반환합니다.

UProjectileMovementBase(으)로부터 재구현되었습니다.

77{
78 const float Alpha = FMath::Clamp(Progress, 0.0f, 1.0f);
79 const float CurveAlpha = PositionCurve ? PositionCurve->GetFloatValue(Alpha) : Alpha;
80 OutPosition = FMath::Lerp(StartLocation, EndLocation, CurveAlpha);
81 return OutPosition.ContainsNaN() == false;
82}
TObjectPtr< UCurveFloat > PositionCurve
Definition ProjectileMovementLinear.h:47

다음을 참조함 : EndLocation, PositionCurve, StartLocation.

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

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

◆ Simulate()

bool UProjectileMovementLinearInterp::Simulate ( float  InDeltaTime,
AActor *  InOwner 
)
overridevirtual
38{
39 const float PreviousTime = ElapsedTime;
40 const UProjectileMovementBase* TimeSource = FlightTimeSource.Get();
41 ElapsedTime = TimeSource ? FMath::Max(0.0f, TimeSource->GetElapsedTime() - SourceStartTime) : ElapsedTime + InDeltaTime;
42 const float Alpha = FMath::Clamp(ElapsedTime / TotalTime, 0.f, 1.f);
43
44 if (Alpha > (1.0f - KINDA_SMALL_NUMBER))
45 {
46 CurrentVelocity = FVector::ZeroVector;
47 InOwner->SetActorLocation(EndLocation, false);
48 return true;
49 }
50
51 FVector NewLocation;
52 SampleFlightPosition(Alpha, NewLocation);
53 const FVector PrevLocation = InOwner->GetActorLocation();
54 InOwner->SetActorLocation(NewLocation, true);
55
56 const FVector TravelDir = NewLocation - PrevLocation;
57 const float TravelTime = ElapsedTime - PreviousTime;
58 CurrentVelocity = TravelTime > 0.0f ? TravelDir / TravelTime : FVector::ZeroVector;
59
60 return false;
61}
Definition ProjectileMovementBase.h:12
FORCEINLINE float GetElapsedTime() const
Definition ProjectileMovementBase.h:25
TWeakObjectPtr< UProjectileMovementBase > FlightTimeSource
Definition ProjectileMovementLinear.h:56
virtual bool SampleFlightPosition(float Progress, FVector &OutPosition) const override
Definition ProjectileMovementLinear.cpp:76
float SourceStartTime
Definition ProjectileMovementLinear.h:57

다음을 참조함 : UProjectileMovementBase::CurrentVelocity, UProjectileMovementBase::ElapsedTime, EndLocation, FlightTimeSource, UProjectileMovementBase::GetElapsedTime(), SampleFlightPosition(), SourceStartTime, TotalTime.

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

◆ SynchronizeArrival()

void UProjectileMovementLinearInterp::SynchronizeArrival ( UProjectileMovementBase *  InTimeSource)

다른 투사체의 남은 비행 시간에 맞춰 같은 프레임에 목표 지점에 도착합니다.

65{
66 FlightTimeSource = InTimeSource;
67 SourceStartTime = InTimeSource ? InTimeSource->GetElapsedTime() : 0.0f;
68
69 if (InTimeSource)
70 {
71 Duration = FMath::Max(0.0f, InTimeSource->GetProjectileDuration() - SourceStartTime);
72 }
73}
virtual float GetProjectileDuration() const
Definition ProjectileMovementBase.h:19

다음을 참조함 : Duration, FlightTimeSource, UProjectileMovementBase::GetElapsedTime(), UProjectileMovementBase::GetProjectileDuration(), SourceStartTime.

다음에 의해서 참조됨 : UGA_Skill_StarFall::OnThrownWeaponSpawned().

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

멤버 데이터 문서화

◆ Duration

float UProjectileMovementLinearInterp::Duration = 1.f

다음에 의해서 참조됨 : Activate(), SynchronizeArrival().

◆ EndLocation

FVector UProjectileMovementLinearInterp::EndLocation = FVector::ZeroVector
private

다음에 의해서 참조됨 : Activate(), SampleFlightPosition(), Simulate().

◆ FlightTimeSource

TWeakObjectPtr<UProjectileMovementBase> UProjectileMovementLinearInterp::FlightTimeSource
private

다음에 의해서 참조됨 : Simulate(), SynchronizeArrival().

◆ PositionCurve

TObjectPtr<UCurveFloat> UProjectileMovementLinearInterp::PositionCurve

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

◆ SourceStartTime

float UProjectileMovementLinearInterp::SourceStartTime = 0.0f
private

다음에 의해서 참조됨 : Simulate(), SynchronizeArrival().

◆ StartLocation

FVector UProjectileMovementLinearInterp::StartLocation = FVector::ZeroVector
private

다음에 의해서 참조됨 : Activate(), SampleFlightPosition().

◆ TotalTime

float UProjectileMovementLinearInterp::TotalTime = 1.f
private

다음에 의해서 참조됨 : Activate(), Simulate().


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