lecodes-cli 0.1.1 → 0.1.2
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 +3 -0
- package/dist/index.js +424 -19
- package/package.json +18 -2
- package/runtime/gl-matrix/common.js +54 -0
- package/runtime/gl-matrix/header.js +12 -0
- package/runtime/gl-matrix/index.js +11 -0
- package/runtime/gl-matrix/mat2.js +425 -0
- package/runtime/gl-matrix/mat2d.js +476 -0
- package/runtime/gl-matrix/mat3.js +765 -0
- package/runtime/gl-matrix/mat4.js +1947 -0
- package/runtime/gl-matrix/quat.js +737 -0
- package/runtime/gl-matrix/quat2.js +822 -0
- package/runtime/gl-matrix/vec2.js +620 -0
- package/runtime/gl-matrix/vec3.js +791 -0
- package/runtime/gl-matrix/vec4.js +652 -0
- package/runtime/worker/animate.js +304 -0
- package/runtime/worker/chunk-4ZN32GYS.js +34 -0
- package/runtime/worker/chunk-G5ZA3LKB.js +52 -0
- package/runtime/worker/chunk-MI3UXE5H.js +1395 -0
- package/runtime/worker/creator.js +930 -0
- package/runtime/worker/globals.js +208 -0
- package/runtime/worker/ui.js +763 -0
- package/runtime/worker/utils.js +16 -0
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
import * as glMatrix from "./common.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 2x3 Matrix
|
|
5
|
+
* @module mat2d
|
|
6
|
+
* @description
|
|
7
|
+
* A mat2d contains six elements defined as:
|
|
8
|
+
* <pre>
|
|
9
|
+
* [a, b,
|
|
10
|
+
* c, d,
|
|
11
|
+
* tx, ty]
|
|
12
|
+
* </pre>
|
|
13
|
+
* This is a short form for the 3x3 matrix:
|
|
14
|
+
* <pre>
|
|
15
|
+
* [a, b, 0,
|
|
16
|
+
* c, d, 0,
|
|
17
|
+
* tx, ty, 1]
|
|
18
|
+
* </pre>
|
|
19
|
+
* The last column is ignored so the array is shorter and operations are faster.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new identity mat2d
|
|
24
|
+
*
|
|
25
|
+
* @returns {mat2d} a new 2x3 matrix
|
|
26
|
+
*/
|
|
27
|
+
export function create() {
|
|
28
|
+
var out = new Float32Array(6);
|
|
29
|
+
out[0] = 1;
|
|
30
|
+
out[3] = 1;
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Creates a new mat2d initialized with values from an existing matrix
|
|
36
|
+
*
|
|
37
|
+
* @param {ReadonlyMat2d} a matrix to clone
|
|
38
|
+
* @returns {mat2d} a new 2x3 matrix
|
|
39
|
+
*/
|
|
40
|
+
export function clone(a) {
|
|
41
|
+
var out = new Float32Array(6);
|
|
42
|
+
out[0] = a[0];
|
|
43
|
+
out[1] = a[1];
|
|
44
|
+
out[2] = a[2];
|
|
45
|
+
out[3] = a[3];
|
|
46
|
+
out[4] = a[4];
|
|
47
|
+
out[5] = a[5];
|
|
48
|
+
return out;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Copy the values from one mat2d to another
|
|
53
|
+
*
|
|
54
|
+
* @param {mat2d} out the receiving matrix
|
|
55
|
+
* @param {ReadonlyMat2d} a the source matrix
|
|
56
|
+
* @returns {mat2d} out
|
|
57
|
+
*/
|
|
58
|
+
export function copy(out, a) {
|
|
59
|
+
out[0] = a[0];
|
|
60
|
+
out[1] = a[1];
|
|
61
|
+
out[2] = a[2];
|
|
62
|
+
out[3] = a[3];
|
|
63
|
+
out[4] = a[4];
|
|
64
|
+
out[5] = a[5];
|
|
65
|
+
return out;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Set a mat2d to the identity matrix
|
|
70
|
+
*
|
|
71
|
+
* @param {mat2d} out the receiving matrix
|
|
72
|
+
* @returns {mat2d} out
|
|
73
|
+
*/
|
|
74
|
+
export function identity(out) {
|
|
75
|
+
out[0] = 1;
|
|
76
|
+
out[1] = 0;
|
|
77
|
+
out[2] = 0;
|
|
78
|
+
out[3] = 1;
|
|
79
|
+
out[4] = 0;
|
|
80
|
+
out[5] = 0;
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Create a new mat2d with the given values
|
|
86
|
+
*
|
|
87
|
+
* @param {Number} a Component A (index 0)
|
|
88
|
+
* @param {Number} b Component B (index 1)
|
|
89
|
+
* @param {Number} c Component C (index 2)
|
|
90
|
+
* @param {Number} d Component D (index 3)
|
|
91
|
+
* @param {Number} tx Component TX (index 4)
|
|
92
|
+
* @param {Number} ty Component TY (index 5)
|
|
93
|
+
* @returns {mat2d} A new mat2d
|
|
94
|
+
*/
|
|
95
|
+
export function fromValues(a, b, c, d, tx, ty) {
|
|
96
|
+
var out = new Float32Array(6);
|
|
97
|
+
out[0] = a;
|
|
98
|
+
out[1] = b;
|
|
99
|
+
out[2] = c;
|
|
100
|
+
out[3] = d;
|
|
101
|
+
out[4] = tx;
|
|
102
|
+
out[5] = ty;
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Set the components of a mat2d to the given values
|
|
108
|
+
*
|
|
109
|
+
* @param {mat2d} out the receiving matrix
|
|
110
|
+
* @param {Number} a Component A (index 0)
|
|
111
|
+
* @param {Number} b Component B (index 1)
|
|
112
|
+
* @param {Number} c Component C (index 2)
|
|
113
|
+
* @param {Number} d Component D (index 3)
|
|
114
|
+
* @param {Number} tx Component TX (index 4)
|
|
115
|
+
* @param {Number} ty Component TY (index 5)
|
|
116
|
+
* @returns {mat2d} out
|
|
117
|
+
*/
|
|
118
|
+
export function set(out, a, b, c, d, tx, ty) {
|
|
119
|
+
out[0] = a;
|
|
120
|
+
out[1] = b;
|
|
121
|
+
out[2] = c;
|
|
122
|
+
out[3] = d;
|
|
123
|
+
out[4] = tx;
|
|
124
|
+
out[5] = ty;
|
|
125
|
+
return out;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Inverts a mat2d
|
|
130
|
+
*
|
|
131
|
+
* @param {mat2d} out the receiving matrix
|
|
132
|
+
* @param {ReadonlyMat2d} a the source matrix
|
|
133
|
+
* @returns {mat2d | null} out, or null if source matrix is not invertible
|
|
134
|
+
*/
|
|
135
|
+
export function invert(out, a) {
|
|
136
|
+
var aa = a[0],
|
|
137
|
+
ab = a[1],
|
|
138
|
+
ac = a[2],
|
|
139
|
+
ad = a[3];
|
|
140
|
+
var atx = a[4],
|
|
141
|
+
aty = a[5];
|
|
142
|
+
var det = aa * ad - ab * ac;
|
|
143
|
+
if (!det) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
det = 1.0 / det;
|
|
147
|
+
out[0] = ad * det;
|
|
148
|
+
out[1] = -ab * det;
|
|
149
|
+
out[2] = -ac * det;
|
|
150
|
+
out[3] = aa * det;
|
|
151
|
+
out[4] = (ac * aty - ad * atx) * det;
|
|
152
|
+
out[5] = (ab * atx - aa * aty) * det;
|
|
153
|
+
return out;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Calculates the determinant of a mat2d
|
|
158
|
+
*
|
|
159
|
+
* @param {ReadonlyMat2d} a the source matrix
|
|
160
|
+
* @returns {Number} determinant of a
|
|
161
|
+
*/
|
|
162
|
+
export function determinant(a) {
|
|
163
|
+
return a[0] * a[3] - a[1] * a[2];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Multiplies two mat2d's
|
|
168
|
+
*
|
|
169
|
+
* @param {mat2d} out the receiving matrix
|
|
170
|
+
* @param {ReadonlyMat2d} a the first operand
|
|
171
|
+
* @param {ReadonlyMat2d} b the second operand
|
|
172
|
+
* @returns {mat2d} out
|
|
173
|
+
*/
|
|
174
|
+
export function multiply(out, a, b) {
|
|
175
|
+
var a0 = a[0],
|
|
176
|
+
a1 = a[1],
|
|
177
|
+
a2 = a[2],
|
|
178
|
+
a3 = a[3],
|
|
179
|
+
a4 = a[4],
|
|
180
|
+
a5 = a[5];
|
|
181
|
+
var b0 = b[0],
|
|
182
|
+
b1 = b[1],
|
|
183
|
+
b2 = b[2],
|
|
184
|
+
b3 = b[3],
|
|
185
|
+
b4 = b[4],
|
|
186
|
+
b5 = b[5];
|
|
187
|
+
out[0] = a0 * b0 + a2 * b1;
|
|
188
|
+
out[1] = a1 * b0 + a3 * b1;
|
|
189
|
+
out[2] = a0 * b2 + a2 * b3;
|
|
190
|
+
out[3] = a1 * b2 + a3 * b3;
|
|
191
|
+
out[4] = a0 * b4 + a2 * b5 + a4;
|
|
192
|
+
out[5] = a1 * b4 + a3 * b5 + a5;
|
|
193
|
+
return out;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Rotates a mat2d by the given angle
|
|
198
|
+
*
|
|
199
|
+
* @param {mat2d} out the receiving matrix
|
|
200
|
+
* @param {ReadonlyMat2d} a the matrix to rotate
|
|
201
|
+
* @param {Number} rad the angle to rotate the matrix by
|
|
202
|
+
* @returns {mat2d} out
|
|
203
|
+
*/
|
|
204
|
+
export function rotate(out, a, rad) {
|
|
205
|
+
var a0 = a[0],
|
|
206
|
+
a1 = a[1],
|
|
207
|
+
a2 = a[2],
|
|
208
|
+
a3 = a[3],
|
|
209
|
+
a4 = a[4],
|
|
210
|
+
a5 = a[5];
|
|
211
|
+
var s = Math.sin(rad);
|
|
212
|
+
var c = Math.cos(rad);
|
|
213
|
+
out[0] = a0 * c + a2 * s;
|
|
214
|
+
out[1] = a1 * c + a3 * s;
|
|
215
|
+
out[2] = a0 * -s + a2 * c;
|
|
216
|
+
out[3] = a1 * -s + a3 * c;
|
|
217
|
+
out[4] = a4;
|
|
218
|
+
out[5] = a5;
|
|
219
|
+
return out;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Scales the mat2d by the dimensions in the given vec2
|
|
224
|
+
*
|
|
225
|
+
* @param {mat2d} out the receiving matrix
|
|
226
|
+
* @param {ReadonlyMat2d} a the matrix to translate
|
|
227
|
+
* @param {ReadonlyVec2} v the vec2 to scale the matrix by
|
|
228
|
+
* @returns {mat2d} out
|
|
229
|
+
**/
|
|
230
|
+
export function scale(out, a, v) {
|
|
231
|
+
var a0 = a[0],
|
|
232
|
+
a1 = a[1],
|
|
233
|
+
a2 = a[2],
|
|
234
|
+
a3 = a[3],
|
|
235
|
+
a4 = a[4],
|
|
236
|
+
a5 = a[5];
|
|
237
|
+
var v0 = v[0],
|
|
238
|
+
v1 = v[1];
|
|
239
|
+
out[0] = a0 * v0;
|
|
240
|
+
out[1] = a1 * v0;
|
|
241
|
+
out[2] = a2 * v1;
|
|
242
|
+
out[3] = a3 * v1;
|
|
243
|
+
out[4] = a4;
|
|
244
|
+
out[5] = a5;
|
|
245
|
+
return out;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Translates the mat2d by the dimensions in the given vec2
|
|
250
|
+
*
|
|
251
|
+
* @param {mat2d} out the receiving matrix
|
|
252
|
+
* @param {ReadonlyMat2d} a the matrix to translate
|
|
253
|
+
* @param {ReadonlyVec2} v the vec2 to translate the matrix by
|
|
254
|
+
* @returns {mat2d} out
|
|
255
|
+
**/
|
|
256
|
+
export function translate(out, a, v) {
|
|
257
|
+
var a0 = a[0],
|
|
258
|
+
a1 = a[1],
|
|
259
|
+
a2 = a[2],
|
|
260
|
+
a3 = a[3],
|
|
261
|
+
a4 = a[4],
|
|
262
|
+
a5 = a[5];
|
|
263
|
+
var v0 = v[0],
|
|
264
|
+
v1 = v[1];
|
|
265
|
+
out[0] = a0;
|
|
266
|
+
out[1] = a1;
|
|
267
|
+
out[2] = a2;
|
|
268
|
+
out[3] = a3;
|
|
269
|
+
out[4] = a0 * v0 + a2 * v1 + a4;
|
|
270
|
+
out[5] = a1 * v0 + a3 * v1 + a5;
|
|
271
|
+
return out;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Creates a matrix from a given angle
|
|
276
|
+
* This is equivalent to (but much faster than):
|
|
277
|
+
*
|
|
278
|
+
* mat2d.identity(dest);
|
|
279
|
+
* mat2d.rotate(dest, dest, rad);
|
|
280
|
+
*
|
|
281
|
+
* @param {mat2d} out mat2d receiving operation result
|
|
282
|
+
* @param {Number} rad the angle to rotate the matrix by
|
|
283
|
+
* @returns {mat2d} out
|
|
284
|
+
*/
|
|
285
|
+
export function fromRotation(out, rad) {
|
|
286
|
+
var s = Math.sin(rad),
|
|
287
|
+
c = Math.cos(rad);
|
|
288
|
+
out[0] = c;
|
|
289
|
+
out[1] = s;
|
|
290
|
+
out[2] = -s;
|
|
291
|
+
out[3] = c;
|
|
292
|
+
out[4] = 0;
|
|
293
|
+
out[5] = 0;
|
|
294
|
+
return out;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Creates a matrix from a vector scaling
|
|
299
|
+
* This is equivalent to (but much faster than):
|
|
300
|
+
*
|
|
301
|
+
* mat2d.identity(dest);
|
|
302
|
+
* mat2d.scale(dest, dest, vec);
|
|
303
|
+
*
|
|
304
|
+
* @param {mat2d} out mat2d receiving operation result
|
|
305
|
+
* @param {ReadonlyVec2} v Scaling vector
|
|
306
|
+
* @returns {mat2d} out
|
|
307
|
+
*/
|
|
308
|
+
export function fromScaling(out, v) {
|
|
309
|
+
out[0] = v[0];
|
|
310
|
+
out[1] = 0;
|
|
311
|
+
out[2] = 0;
|
|
312
|
+
out[3] = v[1];
|
|
313
|
+
out[4] = 0;
|
|
314
|
+
out[5] = 0;
|
|
315
|
+
return out;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Creates a matrix from a vector translation
|
|
320
|
+
* This is equivalent to (but much faster than):
|
|
321
|
+
*
|
|
322
|
+
* mat2d.identity(dest);
|
|
323
|
+
* mat2d.translate(dest, dest, vec);
|
|
324
|
+
*
|
|
325
|
+
* @param {mat2d} out mat2d receiving operation result
|
|
326
|
+
* @param {ReadonlyVec2} v Translation vector
|
|
327
|
+
* @returns {mat2d} out
|
|
328
|
+
*/
|
|
329
|
+
export function fromTranslation(out, v) {
|
|
330
|
+
out[0] = 1;
|
|
331
|
+
out[1] = 0;
|
|
332
|
+
out[2] = 0;
|
|
333
|
+
out[3] = 1;
|
|
334
|
+
out[4] = v[0];
|
|
335
|
+
out[5] = v[1];
|
|
336
|
+
return out;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Returns a string representation of a mat2d
|
|
341
|
+
*
|
|
342
|
+
* @param {ReadonlyMat2d} a matrix to represent as a string
|
|
343
|
+
* @returns {String} string representation of the matrix
|
|
344
|
+
*/
|
|
345
|
+
export function str(a) {
|
|
346
|
+
return "mat2d(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")";
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Returns Frobenius norm of a mat2d
|
|
351
|
+
*
|
|
352
|
+
* @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of
|
|
353
|
+
* @returns {Number} Frobenius norm
|
|
354
|
+
*/
|
|
355
|
+
export function frob(a) {
|
|
356
|
+
return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Adds two mat2d's
|
|
361
|
+
*
|
|
362
|
+
* @param {mat2d} out the receiving matrix
|
|
363
|
+
* @param {ReadonlyMat2d} a the first operand
|
|
364
|
+
* @param {ReadonlyMat2d} b the second operand
|
|
365
|
+
* @returns {mat2d} out
|
|
366
|
+
*/
|
|
367
|
+
export function add(out, a, b) {
|
|
368
|
+
out[0] = a[0] + b[0];
|
|
369
|
+
out[1] = a[1] + b[1];
|
|
370
|
+
out[2] = a[2] + b[2];
|
|
371
|
+
out[3] = a[3] + b[3];
|
|
372
|
+
out[4] = a[4] + b[4];
|
|
373
|
+
out[5] = a[5] + b[5];
|
|
374
|
+
return out;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Subtracts matrix b from matrix a
|
|
379
|
+
*
|
|
380
|
+
* @param {mat2d} out the receiving matrix
|
|
381
|
+
* @param {ReadonlyMat2d} a the first operand
|
|
382
|
+
* @param {ReadonlyMat2d} b the second operand
|
|
383
|
+
* @returns {mat2d} out
|
|
384
|
+
*/
|
|
385
|
+
export function subtract(out, a, b) {
|
|
386
|
+
out[0] = a[0] - b[0];
|
|
387
|
+
out[1] = a[1] - b[1];
|
|
388
|
+
out[2] = a[2] - b[2];
|
|
389
|
+
out[3] = a[3] - b[3];
|
|
390
|
+
out[4] = a[4] - b[4];
|
|
391
|
+
out[5] = a[5] - b[5];
|
|
392
|
+
return out;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Multiply each element of the matrix by a scalar.
|
|
397
|
+
*
|
|
398
|
+
* @param {mat2d} out the receiving matrix
|
|
399
|
+
* @param {ReadonlyMat2d} a the matrix to scale
|
|
400
|
+
* @param {Number} b amount to scale the matrix's elements by
|
|
401
|
+
* @returns {mat2d} out
|
|
402
|
+
*/
|
|
403
|
+
export function multiplyScalar(out, a, b) {
|
|
404
|
+
out[0] = a[0] * b;
|
|
405
|
+
out[1] = a[1] * b;
|
|
406
|
+
out[2] = a[2] * b;
|
|
407
|
+
out[3] = a[3] * b;
|
|
408
|
+
out[4] = a[4] * b;
|
|
409
|
+
out[5] = a[5] * b;
|
|
410
|
+
return out;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Adds two mat2d's after multiplying each element of the second operand by a scalar value.
|
|
415
|
+
*
|
|
416
|
+
* @param {mat2d} out the receiving vector
|
|
417
|
+
* @param {ReadonlyMat2d} a the first operand
|
|
418
|
+
* @param {ReadonlyMat2d} b the second operand
|
|
419
|
+
* @param {Number} scale the amount to scale b's elements by before adding
|
|
420
|
+
* @returns {mat2d} out
|
|
421
|
+
*/
|
|
422
|
+
export function multiplyScalarAndAdd(out, a, b, scale) {
|
|
423
|
+
out[0] = a[0] + b[0] * scale;
|
|
424
|
+
out[1] = a[1] + b[1] * scale;
|
|
425
|
+
out[2] = a[2] + b[2] * scale;
|
|
426
|
+
out[3] = a[3] + b[3] * scale;
|
|
427
|
+
out[4] = a[4] + b[4] * scale;
|
|
428
|
+
out[5] = a[5] + b[5] * scale;
|
|
429
|
+
return out;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
|
|
434
|
+
*
|
|
435
|
+
* @param {ReadonlyMat2d} a The first matrix.
|
|
436
|
+
* @param {ReadonlyMat2d} b The second matrix.
|
|
437
|
+
* @returns {Boolean} True if the matrices are equal, false otherwise.
|
|
438
|
+
*/
|
|
439
|
+
export function exactEquals(a, b) {
|
|
440
|
+
return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Returns whether or not the matrices have approximately the same elements in the same position.
|
|
445
|
+
*
|
|
446
|
+
* @param {ReadonlyMat2d} a The first matrix.
|
|
447
|
+
* @param {ReadonlyMat2d} b The second matrix.
|
|
448
|
+
* @returns {Boolean} True if the matrices are equal, false otherwise.
|
|
449
|
+
*/
|
|
450
|
+
export function equals(a, b) {
|
|
451
|
+
var a0 = a[0],
|
|
452
|
+
a1 = a[1],
|
|
453
|
+
a2 = a[2],
|
|
454
|
+
a3 = a[3],
|
|
455
|
+
a4 = a[4],
|
|
456
|
+
a5 = a[5];
|
|
457
|
+
var b0 = b[0],
|
|
458
|
+
b1 = b[1],
|
|
459
|
+
b2 = b[2],
|
|
460
|
+
b3 = b[3],
|
|
461
|
+
b4 = b[4],
|
|
462
|
+
b5 = b[5];
|
|
463
|
+
return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5));
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Alias for {@link mat2d.multiply}
|
|
468
|
+
* @function
|
|
469
|
+
*/
|
|
470
|
+
export var mul = multiply;
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Alias for {@link mat2d.subtract}
|
|
474
|
+
* @function
|
|
475
|
+
*/
|
|
476
|
+
export var sub = subtract;
|