用户工具

站点工具


侧边栏

script:unityengine:classes:quaternion:quaternion

Quaternion 四元数

struct in UnityEngine

Description 描述

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表示所有旋转。

They are based on complex numbers and are not easy to understand intuitively. 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 are: Quaternion.LookRotation, Quaternion.Angle, Quaternion.Euler, Quaternion.Slerp, Quaternion.FromToRotation, and Quaternion.identity. (The other functions are only for exotic uses.)

他们基于复数并且直觉上不容易理解。你几乎不必要访问或者修改独立的四元素组件(x,y,z,w);通常你只需使用现有的旋转(例如,来自Transform)并使用它们来构造新的旋转(例如,在两个旋转间平滑地插值)。99%的时间你都会用以下几个函数:Quaternion.LookRotation, Quaternion.Angle, Quaternion.Euler, Quaternion.Slerp, Quaternion.FromToRotation, Quaternion.identity(其他函数仅额外使用)。

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

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

Static Variables 静态变量

identityThe identity rotation (Read Only).
同一性旋转(只读)。

Variables 变量

eulerAnglesReturns the euler angle representation of the rotation.
返回表示旋转的欧拉角度。
this[int]Access the x, y, z, w components using [0], [1], [2], [3] respectively.
分别使用 [0]、[1]、 [2]、 [3],访问x、y、z、w组件。
wW component of the Quaternion. Don't modify this directly unless you know quaternions inside out.不
四元数的W组件。不要直接修改这个,除非你很了解四元数。
script/unityengine/classes/quaternion/quaternion.txt · 最后更改: 2018/12/27 02:40 由 shuice