KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
AOwlPlayer 클래스 참조

#include <AOwlPlayer.h>

+ AOwlPlayer에 대한 상속 다이어그램 :
+ AOwlPlayer에 대한 협력 다이어그램:

Public 멤버 함수

 AOwlPlayer ()
 
void DoJump ()
 
bool GetIsJumpStart ()
 
bool GetIsRunning ()
 
virtual void SetupPlayerInputComponent (class UInputComponent *PlayerInputComponent) override
 
virtual void Tick (float DeltaTime) override
 

Public 속성

TObjectPtr< class USceneComponent > HoldPosition
 
TObjectPtr< class UInteractionSystem > InteractionSystem
 

Protected 멤버 함수

virtual void BeginPlay () override
 
void OnInteract (const FInputActionValue &Value)
 
void OnJump ()
 
void OnLook (const FInputActionValue &Value)
 
void OnMove (const FInputActionValue &Value)
 
void OnRun ()
 
void OnStopMove ()
 

Protected 속성

TObjectPtr< class USpringArmComponent > CameraBoom
 
TObjectPtr< class UCameraComponent > FollowCamera
 
TObjectPtr< class UInputAction > InteractAction
 
TObjectPtr< class UInputAction > JumpAction
 
TObjectPtr< class UInputAction > LookAction
 
TObjectPtr< class UInputAction > MoveAction
 
TObjectPtr< class UInputMappingContext > RobotIMC
 
TObjectPtr< class UInputAction > RunAction
 

Private 속성

bool bIsJumpStart
 
bool bIsRunning
 
float RunSpeed = 500.f
 
float WalkSpeed = 200.f
 

상세한 설명

AOwlPlayer.h 파일의 11 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ AOwlPlayer()

AOwlPlayer::AOwlPlayer ( )

AOwlPlayer.cpp 파일의 17 번째 라인에서 정의되었습니다.

