Skip to main content

KEuler

kds-plugin-document / Exports / KEuler

Interface: KEuler

这是一个定义欧拉角的接口,欧拉角是用来表示旋转变换的另一种形式。 其中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.

Table of contents

Properties

Methods

Properties

order

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'.

Defined in

api.d.ts:6741


x

Readonly x: number

绕x轴旋转角度。

The rotate angle around x axis in radians.

Defined in

api.d.ts:6719


y

Readonly y: number

绕y轴旋转角度。

The rotate angle around y axis in radians.

Defined in

api.d.ts:6725


z

Readonly z: number

绕z轴旋转角度。

The rotate angle around z axis in radians.

Defined in

api.d.ts:6731

Methods

clone

clone(): KEuler

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

Clone the euler object.

Returns

KEuler

返回克隆的新欧拉角对象。

Return the new cloned euler object.

Defined in

api.d.ts:6773


copyFrom

copyFrom(euler): void

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

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

Parameters

NameTypeDescription
eulerKEuler另一个欧拉角。 The another euler object.

Returns

void

Defined in

api.d.ts:6783


fromArray

fromArray(array): void

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

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

Parameters

NameTypeDescription
arrayany[]输入数组,至少含x, y, z旋转信息,默认order为当前欧拉角的order。 The input array: [x, y, z, order?], where x, y, z are needed and default order is the current euler order.

Returns

void

Defined in

api.d.ts:6863


isEqual

isEqual(euler): boolean

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

Check whether this Euler object is equal to another.

Parameters

NameTypeDescription
eulerKEuler输入另一个欧拉角。 The another euler object.

Returns

boolean

返回当前与输入欧拉角是否相等。

Return true if current euler is euqal to the input euler.

Defined in

api.d.ts:6853


reorder

reorder(newOrder): void

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

Reorder the angles.

Parameters

NameTypeDescription
newOrderKEulerOrder输入欧拉角旋转顺序。 The input euler order.

Returns

void

Defined in

api.d.ts:6839


set

set(x, y, z, order): void

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

Set x, y, z angles and order.

Parameters

NameTypeDescription
xnumber绕x轴旋转的角度。 Rotate angle around X axis in radians.
ynumber绕y轴旋转的角度。 Rotate angle around Y axis in radians.
znumber绕z轴旋转的角度。 Rotate angle around Z axis in radians.
orderKEulerOrder绕x轴,y轴和z轴旋转的先后顺序。 The order in which to apply the rotations.

Returns

void

Defined in

api.d.ts:6763


setFromQuaternion

setFromQuaternion(q, order?): void

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

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

Parameters

NameTypeDescription
qKQuaternion输入四元数。 The input Quaternion.
order?KEulerOrder输入绕x轴,y轴和z轴旋转的先后顺序, 默认使用当前欧拉角的旋转顺序。 The order in which to apply the rotations. Default order is current euler's order.

Returns

void

Defined in

api.d.ts:6813


setFromRotationMatrix

setFromRotationMatrix(m, order?): void

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

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

Parameters

NameTypeDescription
mKMatrix4输入变换矩阵。 The input matrix.
order?KEulerOrder输入绕x轴,y轴和z轴旋转的先后顺序, 默认使用当前欧拉角的旋转顺序。 The order in which to apply the rotations. Default order is current euler's order.

Returns

void

Defined in

api.d.ts:6798


setFromVector3

setFromVector3(v, order?): void

把一个向量的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.

Parameters

NameTypeDescription
vKVector3d输入向量,x分量为绕x轴旋转的角度,以此类推向量的y,z分量。 The input vector, v.x is the angle of x axis, and so on.
order?KEulerOrder输入绕x轴,y轴和z轴旋转的先后顺序, 默认使用当前欧拉角的旋转顺序。 The order in which to apply the rotations. Default order is current euler's order.

Returns

void

Defined in

api.d.ts:6829


toArray

toArray(): any[]

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

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

Returns

any[]

返回数组,数组存储欧拉角沿x, y, z轴的旋转角度和旋转顺序。

Return array in [x, y, z, order].

Defined in

api.d.ts:6873


toVector

toVector(): KVector3d

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

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

Returns

KVector3d

返回向量,向量存储欧拉角沿x, y, z轴的旋转角度。

Return vector in [x, y, z].

Defined in

api.d.ts:6883