瀏覽代碼

Merge pull request #16933 from JohannesDeml/matrix4_toarray_definition_fix

TS: Fix toArray method for Matrix3 and Matrix4: Add optional parameters array and offset
Mr.doob 6 年之前
父節點
當前提交
1c82ee580b
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 2 1
      src/math/Matrix3.d.ts
  2. 2 1
      src/math/Matrix4.d.ts

+ 2 - 1
src/math/Matrix3.d.ts

@@ -101,7 +101,8 @@ export class Matrix3 implements Matrix {
 	 */
 	 */
 	transposeIntoArray( r: number[] ): number[];
 	transposeIntoArray( r: number[] ): number[];
 	fromArray( array: number[], offset?: number ): Matrix3;
 	fromArray( array: number[], offset?: number ): Matrix3;
-	toArray(): number[];
+
+	toArray( array?: number[], offset?: number ): number[];
 
 
 	/**
 	/**
 	 * Multiplies this matrix by m.
 	 * Multiplies this matrix by m.

+ 2 - 1
src/math/Matrix4.d.ts

@@ -227,7 +227,8 @@ export class Matrix4 implements Matrix {
 	): Matrix4;
 	): Matrix4;
 	equals( matrix: Matrix4 ): boolean;
 	equals( matrix: Matrix4 ): boolean;
 	fromArray( array: number[], offset?: number ): Matrix4;
 	fromArray( array: number[], offset?: number ): Matrix4;
-	toArray(): number[];
+
+	toArray( array?: number[], offset?: number ): number[];
 
 
 	/**
 	/**
 	 * @deprecated Use {@link Matrix4#copyPosition .copyPosition()} instead.
 	 * @deprecated Use {@link Matrix4#copyPosition .copyPosition()} instead.