| 774 | export { Vector4 as Vector4 }; |
| 775 | export { Vector2 as Vector2 }; |
| 776 | class Matrix2 { |
| 777 | ptr; |
| 778 | #internal; |
| 779 | get [0]() { |
| 780 | return new Proxy([ |
| 781 | this.#internal[0], |
| 782 | this.#internal[1] |
| 783 | ], { |
| 784 | set: (_target, prop, value)=>{ |
| 785 | if (prop === "0" || prop === "1") { |
| 786 | this.#internal[prop] = value; |
| 787 | return true; |
| 788 | } |
| 789 | return false; |
| 790 | } |
| 791 | }); |
| 792 | } |
| 793 | set [0](val) { |
| 794 | this.#internal[0] = val[0]; |
| 795 | this.#internal[1] = val[1]; |
| 796 | } |
| 797 | get [1]() { |
| 798 | return new Proxy([ |
| 799 | this.#internal[2], |
| 800 | this.#internal[3] |
| 801 | ], { |
| 802 | set: (_target, prop, value)=>{ |
| 803 | if (prop === "2" || prop === "3") { |
| 804 | this.#internal[2 + prop] = value; |
| 805 | return true; |
| 806 | } |
| 807 | return false; |
| 808 | } |
| 809 | }); |
| 810 | } |
| 811 | set [1](val) { |
| 812 | this.#internal[3] = val[0]; |
| 813 | this.#internal[4] = val[1]; |
| 814 | } |
| 815 | get x() { |
| 816 | return new Vector2(...this[0]); |
| 817 | } |
| 818 | set x(val) { |
| 819 | this.#internal[0] = val.x; |
| 820 | this.#internal[1] = val.y; |
| 821 | } |
| 822 | get y() { |
| 823 | return new Vector2(...this[1]); |
| 824 | } |
| 825 | set y(val) { |
| 826 | this.#internal[2] = val.x; |
| 827 | this.#internal[3] = val.y; |
| 828 | } |
| 829 | static from(c0r0, c0r1, c1r0, c1r1) { |
| 830 | return new Matrix2(new Vector2(c0r0, c0r1), new Vector2(c1r0, c1r1)); |
| 831 | } |
| 832 | static fromAngle(theta) { |
| 833 | const [s, c] = theta.sincos(); |
nothing calls this directly
no outgoing calls
no test coverage detected