Spaces:
Sleeping
Sleeping
File size: 3,645 Bytes
2b7aae2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | import { Matrix4 } from './Matrix4';
import { Vector3 } from './Vector3';
export type Matrix3Tuple = [number, number, number, number, number, number, number, number, number];
/**
* ( interface Matrix<T> )
*/
export interface Matrix {
/**
* Array with matrix values.
*/
elements: number[];
/**
* identity():T;
*/
identity(): Matrix;
/**
* copy(m:T):T;
*/
copy(m: this): this;
/**
* multiplyScalar(s:number):T;
*/
multiplyScalar(s: number): Matrix;
determinant(): number;
/**
* transpose():T;
*/
transpose(): Matrix;
/**
* invert():T;
*/
invert(): Matrix;
/**
* clone():T;
*/
clone(): Matrix;
}
/**
* ( class Matrix3 implements Matrix<Matrix3> )
*/
export class Matrix3 implements Matrix {
/**
* Creates an identity matrix.
*/
constructor();
/**
* Array with matrix values.
* @default [1, 0, 0, 0, 1, 0, 0, 0, 1]
*/
elements: number[];
set(n11: number, n12: number, n13: number, n21: number, n22: number, n23: number, n31: number, n32: number, n33: number): Matrix3;
identity(): Matrix3;
clone(): this;
copy(m: Matrix3): this;
extractBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): Matrix3;
setFromMatrix4(m: Matrix4): Matrix3;
multiplyScalar(s: number): Matrix3;
determinant(): number;
/**
* Inverts this matrix in place.
*/
invert(): Matrix3;
/**
* Transposes this matrix in place.
*/
transpose(): Matrix3;
getNormalMatrix(matrix4: Matrix4): Matrix3;
/**
* Transposes this matrix into the supplied array r, and returns itself.
*/
transposeIntoArray(r: number[]): Matrix3;
setUvTransform(tx: number, ty: number, sx: number, sy: number, rotation: number, cx: number, cy: number): Matrix3;
scale(sx: number, sy: number): Matrix3;
rotate(theta: number): Matrix3;
translate(tx: number, ty: number): Matrix3;
equals(matrix: Matrix3): boolean;
/**
* Sets the values of this matrix from the provided array or array-like.
* @param array the source array or array-like.
* @param offset (optional) offset into the array-like. Default is 0.
*/
fromArray(array: number[] | ArrayLike<number>, offset?: number): Matrix3;
/**
* Returns an array with the values of this matrix, or copies them into the provided array.
* @param array (optional) array to store the matrix to. If this is not provided, a new array will be created.
* @param offset (optional) optional offset into the array.
* @return The created or provided array.
*/
toArray(array?: number[], offset?: number): number[];
toArray(array?: Matrix3Tuple, offset?: 0): Matrix3Tuple;
/**
* Copies he values of this matrix into the provided array-like.
* @param array array-like to store the matrix to.
* @param offset (optional) optional offset into the array-like.
* @return The provided array-like.
*/
toArray(array?: ArrayLike<number>, offset?: number): ArrayLike<number>;
/**
* Multiplies this matrix by m.
*/
multiply(m: Matrix3): Matrix3;
premultiply(m: Matrix3): Matrix3;
/**
* Sets this matrix to a x b.
*/
multiplyMatrices(a: Matrix3, b: Matrix3): Matrix3;
/**
* @deprecated Use {@link Vector3.applyMatrix3 vector.applyMatrix3( matrix )} instead.
*/
multiplyVector3(vector: Vector3): any;
/**
* @deprecated This method has been removed completely.
*/
multiplyVector3Array(a: any): any;
/**
* @deprecated Use {@link Matrix3#invert .invert()} instead.
*/
getInverse(matrix: Matrix4, throwOnDegenerate?: boolean): Matrix3;
getInverse(matrix: Matrix): Matrix;
/**
* @deprecated Use {@link Matrix3#toArray .toArray()} instead.
*/
flattenToArrayOffset(array: number[], offset: number): number[];
}
|