* scale the matrix * @param x - a number representing the abscissa of the scaling vector. * @param [y] - a number representing the ordinate of the scaling vector. * @param [z] - a number representing the depth vector * @returns Reference to this object for method chaining
(x: number, y = x, z = 1)
| 618 | * @returns Reference to this object for method chaining |
| 619 | */ |
| 620 | scale(x: number, y = x, z = 1) { |
| 621 | const a = this.val; |
| 622 | |
| 623 | a[0] = a[0] * x; |
| 624 | a[1] = a[1] * x; |
| 625 | a[2] = a[2] * x; |
| 626 | a[3] = a[3] * x; |
| 627 | |
| 628 | a[4] = a[4] * y; |
| 629 | a[5] = a[5] * y; |
| 630 | a[6] = a[6] * y; |
| 631 | a[7] = a[7] * y; |
| 632 | |
| 633 | a[8] = a[8] * z; |
| 634 | a[9] = a[9] * z; |
| 635 | a[10] = a[10] * z; |
| 636 | a[11] = a[11] * z; |
| 637 | |
| 638 | return this; |
| 639 | } |
| 640 | |
| 641 | /** |
| 642 | * adds a 2D scaling transformation. |
no outgoing calls