📜  从 2 位置数学获取 2d 旋转 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:55.994000             🧑  作者: Mango

代码示例1
Vector3 dir = new Vector3(position2.x - position1.x, position2.y - position1.y);
float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
Quaternion rotation = Quaternion.Euler( 0f, 0f, angle );