@fi4f/hg 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -0
- package/dist/asset.d.ts +46 -0
- package/dist/asset.d.ts.map +1 -0
- package/dist/{core/asset.js → asset.js} +5 -30
- package/dist/asset.js.map +1 -0
- package/dist/{core/cache.d.ts → cache.d.ts} +17 -7
- package/dist/cache.d.ts.map +1 -0
- package/dist/{core/cache.js → cache.js} +5 -6
- package/dist/cache.js.map +1 -0
- package/dist/canvas.d.ts +4 -0
- package/dist/canvas.d.ts.map +1 -0
- package/dist/canvas.js +12 -0
- package/dist/canvas.js.map +1 -0
- package/dist/el.d.ts.map +1 -0
- package/dist/el.js.map +1 -0
- package/dist/event.d.ts.map +1 -0
- package/dist/event.js.map +1 -0
- package/dist/hg.d.ts +13 -13
- package/dist/hg.d.ts.map +1 -1
- package/dist/hg.js +14 -14
- package/dist/hg.js.map +1 -1
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/matrix2.d.ts +152 -0
- package/dist/matrix2.d.ts.map +1 -0
- package/dist/matrix2.js +262 -0
- package/dist/matrix2.js.map +1 -0
- package/dist/matrix3.d.ts +196 -0
- package/dist/matrix3.d.ts.map +1 -0
- package/dist/matrix3.js +352 -0
- package/dist/matrix3.js.map +1 -0
- package/dist/matrix4.d.ts +253 -0
- package/dist/matrix4.d.ts.map +1 -0
- package/dist/matrix4.js +465 -0
- package/dist/matrix4.js.map +1 -0
- package/dist/{core/scene.d.ts → scene.d.ts} +2 -3
- package/dist/scene.d.ts.map +1 -0
- package/dist/scene.js.map +1 -0
- package/dist/sprite.d.ts.map +1 -0
- package/dist/sprite.js.map +1 -0
- package/dist/stage.d.ts +100 -0
- package/dist/stage.d.ts.map +1 -0
- package/dist/stage.js +303 -0
- package/dist/stage.js.map +1 -0
- package/dist/vector2.d.ts +114 -0
- package/dist/vector2.d.ts.map +1 -0
- package/dist/vector2.js +168 -0
- package/dist/vector2.js.map +1 -0
- package/dist/vector3.d.ts +126 -0
- package/dist/vector3.d.ts.map +1 -0
- package/dist/vector3.js +190 -0
- package/dist/vector3.js.map +1 -0
- package/dist/vector4.d.ts +135 -0
- package/dist/vector4.d.ts.map +1 -0
- package/dist/vector4.js +209 -0
- package/dist/vector4.js.map +1 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js.map +1 -0
- package/package.json +1 -1
- package/dist/core/asset.d.ts +0 -71
- package/dist/core/asset.d.ts.map +0 -1
- package/dist/core/asset.js.map +0 -1
- package/dist/core/atlas.d.ts +0 -2
- package/dist/core/atlas.d.ts.map +0 -1
- package/dist/core/atlas.js +0 -2
- package/dist/core/atlas.js.map +0 -1
- package/dist/core/cache.d.ts.map +0 -1
- package/dist/core/cache.js.map +0 -1
- package/dist/core/event.d.ts.map +0 -1
- package/dist/core/event.js.map +0 -1
- package/dist/core/index.d.ts +0 -14
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/scene.d.ts.map +0 -1
- package/dist/core/scene.js.map +0 -1
- package/dist/core/sprite.d.ts.map +0 -1
- package/dist/core/sprite.js.map +0 -1
- package/dist/core/stage.d.ts +0 -130
- package/dist/core/stage.d.ts.map +0 -1
- package/dist/core/stage.js +0 -308
- package/dist/core/stage.js.map +0 -1
- package/dist/math/el.d.ts.map +0 -1
- package/dist/math/el.js.map +0 -1
- package/dist/math/matrix2.d.ts +0 -70
- package/dist/math/matrix2.d.ts.map +0 -1
- package/dist/math/matrix2.js +0 -180
- package/dist/math/matrix2.js.map +0 -1
- package/dist/math/matrix3.d.ts +0 -108
- package/dist/math/matrix3.d.ts.map +0 -1
- package/dist/math/matrix3.js +0 -257
- package/dist/math/matrix3.js.map +0 -1
- package/dist/math/matrix4.d.ts +0 -158
- package/dist/math/matrix4.d.ts.map +0 -1
- package/dist/math/matrix4.js +0 -354
- package/dist/math/matrix4.js.map +0 -1
- package/dist/math/vector2.d.ts +0 -38
- package/dist/math/vector2.d.ts.map +0 -1
- package/dist/math/vector2.js +0 -67
- package/dist/math/vector2.js.map +0 -1
- package/dist/math/vector3.d.ts +0 -34
- package/dist/math/vector3.d.ts.map +0 -1
- package/dist/math/vector3.js +0 -74
- package/dist/math/vector3.js.map +0 -1
- package/dist/math/vector4.d.ts +0 -39
- package/dist/math/vector4.d.ts.map +0 -1
- package/dist/math/vector4.js +0 -81
- package/dist/math/vector4.js.map +0 -1
- package/dist/util/types.d.ts +0 -2
- package/dist/util/types.d.ts.map +0 -1
- package/dist/util/types.js +0 -2
- package/dist/util/types.js.map +0 -1
- package/dist/util/version.d.ts.map +0 -1
- package/dist/util/version.js.map +0 -1
- /package/dist/{math/el.d.ts → el.d.ts} +0 -0
- /package/dist/{math/el.js → el.js} +0 -0
- /package/dist/{core/event.d.ts → event.d.ts} +0 -0
- /package/dist/{core/event.js → event.js} +0 -0
- /package/dist/{core/index.js → index.js} +0 -0
- /package/dist/{core/scene.js → scene.js} +0 -0
- /package/dist/{core/sprite.d.ts → sprite.d.ts} +0 -0
- /package/dist/{core/sprite.js → sprite.js} +0 -0
- /package/dist/{util/version.d.ts → version.d.ts} +0 -0
- /package/dist/{util/version.js → version.js} +0 -0
package/dist/matrix3.js
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { Vector3 } from "./vector3.js";
|
|
2
|
+
import { add, sub, mul, div, mod } from "./el.js";
|
|
3
|
+
export const Matrix3 = {
|
|
4
|
+
/** Constant index for the xx-component of a Matrix3 */
|
|
5
|
+
XX: 0,
|
|
6
|
+
/** Constant index for the xy-component of a Matrix3 */
|
|
7
|
+
XY: 1,
|
|
8
|
+
/** Constant index for the xz-component of a Matrix3 */
|
|
9
|
+
XZ: 2,
|
|
10
|
+
/** Constant index for the yx-component of a Matrix3 */
|
|
11
|
+
YX: 3,
|
|
12
|
+
/** Constant index for the yy-component of a Matrix3 */
|
|
13
|
+
YY: 4,
|
|
14
|
+
/** Constant index for the yz-component of a Matrix3 */
|
|
15
|
+
YZ: 5,
|
|
16
|
+
/** Constant index for the zx-component of a Matrix3 */
|
|
17
|
+
ZX: 6,
|
|
18
|
+
/** Constant index for the zy-component of a Matrix3 */
|
|
19
|
+
ZY: 7,
|
|
20
|
+
/** Constant index for the zz-component of a Matrix3 */
|
|
21
|
+
ZZ: 8,
|
|
22
|
+
/** A collection of getters for Matrix3 objects */
|
|
23
|
+
Get: {
|
|
24
|
+
/** Get the xx-component of a Matrix3 */
|
|
25
|
+
xx(a) { return a[Matrix3.XX]; },
|
|
26
|
+
/** Get the xy-component of a Matrix3 */
|
|
27
|
+
xy(a) { return a[Matrix3.XY]; },
|
|
28
|
+
/** Get the xz-component of a Matrix3 */
|
|
29
|
+
xz(a) { return a[Matrix3.XZ]; },
|
|
30
|
+
/** Get the yx-component of a Matrix3 */
|
|
31
|
+
yx(a) { return a[Matrix3.YX]; },
|
|
32
|
+
/** Get the yy-component of a Matrix3 */
|
|
33
|
+
yy(a) { return a[Matrix3.YY]; },
|
|
34
|
+
/** Get the yz-component of a Matrix3 */
|
|
35
|
+
yz(a) { return a[Matrix3.YZ]; },
|
|
36
|
+
/** Get the zx-component of a Matrix3 */
|
|
37
|
+
zx(a) { return a[Matrix3.ZX]; },
|
|
38
|
+
/** Get the zy-component of a Matrix3 */
|
|
39
|
+
zy(a) { return a[Matrix3.ZY]; },
|
|
40
|
+
/** Get the zz-component of a Matrix3 */
|
|
41
|
+
zz(a) { return a[Matrix3.ZZ]; },
|
|
42
|
+
/** Get the 0th row of a Matrix3 as a Vector3 */
|
|
43
|
+
r0(a) {
|
|
44
|
+
return [
|
|
45
|
+
a[Matrix3.XX],
|
|
46
|
+
a[Matrix3.XY],
|
|
47
|
+
a[Matrix3.XZ]
|
|
48
|
+
];
|
|
49
|
+
},
|
|
50
|
+
/** Get the 1st row of a Matrix3 as a Vector3 */
|
|
51
|
+
r1(a) {
|
|
52
|
+
return [
|
|
53
|
+
a[Matrix3.YX],
|
|
54
|
+
a[Matrix3.YY],
|
|
55
|
+
a[Matrix3.YZ]
|
|
56
|
+
];
|
|
57
|
+
},
|
|
58
|
+
/** Get the 2nd row of a Matrix3 as a Vector3 */
|
|
59
|
+
r2(a) {
|
|
60
|
+
return [
|
|
61
|
+
a[Matrix3.ZX],
|
|
62
|
+
a[Matrix3.ZY],
|
|
63
|
+
a[Matrix3.ZZ]
|
|
64
|
+
];
|
|
65
|
+
},
|
|
66
|
+
/** Get the i-th row of a Matrix3 as a Vector3 */
|
|
67
|
+
row(a, i) {
|
|
68
|
+
switch (i) {
|
|
69
|
+
case 0: return Matrix3.Get.r0(a);
|
|
70
|
+
case 1: return Matrix3.Get.r1(a);
|
|
71
|
+
case 2: return Matrix3.Get.r2(a);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
/** Get the 0th column of a Matrix3 as a Vector3 */
|
|
75
|
+
c0(a) {
|
|
76
|
+
return [
|
|
77
|
+
a[Matrix3.XX],
|
|
78
|
+
a[Matrix3.YX],
|
|
79
|
+
a[Matrix3.ZX]
|
|
80
|
+
];
|
|
81
|
+
},
|
|
82
|
+
/** Get the 1st column of a Matrix3 as a Vector3 */
|
|
83
|
+
c1(a) {
|
|
84
|
+
return [
|
|
85
|
+
a[Matrix3.XY],
|
|
86
|
+
a[Matrix3.YY],
|
|
87
|
+
a[Matrix3.ZY]
|
|
88
|
+
];
|
|
89
|
+
},
|
|
90
|
+
/** Get the 2nd column of a Matrix3 as a Vector3 */
|
|
91
|
+
c2(a) {
|
|
92
|
+
return [
|
|
93
|
+
a[Matrix3.XZ],
|
|
94
|
+
a[Matrix3.YZ],
|
|
95
|
+
a[Matrix3.ZZ]
|
|
96
|
+
];
|
|
97
|
+
},
|
|
98
|
+
/** Get the j-th column of a Matrix3 as a Vector3 */
|
|
99
|
+
col(a, j) {
|
|
100
|
+
switch (j) {
|
|
101
|
+
case 0: return Matrix3.Get.c0(a);
|
|
102
|
+
case 1: return Matrix3.Get.c1(a);
|
|
103
|
+
case 2: return Matrix3.Get.c2(a);
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
/** A collection of setters for Matrix3 objects */
|
|
108
|
+
Set: {
|
|
109
|
+
/** Set the xx-component of a Matrix3 */
|
|
110
|
+
xx(a, xx) { return a[Matrix3.XX] = xx; },
|
|
111
|
+
/** Set the xy-component of a Matrix3 */
|
|
112
|
+
xy(a, xy) { return a[Matrix3.XY] = xy; },
|
|
113
|
+
/** Set the xz-component of a Matrix3 */
|
|
114
|
+
xz(a, xz) { return a[Matrix3.XZ] = xz; },
|
|
115
|
+
/** Set the yx-component of a Matrix3 */
|
|
116
|
+
yx(a, yx) { return a[Matrix3.YX] = yx; },
|
|
117
|
+
/** Set the yy-component of a Matrix3 */
|
|
118
|
+
yy(a, yy) { return a[Matrix3.YY] = yy; },
|
|
119
|
+
/** Set the yz-component of a Matrix3 */
|
|
120
|
+
yz(a, yz) { return a[Matrix3.YZ] = yz; },
|
|
121
|
+
/** Set the zx-component of a Matrix3 */
|
|
122
|
+
zx(a, zx) { return a[Matrix3.ZX] = zx; },
|
|
123
|
+
/** Set the zy-component of a Matrix3 */
|
|
124
|
+
zy(a, zy) { return a[Matrix3.ZY] = zy; },
|
|
125
|
+
/** Set the zz-component of a Matrix3 */
|
|
126
|
+
zz(a, zz) { return a[Matrix3.ZZ] = zz; },
|
|
127
|
+
/** Set the 0th row of a Matrix3 */
|
|
128
|
+
r0(a, [xx, xy, xz]) {
|
|
129
|
+
a[Matrix3.XX] = xx;
|
|
130
|
+
a[Matrix3.XY] = xy;
|
|
131
|
+
a[Matrix3.XZ] = xz;
|
|
132
|
+
return [xx, xy, xz];
|
|
133
|
+
},
|
|
134
|
+
/** Set the 1st row of a Matrix3 */
|
|
135
|
+
r1(a, [yx, yy, yz]) {
|
|
136
|
+
a[Matrix3.YX] = yx;
|
|
137
|
+
a[Matrix3.YY] = yy;
|
|
138
|
+
a[Matrix3.YZ] = yz;
|
|
139
|
+
return [yx, yy, yz];
|
|
140
|
+
},
|
|
141
|
+
/** Set the 2nd row of a Matrix3 */
|
|
142
|
+
r2(a, [zx, zy, zz]) {
|
|
143
|
+
a[Matrix3.ZX] = zx;
|
|
144
|
+
a[Matrix3.ZY] = zy;
|
|
145
|
+
a[Matrix3.ZZ] = zz;
|
|
146
|
+
return [zx, zy, zz];
|
|
147
|
+
},
|
|
148
|
+
/** Set the i-th row of a Matrix3 */
|
|
149
|
+
row(a, i, ri) {
|
|
150
|
+
switch (i) {
|
|
151
|
+
case 0: return Matrix3.Set.r0(a, ri);
|
|
152
|
+
case 1: return Matrix3.Set.r1(a, ri);
|
|
153
|
+
case 2: return Matrix3.Set.r2(a, ri);
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
/** Set the 0th column of a Matrix3 */
|
|
157
|
+
c0(a, [xx, yx, zx]) {
|
|
158
|
+
a[Matrix3.XX] = xx;
|
|
159
|
+
a[Matrix3.YX] = yx;
|
|
160
|
+
a[Matrix3.ZX] = zx;
|
|
161
|
+
return [xx, yx, zx];
|
|
162
|
+
},
|
|
163
|
+
/** Set the 1st column of a Matrix3 */
|
|
164
|
+
c1(a, [xy, yy, zy]) {
|
|
165
|
+
a[Matrix3.XY] = xy;
|
|
166
|
+
a[Matrix3.YY] = yy;
|
|
167
|
+
a[Matrix3.ZY] = zy;
|
|
168
|
+
return [xy, yy, zy];
|
|
169
|
+
},
|
|
170
|
+
/** Set the 2nd column of a Matrix3 */
|
|
171
|
+
c2(a, [xz, yz, zz]) {
|
|
172
|
+
a[Matrix3.XZ] = xz;
|
|
173
|
+
a[Matrix3.YZ] = yz;
|
|
174
|
+
a[Matrix3.ZZ] = zz;
|
|
175
|
+
return [xz, yz, zz];
|
|
176
|
+
},
|
|
177
|
+
/** Set the j-th column of a Matrix3 */
|
|
178
|
+
col(a, j, cj) {
|
|
179
|
+
switch (j) {
|
|
180
|
+
case 0: return Matrix3.Set.c0(a, cj);
|
|
181
|
+
case 1: return Matrix3.Set.c1(a, cj);
|
|
182
|
+
case 2: return Matrix3.Set.c2(a, cj);
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
/** Construct an identity Matrix3 with an optional scale factor */
|
|
187
|
+
id(a = 1) {
|
|
188
|
+
return [
|
|
189
|
+
a, 0, 0,
|
|
190
|
+
0, a, 0,
|
|
191
|
+
0, 0, a
|
|
192
|
+
];
|
|
193
|
+
},
|
|
194
|
+
/**
|
|
195
|
+
* Construct a Matrix3 from a variadic array of numbers.
|
|
196
|
+
*
|
|
197
|
+
* Constructs a uniform Matrix3 when `a.length === 1`
|
|
198
|
+
* ```js
|
|
199
|
+
* Matrix3.new(1) // [1, 1, 1, 1, 1, 1, 1, 1, 1]
|
|
200
|
+
* ```
|
|
201
|
+
*
|
|
202
|
+
* Otherwise constructs a standard zero-padded row-major Matrix3
|
|
203
|
+
* ```js
|
|
204
|
+
* Matrix3.new( ) // [0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
205
|
+
* Matrix3.new(1, 2 ) // [1, 2, 0, 0, 0, 0, 0, 0, 0]
|
|
206
|
+
* Matrix3.new(1, 2, 3, 4) // [1, 2, 3, 4, 0, 0, 0, 0, 0]
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
new(...a) {
|
|
210
|
+
if (a.length === 1)
|
|
211
|
+
return [
|
|
212
|
+
a[Matrix3.XX], a[Matrix3.XX], a[Matrix3.XX],
|
|
213
|
+
a[Matrix3.XX], a[Matrix3.XX], a[Matrix3.XX],
|
|
214
|
+
a[Matrix3.XX], a[Matrix3.XX], a[Matrix3.XX]
|
|
215
|
+
];
|
|
216
|
+
else
|
|
217
|
+
return [
|
|
218
|
+
a[Matrix3.XX] ?? 0, a[Matrix3.XY] ?? 0, a[Matrix3.XZ] ?? 0,
|
|
219
|
+
a[Matrix3.YX] ?? 0, a[Matrix3.YY] ?? 0, a[Matrix3.YZ] ?? 0,
|
|
220
|
+
a[Matrix3.ZX] ?? 0, a[Matrix3.ZY] ?? 0, a[Matrix3.ZZ] ?? 0
|
|
221
|
+
];
|
|
222
|
+
},
|
|
223
|
+
/**
|
|
224
|
+
* Constructs a Matrix3 from a number or an array of numbers.
|
|
225
|
+
*
|
|
226
|
+
* Constructs a uniform Matrix3 when `a` is a number
|
|
227
|
+
* ```js
|
|
228
|
+
* Matrix3.from(1) // [1, 1, 1, 1, 1, 1, 1, 1, 1]
|
|
229
|
+
* ```
|
|
230
|
+
*
|
|
231
|
+
* Otherwise constructs a standard zero-padded Matrix3
|
|
232
|
+
* ```js
|
|
233
|
+
* Matrix3.from([ ]) // [0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
234
|
+
* Matrix3.from([1 ]) // [1, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
235
|
+
* Matrix3.from([1, 2 ]) // [1, 2, 0, 0, 0, 0, 0, 0, 0]
|
|
236
|
+
* Matrix3.from([1, 2, 3, 4]) // [1, 2, 3, 4, 0, 0, 0, 0, 0]
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
from(a) {
|
|
240
|
+
if (typeof a === "number")
|
|
241
|
+
return [
|
|
242
|
+
a, a, a,
|
|
243
|
+
a, a, a,
|
|
244
|
+
a, a, a
|
|
245
|
+
];
|
|
246
|
+
else
|
|
247
|
+
return [
|
|
248
|
+
a[Matrix3.XX] ?? 0, a[Matrix3.XY] ?? 0, a[Matrix3.XZ] ?? 0,
|
|
249
|
+
a[Matrix3.YX] ?? 0, a[Matrix3.YY] ?? 0, a[Matrix3.YZ] ?? 0,
|
|
250
|
+
a[Matrix3.ZX] ?? 0, a[Matrix3.ZY] ?? 0, a[Matrix3.ZZ] ?? 0
|
|
251
|
+
];
|
|
252
|
+
},
|
|
253
|
+
/**
|
|
254
|
+
* Perform an element-wise operation on two Matrix3 objects.
|
|
255
|
+
* Number-like arguments are promoted to uniform Matrix3 objects
|
|
256
|
+
* before performing the operation. Constructs a new Matrix3 when an
|
|
257
|
+
* output argument is not provided.
|
|
258
|
+
*/
|
|
259
|
+
el(op, a, b, out = Matrix3.new()) {
|
|
260
|
+
const [xxa, xya, xza, yxa, yya, yza, zxa, zya, zza] = Matrix3.from(a);
|
|
261
|
+
const [xxb, xyb, xzb, yxb, yyb, yzb, zxb, zyb, zzb] = Matrix3.from(b);
|
|
262
|
+
Matrix3.Set.xx(out, op(xxa, xxb));
|
|
263
|
+
Matrix3.Set.xy(out, op(xya, xyb));
|
|
264
|
+
Matrix3.Set.xz(out, op(xza, xzb));
|
|
265
|
+
Matrix3.Set.yx(out, op(yxa, yxb));
|
|
266
|
+
Matrix3.Set.yy(out, op(yya, yyb));
|
|
267
|
+
Matrix3.Set.yz(out, op(yza, yzb));
|
|
268
|
+
Matrix3.Set.zx(out, op(zxa, zxb));
|
|
269
|
+
Matrix3.Set.zy(out, op(zya, zyb));
|
|
270
|
+
Matrix3.Set.zz(out, op(zza, zzb));
|
|
271
|
+
return out;
|
|
272
|
+
},
|
|
273
|
+
/**
|
|
274
|
+
* Compute the sum of two Matrix3 objects. Number-like arguments are
|
|
275
|
+
* promoted to uniform Matrix3 objects before performing the operation.
|
|
276
|
+
* Constructs a new Matrix3 when an output argument is not provided.
|
|
277
|
+
*/
|
|
278
|
+
add(a, b, out = Matrix3.new()) {
|
|
279
|
+
return Matrix3.el(add, a, b, out);
|
|
280
|
+
},
|
|
281
|
+
/**
|
|
282
|
+
* Compute the difference of two Matrix3 objects. Number-like arguments
|
|
283
|
+
* are promoted to uniform Matrix3 objects before performing the
|
|
284
|
+
* operation. Constructs a new Matrix3 when an output argument is not
|
|
285
|
+
* provided.
|
|
286
|
+
*/
|
|
287
|
+
sub(a, b, out = Matrix3.new()) {
|
|
288
|
+
return Matrix3.el(sub, a, b, out);
|
|
289
|
+
},
|
|
290
|
+
/**
|
|
291
|
+
* Compute the hadamard (element-wise) product of two Matrix3 objects.
|
|
292
|
+
* Number-like arguments are promoted to uniform Matrix3 objects before
|
|
293
|
+
* performing the operation. Constructs a new Matrix3 when an output
|
|
294
|
+
* argument is not provided.
|
|
295
|
+
*/
|
|
296
|
+
hmul(a, b, out = Matrix3.new()) {
|
|
297
|
+
return Matrix3.el(mul, a, b, out);
|
|
298
|
+
},
|
|
299
|
+
/**
|
|
300
|
+
* Compute the hadamard (element-wise) quotient of two Matrix3 objects.
|
|
301
|
+
* Number-like arguments are promoted to uniform Matrix3 objects before
|
|
302
|
+
* performing the operation. Constructs a new Matrix3 when an output
|
|
303
|
+
* argument is not provided.
|
|
304
|
+
*/
|
|
305
|
+
hdiv(a, b, out = Matrix3.new()) {
|
|
306
|
+
return Matrix3.el(div, a, b, out);
|
|
307
|
+
},
|
|
308
|
+
/**
|
|
309
|
+
* Compute the hadamard (element-wise) remainder of two Matrix3 objects.
|
|
310
|
+
* Number-like arguments are promoted to uniform Matrix3 objects before
|
|
311
|
+
* performing the operation. Constructs a new Matrix3 when an output
|
|
312
|
+
* argument is not provided.
|
|
313
|
+
*/
|
|
314
|
+
hmod(a, b, out = Matrix3.new()) {
|
|
315
|
+
return Matrix3.el(mod, a, b, out);
|
|
316
|
+
},
|
|
317
|
+
/**
|
|
318
|
+
* Compute the standard product of two Matrix3 objects. Number-like arguments are
|
|
319
|
+
* promoted to uniform Matrix3 objects before performing the operation.
|
|
320
|
+
* Constructs a new Matrix3 when an output argument is not provided.
|
|
321
|
+
*/
|
|
322
|
+
mul(a, b, out = Matrix3.new()) {
|
|
323
|
+
const A = Matrix3.from(a);
|
|
324
|
+
const B = Matrix3.from(b);
|
|
325
|
+
const r0 = Matrix3.Get.r0(A);
|
|
326
|
+
const r1 = Matrix3.Get.r1(A);
|
|
327
|
+
const r2 = Matrix3.Get.r2(A);
|
|
328
|
+
const c0 = Matrix3.Get.c0(B);
|
|
329
|
+
const c1 = Matrix3.Get.c1(B);
|
|
330
|
+
const c2 = Matrix3.Get.c2(B);
|
|
331
|
+
Matrix3.Set.xx(out, Vector3.dot(r0, c0));
|
|
332
|
+
Matrix3.Set.xy(out, Vector3.dot(r0, c1));
|
|
333
|
+
Matrix3.Set.xz(out, Vector3.dot(r0, c2));
|
|
334
|
+
Matrix3.Set.yx(out, Vector3.dot(r1, c0));
|
|
335
|
+
Matrix3.Set.yy(out, Vector3.dot(r1, c1));
|
|
336
|
+
Matrix3.Set.yz(out, Vector3.dot(r1, c2));
|
|
337
|
+
Matrix3.Set.zx(out, Vector3.dot(r2, c0));
|
|
338
|
+
Matrix3.Set.zy(out, Vector3.dot(r2, c1));
|
|
339
|
+
Matrix3.Set.zz(out, Vector3.dot(r2, c2));
|
|
340
|
+
return out;
|
|
341
|
+
},
|
|
342
|
+
/**
|
|
343
|
+
* Convert a Matrix3 into its string representation.
|
|
344
|
+
* ```js
|
|
345
|
+
* Matrix3.toString([1, 2, 3, 4, 5, 6, 7, 8, 9]) // "mat3<1, 2, 3, 4, 5, 6, 7, 8, 9>"
|
|
346
|
+
* ```
|
|
347
|
+
*/
|
|
348
|
+
toString([xx, xy, xz, yx, yy, yz, zx, zy, zz]) {
|
|
349
|
+
return `mat3<${xx}, ${xy}, ${xz}, ${yx}, ${yy}, ${yz}, ${zx}, ${zy}, ${zz}>`;
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
//# sourceMappingURL=matrix3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrix3.js","sourceRoot":"","sources":["../src/matrix3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAUlD,MAAM,CAAC,MAAM,OAAO,GAAG;IAErB,uDAAuD;IACvD,EAAE,EAAE,CAAU;IACd,uDAAuD;IACvD,EAAE,EAAE,CAAU;IACd,uDAAuD;IACvD,EAAE,EAAE,CAAU;IACd,uDAAuD;IACvD,EAAE,EAAE,CAAU;IACd,uDAAuD;IACvD,EAAE,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CAAA"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { Vector4 } from "./vector4.js";
|
|
2
|
+
export type Matrix4 = [
|
|
3
|
+
number,
|
|
4
|
+
number,
|
|
5
|
+
number,
|
|
6
|
+
number,
|
|
7
|
+
number,
|
|
8
|
+
number,
|
|
9
|
+
number,
|
|
10
|
+
number,
|
|
11
|
+
number,
|
|
12
|
+
number,
|
|
13
|
+
number,
|
|
14
|
+
number,
|
|
15
|
+
number,
|
|
16
|
+
number,
|
|
17
|
+
number,
|
|
18
|
+
number
|
|
19
|
+
];
|
|
20
|
+
export declare const Matrix4: {
|
|
21
|
+
/** Constant index for the xx-component of a Matrix4 */
|
|
22
|
+
XX: 0;
|
|
23
|
+
/** Constant index for the xy-component of a Matrix4 */
|
|
24
|
+
XY: 1;
|
|
25
|
+
/** Constant index for the xz-component of a Matrix4 */
|
|
26
|
+
XZ: 2;
|
|
27
|
+
/** Constant index for the xw-component of a Matrix4 */
|
|
28
|
+
XW: 3;
|
|
29
|
+
/** Constant index for the yx-component of a Matrix4 */
|
|
30
|
+
YX: 4;
|
|
31
|
+
/** Constant index for the yy-component of a Matrix4 */
|
|
32
|
+
YY: 5;
|
|
33
|
+
/** Constant index for the yz-component of a Matrix4 */
|
|
34
|
+
YZ: 6;
|
|
35
|
+
/** Constant index for the yw-component of a Matrix4 */
|
|
36
|
+
YW: 7;
|
|
37
|
+
/** Constant index for the zx-component of a Matrix4 */
|
|
38
|
+
ZX: 8;
|
|
39
|
+
/** Constant index for the zy-component of a Matrix4 */
|
|
40
|
+
ZY: 9;
|
|
41
|
+
/** Constant index for the zz-component of a Matrix4 */
|
|
42
|
+
ZZ: 10;
|
|
43
|
+
/** Constant index for the zw-component of a Matrix4 */
|
|
44
|
+
ZW: 11;
|
|
45
|
+
/** Constant index for the wx-component of a Matrix4 */
|
|
46
|
+
WX: 12;
|
|
47
|
+
/** Constant index for the wy-component of a Matrix4 */
|
|
48
|
+
WY: 13;
|
|
49
|
+
/** Constant index for the wz-component of a Matrix4 */
|
|
50
|
+
WZ: 14;
|
|
51
|
+
/** Constant index for the ww-component of a Matrix4 */
|
|
52
|
+
WW: 15;
|
|
53
|
+
/** A collection of getters for Matrix4 objects */
|
|
54
|
+
Get: {
|
|
55
|
+
/** Get the xx-component of a Matrix4 */
|
|
56
|
+
xx(a: Matrix4): number;
|
|
57
|
+
/** Get the xy-component of a Matrix4 */
|
|
58
|
+
xy(a: Matrix4): number;
|
|
59
|
+
/** Get the xz-component of a Matrix4 */
|
|
60
|
+
xz(a: Matrix4): number;
|
|
61
|
+
/** Get the xw-component of a Matrix4 */
|
|
62
|
+
xw(a: Matrix4): number;
|
|
63
|
+
/** Get the yx-component of a Matrix4 */
|
|
64
|
+
yx(a: Matrix4): number;
|
|
65
|
+
/** Get the yy-component of a Matrix4 */
|
|
66
|
+
yy(a: Matrix4): number;
|
|
67
|
+
/** Get the yz-component of a Matrix4 */
|
|
68
|
+
yz(a: Matrix4): number;
|
|
69
|
+
/** Get the yw-component of a Matrix4 */
|
|
70
|
+
yw(a: Matrix4): number;
|
|
71
|
+
/** Get the zx-component of a Matrix4 */
|
|
72
|
+
zx(a: Matrix4): number;
|
|
73
|
+
/** Get the zy-component of a Matrix4 */
|
|
74
|
+
zy(a: Matrix4): number;
|
|
75
|
+
/** Get the zz-component of a Matrix4 */
|
|
76
|
+
zz(a: Matrix4): number;
|
|
77
|
+
/** Get the zw-component of a Matrix4 */
|
|
78
|
+
zw(a: Matrix4): number;
|
|
79
|
+
/** Get the wx-component of a Matrix4 */
|
|
80
|
+
wx(a: Matrix4): number;
|
|
81
|
+
/** Get the wy-component of a Matrix4 */
|
|
82
|
+
wy(a: Matrix4): number;
|
|
83
|
+
/** Get the wz-component of a Matrix4 */
|
|
84
|
+
wz(a: Matrix4): number;
|
|
85
|
+
/** Get the ww-component of a Matrix4 */
|
|
86
|
+
ww(a: Matrix4): number;
|
|
87
|
+
/** Get the 0th row of a Matrix4 as a Vector4 */
|
|
88
|
+
r0(a: Matrix4): [number, number, number, number];
|
|
89
|
+
/** Get the 1st row of a Matrix4 as a Vector4 */
|
|
90
|
+
r1(a: Matrix4): [number, number, number, number];
|
|
91
|
+
/** Get the 2nd row of a Matrix4 as a Vector4 */
|
|
92
|
+
r2(a: Matrix4): [number, number, number, number];
|
|
93
|
+
/** Get the 3rd row of a Matrix4 as a Vector4 */
|
|
94
|
+
r3(a: Matrix4): [number, number, number, number];
|
|
95
|
+
/** Get the i-th row of a Matrix4 as a Vector4 */
|
|
96
|
+
row(a: Matrix4, i: 0 | 1 | 2 | 3): [number, number, number, number];
|
|
97
|
+
/** Get the 0th column of a Matrix4 as a Vector4 */
|
|
98
|
+
c0(a: Matrix4): [number, number, number, number];
|
|
99
|
+
/** Get the 1st column of a Matrix4 as a Vector4 */
|
|
100
|
+
c1(a: Matrix4): [number, number, number, number];
|
|
101
|
+
/** Get the 2nd column of a Matrix4 as a Vector4 */
|
|
102
|
+
c2(a: Matrix4): [number, number, number, number];
|
|
103
|
+
/** Get the 3rd column of a Matrix4 as a Vector4 */
|
|
104
|
+
c3(a: Matrix4): [number, number, number, number];
|
|
105
|
+
/** Get the j-th column of a Matrix4 as a Vector4 */
|
|
106
|
+
col(a: Matrix4, j: 0 | 1 | 2 | 3): [number, number, number, number];
|
|
107
|
+
};
|
|
108
|
+
/** A collection of setters for Matrix4 objects */
|
|
109
|
+
Set: {
|
|
110
|
+
/** Set the xx-component of a Matrix4 */
|
|
111
|
+
xx(a: Matrix4, xx: number): number;
|
|
112
|
+
/** Set the xy-component of a Matrix4 */
|
|
113
|
+
xy(a: Matrix4, xy: number): number;
|
|
114
|
+
/** Set the xz-component of a Matrix4 */
|
|
115
|
+
xz(a: Matrix4, xz: number): number;
|
|
116
|
+
/** Set the xw-component of a Matrix4 */
|
|
117
|
+
xw(a: Matrix4, xw: number): number;
|
|
118
|
+
/** Set the yx-component of a Matrix4 */
|
|
119
|
+
yx(a: Matrix4, yx: number): number;
|
|
120
|
+
/** Set the yy-component of a Matrix4 */
|
|
121
|
+
yy(a: Matrix4, yy: number): number;
|
|
122
|
+
/** Set the yz-component of a Matrix4 */
|
|
123
|
+
yz(a: Matrix4, yz: number): number;
|
|
124
|
+
/** Set the yw-component of a Matrix4 */
|
|
125
|
+
yw(a: Matrix4, yw: number): number;
|
|
126
|
+
/** Set the zx-component of a Matrix4 */
|
|
127
|
+
zx(a: Matrix4, zx: number): number;
|
|
128
|
+
/** Set the zy-component of a Matrix4 */
|
|
129
|
+
zy(a: Matrix4, zy: number): number;
|
|
130
|
+
/** Set the zz-component of a Matrix4 */
|
|
131
|
+
zz(a: Matrix4, zz: number): number;
|
|
132
|
+
/** Set the zw-component of a Matrix4 */
|
|
133
|
+
zw(a: Matrix4, zw: number): number;
|
|
134
|
+
/** Set the wx-component of a Matrix4 */
|
|
135
|
+
wx(a: Matrix4, wx: number): number;
|
|
136
|
+
/** Set the wy-component of a Matrix4 */
|
|
137
|
+
wy(a: Matrix4, wy: number): number;
|
|
138
|
+
/** Set the wz-component of a Matrix4 */
|
|
139
|
+
wz(a: Matrix4, wz: number): number;
|
|
140
|
+
/** Set the ww-component of a Matrix4 */
|
|
141
|
+
ww(a: Matrix4, ww: number): number;
|
|
142
|
+
/** Set the 0th row of a Matrix4 */
|
|
143
|
+
r0(a: Matrix4, [xx, xy, xz, xw]: Vector4): [number, number, number, number];
|
|
144
|
+
/** Set the 1st row of a Matrix4 */
|
|
145
|
+
r1(a: Matrix4, [yx, yy, yz, yw]: Vector4): [number, number, number, number];
|
|
146
|
+
/** Set the 2nd row of a Matrix4 */
|
|
147
|
+
r2(a: Matrix4, [zx, zy, zz, zw]: Vector4): [number, number, number, number];
|
|
148
|
+
/** Set the 3rd row of a Matrix4 */
|
|
149
|
+
r3(a: Matrix4, [wx, wy, wz, ww]: Vector4): [number, number, number, number];
|
|
150
|
+
/** Set the i-th row of a Matrix4 */
|
|
151
|
+
row(a: Matrix4, i: 0 | 1 | 2 | 3, ri: Vector4): [number, number, number, number];
|
|
152
|
+
/** Set the 0th column of a Matrix4 */
|
|
153
|
+
c0(a: Matrix4, [xx, yx, zx, wx]: Vector4): [number, number, number, number];
|
|
154
|
+
/** Set the 1st column of a Matrix4 */
|
|
155
|
+
c1(a: Matrix4, [xy, yy, zy, wy]: Vector4): [number, number, number, number];
|
|
156
|
+
/** Set the 2nd column of a Matrix4 */
|
|
157
|
+
c2(a: Matrix4, [xz, yz, zz, wz]: Vector4): [number, number, number, number];
|
|
158
|
+
/** Set the 3rd column of a Matrix4 */
|
|
159
|
+
c3(a: Matrix4, [xw, yw, zw, ww]: Vector4): [number, number, number, number];
|
|
160
|
+
/** Set the j-th column of a Matrix4 */
|
|
161
|
+
col(a: Matrix4, j: 0 | 1 | 2 | 3, cj: Vector4): [number, number, number, number];
|
|
162
|
+
};
|
|
163
|
+
/** Construct an identity Matrix4 with an optional scale factor */
|
|
164
|
+
id(a?: number): [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number];
|
|
165
|
+
/**
|
|
166
|
+
* Construct a Matrix4 from a variadic array of numbers.
|
|
167
|
+
*
|
|
168
|
+
* Constructs a uniform Matrix4 when `a.length === 1`
|
|
169
|
+
* ```js
|
|
170
|
+
* Matrix4.new(1) // [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* Otherwise constructs a standard zero-padded row-major Matrix4
|
|
174
|
+
* ```js
|
|
175
|
+
* Matrix4.new( ) // [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
176
|
+
* Matrix4.new(1, 2 ) // [1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
177
|
+
* Matrix4.new(1, 2, 3, 4) // [1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
"new"(...a: Array<number>): [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number];
|
|
181
|
+
/**
|
|
182
|
+
* Constructs a Matrix4 from a number or an array of numbers.
|
|
183
|
+
*
|
|
184
|
+
* Constructs a uniform Matrix4 when `a` is a number
|
|
185
|
+
* ```js
|
|
186
|
+
* Matrix4.from(1) // [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
|
|
187
|
+
* ```
|
|
188
|
+
*
|
|
189
|
+
* Otherwise constructs a standard zero-padded Matrix4
|
|
190
|
+
* ```js
|
|
191
|
+
* Matrix4.from([ ]) // [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
192
|
+
* Matrix4.from([1 ]) // [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
193
|
+
* Matrix4.from([1, 2 ]) // [1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
194
|
+
* Matrix4.from([1, 2, 3, 4]) // [1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
from(a: number | Array<number>): [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number];
|
|
198
|
+
/**
|
|
199
|
+
* Perform an element-wise operation on two Matrix4 objects.
|
|
200
|
+
* Number-like arguments are promoted to uniform Matrix4 objects
|
|
201
|
+
* before performing the operation. Constructs a new Matrix4 when an
|
|
202
|
+
* output argument is not provided.
|
|
203
|
+
*/
|
|
204
|
+
el(op: (a: number, b: number) => number, a: number | Matrix4, b: number | Matrix4, out?: Matrix4): Matrix4;
|
|
205
|
+
/**
|
|
206
|
+
* Compute the sum of two Matrix4 objects. Number-like arguments are
|
|
207
|
+
* promoted to uniform Matrix4 objects before performing the operation.
|
|
208
|
+
* Constructs a new Matrix4 when an output argument is not provided.
|
|
209
|
+
*/
|
|
210
|
+
add(a: number | Matrix4, b: number | Matrix4, out?: Matrix4): Matrix4;
|
|
211
|
+
/**
|
|
212
|
+
* Compute the difference of two Matrix4 objects. Number-like arguments
|
|
213
|
+
* are promoted to uniform Matrix4 objects before performing the
|
|
214
|
+
* operation. Constructs a new Matrix4 when an output argument is not
|
|
215
|
+
* provided.
|
|
216
|
+
*/
|
|
217
|
+
sub(a: number | Matrix4, b: number | Matrix4, out?: Matrix4): Matrix4;
|
|
218
|
+
/**
|
|
219
|
+
* Compute the hadamard (element-wise) product of two Matrix4 objects.
|
|
220
|
+
* Number-like arguments are promoted to uniform Matrix4 objects before
|
|
221
|
+
* performing the operation. Constructs a new Matrix4 when an output
|
|
222
|
+
* argument is not provided.
|
|
223
|
+
*/
|
|
224
|
+
hmul(a: number | Matrix4, b: number | Matrix4, out?: Matrix4): Matrix4;
|
|
225
|
+
/**
|
|
226
|
+
* Compute the hadamard (element-wise) quotient of two Matrix4 objects.
|
|
227
|
+
* Number-like arguments are promoted to uniform Matrix4 objects before
|
|
228
|
+
* performing the operation. Constructs a new Matrix4 when an output
|
|
229
|
+
* argument is not provided.
|
|
230
|
+
*/
|
|
231
|
+
hdiv(a: number | Matrix4, b: number | Matrix4, out?: Matrix4): Matrix4;
|
|
232
|
+
/**
|
|
233
|
+
* Compute the hadamard (element-wise) remainder of two Matrix4 objects.
|
|
234
|
+
* Number-like arguments are promoted to uniform Matrix4 objects before
|
|
235
|
+
* performing the operation. Constructs a new Matrix4 when an output
|
|
236
|
+
* argument is not provided.
|
|
237
|
+
*/
|
|
238
|
+
hmod(a: number | Matrix4, b: number | Matrix4, out?: Matrix4): Matrix4;
|
|
239
|
+
/**
|
|
240
|
+
* Compute the standard product of two Matrix4 objects. Number-like arguments are
|
|
241
|
+
* promoted to uniform Matrix4 objects before performing the operation.
|
|
242
|
+
* Constructs a new Matrix4 when an output argument is not provided.
|
|
243
|
+
*/
|
|
244
|
+
mul(a: number | Matrix4, b: number | Matrix4, out?: Matrix4): Matrix4;
|
|
245
|
+
/**
|
|
246
|
+
* Convert a Matrix4 into its string representation.
|
|
247
|
+
* ```js
|
|
248
|
+
* Matrix4.toString([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]) // "mat4<1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16>"
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
toString([xx, xy, xz, xw, yx, yy, yz, yw, zx, zy, zz, zw, wx, wy, wz, ww]: Matrix4): `mat4<${number}, ${number}, ${number}, ${number}, ${number}, ${number}, ${number}, ${number}, ${number}, ${number}, ${number}, ${number}, ${number}, ${number}, ${number}, ${number}>`;
|
|
252
|
+
};
|
|
253
|
+
//# sourceMappingURL=matrix4.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrix4.d.ts","sourceRoot":"","sources":["../src/matrix4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM;IAAE,MAAM;IAAE,MAAM;IAAE,MAAM;IAC9B,MAAM;IAAE,MAAM;IAAE,MAAM;IAAE,MAAM;IAC9B,MAAM;IAAE,MAAM;IAAE,MAAM;IAAE,MAAM;IAC9B,MAAM;IAAE,MAAM;IAAE,MAAM;IAAE,MAAM;CAC/B,CAAA;AAED,eAAO,MAAM,OAAO;IAClB,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAGvD,kDAAkD;;QAEhD,wCAAwC;cAClC,OAAO;QACb,wCAA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