18{
19 // Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
20 PrimaryActorTick.bCanEverTick = true;
21
22 // Constructor Helpers
23 ConstructorHelpers::FObjectFinder<UInputMappingContext> imcRef(TEXT("/Script/EnhancedInput.InputMappingContext'/Game/CustomContents/Input/Player/IMC_Robot.IMC_Robot'"));
24 if (imcRef.Succeeded())
25 {
26 RobotIMC = imcRef.Object;
27 }
28
29 ConstructorHelpers::FObjectFinder<UInputAction> moveActionRef(TEXT("/Script/EnhancedInput.InputAction'/Game/CustomContents/Input/Player/IA_RobotMove.IA_RobotMove'"));
30 if (moveActionRef.Succeeded())
31 {
32 MoveAction = moveActionRef.Object;
33 }
34
35 ConstructorHelpers::FObjectFinder<UInputAction> lookActionRef(TEXT("/Script/EnhancedInput.InputAction'/Game/CustomContents/Input/Player/IA_RobotLook.IA_RobotLook'"));
36 if (lookActionRef.Succeeded())
37 {
38 LookAction = lookActionRef.Object;
39 }
40
41 ConstructorHelpers::FObjectFinder<UInputAction> jumpActionRef(TEXT("/Script/EnhancedInput.InputAction'/Game/CustomContents/Input/Player/IA_RobotJump.IA_RobotJump'"));
42 if (jumpActionRef.Succeeded())
43 {
44 JumpAction = jumpActionRef.Object;
45 }
46
47 ConstructorHelpers::FObjectFinder<UInputAction> runActionRef(TEXT("/Script/EnhancedInput.InputAction'/Game/CustomContents/Input/Player/IA_RobotRun.IA_RobotRun'"));
48 if (runActionRef.Succeeded())
49 {
50 RunAction = runActionRef.Object;
51 }
52
53 ConstructorHelpers::FObjectFinder<UInputAction> interactActionRef(TEXT("/Script/EnhancedInput.InputAction'/Game/CustomContents/Input/Player/IA_RobotInteract.IA_RobotInteract'"));
54 if (interactActionRef.Succeeded())
55 {
56 InteractAction = interactActionRef.Object;
57 }
58 // ConstructorHelpers::FObjectFinder<UInputAction> grabActionRef(TEXT("/Script/EnhancedInput.InputAction'/Game/CustomContents/Input/Player/IA_RobotGrab.IA_RobotGrab'"));
59 // if (grabActionRef.Succeeded())
60 // {
61 // GrabAction = grabActionRef.Object;
62 // }
63
64 // Mesh
65 // Set Owl Mesh
66 ConstructorHelpers::FObjectFinder<USkeletalMesh> playerMeshRef(TEXT("/Script/Engine.SkeletalMesh'/Game/CustomContents/Character/Asset/Owl/SKM_GreenOwlRobot.SKM_GreenOwlRobot'"));
67 if (playerMeshRef.Succeeded())
68 {
69 GetMesh()->SetSkeletalMesh(playerMeshRef.Object);
70 GetMesh()->SetRelativeLocationAndRotation(FVector(0, 0, -70), FRotator(0, -90, 0));
71 }
72
73 // ABP
74 // Set ABP_Owl
75 ConstructorHelpers::FClassFinder<UAnimInstance> playerABPRef(TEXT("/Game/CustomContents/Animations/ABP_Owl.ABP_Owl_C"));
76 if (playerABPRef.Succeeded())
77 {
78 GetMesh()->SetAnimInstanceClass(playerABPRef.Class);
79 }
80
81 // Capsule Comp
82 GetCapsuleComponent()->InitCapsuleSize(35.f, 70.0f);
83
84 // Movement
85 bUseControllerRotationPitch = false;
86 bUseControllerRotationYaw = true;
87 bUseControllerRotationRoll = false;
88
89 GetCharacterMovement()->RotationRate = FRotator(0.0f, 500.0f, 0.0f);
90 GetCharacterMovement()->MaxWalkSpeed = WalkSpeed;
91 GetCharacterMovement()->bOrientRotationToMovement = true;
92
93 // InteractionSystem
94 InteractionSystem = CreateDefaultSubobject<UInteractionSystem>(TEXT("InteractionSystem"));
95
96 // Hold Position
97 HoldPosition = CreateDefaultSubobject<USceneComponent>(TEXT("HoldPosition"));
98 HoldPosition->SetupAttachment(GetRootComponent());
99
100 // Camera Comp
101 CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom"));
102 CameraBoom->SetupAttachment(RootComponent);
103 CameraBoom->TargetArmLength = 250.f;
104 CameraBoom->bUsePawnControlRotation = false;
105
106 FollowCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("FollowCamera"));
107 FollowCamera->SetupAttachment(GetMesh(), TEXT("Head"));
108 // First Person Camera
109 FollowCamera->SetRelativeLocationAndRotation(FVector(0,-14.285715,21.428572), FRotator(90, 90, 0));
110 FollowCamera->bUsePawnControlRotation = true;
111}
TObjectPtr< class UInputMappingContext > RobotIMC
Definition AOwlPlayer.h:44
TObjectPtr< class UInputAction > RunAction
Definition AOwlPlayer.h:56
TObjectPtr< class UInputAction > MoveAction
Definition AOwlPlayer.h:47
TObjectPtr< class UInputAction > InteractAction
Definition AOwlPlayer.h:59
TObjectPtr< class USceneComponent > HoldPosition
Definition AOwlPlayer.h:32
TObjectPtr< class USpringArmComponent > CameraBoom
Definition AOwlPlayer.h:37
TObjectPtr< class UInteractionSystem > InteractionSystem
Definition AOwlPlayer.h:28
TObjectPtr< class UInputAction > JumpAction
Definition AOwlPlayer.h:53
TObjectPtr< class UInputAction > LookAction
Definition AOwlPlayer.h:50
float WalkSpeed
Definition AOwlPlayer.h:77
TObjectPtr< class UCameraComponent > FollowCamera
Definition AOwlPlayer.h:40

다음을 참조함 : CameraBoom, FollowCamera, HoldPosition, InteractAction, InteractionSystem, JumpAction, LookAction, MoveAction, RobotIMC, RunAction, WalkSpeed.

멤버 함수 문서화

◆ BeginPlay()

void AOwlPlayer::BeginPlay ( )
overrideprotectedvirtual

AOwlPlayer.cpp 파일의 113 번째 라인에서 정의되었습니다.

114{
115 Super::BeginPlay();
116
117 auto pc = Cast<APlayerController>(Controller);
118 if (pc)
119 {
120 auto subsys = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(pc->GetLocalPlayer());
121 if (subsys)
122 {
123 subsys->AddMappingContext(RobotIMC, 0);
124 }
125 }
126}

다음을 참조함 : RobotIMC.

◆ DoJump()

void AOwlPlayer::DoJump ( )

AOwlPlayer.cpp 파일의 254 번째 라인에서 정의되었습니다.

255{
256 bIsJumpStart = false;
257 Jump();
258}
bool bIsJumpStart
Definition AOwlPlayer.h:80

