@fi4f/hg 0.0.11 → 0.0.12
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/matrix2.js
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { Vector2 } from "./vector2.js";
|
|
2
|
+
import { add, sub, mul, div, mod } from "./el.js";
|
|
3
|
+
export const Matrix2 = {
|
|
4
|
+
/** Constant index for the xx-component of a Matrix2 */
|
|
5
|
+
XX: 0,
|
|
6
|
+
/** Constant index for the xy-component of a Matrix2 */
|
|
7
|
+
XY: 1,
|
|
8
|
+
/** Constant index for the yx-component of a Matrix2 */
|
|
9
|
+
YX: 2,
|
|
10
|
+
/** Constant index for the yy-component of a Matrix2 */
|
|
11
|
+
YY: 3,
|
|
12
|
+
/** A collection of getters for Matrix2 objects */
|
|
13
|
+
Get: {
|
|
14
|
+
/** Get the xx-component of a Matrix2 */
|
|
15
|
+
xx(a) { return a[Matrix2.XX]; },
|
|
16
|
+
/** Get the xy-component of a Matrix2 */
|
|
17
|
+
xy(a) { return a[Matrix2.XY]; },
|
|
18
|
+
/** Get the yx-component of a Matrix2 */
|
|
19
|
+
yx(a) { return a[Matrix2.YX]; },
|
|
20
|
+
/** Get the yy-component of a Matrix2 */
|
|
21
|
+
yy(a) { return a[Matrix2.YY]; },
|
|
22
|
+
/** Get the 0th row of a Matrix2 as a Vector2 */
|
|
23
|
+
r0(a) {
|
|
24
|
+
return [
|
|
25
|
+
a[Matrix2.XX],
|
|
26
|
+
a[Matrix2.XY]
|
|
27
|
+
];
|
|
28
|
+
},
|
|
29
|
+
/** Get the 1st row of a Matrix2 as a Vector2 */
|
|
30
|
+
r1(a) {
|
|
31
|
+
return [
|
|
32
|
+
a[Matrix2.YX],
|
|
33
|
+
a[Matrix2.YY]
|
|
34
|
+
];
|
|
35
|
+
},
|
|
36
|
+
/** Get the i-th row of a Matrix2 as a Vector2 */
|
|
37
|
+
row(a, i) {
|
|
38
|
+
switch (i) {
|
|
39
|
+
case 0: return Matrix2.Get.r0(a);
|
|
40
|
+
case 1: return Matrix2.Get.r1(a);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
/** Get the 0th column of a Matrix2 as a Vector2 */
|
|
44
|
+
c0(a) {
|
|
45
|
+
return [
|
|
46
|
+
a[Matrix2.XX],
|
|
47
|
+
a[Matrix2.YX]
|
|
48
|
+
];
|
|
49
|
+
},
|
|
50
|
+
/** Get the 1st column of a Matrix2 as a Vector2 */
|
|
51
|
+
c1(a) {
|
|
52
|
+
return [
|
|
53
|
+
a[Matrix2.XY],
|
|
54
|
+
a[Matrix2.YY]
|
|
55
|
+
];
|
|
56
|
+
},
|
|
57
|
+
/** Get the j-th column of a Matrix2 as a Vector2 */
|
|
58
|
+
col(a, j) {
|
|
59
|
+
switch (j) {
|
|
60
|
+
case 0: return Matrix2.Get.c0(a);
|
|
61
|
+
case 1: return Matrix2.Get.c1(a);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
/** A collection of setters for Matrix2 objects */
|
|
66
|
+
Set: {
|
|
67
|
+
/** Set the xx-component of a Matrix2 */
|
|
68
|
+
xx(a, xx) { return a[Matrix2.XX] = xx; },
|
|
69
|
+
/** Set the xy-component of a Matrix2 */
|
|
70
|
+
xy(a, xy) { return a[Matrix2.XY] = xy; },
|
|
71
|
+
/** Set the yx-component of a Matrix2 */
|
|
72
|
+
yx(a, yx) { return a[Matrix2.YX] = yx; },
|
|
73
|
+
/** Set the yy-component of a Matrix2 */
|
|
74
|
+
yy(a, yy) { return a[Matrix2.YY] = yy; },
|
|
75
|
+
/** Set the 0th row of a Matrix2 */
|
|
76
|
+
r0(a, [xx, xy]) {
|
|
77
|
+
a[Matrix2.XX] = xx;
|
|
78
|
+
a[Matrix2.XY] = xy;
|
|
79
|
+
return [xx, xy];
|
|
80
|
+
},
|
|
81
|
+
/** Set the 1st row of a Matrix2 */
|
|
82
|
+
r1(a, [yx, yy]) {
|
|
83
|
+
a[Matrix2.YX] = yx;
|
|
84
|
+
a[Matrix2.YY] = yy;
|
|
85
|
+
return [yx, yy];
|
|
86
|
+
},
|
|
87
|
+
/** Set the i-th row of a Matrix2 */
|
|
88
|
+
row(a, i, ri) {
|
|
89
|
+
switch (i) {
|
|
90
|
+
case 0: return Matrix2.Set.r0(a, ri);
|
|
91
|
+
case 1: return Matrix2.Set.r1(a, ri);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
/** Set the 0th column of a Matrix2 */
|
|
95
|
+
c0(a, [xx, yx]) {
|
|
96
|
+
a[Matrix2.XX] = xx;
|
|
97
|
+
a[Matrix2.YX] = yx;
|
|
98
|
+
return [xx, yx];
|
|
99
|
+
},
|
|
100
|
+
/** Set the 1st column of a Matrix2 */
|
|
101
|
+
c1(a, [xy, yy]) {
|
|
102
|
+
a[Matrix2.XY] = xy;
|
|
103
|
+
a[Matrix2.YY] = yy;
|
|
104
|
+
return [xy, yy];
|
|
105
|
+
},
|
|
106
|
+
/** Set the j-th column of a Matrix2 */
|
|
107
|
+
col(a, j, cj) {
|
|
108
|
+
switch (j) {
|
|
109
|
+
case 0: return Matrix2.Set.c0(a, cj);
|
|
110
|
+
case 1: return Matrix2.Set.c1(a, cj);
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
/** Construct an identity Matrix2 with an optional scale factor */
|
|
115
|
+
id(a = 1) {
|
|
116
|
+
return [
|
|
117
|
+
a, 0,
|
|
118
|
+
0, a
|
|
119
|
+
];
|
|
120
|
+
},
|
|
121
|
+
/**
|
|
122
|
+
* Construct a Matrix2 from a variadic array of numbers.
|
|
123
|
+
*
|
|
124
|
+
* Constructs a uniform Matrix2 when `a.length === 1`
|
|
125
|
+
* ```js
|
|
126
|
+
* Matrix2.new(1) // [1, 1, 1, 1]
|
|
127
|
+
* ```
|
|
128
|
+
*
|
|
129
|
+
* Otherwise constructs a standard zero-padded row-major Matrix2
|
|
130
|
+
* ```js
|
|
131
|
+
* Matrix2.new( ) // [0, 0, 0, 0]
|
|
132
|
+
* Matrix2.new(1, 2 ) // [1, 2, 0, 0]
|
|
133
|
+
* Matrix2.new(1, 2, 3, 4) // [1, 2, 3, 4]
|
|
134
|
+
*/
|
|
135
|
+
new(...a) {
|
|
136
|
+
if (a.length === 1)
|
|
137
|
+
return [
|
|
138
|
+
a[Matrix2.XX], a[Matrix2.XX],
|
|
139
|
+
a[Matrix2.XX], a[Matrix2.XX]
|
|
140
|
+
];
|
|
141
|
+
else
|
|
142
|
+
return [
|
|
143
|
+
a[Matrix2.XX] ?? 0, a[Matrix2.XY] ?? 0,
|
|
144
|
+
a[Matrix2.YX] ?? 0, a[Matrix2.YY] ?? 0
|
|
145
|
+
];
|
|
146
|
+
},
|
|
147
|
+
/**
|
|
148
|
+
* Constructs a Matrix2 from a number or an array of numbers.
|
|
149
|
+
*
|
|
150
|
+
* Constructs a uniform Matrix2 when `a` is a number
|
|
151
|
+
* ```js
|
|
152
|
+
* Matrix2.from(1) // [1, 1, 1, 1]
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
155
|
+
* Otherwise constructs a standard zero-padded Matrix2
|
|
156
|
+
* ```js
|
|
157
|
+
* Matrix2.from([ ]) // [0, 0, 0, 0]
|
|
158
|
+
* Matrix2.from([1 ]) // [1, 0, 0, 0]
|
|
159
|
+
* Matrix2.from([1, 2 ]) // [1, 2, 0, 0]
|
|
160
|
+
* Matrix2.from([1, 2, 3, 4]) // [1, 2, 3, 4]
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
from(a) {
|
|
164
|
+
if (typeof a === "number")
|
|
165
|
+
return [
|
|
166
|
+
a, a,
|
|
167
|
+
a, a
|
|
168
|
+
];
|
|
169
|
+
else
|
|
170
|
+
return [
|
|
171
|
+
a[Matrix2.XX] ?? 0, a[Matrix2.XY] ?? 0,
|
|
172
|
+
a[Matrix2.YX] ?? 0, a[Matrix2.YY] ?? 0
|
|
173
|
+
];
|
|
174
|
+
},
|
|
175
|
+
/**
|
|
176
|
+
* Perform an element-wise operation on two Matrix2 objects.
|
|
177
|
+
* Number-like arguments are promoted to uniform Matrix2 objects
|
|
178
|
+
* before performing the operation. Constructs a new Matrix2 when an
|
|
179
|
+
* output argument is not provided.
|
|
180
|
+
*/
|
|
181
|
+
el(op, a, b, out = Matrix2.new()) {
|
|
182
|
+
const [xxa, xya, yxa, yya] = Matrix2.from(a);
|
|
183
|
+
const [xxb, xyb, yxb, yyb] = Matrix2.from(b);
|
|
184
|
+
Matrix2.Set.xx(out, op(xxa, xxb));
|
|
185
|
+
Matrix2.Set.xy(out, op(xya, xyb));
|
|
186
|
+
Matrix2.Set.yx(out, op(yxa, yxb));
|
|
187
|
+
Matrix2.Set.yy(out, op(yya, yyb));
|
|
188
|
+
return out;
|
|
189
|
+
},
|
|
190
|
+
/**
|
|
191
|
+
* Compute the sum of two Matrix2 objects. Number-like arguments are
|
|
192
|
+
* promoted to uniform Matrix2 objects before performing the operation.
|
|
193
|
+
* Constructs a new Matrix2 when an output argument is not provided.
|
|
194
|
+
*/
|
|
195
|
+
add(a, b, out = Matrix2.new()) {
|
|
196
|
+
return Matrix2.el(add, a, b, out);
|
|
197
|
+
},
|
|
198
|
+
/**
|
|
199
|
+
* Compute the difference of two Matrix2 objects. Number-like arguments
|
|
200
|
+
* are promoted to uniform Matrix2 objects before performing the
|
|
201
|
+
* operation. Constructs a new Matrix2 when an output argument is not
|
|
202
|
+
* provided.
|
|
203
|
+
*/
|
|
204
|
+
sub(a, b, out = Matrix2.new()) {
|
|
205
|
+
return Matrix2.el(sub, a, b, out);
|
|
206
|
+
},
|
|
207
|
+
/**
|
|
208
|
+
* Compute the hadamard (element-wise) product of two Matrix2 objects.
|
|
209
|
+
* Number-like arguments are promoted to uniform Matrix2 objects before
|
|
210
|
+
* performing the operation. Constructs a new Matrix2 when an output
|
|
211
|
+
* argument is not provided.
|
|
212
|
+
*/
|
|
213
|
+
hmul(a, b, out = Matrix2.new()) {
|
|
214
|
+
return Matrix2.el(mul, a, b, out);
|
|
215
|
+
},
|
|
216
|
+
/**
|
|
217
|
+
* Compute the hadamard (element-wise) quotient of two Matrix2 objects.
|
|
218
|
+
* Number-like arguments are promoted to uniform Matrix2 objects before
|
|
219
|
+
* performing the operation. Constructs a new Matrix2 when an output
|
|
220
|
+
* argument is not provided.
|
|
221
|
+
*/
|
|
222
|
+
hdiv(a, b, out = Matrix2.new()) {
|
|
223
|
+
return Matrix2.el(div, a, b, out);
|
|
224
|
+
},
|
|
225
|
+
/**
|
|
226
|
+
* Compute the hadamard (element-wise) remainder of two Matrix2 objects.
|
|
227
|
+
* Number-like arguments are promoted to uniform Matrix2 objects before
|
|
228
|
+
* performing the operation. Constructs a new Matrix2 when an output
|
|
229
|
+
* argument is not provided.
|
|
230
|
+
*/
|
|
231
|
+
hmod(a, b, out = Matrix2.new()) {
|
|
232
|
+
return Matrix2.el(mod, a, b, out);
|
|
233
|
+
},
|
|
234
|
+
/**
|
|
235
|
+
* Compute the standard product of two Matrix2 objects. Number-like arguments are
|
|
236
|
+
* promoted to uniform Matrix2 objects before performing the operation.
|
|
237
|
+
* Constructs a new Matrix2 when an output argument is not provided.
|
|
238
|
+
*/
|
|
239
|
+
mul(a, b, out = Matrix2.new()) {
|
|
240
|
+
const A = Matrix2.from(a);
|
|
241
|
+
const B = Matrix2.from(b);
|
|
242
|
+
const r0 = Matrix2.Get.r0(A);
|
|
243
|
+
const r1 = Matrix2.Get.r1(A);
|
|
244
|
+
const c0 = Matrix2.Get.c0(B);
|
|
245
|
+
const c1 = Matrix2.Get.c1(B);
|
|
246
|
+
Matrix2.Set.xx(out, Vector2.dot(r0, c0));
|
|
247
|
+
Matrix2.Set.xy(out, Vector2.dot(r0, c1));
|
|
248
|
+
Matrix2.Set.yx(out, Vector2.dot(r1, c0));
|
|
249
|
+
Matrix2.Set.yy(out, Vector2.dot(r1, c1));
|
|
250
|
+
return out;
|
|
251
|
+
},
|
|
252
|
+
/**
|
|
253
|
+
* Convert a Matrix2 into its string representation.
|
|
254
|
+
* ```js
|
|
255
|
+
* Matrix2.toString([1, 2, 3, 4]) // "mat2<1, 2, 3, 4>"
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
toString([xx, xy, yx, yy]) {
|
|
259
|
+
return `mat2<${xx}, ${xy}, ${yx}, ${yy}>`;
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
//# sourceMappingURL=matrix2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrix2.js","sourceRoot":"","sources":["../src/matrix2.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;AAOlD,MAAM,CAAC,MAA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AAA;QAC5B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;QACxC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;QACxC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;QACxC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;QACxC,OAAO,GAAG,CAAA;IACZ,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAW;QACjC,OAAO,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAY,CAAA;IACpD,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { Vector3 } from "./vector3.js";
|
|
2
|
+
export type Matrix3 = [
|
|
3
|
+
number,
|
|
4
|
+
number,
|
|
5
|
+
number,
|
|
6
|
+
number,
|
|
7
|
+
number,
|
|
8
|
+
number,
|
|
9
|
+
number,
|
|
10
|
+
number,
|
|
11
|
+
number
|
|
12
|
+
];
|
|
13
|
+
export declare const Matrix3: {
|
|
14
|
+
/** Constant index for the xx-component of a Matrix3 */
|
|
15
|
+
XX: 0;
|
|
16
|
+
/** Constant index for the xy-component of a Matrix3 */
|
|
17
|
+
XY: 1;
|
|
18
|
+
/** Constant index for the xz-component of a Matrix3 */
|
|
19
|
+
XZ: 2;
|
|
20
|
+
/** Constant index for the yx-component of a Matrix3 */
|
|
21
|
+
YX: 3;
|
|
22
|
+
/** Constant index for the yy-component of a Matrix3 */
|
|
23
|
+
YY: 4;
|
|
24
|
+
/** Constant index for the yz-component of a Matrix3 */
|
|
25
|
+
YZ: 5;
|
|
26
|
+
/** Constant index for the zx-component of a Matrix3 */
|
|
27
|
+
ZX: 6;
|
|
28
|
+
/** Constant index for the zy-component of a Matrix3 */
|
|
29
|
+
ZY: 7;
|
|
30
|
+
/** Constant index for the zz-component of a Matrix3 */
|
|
31
|
+
ZZ: 8;
|
|
32
|
+
/** A collection of getters for Matrix3 objects */
|
|
33
|
+
Get: {
|
|
34
|
+
/** Get the xx-component of a Matrix3 */
|
|
35
|
+
xx(a: Matrix3): number;
|
|
36
|
+
/** Get the xy-component of a Matrix3 */
|
|
37
|
+
xy(a: Matrix3): number;
|
|
38
|
+
/** Get the xz-component of a Matrix3 */
|
|
39
|
+
xz(a: Matrix3): number;
|
|
40
|
+
/** Get the yx-component of a Matrix3 */
|
|
41
|
+
yx(a: Matrix3): number;
|
|
42
|
+
/** Get the yy-component of a Matrix3 */
|
|
43
|
+
yy(a: Matrix3): number;
|
|
44
|
+
/** Get the yz-component of a Matrix3 */
|
|
45
|
+
yz(a: Matrix3): number;
|
|
46
|
+
/** Get the zx-component of a Matrix3 */
|
|
47
|
+
zx(a: Matrix3): number;
|
|
48
|
+
/** Get the zy-component of a Matrix3 */
|
|
49
|
+
zy(a: Matrix3): number;
|
|
50
|
+
/** Get the zz-component of a Matrix3 */
|
|
51
|
+
zz(a: Matrix3): number;
|
|
52
|
+
/** Get the 0th row of a Matrix3 as a Vector3 */
|
|
53
|
+
r0(a: Matrix3): [number, number, number];
|
|
54
|
+
/** Get the 1st row of a Matrix3 as a Vector3 */
|
|
55
|
+
r1(a: Matrix3): [number, number, number];
|
|
56
|
+
/** Get the 2nd row of a Matrix3 as a Vector3 */
|
|
57
|
+
r2(a: Matrix3): [number, number, number];
|
|
58
|
+
/** Get the i-th row of a Matrix3 as a Vector3 */
|
|
59
|
+
row(a: Matrix3, i: 0 | 1 | 2): [number, number, number];
|
|
60
|
+
/** Get the 0th column of a Matrix3 as a Vector3 */
|
|
61
|
+
c0(a: Matrix3): [number, number, number];
|
|
62
|
+
/** Get the 1st column of a Matrix3 as a Vector3 */
|
|
63
|
+
c1(a: Matrix3): [number, number, number];
|
|
64
|
+
/** Get the 2nd column of a Matrix3 as a Vector3 */
|
|
65
|
+
c2(a: Matrix3): [number, number, number];
|
|
66
|
+
/** Get the j-th column of a Matrix3 as a Vector3 */
|
|
67
|
+
col(a: Matrix3, j: 0 | 1 | 2): [number, number, number];
|
|
68
|
+
};
|
|
69
|
+
/** A collection of setters for Matrix3 objects */
|
|
70
|
+
Set: {
|
|
71
|
+
/** Set the xx-component of a Matrix3 */
|
|
72
|
+
xx(a: Matrix3, xx: number): number;
|
|
73
|
+
/** Set the xy-component of a Matrix3 */
|
|
74
|
+
xy(a: Matrix3, xy: number): number;
|
|
75
|
+
/** Set the xz-component of a Matrix3 */
|
|
76
|
+
xz(a: Matrix3, xz: number): number;
|
|
77
|
+
/** Set the yx-component of a Matrix3 */
|
|
78
|
+
yx(a: Matrix3, yx: number): number;
|
|
79
|
+
/** Set the yy-component of a Matrix3 */
|
|
80
|
+
yy(a: Matrix3, yy: number): number;
|
|
81
|
+
/** Set the yz-component of a Matrix3 */
|
|
82
|
+
yz(a: Matrix3, yz: number): number;
|
|
83
|
+
/** Set the zx-component of a Matrix3 */
|
|
84
|
+
zx(a: Matrix3, zx: number): number;
|
|
85
|
+
/** Set the zy-component of a Matrix3 */
|
|
86
|
+
zy(a: Matrix3, zy: number): number;
|
|
87
|
+
/** Set the zz-component of a Matrix3 */
|
|
88
|
+
zz(a: Matrix3, zz: number): number;
|
|
89
|
+
/** Set the 0th row of a Matrix3 */
|
|
90
|
+
r0(a: Matrix3, [xx, xy, xz]: Vector3): [number, number, number];
|
|
91
|
+
/** Set the 1st row of a Matrix3 */
|
|
92
|
+
r1(a: Matrix3, [yx, yy, yz]: Vector3): [number, number, number];
|
|
93
|
+
/** Set the 2nd row of a Matrix3 */
|
|
94
|
+
r2(a: Matrix3, [zx, zy, zz]: Vector3): [number, number, number];
|
|
95
|
+
/** Set the i-th row of a Matrix3 */
|
|
96
|
+
row(a: Matrix3, i: 0 | 1 | 2, ri: Vector3): [number, number, number];
|
|
97
|
+
/** Set the 0th column of a Matrix3 */
|
|
98
|
+
c0(a: Matrix3, [xx, yx, zx]: Vector3): [number, number, number];
|
|
99
|
+
/** Set the 1st column of a Matrix3 */
|
|
100
|
+
c1(a: Matrix3, [xy, yy, zy]: Vector3): [number, number, number];
|
|
101
|
+
/** Set the 2nd column of a Matrix3 */
|
|
102
|
+
c2(a: Matrix3, [xz, yz, zz]: Vector3): [number, number, number];
|
|
103
|
+
/** Set the j-th column of a Matrix3 */
|
|
104
|
+
col(a: Matrix3, j: 0 | 1 | 2, cj: Vector3): [number, number, number];
|
|
105
|
+
};
|
|
106
|
+
/** Construct an identity Matrix3 with an optional scale factor */
|
|
107
|
+
id(a?: number): [number, number, number, number, number, number, number, number, number];
|
|
108
|
+
/**
|
|
109
|
+
* Construct a Matrix3 from a variadic array of numbers.
|
|
110
|
+
*
|
|
111
|
+
* Constructs a uniform Matrix3 when `a.length === 1`
|
|
112
|
+
* ```js
|
|
113
|
+
* Matrix3.new(1) // [1, 1, 1, 1, 1, 1, 1, 1, 1]
|
|
114
|
+
* ```
|
|
115
|
+
*
|
|
116
|
+
* Otherwise constructs a standard zero-padded row-major Matrix3
|
|
117
|
+
* ```js
|
|
118
|
+
* Matrix3.new( ) // [0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
119
|
+
* Matrix3.new(1, 2 ) // [1, 2, 0, 0, 0, 0, 0, 0, 0]
|
|
120
|
+
* Matrix3.new(1, 2, 3, 4) // [1, 2, 3, 4, 0, 0, 0, 0, 0]
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
"new"(...a: Array<number>): [number, number, number, number, number, number, number, number, number];
|
|
124
|
+
/**
|
|
125
|
+
* Constructs a Matrix3 from a number or an array of numbers.
|
|
126
|
+
*
|
|
127
|
+
* Constructs a uniform Matrix3 when `a` is a number
|
|
128
|
+
* ```js
|
|
129
|
+
* Matrix3.from(1) // [1, 1, 1, 1, 1, 1, 1, 1, 1]
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
132
|
+
* Otherwise constructs a standard zero-padded Matrix3
|
|
133
|
+
* ```js
|
|
134
|
+
* Matrix3.from([ ]) // [0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
135
|
+
* Matrix3.from([1 ]) // [1, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
136
|
+
* Matrix3.from([1, 2 ]) // [1, 2, 0, 0, 0, 0, 0, 0, 0]
|
|
137
|
+
* Matrix3.from([1, 2, 3, 4]) // [1, 2, 3, 4, 0, 0, 0, 0, 0]
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
from(a: number | Array<number>): [number, number, number, number, number, number, number, number, number];
|
|
141
|
+
/**
|
|
142
|
+
* Perform an element-wise operation on two Matrix3 objects.
|
|
143
|
+
* Number-like arguments are promoted to uniform Matrix3 objects
|
|
144
|
+
* before performing the operation. Constructs a new Matrix3 when an
|
|
145
|
+
* output argument is not provided.
|
|
146
|
+
*/
|
|
147
|
+
el(op: (a: number, b: number) => number, a: number | Matrix3, b: number | Matrix3, out?: Matrix3): Matrix3;
|
|
148
|
+
/**
|
|
149
|
+
* Compute the sum of two Matrix3 objects. Number-like arguments are
|
|
150
|
+
* promoted to uniform Matrix3 objects before performing the operation.
|
|
151
|
+
* Constructs a new Matrix3 when an output argument is not provided.
|
|
152
|
+
*/
|
|
153
|
+
add(a: number | Matrix3, b: number | Matrix3, out?: Matrix3): Matrix3;
|
|
154
|
+
/**
|
|
155
|
+
* Compute the difference of two Matrix3 objects. Number-like arguments
|
|
156
|
+
* are promoted to uniform Matrix3 objects before performing the
|
|
157
|
+
* operation. Constructs a new Matrix3 when an output argument is not
|
|
158
|
+
* provided.
|
|
159
|
+
*/
|
|
160
|
+
sub(a: number | Matrix3, b: number | Matrix3, out?: Matrix3): Matrix3;
|
|
161
|
+
/**
|
|
162
|
+
* Compute the hadamard (element-wise) product of two Matrix3 objects.
|
|
163
|
+
* Number-like arguments are promoted to uniform Matrix3 objects before
|
|
164
|
+
* performing the operation. Constructs a new Matrix3 when an output
|
|
165
|
+
* argument is not provided.
|
|
166
|
+
*/
|
|
167
|
+
hmul(a: number | Matrix3, b: number | Matrix3, out?: Matrix3): Matrix3;
|
|
168
|
+
/**
|
|
169
|
+
* Compute the hadamard (element-wise) quotient of two Matrix3 objects.
|
|
170
|
+
* Number-like arguments are promoted to uniform Matrix3 objects before
|
|
171
|
+
* performing the operation. Constructs a new Matrix3 when an output
|
|
172
|
+
* argument is not provided.
|
|
173
|
+
*/
|
|
174
|
+
hdiv(a: number | Matrix3, b: number | Matrix3, out?: Matrix3): Matrix3;
|
|
175
|
+
/**
|
|
176
|
+
* Compute the hadamard (element-wise) remainder of two Matrix3 objects.
|
|
177
|
+
* Number-like arguments are promoted to uniform Matrix3 objects before
|
|
178
|
+
* performing the operation. Constructs a new Matrix3 when an output
|
|
179
|
+
* argument is not provided.
|
|
180
|
+
*/
|
|
181
|
+
hmod(a: number | Matrix3, b: number | Matrix3, out?: Matrix3): Matrix3;
|
|
182
|
+
/**
|
|
183
|
+
* Compute the standard product of two Matrix3 objects. Number-like arguments are
|
|
184
|
+
* promoted to uniform Matrix3 objects before performing the operation.
|
|
185
|
+
* Constructs a new Matrix3 when an output argument is not provided.
|
|
186
|
+
*/
|
|
187
|
+
mul(a: number | Matrix3, b: number | Matrix3, out?: Matrix3): Matrix3;
|
|
188
|
+
/**
|
|
189
|
+
* Convert a Matrix3 into its string representation.
|
|
190
|
+
* ```js
|
|
191
|
+
* Matrix3.toString([1, 2, 3, 4, 5, 6, 7, 8, 9]) // "mat3<1, 2, 3, 4, 5, 6, 7, 8, 9>"
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
toString([xx, xy, xz, yx, yy, yz, zx, zy, zz]: Matrix3): `mat3<${number}, ${number}, ${number}, ${number}, ${number}, ${number}, ${number}, ${number}, ${number}>`;
|
|
195
|
+
};
|
|
196
|
+
//# sourceMappingURL=matrix3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrix3.d.ts","sourceRoot":"","sources":["../src/matrix3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM;IAAE,MAAM;IAAE,MAAM;IACtB,MAAM;IAAE,MAAM;IAAE,MAAM;IACtB,MAAM;IAAE,MAAM;IAAE,MAAM;CACvB,CAAA;AAID,eAAO,MAAM,OAAO;IAElB,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAEvD,uDAAuD;;IAGvD,kDAAkD;;QAEhD,wCAAwC;cAClC,OAAO;QACb,wCAAwC;cAClC,OAAO;QACb,wCAAwC;cAClC,OAAO;QACb,wCAAwC;cAClC,OAAO;QACb,wCAAwC;cAClC,OAAO;QACb,wCAAwC;cAClC,OAAO;QACb,wCAAwC;cAClC,OAAO;QACb,wCAAwC;cAClC,OAAO;QACb,wCAAwC;cAClC,OAAO;QAEb,gDAAgD;cAC1C,OAAO;QAOb,gDAAgD;cAC1C,OAAO;QAOb,gDAAgD;cAC1C,OAAO;QAOb,iDAAiD;eAC1C,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;QAQ5B,mDAAmD;cAC7C,OAAO;QAOb,mDAAmD;cAC7C,OAAO;QAOb,mDAAmD;cAC7C,OAAO;QAOb,oDAAoD;eAC7C,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;;IAS9B,kDAAkD;;QAEhD,wCAAwC;cAClC,OAAO,MAAM,MAAM;QACzB,wCAAwC;cAClC,OAAO,MAAM,MAAM;QACz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