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

#include <CK_PlayerController.h>

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

Public 멤버 함수

 ACK_PlayerController ()
 
bool GetMouseLocation (FVector &OutLocation) const
 
void SetTargetFOV (float NewFOV, float Speed)
 

Public 속성

TSubclassOf< UHUDWidgetHUDWidgetClass
 
TObjectPtr< UHUDWidgetHUDWidget
 

Protected 멤버 함수

virtual void BeginPlay () override
 
virtual void PlayerTick (float DeltaTime) override
 

Private 속성

float TargetFOV = 90.0f
 
float FOVChangeSpeed = 2.0f
 
bool bIsFOVChanging = false
 

생성자 & 소멸자 문서화

◆ ACK_PlayerController()

ACK_PlayerController::ACK_PlayerController ( )
12{
13 bShowMouseCursor = true;
14 bEnableClickEvents = true;
15 bEnableMouseOverEvents = true;
16}

멤버 함수 문서화

◆ BeginPlay()

void ACK_PlayerController::BeginPlay ( )
overrideprotectedvirtual
41{
42 Super::BeginPlay();
43
44 FInputModeGameAndUI InputMode;
45 InputMode.SetLockMouseToViewportBehavior(EMouseLockMode::LockAlways);
46 InputMode.SetHideCursorDuringCapture(false);
47
48 SetInputMode(InputMode);
49
50 if (IsLocalPlayerController() && HUDWidgetClass)
51 {
52 HUDWidget = CreateWidget<UHUDWidget>(this, HUDWidgetClass);
53 if (HUDWidget)
54 {
55 HUDWidget->AddToViewport();
56
57 if (APawn* ControlledPawn = GetPawn())
58 {
59 if (APlayerState* PS = ControlledPawn->GetPlayerState())
60 {
61 HUDWidget->SetAbilitySystemComponent(PS);
62 }
63 }
64 }
65 }
66}
TObjectPtr< UHUDWidget > HUDWidget
Definition CK_PlayerController.h:36
TSubclassOf< UHUDWidget > HUDWidgetClass
Definition CK_PlayerController.h:33

◆ GetMouseLocation()

bool ACK_PlayerController::GetMouseLocation ( FVector &  OutLocation) const
19{
20 FHitResult HitResult;
21 GetHitResultUnderCursor(ECC_Visibility, false, HitResult);
22
23 if (HitResult.bBlockingHit)
24 {
25 OutLocation = HitResult.ImpactPoint;
26 return true;
27 }
28
29 OutLocation = FVector::ZeroVector;
30 return false;
31}

◆ PlayerTick()

void ACK_PlayerController::PlayerTick ( float  DeltaTime)
overrideprotectedvirtual
69{
70 Super::PlayerTick(DeltaTime);
71
73 {
74 if (APawn* ControlledPawn = GetPawn())
75 {
76 if (UCameraComponent* CameraComp = ControlledPawn->FindComponentByClass<UCameraComponent>())
77 {
78 if (FMath::IsNearlyEqual(CameraComp->FieldOfView, TargetFOV, 0.1f))
79 {
80 CameraComp->FieldOfView = TargetFOV;
81 bIsFOVChanging = false;
82 }
83 else
84 {
85 CameraComp->FieldOfView = FMath::FInterpTo(CameraComp->FieldOfView, TargetFOV, DeltaTime, FOVChangeSpeed);
86 }
87 }
88 }
89 }
90}
float TargetFOV
Definition CK_PlayerController.h:39
float FOVChangeSpeed
Definition CK_PlayerController.h:40
bool bIsFOVChanging
Definition CK_PlayerController.h:41

◆ SetTargetFOV()

void ACK_PlayerController::SetTargetFOV ( float  NewFOV,
float  Speed 
)
34{
35 TargetFOV = NewFOV;
36 FOVChangeSpeed = Speed;
37 bIsFOVChanging = true;
38}

멤버 데이터 문서화

◆ bIsFOVChanging

bool ACK_PlayerController::bIsFOVChanging = false
private

◆ FOVChangeSpeed

float ACK_PlayerController::FOVChangeSpeed = 2.0f
private

◆ HUDWidget

TObjectPtr<UHUDWidget> ACK_PlayerController::HUDWidget

◆ HUDWidgetClass

TSubclassOf<UHUDWidget> ACK_PlayerController::HUDWidgetClass

◆ TargetFOV

float ACK_PlayerController::TargetFOV = 90.0f
private

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