다음을 참조함 : bIsJumpStart.

◆ GetIsJumpStart()

bool AOwlPlayer::GetIsJumpStart ( )

AOwlPlayer.cpp 파일의 249 번째 라인에서 정의되었습니다.

250{
251 return bIsJumpStart;
252}

다음을 참조함 : bIsJumpStart.

◆ GetIsRunning()

bool AOwlPlayer::GetIsRunning ( )

AOwlPlayer.cpp 파일의 244 번째 라인에서 정의되었습니다.

245{
246 return bIsRunning;
247}
bool bIsRunning
Definition AOwlPlayer.h:79

다음을 참조함 : bIsRunning.

◆ OnInteract()

void AOwlPlayer::OnInteract ( const FInputActionValue &  Value)
protected

AOwlPlayer.cpp 파일의 234 번째 라인에서 정의되었습니다.

235{
236 // AOwlPlayer* MyPlayer = Cast<AOwlPlayer>(GetPawn());
237 // if (MyPlayer && MyPlayer->InteractionSystem)
238 // {
239 // MyPlayer->InteractionSystem->TryInteract();
240 // }
241 InteractionSystem->TryInteract();
242}

다음을 참조함 : InteractionSystem.

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

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

◆ OnJump()

void AOwlPlayer::OnJump ( )
protected

AOwlPlayer.cpp 파일의 193 번째 라인에서 정의되었습니다.

194{
195 bIsJumpStart = true;
196}

다음을 참조함 : bIsJumpStart.

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

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

◆ OnLook()

void AOwlPlayer::OnLook ( const FInputActionValue &  Value)
protected

AOwlPlayer.cpp 파일의 180 번째 라인에서 정의되었습니다.

181{
182 // input is a Vector2D
183 FVector2D LookAxisVector = Value.Get<FVector2D>();
184
185 if (GetController() != nullptr)
186 {
187 // add yaw and pitch input to controller
188 AddControllerYawInput(LookAxisVector.X);
189 AddControllerPitchInput(LookAxisVector.Y);
190 }
191}

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

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

◆ OnMove()

void AOwlPlayer::OnMove ( const FInputActionValue &  Value)
protected

AOwlPlayer.cpp 파일의 151 번째 라인에서 정의되었습니다.

152{
153 // input is a Vector2D
154 FVector2D MovementVector = Value.Get<FVector2D>();
155
156 if (GetController() != nullptr)
157 {
158 // find out which way is forward
159 const FRotator Rotation = GetController()->GetControlRotation();
160 const FRotator YawRotation(0, Rotation.Yaw, 0);
161
162 // get forward vector
163 const FVector ForwardDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
164
165 // get right vector
166 const FVector RightDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y);
167
168 // add movement
169 AddMovementInput(ForwardDirection, MovementVector.Y);
170 AddMovementInput(RightDirection, MovementVector.X);
171 }
172}

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

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

◆ OnRun()

void AOwlPlayer::OnRun ( )
protected

AOwlPlayer.cpp 파일의 198 번째 라인에서 정의되었습니다.

199{
200 if (bIsJumpStart || GetMovementComponent()->IsFalling()) return;
201
202 if (bIsRunning)
203 {
204 bIsRunning = false;
205 GetCharacterMovement()->MaxWalkSpeed = WalkSpeed;
206 }
207 else
208 {
209 bIsRunning = true;
210 GetCharacterMovement()->MaxWalkSpeed = RunSpeed;
211 }
212}
float RunSpeed
Definition AOwlPlayer.h:78

다음을 참조함 : bIsJumpStart, bIsRunning, RunSpeed, WalkSpeed.

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

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

◆ OnStopMove()

void AOwlPlayer::OnStopMove ( )
protected

AOwlPlayer.cpp 파일의 174 번째 라인에서 정의되었습니다.

175{
176 bIsRunning = false;
177 GetCharacterMovement()->MaxWalkSpeed = WalkSpeed;
178}

다음을 참조함 : bIsRunning, WalkSpeed.

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

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

◆ SetupPlayerInputComponent()

void AOwlPlayer::SetupPlayerInputComponent ( class UInputComponent *  PlayerInputComponent)
overridevirtual

AOwlPlayer.cpp 파일의 133 번째 라인에서 정의되었습니다.

