向量旋转
作者:互联网
- 已知两边求夹角
float angle = Quaternion.LookRotation(vector, Vector3.up).eulerAngles;
- 已知斜边与夹角求临边
vector.x = vector.x * Mathf.Cos(Mathf.Deg2Rad * angle);
- 向量以Y轴为中心旋转angle
Vector3 vector = Quaternion.AngleAxis(angle, Vector3.up) * Vector3.forward;
标签:angle,up,Vector3,Mathf,旋转,Quaternion,vector,向量 来源: https://www.cnblogs.com/Joke-crazy/p/10388202.html