常用四元数Quaternion运算(长期更新)

版权声明:本文为博主原创文章,转载请表明来源和网址。 https://blog.csdn.net/thinbug/article/details/79085288

经常做四元数变化就要想半天,太生疏,把常用的总结下来。

1.头方向不正,把头摆水平

Quaternion qForward = Quaternion.LookRotation(Vector3.up, -transform.forward) * Quaternion.AngleAxis(90f, Vector3.right);
transform.rotation = qForward;

猜你喜欢

转载自blog.csdn.net/thinbug/article/details/79085288