134{
135 Super::SetupPlayerInputComponent(PlayerInputComponent);
136
137 auto playerInput = Cast<UEnhancedInputComponent>(PlayerInputComponent);
138 if (playerInput)
139 {
140 playerInput->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AOwlPlayer::OnMove);
141 playerInput->BindAction(MoveAction, ETriggerEvent::Completed, this, &AOwlPlayer::OnStopMove);
142 playerInput->BindAction(LookAction, ETriggerEvent::Triggered, this, &AOwlPlayer::OnLook);
143 playerInput->BindAction(JumpAction, ETriggerEvent::Started, this, &AOwlPlayer::OnJump);
144 playerInput->BindAction(RunAction, ETriggerEvent::Started, this, &AOwlPlayer::OnRun);
145 // playerInput->BindAction(GrabAction, ETriggerEvent::Started, this, &AOwlPlayer::OnGrab);
146 // playerInput->BindAction(GrabAction, ETriggerEvent::Completed, this, &AOwlPlayer::OnGrabRelease);
147 playerInput->BindAction(InteractAction, ETriggerEvent::Started, this, &AOwlPlayer::OnInteract);
148 }
149}
void OnJump()
void OnStopMove()
void OnInteract(const FInputActionValue &Value)
void OnMove(const FInputActionValue &Value)
void OnLook(const FInputActionValue &Value)

다음을 참조함 : InteractAction, JumpAction, LookAction, MoveAction, OnInteract(), OnJump(), OnLook(), OnMove(), OnRun(), OnStopMove(), RunAction.

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

◆ Tick()

void AOwlPlayer::Tick ( float  DeltaTime)
overridevirtual

AOwlPlayer.cpp 파일의 128 번째 라인에서 정의되었습니다.

129{
130 Super::Tick(DeltaTime);
131}

멤버 데이터 문서화

◆ bIsJumpStart

bool AOwlPlayer::bIsJumpStart
private

AOwlPlayer.h 파일의 80 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : DoJump(), GetIsJumpStart(), OnJump(), OnRun().

◆ bIsRunning

bool AOwlPlayer::bIsRunning
private

AOwlPlayer.h 파일의 79 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : GetIsRunning(), OnRun(), OnStopMove().

◆ CameraBoom

TObjectPtr<class USpringArmComponent> AOwlPlayer::CameraBoom
protected

AOwlPlayer.h 파일의 37 번째 라인에서 정의되었습니다.

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

◆ FollowCamera

TObjectPtr<class UCameraComponent> AOwlPlayer::FollowCamera
protected

AOwlPlayer.h 파일의 40 번째 라인에서 정의되었습니다.

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

◆ HoldPosition

TObjectPtr<class USceneComponent> AOwlPlayer::HoldPosition

AOwlPlayer.h 파일의 32 번째 라인에서 정의되었습니다.

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

◆ InteractAction

TObjectPtr<class UInputAction> AOwlPlayer::InteractAction
protected

AOwlPlayer.h 파일의 59 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AOwlPlayer(), SetupPlayerInputComponent().

◆ InteractionSystem

TObjectPtr<class UInteractionSystem> AOwlPlayer::InteractionSystem

AOwlPlayer.h 파일의 28 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AOwlPlayer(), OnInteract().

◆ JumpAction

TObjectPtr<class UInputAction> AOwlPlayer::JumpAction
protected

AOwlPlayer.h 파일의 53 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AOwlPlayer(), SetupPlayerInputComponent().

◆ LookAction

TObjectPtr<class UInputAction> AOwlPlayer::LookAction
protected

AOwlPlayer.h 파일의 50 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AOwlPlayer(), SetupPlayerInputComponent().

◆ MoveAction

TObjectPtr<class UInputAction> AOwlPlayer::MoveAction
protected

AOwlPlayer.h 파일의 47 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AOwlPlayer(), SetupPlayerInputComponent().

◆ RobotIMC

TObjectPtr<class UInputMappingContext> AOwlPlayer::RobotIMC
protected

AOwlPlayer.h 파일의 44 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AOwlPlayer(), BeginPlay().

◆ RunAction

TObjectPtr<class UInputAction> AOwlPlayer::RunAction
protected

AOwlPlayer.h 파일의 56 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AOwlPlayer(), SetupPlayerInputComponent().

◆ RunSpeed

float AOwlPlayer::RunSpeed = 500.f
private

AOwlPlayer.h 파일의 78 번째 라인에서 정의되었습니다.

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

◆ WalkSpeed

float AOwlPlayer::WalkSpeed = 200.f
private

AOwlPlayer.h 파일의 77 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AOwlPlayer(), OnRun(), OnStopMove().


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