Răsfoiți Sursa

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 ani în urmă
părinte
comite
1c82ee580b
2 a modificat fișierele cu 4 adăugiri și 2 ștergeri
  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[];
 	fromArray( array: number[], offset?: number ): Matrix3;
-	toArray(): number[];
+
+	toArray( array?: number[], offset?: number ): number[];
 
 	/**
 	 * Multiplies this matrix by m.

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

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