(...args)
| 25 | #sqDimention; |
| 26 | |
| 27 | constructor(...args) { |
| 28 | super(...args); |
| 29 | // This is default behavior when object |
| 30 | // instantiated using createMatrix() |
| 31 | if (isMatrixArray(args[0]) && isPerfectSquare(args[0])) { |
| 32 | const sqDimention = Math.sqrt(args[0].length); |
| 33 | this.#sqDimention = sqDimention; |
| 34 | this.matrix = GLMAT_ARRAY_TYPE.from(args[0]); |
| 35 | } else if (typeof args[0] === 'number') { |
| 36 | this.#sqDimention = Number(args[0]); |
| 37 | this.matrix = this.#createIdentityMatrix(args[0]); |
| 38 | } |
| 39 | return this; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Returns the 3x3 matrix if the dimensions are 3x3, otherwise returns `undefined`. |
nothing calls this directly
no test coverage detected