Matrix3.d.ts 3.6 KB

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