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

#include <ProjectileMovementParabolic.h>

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

Public 멤버 함수

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

Public 속성

float Speed = 1000.f
 
float Duration = 2.f
 
float ArcHeight = 300.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 FlightDirection = FVector::ZeroVector
 
float TotalTime = 1.f
 
float ElapsedTime = 0.f
 
float ActiveArcHeight = 0.f
 

추가로 상속된 멤버들

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

멤버 함수 문서화

◆ Activate()

void UProjectileMovementParabolic::Activate ( const FVector &  InStart,
const FVector &  InDirection 
)
overridevirtual
9{
10 StartLocation = InStart;
11 FlightDirection = InDirection.GetSafeNormal();
14 ElapsedTime = 0.f;
16}
FVector CurrentVelocity
Definition ProjectileMovementBase.h:28
float TotalTime
Definition ProjectileMovementParabolic.h:35
float ElapsedTime
Definition ProjectileMovementParabolic.h:36
FVector StartLocation
Definition ProjectileMovementParabolic.h:33
float Duration
Definition ProjectileMovementParabolic.h:27
float ArcHeight
Definition ProjectileMovementParabolic.h:30
float ActiveArcHeight
Definition ProjectileMovementParabolic.h:37
FVector FlightDirection
Definition ProjectileMovementParabolic.h:34
float Speed
Definition ProjectileMovementParabolic.h:24

◆ GetProjectileDuration()

virtual float UProjectileMovementParabolic::GetProjectileDuration ( ) const
inlineoverridevirtual

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

20{ return Duration; }

◆ Simulate()

bool UProjectileMovementParabolic::Simulate ( float  InDeltaTime,
AActor *  InOwner 
)
overridevirtual
20{
21 ElapsedTime += InDeltaTime;
22 const float Alpha = FMath::Clamp(ElapsedTime / TotalTime, 0.f, 1.f);
23
24 if (Alpha > (1.0f - KINDA_SMALL_NUMBER))
25 {
26 const FVector LandingPoint = StartLocation + FlightDirection * (Speed * TotalTime);
27 CurrentVelocity = FVector::ZeroVector;
28 InOwner->SetActorLocation(LandingPoint, false);
29 return true;
30 }
31
32 const FVector HorizontalPos = StartLocation + FlightDirection * (Speed * ElapsedTime);
33 const float ArcZ = FMath::Sin(Alpha * PI) * ActiveArcHeight;
34 const FVector NewLocation = HorizontalPos + FVector(0.f, 0.f, ArcZ);
35 const FVector PrevLocation = InOwner->GetActorLocation();
36 InOwner->SetActorLocation(NewLocation, true);
37
38 const FVector TravelDir = NewLocation - PrevLocation;
39 CurrentVelocity = TravelDir / InDeltaTime;
40
41 return false;
42}

멤버 데이터 문서화

◆ ActiveArcHeight

float UProjectileMovementParabolic::ActiveArcHeight = 0.f
private

◆ ArcHeight

float UProjectileMovementParabolic::ArcHeight = 300.f

◆ Duration

float UProjectileMovementParabolic::Duration = 2.f

◆ ElapsedTime

float UProjectileMovementParabolic::ElapsedTime = 0.f
private

◆ FlightDirection

FVector UProjectileMovementParabolic::FlightDirection = FVector::ZeroVector
private

◆ Speed

float UProjectileMovementParabolic::Speed = 1000.f

◆ StartLocation

FVector UProjectileMovementParabolic::StartLocation = FVector::ZeroVector
private

◆ TotalTime

float UProjectileMovementParabolic::TotalTime = 1.f
private

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