Matrix3.d.ts 3.9 KB

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