跳到主要内容

KEuler interface

这是一个定义欧拉角的接口,欧拉角是用来表示旋转变换的另一种形式。 其中x, y, z分别表示绕x轴,y轴和z轴旋转的角度,order表示绕x轴,y轴和z轴旋转的先后顺序。

An interface representing Euler Angles. Euler angles describe a rotational transformation by rotating an object around its various axes in specified amounts and order.

Signature:

export interface KEuler 

Properties

Property

Modifiers

Type

Description

order

KEulerOrder

order表示绕x轴,y轴和z轴旋转的先后顺序。 例如XYZ表示先绕X轴旋转,再绕Y轴旋转,最后绕Z轴旋转;ZYX表示先绕Z轴旋转,再绕Y轴旋转,最后绕X轴旋转。

The order in which to apply the rotations. Default is 'XYZ', which means that the object will firstly be rotated around its X axis, then its Y axis and finally its Z axis. Other possibilities are: 'YZX', 'ZXY', 'XZY', 'YXZ' and 'ZYX'.

x

readonly

number

绕x轴旋转角度。

The rotate angle around x axis in radians.

y

readonly

number

绕y轴旋转角度。

The rotate angle around y axis in radians.

z

readonly

number

绕z轴旋转角度。

The rotate angle around z axis in radians.

Methods

Method

Description

clone()

克隆自己返回一个新的欧拉角对象。

Clone the euler object.

copyFrom(euler)

从另外一个欧拉角复制x,y,z和order数据,覆盖掉自己的数据。

Copy x, y, z angles and order from another Euler object.

fromArray(array)

从一个数组读取x,y,z和order数据,写入到当前对象中。

Set x, y, z angles and order from an array.

isEqual(euler)

检查是不是和另外一个欧拉角对象相等。

Check whether this Euler object is equal to another.

reorder(newOrder)

重新设置欧拉角旋转顺序。

Reorder the angles.

set(x, y, z, order)

设置绕x,y,z轴旋转的角度和旋转顺序。

Set x, y, z angles and order.

setFromQuaternion(q, order)

从一个四元数对象提取x,y,z旋转分量并结合输入的旋转顺序order,设置到当前的欧拉角对象。

Set x, y, z angles and order from a quaternion.

setFromRotationMatrix(m, order)

从一个变换矩阵中提取x,y,z旋转分量并结合输入的旋转顺序order,设置到当前的欧拉角对象。

Set x, y, z angles and order from a matrix.

setFromVector3(v, order)

把一个向量的x,y,z分量分别当作x,y,z旋转分量并结合输入的旋转顺序order,设置到当前的欧拉角对象。

Set x, y, z angles and order from a vector3d. NOTE: v.x is the angle of x axis, and so on.

toArray()

把欧拉角对象转化成数组形式[x, y, z, order]。

Convert to an array containing x, y, z angles and the order.

toVector()

把当前欧拉角对象转化成一个向量[x,y,z]。

Convert to a vector3d containing x, y, z angles.