unity 四元数旋转各元素值的计算方法
// 旋转轴
Vector3 axis = Vector3.up;
// 旋转弧度
float rad = 50f * Mathf.Deg2Rad;
Quaternion quaternion = new Quaternion();
quaternion.x = Mathf.Sin(rad / 2f) * axis.x;
quaternion.y = Mathf.Sin(rad / 2f) * axis.y;
quaternion.z = Mathf.Sin(rad / 2f) * axis.z;
quaternion.w = Mathf.Cos(rad / 2f);
transform.rotation = quaternion;
// 相当于
//transform.rotation = Quaternion.Euler(0f, 50f, 0f);