// 0.0 >= t <= 1.0 her be magic and dragons
public Vector3 GetPointAtTime(float t)
{
float u = 1f - t;
float tt = t * t;
float uu = u * u;
float uuu = uu * u;
float ttt = tt * t;
Vector3 p = uuu * this.points[0].position; //first term
p += 3 * uu * t * this.points[1].position; //second term
p += 3 * u * tt * this.points[2].position; //third term
p += ttt * this.points[3].position; //fourth term
return p;
}
t : 시간
point[0] : 시작지점
point[1] : 조절 지점 1
point[2] : 조절 지점 2
point[3] : 도착 지점
'게임개발 > 유니티' 카테고리의 다른 글
[UniteSeoul 2020] Tips & Tricks For Using Profiler (0) | 2020.12.02 |
---|---|
AssetBundle 관리 (0) | 2020.04.13 |
(Unity)안드로이드 전화번호 가지고오기 (0) | 2019.08.29 |
단발성 진동 알람 이벤트 처리 (0) | 2019.04.24 |
unity google play games plugin 연동 문제 (0) | 2018.08.17 |