untiy中的物体旋转,角度与弧度的问题

旋转方式一:
transform.rotation
这个用的是弧度,弧度,-1~1的东西
而设置的时候,再设置
playerGameObject.transform.rotation = Quaternion.Euler(rotation);
用的又是角度,
太恶心了。
所以不如取值的时候直接就取弧度,设置的时候也用弧度,如下:
取弧度:Vector3 myrotation = transform.eulerAngles
设置弧度:playerGameObject.transform.eulerAngles = myrotation;

猜你喜欢

转载自blog.csdn.net/qq_40666620/article/details/105145794