🎮Unreal4/C++

[UE4] PointLight 만들기, Ease Out Bounce 적용시키기

공대 컴린이 2023. 2. 28. 16:38
728x90

💡 Point Light

Point Light를 생성하기 위해 UPointLightComponent 객체를 선언하였다.

 

이런식으로 객체를 생성하고 나서 구글에 객체명을 검색하면 include 시킬 헤더파일의 경로와, 매개변수 등의 다양한 정보를 찾을 수 있다.

https://docs.unrealengine.com/4.26/en-US/API/Runtime/Engine/Components/UPointLightComponent/

 

UPointLightComponent

A light component which emits light from a single point equally in all directions.

docs.unrealengine.com

UPointLightComponent 객체를 사용하기위해 Components에 존재하는 PointLightComponent 헤더를 추가하였다.

 

그다음, 이전에 만들어두었던 CreateComponent 함수를 이용하여 PointLight 변수를 초기화해주었다.

 

Light를 Cos 곡선에 따라 음수일 때 출력하지 않고, 양수일 때 출력하도록 만들어 불빛이 깜빡거리도록 구현하였다.

 

결과적으로 빨간 SolidBox 왼쪽에 Blue Light가 깜빡거리며 나타나게 되었다.

📈 Ease Out Bounce

Easing 함수를 만들어주는 사이트에 다양한 곡선이 존재하고, 그에 대한 수식까지 제공해주고 있다. 이를 활용하여 Easing 곡선대로 Arrow가 흔들리도록 적용시켜보았다.

 

내가 사용해본 함수는 ease Out Bounce이다.

 

사이트에 함수를 선택하여 들어가면 수학함수로 곡선의 수식을 제공해주므로 해당 수식을 가져가서 Arrow의 위치를 초기화하였다.

 

 

실행 결과, Arrow가 사이트의 곡선대로 흔들리는 모습을 확인할 수 있었다. (더불어 깜빡거리는 왼쪽의 Point Light도 확인해보자)

 


https://easings.net/ko#easeOutBounce

 

Easing Functions Cheat Sheet

Easing functions specify the speed of animation to make the movement more natural. Real objects don’t just move at a constant speed, and do not start and stop in an instant. This page helps you choose the right easing function.

easings.net

 

728x90