ht.Math.Matrix3()

new Matrix3()

Members

isMatrix3 :boolean

是否为 Matrix3

Default Value:
  • true

Methods

applyToBufferAttribute(attribute) → {ht.Math.Vector3}

用这个矩阵乘以缓存属性 attribute 里的所有3d向量

Parameters:
Name Type Description
attribute ht.Math.Vector3

表示三维向量缓存属性。

Returns:
ht.Math.Vector3

clone() → {ht.Math.Matrix3}

创建一个相同的矩阵

Returns:
ht.Math.Matrix3

copy(Matrix3) → {ht.Math.Matrix3}

将矩阵 Matrix3 的元素复制到当前矩阵中

Parameters:
Name Type Description
Matrix3 ht.Math.Matrix3
Returns:
ht.Math.Matrix3

equals(Matrix3) → {any}

当前矩阵和所传入 矩阵 是否相等

Parameters:
Name Type Description
Matrix3 ht.Math.Matrix3
Returns:
any

fromArray(Array, offset) → {ht.Math.Matrix3}

使用列优先数组来设置当前矩阵

Parameters:
Name Type Attributes Description
Array Array.<Object>

矩阵列优先数组

offset number <optional>

数组的偏移量,默认值为 0

Returns:
ht.Math.Matrix3

getElements() → {Array.<number>}

返回矩阵列优先数组

Returns:
Array.<number>
Since:
  • 7.7.0

getInverse() → {ht.Math.Matrix3}

将当前矩阵设置为 Matrix4 矩阵的逆矩阵

Returns:
ht.Math.Matrix3

getNormalMatrix(Matrix4) → {ht.Math.Matrix4}

将这个矩阵设置为给定矩阵的正规矩阵normal matrix(左上角的3x3)。 正规矩阵是矩阵m的逆矩阵inverse 的转置transpose。

Parameters:
Name Type Description
Matrix4 ht.Math.Matrix4
Returns:
ht.Math.Matrix4

identity() → {ht.Math.Matrix3}

将当前矩阵重置为单位矩阵

Returns:
ht.Math.Matrix3

multiply(Matrix3) → {ht.Math.Matrix3}

将当前矩阵乘以矩阵 Matrix3

Parameters:
Name Type Description
Matrix3 ht.Math.Matrix3
Returns:
ht.Math.Matrix3

multiplyMatrices(Matrix3_one, Matrix3_two) → {ht.Math.Matrix3}

两个矩阵相乘

Parameters:
Name Type Description
Matrix3_one ht.Math.Matrix3
Matrix3_two ht.Math.Matrix3
Returns:
ht.Math.Matrix3

multiplyScalar(Matrix3) → {ht.Math.Matrix3}

当前矩阵所有的元素乘以该缩放值 scale

Parameters:
Name Type Description
Matrix3 ht.Math.Matrix3
Returns:
ht.Math.Matrix3

premultiply(Matrix3) → {ht.Math.Matrix3}

将矩阵 Matrix3 乘以当前矩阵

Parameters:
Name Type Description
Matrix3 ht.Math.Matrix3
Returns:
ht.Math.Matrix3

rotate(r) → {ht.Math.Matrix3}

在当前值基础上设置旋转值

Parameters:
Name Type Description
r number
Returns:
ht.Math.Matrix3

scale(x, y) → {ht.Math.Matrix3}

在当前值基础上设置缩放值

Parameters:
Name Type Description
x number
y number
Returns:
ht.Math.Matrix3

set(n11, n12, n13, n21, n22, n23, n31, n32, n33) → {ht.Math.Matrix3}

将传入的数值以行优先的格式设置给该矩阵

Parameters:
Name Type Description
n11 number
n12 number
n13 number
n21 number
n22 number
n23 number
n31 number
n32 number
n33 number
Returns:
ht.Math.Matrix3

setFromMatrix4(Matrix4) → {ht.Math.Matrix3}

从矩阵 Matrix4 中, 设置当前矩阵为其中与位置相关的元素

Parameters:
Name Type Description
Matrix4 ht.Math.Matrix4
Returns:
ht.Math.Matrix3

setUvTransform(tx, ty, sx, sy, rotation, cx, cy) → {any}

使用偏移,重复,旋转和中心点位置设置UV变换矩阵

Parameters:
Name Type Description
tx number

x偏移量

ty number

y偏移量

sx number

x方向的重复比例

sy number

y方向的重复比例

rotation number

旋转(弧度)

cx number

旋转中心x

cy number

旋转中心y

Returns:
any

toArray(array, offset) → {Array.<number>}

使用列优先格式将此矩阵的元素写入数组中

Parameters:
Name Type Attributes Description
array Array.<Object> <optional>

用于存储矩阵元素的数组,如果未指定会创建一个新的数组

offset number <optional>

数组中元素的偏移量

Returns:
Array.<number>

translate(x, y) → {ht.Math.Matrix3}

在当前值基础上增加水平和垂直平移值

Parameters:
Name Type Description
x number
y number
Returns:
ht.Math.Matrix3

transpose() → {ht.Math.Matrix3}

矩阵转置

Returns:
ht.Math.Matrix3

transposeIntoArray(Array) → {ht.Math.Matrix3}

将当前矩阵的转置Transposes存入给定的数组array : Array但不改变当前矩阵, 并返回当前矩阵

Parameters:
Name Type Description
Array Array.<Object>
Returns:
ht.Math.Matrix3