Method GetCameraRotationToTarget
GetCameraRotationToTarget(Quaternion, Vector3, Vector3)
Get the rotations, first about world up, then about (travelling) local right, necessary to align the quaternion's forward with the target direction. This represents the tripod head movement needed to look at the target. This formulation makes it easy to interpolate without introducing spurious roll.
선언
public static Vector2 GetCameraRotationToTarget(this Quaternion orient, Vector3 lookAtDir, Vector3 worldUp)
파라미터
타입 | 이름 | 설명 |
---|---|---|
Quaternion | orient | |
Vector3 | lookAtDir | The worldspace target direction in which we want to look |
Vector3 | worldUp | Which way is up. Must have a length of 1. |
반환
타입 | 설명 |
---|---|
Vector2 | Vector2.y is rotation about worldUp, and Vector2.x is second rotation, about local right. |