Quaternion.Euler, AngleAxis
public static Quaternion Euler(float x, float y, float z); 오일러각을 쿼터니언 회전각으로 반환
public static Quaternion Euler(Vector3 euler); Vector3 인자값 사용 (위의 수치를 한꺼번에 사용한 것과 다름없다)
public static Quaternion AngleAxis(float angle, Vector3 axis); axis 축 방향을 중심으로 angle 각 만큼 회전
Quaternion.Angle, Inverse, Dot
public static float Angle(Quaternion a, Quaternion b); 두 쿼터니언 회전각 a, b 사이의 차이각
public static Quaternion Inverse(Quaternion rotation); rotation의 inverse를 반환
public static float Dot(Quaternion a, Quaternion b); 두개의 rotation 사이의 내적
( 0.7, 0.0, 0.0, 0.7)
(-0.7, 0.0, 0.0, 0.7)
180
(-0.7, 0.0, 0.0, 0.7)
Quaternion.FromToRotation, LookRotation, RotateTowards
public static Quaternion FromToRotation(Vector3 fromDirection, Vector3 toDirection); from 백터방향에서 to백터방향으로 회전한 각도를 쿼터니언으로 반환
public static Quaternion LookRotation(Vector3 forward); 지정된 방향 백터로 쿼터니언 회전 각 반환
public static Quaternion RotateTowards(Quaternion from, Quaternion to, float maxDegreesDelta);
from에서 to까지의 quaternion 회전각 차이에서 maxDegreesDelta 수치 만큼 회전
Quaternion.Lerp, Slerp
public static Quaternion Lerp(Quaternion a, Quaternion b, float t); 변화 전 a와 변화 후 b 사이를 정규화한 변화량 t(0.0f~1.0f) 로 선형보간한다.
public static Quaternion Slerp(Quaternion a, Quaternion b, float t); 변화 전 a와 변화 후 b 사이를 정규화한 변화량 t(0.0f~1.0f) 로 구면보간한다.
public static Quaternion Lerp/SlerpUnclamped(Quaternion a, Quaternion b, float t); 사이 입력값의 한계치를 제한하지 않는다.
mathf.LerpUnclamped(1.0, 2.0, 1.5) == 2.5 vs mathf.Lerp(1.0, 2.0, 1.5) == 2.0
slerp/lerp 비교 링크 - https://imgur.com/r/Unity3D/FeKRE1c
'UnityEngine > API 스크립팅' 카테고리의 다른 글
[Find 메서드] Find, GetChild, GetInstanceID (0) | 2018.06.12 |
---|---|
[트랜스폼 메서드] Translate, Rotate, TransformDirection (0) | 2018.06.10 |
[트랜스폼 속성] position, scale, rotation, eulerAngles (0) | 2018.06.09 |
[트랜스폼 속성] forward, childCount, parent (0) | 2018.06.08 |
[백터 속성과 메서드] Properties, magnitude, nomalized (0) | 2018.06.05 |