Quaternion 四元数

Struct

Quaternions are used to represent rotations.

四元数用于表示旋转。

They are compact, don't suffer from gimbal lock and can easily be interpolated. Unity internally uses Quaternions to represent all rotations.

它们是紧凑的,不会出现万向节锁并且能够很容易被插值。Unity内使用Quaternion表示所有旋转。

However, they are based on complex numbers and are not easy to understand intuitively. Thus you almost never access or modify individual Quaternion components (x,y,z,w); most often you would just take existing rotations (e.g. from the Transform) and use them to construct new rotations (e.g. to smoothly interpolate between two rotations). The Quaternion functions that you use 99% of the time (The other functions are only for exoctic uses) Quaternion.LookRotation, Quaternion.Angle, Quaternion.Euler, Quaternion.Slerp, Quaternion.FromToRotation, Quaternion.identity

然而,它们基于复数的并不容易被直观地理解,因此你没有必要访问或修改单个Quaternion组件(x,y,z,w);通常你只需把现有的旋转(例如,来自Transform)并使用它们来构造新的旋转(例如,在两个旋转间平滑地插值)。四元数函数你99%的时间你会使用它(其他函数仅额外使用)Quaternion.LookRotation, Quaternion.Angle, Quaternion.Euler, Quaternion.Slerp, Quaternion.FromToRotation, Quaternion.identity

You can use Quaternion.operator * to rotate one rotation by another, or to rotate a vector by a rotation.

你可以使用Quaternion.operator *由另一个四元数来旋转一个旋转角度,或由一个旋转角度来旋转一个向量。

Variables变量

Constructors构造器

Functions函数

Class Variables类变量

Class Functions类函数

最后修改:2011年1月16日 Sunday 18:10

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。