Skip to main content

Class: Euler

欧拉角描述一个旋转变换,通过指定轴顺序和其各个轴向上的指定旋转角度来旋转一个物体

const a = new Euler(0, 1, 1.57, 'xyz' )

Hierarchy

  • default

    Euler

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Euler(x?, y?, z?, order?): Euler

Parameters

NameTypeDefault valueDescription
xnumber0用弧度表示x轴旋转量,默认值是 0
ynumber0用弧度表示y轴旋转量,默认值是 0
znumber0用弧度表示z轴旋转量,默认值是 0
orderANGLE_ORDER'xyz'表示旋转顺序的字符串,默认为'xyz'

Returns

Euler

Overrides

Vector.constructor

Defined in

src/math/Euler.ts:32

Properties

elements

elements: Float32Array | Float64Array

Overrides

Vector.elements

Defined in

src/math/Euler.ts:20

Accessors

x

get x(): number

获取 x 值

Returns

number

number;

Defined in

src/math/Euler.ts:45

set x(x): void

设置 x 值

Parameters

NameType
xnumber

Returns

void

Defined in

src/math/Euler.ts:53


y

get y(): number

获取 y 值

Returns

number

number;

Defined in

src/math/Euler.ts:62

set y(y): void

设置 y 值

Parameters

NameType
ynumber

Returns

void

Defined in

src/math/Euler.ts:70


z

get z(): number

获取 z 值

Returns

number

number;

Defined in

src/math/Euler.ts:79

set z(z): void

设置 z 值

Parameters

NameType
znumber

Returns

void

Defined in

src/math/Euler.ts:87


order

get order(): ANGLE_ORDER

获取旋转顺序

Returns

ANGLE_ORDER

Defined in

src/math/Euler.ts:95

set order(order): void

设置旋转顺序

Parameters

NameType
orderANGLE_ORDER

Returns

void

Defined in

src/math/Euler.ts:103


roll

get roll(): number

Returns

number

Defined in

src/math/Euler.ts:108

set roll(roll): void

Parameters

NameType
rollnumber

Returns

void

Defined in

src/math/Euler.ts:112


pitch

get pitch(): number

Returns

number

Defined in

src/math/Euler.ts:116

set pitch(pitch): void

Parameters

NameType
pitchnumber

Returns

void

Defined in

src/math/Euler.ts:120


yaw

get yaw(): number

Returns

number

Defined in

src/math/Euler.ts:124

set yaw(yaw): void

Parameters

NameType
yawnumber

Returns

void

Defined in

src/math/Euler.ts:128

Methods

fromObject

fromObject(«destructured»): Euler

从对象创建欧拉角

Parameters

NameType
«destructured»Object
› xany
› yany
› zany
› orderany

Returns

Euler

Defined in

src/math/Euler.ts:139


toObject

toObject(): Object

转换到对象

Returns

Object

NameType
xnumber
ynumber
znumber
orderANGLE_ORDER

Defined in

src/math/Euler.ts:159


fromRotationMatrix

fromRotationMatrix(m, order?, update?): Euler

从 Matrix4 创建欧拉角

Parameters

NameTypeDefault value
mMatrix4undefined
orderANGLE_ORDERundefined
updatebooleantrue

Returns

Euler

Defined in

src/math/Euler.ts:174


fromQuaternion

fromQuaternion(q): Euler

从四元数创建欧拉角

Parameters

NameType
qQuaternion

Returns

Euler

Defined in

src/math/Euler.ts:268


fromVector3

fromVector3(vec3, order?): Euler

从 Vector3 创建欧拉角

Parameters

NameType
vec3any
orderANGLE_ORDER

Returns

Euler

Defined in

src/math/Euler.ts:289


toQuaternion

toQuaternion(): Quaternion

转换到四元数

Returns

Quaternion

Defined in

src/math/Euler.ts:296


toVector3

toVector3(): Vector3

转换到 Vector3

Returns

Vector3

Defined in

src/math/Euler.ts:314


set

set(x, y, z, order?): Euler

设置欧拉角的 x、y、z、order

Parameters

NameType
xany
yany
zany
orderANGLE_ORDER

Returns

Euler

Defined in

src/math/Euler.ts:325


clone

clone(): Euler

克隆此欧拉角对象

Returns

Euler

Defined in

src/math/Euler.ts:337


copy

copy(euler): Euler

将传入的 euler 的各数值复制到此欧拉角

Parameters

NameType
eulerEuler

Returns

Euler

Defined in

src/math/Euler.ts:345


equals

equals(e): boolean

判断两个欧拉角是否相同

Parameters

NameType
eEuler

Returns

boolean

Defined in

src/math/Euler.ts:361


onChange

onChange(cb): void

监听欧拉角变更

Parameters

NameTypeDescription
cbICallback回调函数

Returns

void

Defined in

src/math/Euler.ts:369


triggerChange

triggerChange(): void

触发所有的回调函数

Returns

void

Defined in

src/math/Euler.ts:378


toString

toString(): string

转换为字符串

Returns

string

Defined in

src/math/Euler.ts:385


fromArray

fromArray(array, offset?): Euler

从数组构建向量数据

Parameters

NameTypeDefault valueDescription
arrayanyundefined原始数组
offsetnumber0数组偏移量

Returns

Euler

Inherited from

Vector.fromArray

Defined in

src/math/Vector.ts:15


toArray

toArray(out?, offset?): Float32Array | Float64Array | number[]

从向量转换到数组

Parameters

NameTypeDefault valueDescription
outFloat32Array | Float64Array | number[][]输出数据
offsetnumber0偏移量

Returns

Float32Array | Float64Array | number[]

Inherited from

Vector.toArray

Defined in

src/math/Vector.ts:28