Class: Quaternion
四元数,主要用于在三维世界描述旋转
const a = new Quaternion(0, 0, 0, 0);
Hierarchy
-
default
↳
Quaternion
Table of contents
Constructors
Properties
Accessors
Methods
- fromObject
- toObject
- fromAxisAngle
- getAxisAngle
- fromEuler
- fromMat3
- set
- length
- multiply
- slerp
- invert
- conjugate
- normalize
- dot
- angleTo
- clone
- copy
- equals
- onChange
- triggerChange
- toString
- fromArray
- toArray
Constructors
constructor
• new Quaternion(x?
, y?
, z?
, w?
): Quaternion
Parameters
Name | Type | Default value | Description |
---|---|---|---|
x | number | 0 | x 坐标,默认为 0 |
y | number | 0 | y 坐标,默认为 0 |
z | number | 0 | z 坐标,默认为 0 |
w | number | 0 | w 坐标,默认为 0 |
Returns
Overrides
Vector.constructor
Defined in
Properties
elements
• elements: Float32Array
| Float64Array
Overrides
Vector.elements
Defined in
Accessors
x
• get
x(): number
获取 x 值
Returns
number
number;
Defined in
• set
x(x
): void
设置 x 值
Parameters
Name | Type |
---|---|
x | number |
Returns
void
Defined in
y
• get
y(): number
获取 y 值
Returns
number
number;
Defined in
• set
y(y
): void
设置 y 值
Parameters
Name | Type |
---|---|
y | number |
Returns
void
Defined in
z
• get
z(): number
获取 z 值
Returns
number
number;
Defined in
• set
z(z
): void
设置 z 值
Parameters
Name | Type |
---|---|
z | number |
Returns
void
Defined in
w
• get
w(): number
获取 w 值
Returns
number
number;
Defined in
• set
w(w
): void
设置 w 值
Parameters
Name | Type |
---|---|
w | number |
Returns
void
Defined in
Methods
fromObject
▸ fromObject(object
): Quaternion
从对象赋值 Quaternion 的 x、y、z、w 值
Parameters
Name | Type |
---|---|
object | Object |
object.x | any |
object.y | any |
object.z | any |
object.w | any |