Document: Description of RtsCamera - Tiny-Metro/Poly-Metro GitHub Wiki
ARtscamera::ARtsCamera
์ด ํจ์๋ ํด๋์ค์ ์์ฑ์๋ก, ์ธ์คํด์ค๊ฐ ๋ง๋ค์ด์ง ๋ ํ ๋ฒ๋ง ํธ์ถ๋ฉ๋๋ค. ์ด ์์ฑ์์์๋ ํ์ํ ์ปดํฌ๋ํธ๋ฅผ ์ด๊ธฐํํ๊ณ ์ค์ ํฉ๋๋ค.
์ด ์์ฑ์๋ ARtsCamera ํด๋์ค์ ์ธ์คํด์ค๋ฅผ ์ด๊ธฐํํ๋ ์ญํ ์ ํฉ๋๋ค. ์ด ์์ฑ์์์๋ ์นด๋ฉ๋ผ์ ๊ตฌ์ฑ ์์๋ค์ ์์ฑํ๊ณ ์ด๊ธฐํํฉ๋๋ค.
CustomCollisionComponent: ๊ตฌ์ฒด ์ถฉ๋ ์ปดํฌ๋ํธ๋ฅผ ์์ฑํ๊ณ ์ด๊ธฐํํฉ๋๋ค. ์ด ์ปดํฌ๋ํธ๋ ์นด๋ฉ๋ผ์ ์ถฉ๋ ์ฒดํฌ์ ์์ง์์ ์ฌ์ฉ๋ฉ๋๋ค. ์ฌ๊ธฐ์ CustomCollisionComponent๋ USphereComponent ํ์ ์ผ๋ก ์์ฑ๋๋ฉฐ, "RtsCamera_CollisionComponent0"์ด๋ผ๋ ์ด๋ฆ์ ๊ฐ์ต๋๋ค. ์ด ์ปดํฌ๋ํธ๋ ์นด๋ฉ๋ผ๊ฐ ์ด๋ป๊ฒ ์ถฉ๋ํ ๊ฒ์ธ์ง ์ ํฉ๋๋ค. ์ถฉ๋ ์ปดํฌ๋ํธ๊ฐ ๊ตฌ ํํ์ด๊ณ ๊ทธ ๋ฐ๊ฒฝ์ 100 ์ ๋์ผ๋ก ์ค์ ๋์ด์์ต๋ค.MovementComponent: ์ด ์ปดํฌ๋ํธ๋ ์นด๋ฉ๋ผ์ ์์ง์์ ์ ์ดํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค. UFloatingPawnMovement ํ์ ์ Movement Component๋ฅผ ์์ฑํ๊ณ ์ด๊ธฐํ ํฉ๋๋ค. ์ด๋ฆ์ "RtsCameran_MovementComponen0" ์ ๋๋ค.RootComponent: ์นด๋ฉ๋ผ์ ๋ฃจํธ ์ปดํฌ๋ํธ๋กCustomCollisionComponent๋ฅผ ์ค์ ํฉ๋๋ค.
ARtscamera::SetupPlayerInputComponent
์ด ํจ์๋ ์ ๋ ฅ ์ปดํฌ๋ํธ์ ๋ง์ฐ์ค ํ ์ ๋ ฅ๊ณผ ํ์ ๋ชจ๋ ๊ด๋ จ ์ก์ ์ ๋ฐ์ธ๋ฉํฉ๋๋ค.
์ด ํจ์๋ ํ๋ ์ด์ด์ ์
๋ ฅ ์ปดํฌ๋ํธ์ ์
๋ ฅ ๋ฐ์ธ๋ฉ์ ์ค์ ํ๋ ์ญํ ์ ํฉ๋๋ค. InputComponent ๋งค๊ฐ๋ณ์๋ฅผ ํตํด ํ๋ ์ด์ด์ ์
๋ ฅ ์ปดํฌ๋ํธ๋ฅผ ๋ฐ์์จ ํ, ๋ค์ํ ์
๋ ฅ ์ถ๊ณผ ์ก์
์ ๋ฐ์ธ๋ฉํฉ๋๋ค. ์ด ํจ์๋ฅผ ํตํด ๋ง์ฐ์ค ํ ์
๋ ฅ, ์นด๋ฉ๋ผ ํ์ ๋ชจ๋ ํ์ฑํ ๋ฐ ๋นํ์ฑํ ์ก์
์ ์ค์ ํฉ๋๋ค.
- BindAxis๋ก ๋ง์ฐ์ค ํ ์ ์ค์ธ ํจ์์ ๋ฐ์ธ๋ฉ ํ์๊ณ
- BindAction์ผ๋ก ๋ง์ฐ์ค ์ค๋ฅธ์ชฝ ๋ฒํผ์ ๋๋ ์ ๋ ํจ์ EngageRotation์ผ๋ก ํ์ ๋ชจ๋๊ฐ ํ์ฑํ๋๊ฒ ํ์๊ณ ๋ผ์์ DisEngageRotation์ผ๋ก ํ์ ๋ชจ๋๊ฐ ๋นํ์ฑํ๋๊ฒ ๋ง๋ค์์ต๋๋ค.
ARtscamera::Tick
playerController๊ฐ ์ ํจํ์ง ์์ ๊ฒฝ์ฐ,GetController()๋ฅผ ํตํด ํด๋น ์นด๋ฉ๋ผ์ ์ปจํธ๋กค๋ฌ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.GetMousePosition()์ ์ฌ์ฉํ์ฌ ๋ง์ฐ์ค์ ํ์ฌ ์์น(mouseLocation)๋ฅผ ๊ฐ์ ธ์ต๋๋ค.rotationMode๊ฐ ํ์ฑํ๋ ๊ฒฝ์ฐ, ๋ง์ฐ์ค ์์ง์์ ๋ฐ๋ผ ํ์ ์ ์ฒ๋ฆฌํฉ๋๋ค.DeltaMouse๋ณ์๋ ๋ง์ฐ์ค ์์ง์์ ๋ณํ๋์ ๋ํ๋ด๋ฉฐ,mouseScreenLocationGrab๊ณผmouseLocation์ ์ฐจ์ด๋ก ๊ณ์ฐ๋ฉ๋๋ค.RotationSpeed์DeltaSeconds๊ฐ์ ๊ณฑํ์ฌ ํ์ ์๋๋ฅผ ๊ณ์ฐํฉ๋๋ค.- ํ์ ๊ฐ๋๋ฅผ
NewRotation์ผ๋ก ์ ๋ฐ์ดํธํ ํSetActorRotation()ํจ์๋ก ์ ์ฉํฉ๋๋ค. mouseScreenLocationGrab์ ํ์ฌmouseLocation์ผ๋ก ์ ๋ฐ์ดํธํฉ๋๋ค.
rotationMode๊ฐ ๋นํ์ฑํ๋ ๊ฒฝ์ฐ, ๋ง์ฐ์ค ์์น์ ๋ฐ๋ผ ํฌ(Pan) ์์ ์ ์ํํฉ๋๋ค.- ํ๋ฉด ๊ฐ์ฅ์๋ฆฌ์ ๋ง์ฐ์ค๊ฐ ์์นํ ๊ฒฝ์ฐ, ํด๋น ๋ฐฉํฅ์ผ๋ก ์นด๋ฉ๋ผ๋ฅผ ํจ๋ํฉ๋๋ค.
ScreenEdgePanZonePercent๊ฐ์ ๊ธฐ์ค์ผ๋ก ํ๋์ด ๋ฐ์ํ ์ง์ ์ ๊ฒฐ์ ํฉ๋๋ค.- ๊ฐ ๋ฐฉํฅ์ ๋ํ ํจ๋ ํจ์๋ค(
PanLeft(),PanRight(),PanForward(),PanBackward())์ ํธ์ถํฉ๋๋ค.
ARtscamera::BeginPlay
BeginPlay ํจ์์์๋ ๊ฒ์ ์์ ์ ํ ๋ฒ๋ง ํธ์ถ๋๋ฉฐ, ํ๋ ์ด์ด ์ปจํธ๋กค๋ฌ์ ์ธ์คํด์ค๋ฅผ ๋ฐ์์ค๊ณ ์ด๊ธฐ ์์น์ ํ์ ๊ฐ์ ์ค์ ํฉ๋๋ค.
playerController: ํ์ฌ ์นด๋ฉ๋ผ์ ์ปจํธ๋กค๋ฌ๋ฅผ ๊ฐ์ ธ์playerController๋ณ์์ ํ ๋นํฉ๋๋ค.CustomCollisionComponent์ ์์น์ ํ์ ์ ์ด๊ธฐ ๊ฐ์ธinitLocation๊ณผinitRotation์ผ๋ก ์ค์ ํฉ๋๋ค.CustomCollisionComponent๋ผ๋ ์คํผ์ด ์ปดํฌ๋ํธ์ ์๋ ์์น๋ฅผinitLocation๋ณ์๋ก ์ค์ ํฉ๋๋ค. ๊ฒ์์ด ์์๋ ๋ ์นด๋ฉ๋ผ์ ์์น๋ฅผinitLocation๊ฐ์ผ๋ก ์ด๊ธฐํํฉCustomCollisionComponent์ ์๋ ํ์ ์initRotation๊ฐ์ผ๋ก ์ค์ ํฉ๋๋ค. ์นด๋ฉ๋ผ์ ํ์ ์initRotation๊ฐ์ผ๋ก ์ด๊ธฐํํฉ๋๋ค.playerController๋ฅผ ํตํด ํ์ฌ ํ๋ฉด์ ๋๋น์ ๋์ด์ธscreenWidth์screenHeight๋ฅผ ์ป์ด์ต๋๋ค.playerController์ ๋ทฐํฌํธ ํฌ๊ธฐ๋ฅผ ๊ฐ์ ธ์screenWidth์screenHeight๋ณ์์ ํ ๋นํฉ๋๋ค. ์ด๋ฅผ ํตํด ์นด๋ฉ๋ผ์ ํ๋ฉด ํฌ๊ธฐ๋ฅผ ์ ์ ์์ต๋๋ค.
ARtscamera::ChangePitch
์ด ํจ์๋ ์นด๋ฉ๋ผ์ ํผ์น(์ํ ํ์ )๋ฅผ ๋ณ๊ฒฝํ๋ ์ญํ ์ ํฉ๋๋ค.
magnitude๊ฐ์ ๋ฐ๋ผ ํผ์น๋ฅผ ๋ณ๊ฒฝํฉ๋๋ค. ์ ๋ ฅ๋magnitude๊ฐ์ด ์์๋ฉด ์์ชฝ ๋ฐฉํฅ์ผ๋ก, ์์๋ฉด ์๋์ชฝ ๋ฐฉํฅ์ผ๋ก ํผ์น๋ฅผ ๋ณ๊ฒฝํฉ๋๋ค.- ํ์ ๋ชจ๋๊ฐ ํ์ฑํ๋์ด์ผ ํ๋ฉฐ,
playerController๊ฐ ์ ํจํ๊ณ ์ค์ ๋ ์ต๋ ๋ฐ ์ต์ ํผ์น ๊ฐ์ ๋ฒ์ด๋์ง ์์์ผ ํฉ๋๋ค. - ์ ์กฐ๊ฑด์ ๋ง์กฑํ๋ ๊ฒฝ์ฐ,
AddControllerPitchInput()ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์ปจํธ๋กค๋ฌ์ ํผ์น ์ ๋ ฅ์ ๋ณ๊ฒฝํฉ๋๋ค.magnitude์PitchChangeRate,GetWorld()->GetDeltaSeconds()๊ฐ์ ์กฐํฉํ์ฌ ํผ์น ๋ณํ์ ํฌ๊ธฐ ๋ฐ ์๋๋ฅผ ๊ฒฐ์ ํฉ๋๋ค.
ARtscamera::ChangeYaw
ChangeYaw ํจ์๋ ์ฌ์ฉ์ ์ ๋ ฅ์ ๋ฐ์ํ์ฌ ์นด๋ฉ๋ผ์ ์(yaw, ์ข์ฐ ํ์ )๋ฅผ ๋ณ๊ฒฝํ๋ ์ญํ ์ ํฉ๋๋ค.
magnitude๊ฐ์ ๋ฐ๋ผ ์ข์ฐ ํ์ ์ ๋ณ๊ฒฝํฉ๋๋ค. ์ ๋ ฅ๋magnitude๊ฐ์ด ์์๋ฉด ์ฐ์ธก ๋ฐฉํฅ์ผ๋ก, ์์๋ฉด ์ข์ธก ๋ฐฉํฅ์ผ๋ก ํ์ ํฉ๋๋ค.- ํ์ ๋ชจ๋๊ฐ ํ์ฑํ๋์ด์ผ ํ๋ฉฐ,
playerController๊ฐ ์ ํจํ ๊ฒฝ์ฐ์๋ง ํ์ ์ ์ํํฉ๋๋ค. - ์ ์กฐ๊ฑด์ ๋ง์กฑํ๋ ๊ฒฝ์ฐ,
AddControllerYawInput()ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์ปจํธ๋กค๋ฌ์ ์ ์ ๋ ฅ์ ๋ณ๊ฒฝํฉ๋๋ค.magnitude์YawRate,GetWorld()->GetDeltaSeconds()๊ฐ์ ์กฐํฉํ์ฌ ์ ๋ณํ์ ํฌ๊ธฐ ๋ฐ ์๋๋ฅผ ๊ฒฐ์ ํฉ๋๋ค.
ARtscamera::Orbit
Orbit ํจ์๋ ์นด๋ฉ๋ผ๊ฐ ๋ชฉํ ์ฃผ์๋ฅผ ํ์ (Orbit)ํ๋ ๊ธฐ๋ฅ์ ๊ตฌํํฉ๋๋ค.
magnitude๋งค๊ฐ๋ณ์๋ Orbit์ ํฌ๊ธฐ๋ฅผ ๋ํ๋ด๋ฉฐ, ์์์ผ ๊ฒฝ์ฐ ์ค๋ฅธ์ชฝ์ผ๋ก, ์์์ผ ๊ฒฝ์ฐ ์ผ์ชฝ์ผ๋ก Orbit ๋์์ด ์ํ๋ฉ๋๋ค.- ์กฐ๊ฑด์ ๋ง์กฑํ๋ ๊ฒฝ์ฐ,
AddControllerYawInput()ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์ปจํธ๋กค๋ฌ์ ์ ์ ๋ ฅ์ ๋ณ๊ฒฝํฉ๋๋ค.magnitude์YawRate,GetWorld()->GetDeltaSeconds()๊ฐ์ ์กฐํฉํ์ฌ Yaw ๋ณํ์ ํฌ๊ธฐ ๋ฐ ์๋๋ฅผ ๊ฒฐ์ ํฉ๋๋ค - ์นด๋ฉ๋ผ์ Yaw ํ์ ๊ฐ์ ์ ๋ ฅ์ ์ถ๊ฐํฉ๋๋ค. ์ฌ๊ธฐ์ magnitude๋ ์์ ์ฃผ์์ ํ์ ์ ๋๋ฅผ ๋ํ๋ด๋ฉฐ, YawRate์ Yaw ์ถ์ ๋ฐ๋ฅธ ํ์ ์๋๋ฅผ ๋ํ๋ ๋๋ค. GetWorld()->GetDeltaSeconds()๋ก ํ๋ ์ ์ฌ์ด์ ์๊ฐ ๊ฐ๊ฒฉ(Delta Time)์ ๊ฐ์ ธ์ ์ผ๋ง๋ ๋ง์ ํ์ ์ด ๋ฐ์ํด์ผ ํ๋์ง ๊ณ์ฐํฉ๋๋ค.
- ํ์ฌ ์ปจํธ๋กค๋ฌ์ ๋ฐฉํฅ์ผ๋ก๋ถํฐ Y์ถ ๋ฐฉํฅ ๋ฒกํฐ๋ฅผ ์ป๊ณ , ์ด ๋ฒกํฐ ๋ฐฉํฅ์ผ๋ก ์นด๋ฉ๋ผ๋ฅผ ์ด๋์ํต๋๋ค. ์ฌ๊ธฐ์๋ ๋ง์ฐฌ๊ฐ์ง๋ก Delta Time๊ณผ ๋ค๋ฅธ ์์๋ค์ ๊ณฑํ์ฌ ์ผ๋ง๋ ๋ง์ ์ด๋์ด ๋ฐ์ํด์ผ ํ๋์ง ๊ณ์ฐํฉ๋๋ค.
ARtscamera::PanForward/PanBackward/PanRight/PanLeft
์ด ๋ค ๊ฐ์ง ํจ์๋ ์นด๋ฉ๋ผ๋ฅผ ๊ฐ๊ฐ ์, ๋ค, ์ค๋ฅธ์ชฝ, ์ผ์ชฝ์ผ๋ก ์ด๋์ํค๋ ์ญํ ์ ํฉ๋๋ค.
AddMovementInput()ํจ์๋ฅผ ํธ์ถํ์ฌ ์นด๋ฉ๋ผ์ ์์น๋ฅผ ์์ง์ ๋๋ค.- ์ด๋ ๋ฐฉํฅ์ ์นด๋ฉ๋ผ์ ํ์ฌ ํ์ ์ ๋ฐ๋ผ ๊ณ์ฐ๋๋ฉฐ,
FRotationMatrix(GetControlRotation()).GetScaledAxis()๋ฅผ ์ฌ์ฉํฉ๋๋ค. PanRate๊ฐ์ ๋ฐ๋ผ ์ด๋ ์๋๊ฐ ๊ฒฐ์ ๋ฉ๋๋ค.- ํ์ ๋ชจ๋๊ฐ ๋นํ์ฑํ๋์ด์ผ ํ๋ฉฐ,
playerController๊ฐ ์ ํจํ ๊ฒฝ์ฐ์๋ง ์ด๋์ ์ํํฉ๋๋ค. - PanForward: ์นด๋ฉ๋ผ๋ฅผ ์์ผ๋ก ์ด๋์ํค๋ ํจ์์ ๋๋ค. rotationMode๊ฐ ๋นํ์ฑํ๋์ด ์๊ณ playerController๊ฐ ์กด์ฌํ ๋๋ง ์ด๋ํฉ๋๋ค. FRotationMatrix(GetControlRotation()).GetScaledAxis(EAxis::X)๋ก ํ์ฌ ์ปจํธ๋กค๋ฌ์ ๋ฐฉํฅ์์ X์ถ ๋ฐฉํฅ ๋ฒกํฐ๋ฅผ ์ป๊ณ , ์ด ๋ฒกํฐ ๋ฐฉํฅ์ผ๋ก ์นด๋ฉ๋ผ๋ฅผ PanRate * GetWorld()->GetDeltaSeconds() ๋งํผ ์ด๋์ํต๋๋ค.
- PanBackward: ์นด๋ฉ๋ผ๋ฅผ ๋ค๋ก ์ด๋์ํค๋ ํจ์์ ๋๋ค. ์์ ๋์ผํ ๋ฐฉ์์ด์ง๋ง, ๋ง์ง๋ง์ -PanRate * GetWorld()->GetDeltaSeconds()๋ฅผ ์ฌ์ฉํ์ฌ ๋ฐ๋ ๋ฐฉํฅ์ผ๋ก ์ด๋์ํต๋๋ค.
- PanRight: ์นด๋ฉ๋ผ๋ฅผ ์ค๋ฅธ์ชฝ์ผ๋ก ์ด๋์ํค๋ ํจ์์ ๋๋ค. rotationMode๊ฐ ๋นํ์ฑํ๋์ด ์๊ณ playerController๊ฐ ์กด์ฌํ ๋๋ง ์ด๋ํฉ๋๋ค. FRotationMatrix(GetControlRotation()).GetScaledAxis(EAxis::Y)๋ก ํ์ฌ ์ปจํธ๋กค๋ฌ์ ๋ฐฉํฅ์์ Y์ถ ๋ฐฉํฅ ๋ฒกํฐ๋ฅผ ์ป๊ณ , ์ด ๋ฒกํฐ ๋ฐฉํฅ์ผ๋ก ์นด๋ฉ๋ผ๋ฅผ PanRate * GetWorld()->GetDeltaSeconds() ๋งํผ ์ด๋์ํต๋๋ค.
- PanLeft: ์นด๋ฉ๋ผ๋ฅผ ์ผ์ชฝ์ผ๋ก ์ด๋์ํค๋ ํจ์์ ๋๋ค. ์์ ๋์ผํ ๋ฐฉ์ด์ง๋ง, ๋ง์ง๋ง์ -PanRate * GetWorld()->GetDeltaSeconds()๋ฅผ ์ฌ์ฉํ์ฌ ๋ฐ๋ ๋ฐฉํฅ์ผ๋ก ์ด๋์ํต๋๋ค.
ARtscamera::ZoomIn
์ด ํจ์๋ ์นด๋ฉ๋ผ์ ์ค ์ธ/์์์ ์ฒ๋ฆฌํ๋ ์ญํ ์ ํฉ๋๋ค, ๋ง์ฐ์ค ํ ์ ๋ฐ์ธ๋ฉ๋์ด ์กฐ์ํ ์ ์์ต๋๋ค.
magnitude๊ฐ์ ๋ฐ๋ผ ์นด๋ฉ๋ผ์ Z ์ถ ์์น๋ฅผ ๋ณ๊ฒฝํ์ฌ ์ค ์ธ ๋๋ ์ค ์์์ ์ํํฉ๋๋ค. ์ ๋ ฅ๋magnitude๊ฐ์ด ํ๋ฌ์ค๋ฉด ์ค ์ธ, ๋ง์ด๋์ค๋ฉด ์ค ์์์ด ๋ฉ๋.- ์ค ์๋๋
ZoomRate๋ณ์์ ๋ฐ๋ผ ๋ฐ๋๋ฉฐ,GetWorld()->GetDeltaSeconds()๋ฅผ ํตํด ํ๋ ์ ๊ฐ ์๊ฐ ๋ณํ๋ฅผ ๊ณ ๋ คํฉ๋๋ค. - ์นด๋ฉ๋ผ์ ์์น ๋ณ๊ฒฝ์
AddMovementInput()ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์ํํฉ๋๋ค. - ์ต๋ ๋ฐ ์ต์ ์ค ๊ฐ(MinZoom, MaxZoom) ๋ฒ์ ๋ด์์๋ง ๋ณ๊ฒฝ๋ฉ๋๋ค.
- ํ์ ๋ชจ๋๊ฐ ๋นํ์ฑํ๋์ด์ผ ํ๋ฉฐ,
playerController๊ฐ ์ ํจํ ๊ฒฝ์ฐ์๋ง ์ค์ด ์ํ๋ฉ๋๋ค. - ์ ์กฐ๊ฑด์ ๋ง์กฑํ๋ ๊ฒฝ์ฐ,
FRotationMatrix(GetControlRotation()).GetScaledAxis(EAxis::Z)๋ฅผ ์ฌ์ฉํ์ฌ ์ปจํธ๋กค๋ฌ์ ํ์ฌ ๋์ด ์ถ ๋ฒกํฐ๋ฅผ ๊ฐ์ ธ์จ ํ,magnitude,-ZoomRate๊ฐ,GetWorld()->GetDeltaSeconds()๊ฐ์ ์กฐํฉํ์ฌ ์ด๋ ์ ๋ ฅ์ ํฌ๊ธฐ์ ์๋๋ฅผ ๊ฒฐ์ ํฉ๋๋ค.
ARtscamera::EngageRotation()
์ค๋ฅธ์ชฝ ๋ง์ฐ์ค ๋ฒํผ์ ๋๋ฌ์ ์นด๋ฉ๋ผ์ ํ์ ๊ธฐ๋ฅ์ ํ์ฑํํฉ๋๋ค.
์ด ํจ์๋ ์นด๋ฉ๋ผ๋ฅผ ํ์ ๋ชจ๋๋ก ์ ํํ๋ ์ญํ ์ ํฉ๋๋ค. ํ์ ๋ชจ๋๋ ๋ง์ฐ์ค ์์ง์์ ๋ฐ๋ผ ์นด๋ฉ๋ผ๊ฐ ํ์ ํ๋๋ก ๋ง๋๋ ๊ฒ์ ์๋ฏธํฉ๋๋ค. ํจ์ ๋ด์์ ์ํ๋๋ ์ฃผ์ ์์ ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
playerController๊ฐ ์ ํจํ ๊ฒฝ์ฐ์๋ง ์๋์ ์ฝ๋๋ฅผ ์คํํฉ๋๋ค.rotationMode๋ณ์๋ฅผtrue๋ก ์ค์ ํ์ฌ ํ์ ๋ชจ๋๋ฅผ ํ์ฑํํฉ๋๋ค.playerController์ ๋ง์ฐ์ค ์ปค์ ํ์ ์ฌ๋ถ์ ํด๋ฆญ ์ด๋ฒคํธ ํ์ฑํ ์ฌ๋ถ๋ฅผ ์ค์ ํ์ฌ, ๋ง์ฐ์ค ์ปค์๊ฐ ์ฌ๋ผ์ง๊ณ ํด๋ฆญ ์ด๋ฒคํธ๊ฐ ๋นํ์ฑํ๋๋๋ก ํฉ๋๋ค.InitialRotation๋ณ์์ ํ์ฌ ์นด๋ฉ๋ผ์ ํ์ ๊ฐ์ ์ ์ฅํ์ฌ ํ์ ๋ชจ๋๋ฅผ ์ข ๋ฃํ ๋ ๋ณต์ํ ์ ์๋๋ก ํฉ๋๋ค.
ARtscamera::DisengageRotation()
EngageRotation๊ณผ ๋ฐ๋๋ก ์๋ํ์ฌ ์นด๋ฉ๋ผ์ ํ์ ๊ธฐ๋ฅ์ ๋นํ์ฑํํฉ๋๋ค.
์ด ํจ์๋ ํ์ ๋ชจ๋๋ฅผ ๋นํ์ฑํํ์ฌ ์นด๋ฉ๋ผ๋ฅผ ํฌ ๋ชจ๋๋ก ์ ํํ๋ ์ญํ ์ ํฉ๋๋ค. ํจ์ ๋ด์์ ์ํ๋๋ ์ฃผ์ ์์ ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค
rotationMode๊ฐ ํ์ฑํ๋์ด ์๊ณ ,playerController๊ฐ ์ ํจํ ๊ฒฝ์ฐ์๋ง ์๋์ ์ฝ๋๋ฅผ ์คํํฉ๋๋ค.rotationMode๋ณ์๋ฅผfalse๋ก ์ค์ ํ์ฌ ํ์ ๋ชจ๋๋ฅผ ๋นํ์ฑํํฉ๋๋ค.playerController์ ๋ง์ฐ์ค ์ปค์ ํ์ ์ฌ๋ถ์ ํด๋ฆญ ์ด๋ฒคํธ ํ์ฑํ ์ฌ๋ถ๋ฅผ ๋ณต์ํ์ฌ ์ ์ ์ํ๋ก ๋์์ค๊ฒ ํฉ๋๋ค.InitialRotation์ ์ ์ฅ๋ ์ด๊ธฐ ํ์ ๊ฐ์ ์ฌ์ฉํ์ฌ ์นด๋ฉ๋ผ์ ํ์ ๊ฐ์ ์๋ ์ํ๋ก ๋ณต์ํฉ๋๋ค.
ARtscamera::Jumpto
ํน์ ์์น๋ก ์ฆ์ ์นด๋ฉ๋ผ๋ฅผ ์ด๋์ํค๋ ๋ฐ ์ฌ์ฉ, ์ด ํจ์๋ ์ง์ ํ ์์น๋ก ์นด๋ฉ๋ผ๋ฅผ ์๊ฐ์ด๋์ํค๋ ์ญํ ์ ํฉ๋๋ค.
FVector NewLocation๋งค๊ฐ๋ณ์๋ก ์ ๋ฌ๋ ์์น๋ก ์นด๋ฉ๋ผ์ ์์น๋ฅผ ๋ณ๊ฒฝํฉ๋๋ค.NewLocation๋ฒกํฐ์ X์ Y ์ขํ๋ฅผ ๊ทธ๋๋ก ์ฌ์ฉํ๊ณ , Z ์ขํ๋ ํ์ฌ ์นด๋ฉ๋ผ์ Z ์ขํ๊ฐ์ ์ฌ์ฉํ์ฌ ์๋ก์ด ์์น๋ฅผ ๊ณ์ฐํฉ๋๋ค. ์ด๋ ๊ฒ ํจ์ผ๋ก์จ ์นด๋ฉ๋ผ์ ๋์ด๋ ๋ณ๊ฒฝ๋์ง ์๊ณ X์ Y ์ขํ๋ง ๋ณ๊ฒฝ๋ฉ๋๋ค. ์๋ก์ด ์์น ๋ฒกํฐNewCameraLocation์ ์ฌ์ฉํ์ฌ ์นด๋ฉ๋ผ์ ์์น๋ฅผ ์ด๋์ํต๋๋ค.- ์ด ๊ธฐ๋ฅ์ ์ธ๋ถ์์๋ ์ฌ์ฉํ ํจ์์ด๊ธฐ ๋๋ฌธ์ UFuction์ผ๋ก ๋ง๋ค์์ต๋๋ค.