unity两个物体之间的角度(0-360)
//在xy平面的360度旋转,即绕着Z轴旋转
public float Angle_360(Vector3 from_, Vector3 to_)
{
Vector3 v3 = Vector3.Cross(from_, to_); //叉乘判断正方向
if (v3.z > 0)
return Vector3.Angle(from_, to_);
else
return 360 - Vector3.Angle(from_
转载
2020-08-19 16:08:50 ·
3402 阅读 ·
0 评论