#include <CK_PlayerController.h>
◆ 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
51 {
54 {
56
57 if (APawn* ControlledPawn = GetPawn())
58 {
59 if (APlayerState* PS = ControlledPawn->GetPlayerState())
60 {
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 {
82 }
83 else
84 {
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 |
|
) |
| |
◆ 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 |
이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: