exodeui 2.6.16 → 2.6.17
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/dist/index.js +4 -4
- package/dist/index.mjs +413 -412
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -97,27 +97,27 @@ class dA {
|
|
|
97
97
|
const A = B.rawbroadphase_new();
|
|
98
98
|
return this.__wbg_ptr = A >>> 0, YI.register(this, this.__wbg_ptr, this), this;
|
|
99
99
|
}
|
|
100
|
-
castRay(A, I, g, C, Q, E, D, o, w, h, G,
|
|
100
|
+
castRay(A, I, g, C, Q, E, D, o, w, h, G, K) {
|
|
101
101
|
try {
|
|
102
|
-
s(A, DA), s(I, P), s(g, gA), s(C,
|
|
103
|
-
const
|
|
104
|
-
return
|
|
102
|
+
s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, a);
|
|
103
|
+
const N = B.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, o, Y(w) ? 4294967297 : w >>> 0, !Y(h), Y(h) ? 0 : h, !Y(G), Y(G) ? 0 : G, $(K));
|
|
104
|
+
return N === 0 ? void 0 : _I.__wrap(N);
|
|
105
105
|
} finally {
|
|
106
106
|
f[X++] = void 0;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
castRayAndGetNormal(A, I, g, C, Q, E, D, o, w, h, G,
|
|
109
|
+
castRayAndGetNormal(A, I, g, C, Q, E, D, o, w, h, G, K) {
|
|
110
110
|
try {
|
|
111
|
-
s(A, DA), s(I, P), s(g, gA), s(C,
|
|
112
|
-
const
|
|
113
|
-
return
|
|
111
|
+
s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, a);
|
|
112
|
+
const N = B.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, o, Y(w) ? 4294967297 : w >>> 0, !Y(h), Y(h) ? 0 : h, !Y(G), Y(G) ? 0 : G, $(K));
|
|
113
|
+
return N === 0 ? void 0 : FI.__wrap(N);
|
|
114
114
|
} finally {
|
|
115
115
|
f[X++] = void 0;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
intersectionsWithRay(A, I, g, C, Q, E, D, o, w, h, G,
|
|
118
|
+
intersectionsWithRay(A, I, g, C, Q, E, D, o, w, h, G, K, N) {
|
|
119
119
|
try {
|
|
120
|
-
s(A, DA), s(I, P), s(g, gA), s(C,
|
|
120
|
+
s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, a), B.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, $(o), w, Y(h) ? 4294967297 : h >>> 0, !Y(G), Y(G) ? 0 : G, !Y(K), Y(K) ? 0 : K, $(N));
|
|
121
121
|
} finally {
|
|
122
122
|
f[X++] = void 0, f[X++] = void 0;
|
|
123
123
|
}
|
|
@@ -125,16 +125,16 @@ class dA {
|
|
|
125
125
|
intersectionWithShape(A, I, g, C, Q, E, D, o, w, h, G) {
|
|
126
126
|
try {
|
|
127
127
|
const M = B.__wbindgen_add_to_stack_pointer(-16);
|
|
128
|
-
s(A, DA), s(I, P), s(g, gA), s(C,
|
|
129
|
-
var
|
|
130
|
-
return
|
|
128
|
+
s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, b), s(E, e), B.rawbroadphase_intersectionWithShape(M, this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D, Y(o) ? 4294967297 : o >>> 0, !Y(w), Y(w) ? 0 : w, !Y(h), Y(h) ? 0 : h, $(G));
|
|
129
|
+
var K = wA().getInt32(M + 0, !0), N = wA().getFloat64(M + 8, !0);
|
|
130
|
+
return K === 0 ? void 0 : N;
|
|
131
131
|
} finally {
|
|
132
132
|
B.__wbindgen_add_to_stack_pointer(16), f[X++] = void 0;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
projectPoint(A, I, g, C, Q, E, D, o, w, h) {
|
|
136
136
|
try {
|
|
137
|
-
s(A, DA), s(I, P), s(g, gA), s(C,
|
|
137
|
+
s(A, DA), s(I, P), s(g, gA), s(C, a);
|
|
138
138
|
const G = B.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E, Y(D) ? 4294967297 : D >>> 0, !Y(o), Y(o) ? 0 : o, !Y(w), Y(w) ? 0 : w, $(h));
|
|
139
139
|
return G === 0 ? void 0 : GI.__wrap(G);
|
|
140
140
|
} finally {
|
|
@@ -143,7 +143,7 @@ class dA {
|
|
|
143
143
|
}
|
|
144
144
|
projectPointAndGetFeature(A, I, g, C, Q, E, D, o, w) {
|
|
145
145
|
try {
|
|
146
|
-
s(A, DA), s(I, P), s(g, gA), s(C,
|
|
146
|
+
s(A, DA), s(I, P), s(g, gA), s(C, a);
|
|
147
147
|
const h = B.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, Y(E) ? 4294967297 : E >>> 0, !Y(D), Y(D) ? 0 : D, !Y(o), Y(o) ? 0 : o, $(w));
|
|
148
148
|
return h === 0 ? void 0 : GI.__wrap(h);
|
|
149
149
|
} finally {
|
|
@@ -152,30 +152,30 @@ class dA {
|
|
|
152
152
|
}
|
|
153
153
|
intersectionsWithPoint(A, I, g, C, Q, E, D, o, w, h) {
|
|
154
154
|
try {
|
|
155
|
-
s(A, DA), s(I, P), s(g, gA), s(C,
|
|
155
|
+
s(A, DA), s(I, P), s(g, gA), s(C, a), B.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, $(Q), E, Y(D) ? 4294967297 : D >>> 0, !Y(o), Y(o) ? 0 : o, !Y(w), Y(w) ? 0 : w, $(h));
|
|
156
156
|
} finally {
|
|
157
157
|
f[X++] = void 0, f[X++] = void 0;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
castShape(A, I, g, C, Q, E, D, o, w, h, G,
|
|
160
|
+
castShape(A, I, g, C, Q, E, D, o, w, h, G, K, N, M, F) {
|
|
161
161
|
try {
|
|
162
|
-
s(A, DA), s(I, P), s(g, gA), s(C,
|
|
163
|
-
const J = B.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o, w, h, G, Y(
|
|
162
|
+
s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, b), s(E, a), s(D, e);
|
|
163
|
+
const J = B.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o, w, h, G, Y(K) ? 4294967297 : K >>> 0, !Y(N), Y(N) ? 0 : N, !Y(M), Y(M) ? 0 : M, $(F));
|
|
164
164
|
return J === 0 ? void 0 : kI.__wrap(J);
|
|
165
165
|
} finally {
|
|
166
166
|
f[X++] = void 0;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
intersectionsWithShape(A, I, g, C, Q, E, D, o, w, h, G,
|
|
169
|
+
intersectionsWithShape(A, I, g, C, Q, E, D, o, w, h, G, K) {
|
|
170
170
|
try {
|
|
171
|
-
s(A, DA), s(I, P), s(g, gA), s(C,
|
|
171
|
+
s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, b), s(E, e), B.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, $(D), o, Y(w) ? 4294967297 : w >>> 0, !Y(h), Y(h) ? 0 : h, !Y(G), Y(G) ? 0 : G, $(K));
|
|
172
172
|
} finally {
|
|
173
173
|
f[X++] = void 0, f[X++] = void 0;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
collidersWithAabbIntersectingAabb(A, I, g, C, Q, E) {
|
|
177
177
|
try {
|
|
178
|
-
s(A, DA), s(I, P), s(g, gA), s(C,
|
|
178
|
+
s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, a), B.rawbroadphase_collidersWithAabbIntersectingAabb(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, $(E));
|
|
179
179
|
} finally {
|
|
180
180
|
f[X++] = void 0;
|
|
181
181
|
}
|
|
@@ -219,30 +219,30 @@ class Og {
|
|
|
219
219
|
}
|
|
220
220
|
translationDeltaApplied() {
|
|
221
221
|
const A = B.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
|
|
222
|
-
return
|
|
222
|
+
return a.__wrap(A);
|
|
223
223
|
}
|
|
224
224
|
translationDeltaRemaining() {
|
|
225
225
|
const A = B.rawcharactercollision_translationDeltaRemaining(this.__wbg_ptr);
|
|
226
|
-
return
|
|
226
|
+
return a.__wrap(A);
|
|
227
227
|
}
|
|
228
228
|
toi() {
|
|
229
229
|
return B.rawcharactercollision_toi(this.__wbg_ptr);
|
|
230
230
|
}
|
|
231
231
|
worldWitness1() {
|
|
232
232
|
const A = B.rawcharactercollision_worldWitness1(this.__wbg_ptr);
|
|
233
|
-
return
|
|
233
|
+
return a.__wrap(A);
|
|
234
234
|
}
|
|
235
235
|
worldWitness2() {
|
|
236
236
|
const A = B.rawcharactercollision_worldWitness2(this.__wbg_ptr);
|
|
237
|
-
return
|
|
237
|
+
return a.__wrap(A);
|
|
238
238
|
}
|
|
239
239
|
worldNormal1() {
|
|
240
240
|
const A = B.rawcharactercollision_worldNormal1(this.__wbg_ptr);
|
|
241
|
-
return
|
|
241
|
+
return a.__wrap(A);
|
|
242
242
|
}
|
|
243
243
|
worldNormal2() {
|
|
244
244
|
const A = B.rawcharactercollision_worldNormal2(this.__wbg_ptr);
|
|
245
|
-
return
|
|
245
|
+
return a.__wrap(A);
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
const eI = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -264,7 +264,7 @@ class gA {
|
|
|
264
264
|
}
|
|
265
265
|
coTranslation(A) {
|
|
266
266
|
const I = B.rawcolliderset_coTranslation(this.__wbg_ptr, A);
|
|
267
|
-
return
|
|
267
|
+
return a.__wrap(I);
|
|
268
268
|
}
|
|
269
269
|
coRotation(A) {
|
|
270
270
|
const I = B.rawcolliderset_coRotation(this.__wbg_ptr, A);
|
|
@@ -272,7 +272,7 @@ class gA {
|
|
|
272
272
|
}
|
|
273
273
|
coTranslationWrtParent(A) {
|
|
274
274
|
const I = B.rawcolliderset_coTranslationWrtParent(this.__wbg_ptr, A);
|
|
275
|
-
return I === 0 ? void 0 :
|
|
275
|
+
return I === 0 ? void 0 : a.__wrap(I);
|
|
276
276
|
}
|
|
277
277
|
coRotationWrtParent(A) {
|
|
278
278
|
const I = B.rawcolliderset_coRotationWrtParent(this.__wbg_ptr, A);
|
|
@@ -298,14 +298,14 @@ class gA {
|
|
|
298
298
|
}
|
|
299
299
|
coHalfspaceNormal(A) {
|
|
300
300
|
const I = B.rawcolliderset_coHalfspaceNormal(this.__wbg_ptr, A);
|
|
301
|
-
return I === 0 ? void 0 :
|
|
301
|
+
return I === 0 ? void 0 : a.__wrap(I);
|
|
302
302
|
}
|
|
303
303
|
coHalfExtents(A) {
|
|
304
304
|
const I = B.rawcolliderset_coHalfExtents(this.__wbg_ptr, A);
|
|
305
|
-
return I === 0 ? void 0 :
|
|
305
|
+
return I === 0 ? void 0 : a.__wrap(I);
|
|
306
306
|
}
|
|
307
307
|
coSetHalfExtents(A, I) {
|
|
308
|
-
s(I,
|
|
308
|
+
s(I, a), B.rawcolliderset_coSetHalfExtents(this.__wbg_ptr, A, I.__wbg_ptr);
|
|
309
309
|
}
|
|
310
310
|
coRadius(A) {
|
|
311
311
|
const I = B.rawcolliderset_coRadius(this.__wbg_ptr, A);
|
|
@@ -341,7 +341,7 @@ class gA {
|
|
|
341
341
|
}
|
|
342
342
|
coVoxelSize(A) {
|
|
343
343
|
const I = B.rawcolliderset_coVoxelSize(this.__wbg_ptr, A);
|
|
344
|
-
return I === 0 ? void 0 :
|
|
344
|
+
return I === 0 ? void 0 : a.__wrap(I);
|
|
345
345
|
}
|
|
346
346
|
coSetVoxel(A, I, g, C) {
|
|
347
347
|
B.rawcolliderset_coSetVoxel(this.__wbg_ptr, A, I, g, C);
|
|
@@ -393,7 +393,7 @@ class gA {
|
|
|
393
393
|
}
|
|
394
394
|
coHeightfieldScale(A) {
|
|
395
395
|
const I = B.rawcolliderset_coHeightfieldScale(this.__wbg_ptr, A);
|
|
396
|
-
return I === 0 ? void 0 :
|
|
396
|
+
return I === 0 ? void 0 : a.__wrap(I);
|
|
397
397
|
}
|
|
398
398
|
coParent(A) {
|
|
399
399
|
try {
|
|
@@ -451,23 +451,23 @@ class gA {
|
|
|
451
451
|
return B.rawcolliderset_coContactForceEventThreshold(this.__wbg_ptr, A);
|
|
452
452
|
}
|
|
453
453
|
coContainsPoint(A, I) {
|
|
454
|
-
return s(I,
|
|
454
|
+
return s(I, a), B.rawcolliderset_coContainsPoint(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
|
|
455
455
|
}
|
|
456
456
|
coCastShape(A, I, g, C, Q, E, D, o, w) {
|
|
457
|
-
s(I,
|
|
457
|
+
s(I, a), s(g, e), s(C, a), s(Q, b), s(E, a);
|
|
458
458
|
const h = B.rawcolliderset_coCastShape(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D, o, w);
|
|
459
459
|
return h === 0 ? void 0 : JI.__wrap(h);
|
|
460
460
|
}
|
|
461
461
|
coCastCollider(A, I, g, C, Q, E, D) {
|
|
462
|
-
s(I,
|
|
462
|
+
s(I, a), s(C, a);
|
|
463
463
|
const o = B.rawcolliderset_coCastCollider(this.__wbg_ptr, A, I.__wbg_ptr, g, C.__wbg_ptr, Q, E, D);
|
|
464
464
|
return o === 0 ? void 0 : kI.__wrap(o);
|
|
465
465
|
}
|
|
466
466
|
coIntersectsShape(A, I, g, C) {
|
|
467
|
-
return s(I, e), s(g,
|
|
467
|
+
return s(I, e), s(g, a), s(C, b), B.rawcolliderset_coIntersectsShape(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr) !== 0;
|
|
468
468
|
}
|
|
469
469
|
coContactShape(A, I, g, C, Q) {
|
|
470
|
-
s(I, e), s(g,
|
|
470
|
+
s(I, e), s(g, a), s(C, b);
|
|
471
471
|
const E = B.rawcolliderset_coContactShape(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q);
|
|
472
472
|
return E === 0 ? void 0 : II.__wrap(E);
|
|
473
473
|
}
|
|
@@ -476,18 +476,18 @@ class gA {
|
|
|
476
476
|
return C === 0 ? void 0 : II.__wrap(C);
|
|
477
477
|
}
|
|
478
478
|
coProjectPoint(A, I, g) {
|
|
479
|
-
s(I,
|
|
479
|
+
s(I, a);
|
|
480
480
|
const C = B.rawcolliderset_coProjectPoint(this.__wbg_ptr, A, I.__wbg_ptr, g);
|
|
481
481
|
return yI.__wrap(C);
|
|
482
482
|
}
|
|
483
483
|
coIntersectsRay(A, I, g, C) {
|
|
484
|
-
return s(I,
|
|
484
|
+
return s(I, a), s(g, a), B.rawcolliderset_coIntersectsRay(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C) !== 0;
|
|
485
485
|
}
|
|
486
486
|
coCastRay(A, I, g, C, Q) {
|
|
487
|
-
return s(I,
|
|
487
|
+
return s(I, a), s(g, a), B.rawcolliderset_coCastRay(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C, Q);
|
|
488
488
|
}
|
|
489
489
|
coCastRayAndGetNormal(A, I, g, C, Q) {
|
|
490
|
-
s(I,
|
|
490
|
+
s(I, a), s(g, a);
|
|
491
491
|
const E = B.rawcolliderset_coCastRayAndGetNormal(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C, Q);
|
|
492
492
|
return E === 0 ? void 0 : MI.__wrap(E);
|
|
493
493
|
}
|
|
@@ -540,7 +540,7 @@ class gA {
|
|
|
540
540
|
B.rawcolliderset_coSetMass(this.__wbg_ptr, A, I);
|
|
541
541
|
}
|
|
542
542
|
coSetMassProperties(A, I, g, C) {
|
|
543
|
-
s(g,
|
|
543
|
+
s(g, a), B.rawcolliderset_coSetMassProperties(this.__wbg_ptr, A, I, g.__wbg_ptr, C);
|
|
544
544
|
}
|
|
545
545
|
constructor() {
|
|
546
546
|
const A = B.rawcolliderset_new();
|
|
@@ -552,10 +552,10 @@ class gA {
|
|
|
552
552
|
contains(A) {
|
|
553
553
|
return B.rawcolliderset_contains(this.__wbg_ptr, A) !== 0;
|
|
554
554
|
}
|
|
555
|
-
createCollider(A, I, g, C, Q, E, D, o, w, h, G,
|
|
555
|
+
createCollider(A, I, g, C, Q, E, D, o, w, h, G, K, N, M, F, J, k, y, U, R, c, L, r, p) {
|
|
556
556
|
try {
|
|
557
557
|
const GA = B.__wbindgen_add_to_stack_pointer(-16);
|
|
558
|
-
s(I, e), s(g,
|
|
558
|
+
s(I, e), s(g, a), s(C, b), s(D, a), s(p, P), B.rawcolliderset_createCollider(GA, this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E, D.__wbg_ptr, o, w, h, G, K, N, M, F, J, k, y, U, R, c, L, r, p.__wbg_ptr);
|
|
559
559
|
var q = wA().getInt32(GA + 0, !0), AA = wA().getFloat64(GA + 8, !0);
|
|
560
560
|
return q === 0 ? void 0 : AA;
|
|
561
561
|
} finally {
|
|
@@ -601,19 +601,19 @@ class kI {
|
|
|
601
601
|
}
|
|
602
602
|
witness1() {
|
|
603
603
|
const A = B.rawcollidershapecasthit_witness1(this.__wbg_ptr);
|
|
604
|
-
return
|
|
604
|
+
return a.__wrap(A);
|
|
605
605
|
}
|
|
606
606
|
witness2() {
|
|
607
607
|
const A = B.rawcollidershapecasthit_witness2(this.__wbg_ptr);
|
|
608
|
-
return
|
|
608
|
+
return a.__wrap(A);
|
|
609
609
|
}
|
|
610
610
|
normal1() {
|
|
611
611
|
const A = B.rawcollidershapecasthit_normal1(this.__wbg_ptr);
|
|
612
|
-
return
|
|
612
|
+
return a.__wrap(A);
|
|
613
613
|
}
|
|
614
614
|
normal2() {
|
|
615
615
|
const A = B.rawcollidershapecasthit_normal2(this.__wbg_ptr);
|
|
616
|
-
return
|
|
616
|
+
return a.__wrap(A);
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
const kg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -641,14 +641,14 @@ class uI {
|
|
|
641
641
|
}
|
|
642
642
|
total_force() {
|
|
643
643
|
const A = B.rawcontactforceevent_total_force(this.__wbg_ptr);
|
|
644
|
-
return
|
|
644
|
+
return a.__wrap(A);
|
|
645
645
|
}
|
|
646
646
|
total_force_magnitude() {
|
|
647
647
|
return B.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr);
|
|
648
648
|
}
|
|
649
649
|
max_force_direction() {
|
|
650
650
|
const A = B.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
|
|
651
|
-
return
|
|
651
|
+
return a.__wrap(A);
|
|
652
652
|
}
|
|
653
653
|
max_force_magnitude() {
|
|
654
654
|
return B.rawcontactforceevent_max_force_magnitude(this.__wbg_ptr);
|
|
@@ -673,15 +673,15 @@ class PI {
|
|
|
673
673
|
}
|
|
674
674
|
normal() {
|
|
675
675
|
const A = B.rawcontactmanifold_normal(this.__wbg_ptr);
|
|
676
|
-
return
|
|
676
|
+
return a.__wrap(A);
|
|
677
677
|
}
|
|
678
678
|
local_n1() {
|
|
679
679
|
const A = B.rawcontactmanifold_local_n1(this.__wbg_ptr);
|
|
680
|
-
return
|
|
680
|
+
return a.__wrap(A);
|
|
681
681
|
}
|
|
682
682
|
local_n2() {
|
|
683
683
|
const A = B.rawcontactmanifold_local_n2(this.__wbg_ptr);
|
|
684
|
-
return
|
|
684
|
+
return a.__wrap(A);
|
|
685
685
|
}
|
|
686
686
|
subshape1() {
|
|
687
687
|
return B.rawcontactmanifold_subshape1(this.__wbg_ptr) >>> 0;
|
|
@@ -694,11 +694,11 @@ class PI {
|
|
|
694
694
|
}
|
|
695
695
|
contact_local_p1(A) {
|
|
696
696
|
const I = B.rawcontactmanifold_contact_local_p1(this.__wbg_ptr, A);
|
|
697
|
-
return I === 0 ? void 0 :
|
|
697
|
+
return I === 0 ? void 0 : a.__wrap(I);
|
|
698
698
|
}
|
|
699
699
|
contact_local_p2(A) {
|
|
700
700
|
const I = B.rawcontactmanifold_contact_local_p2(this.__wbg_ptr, A);
|
|
701
|
-
return I === 0 ? void 0 :
|
|
701
|
+
return I === 0 ? void 0 : a.__wrap(I);
|
|
702
702
|
}
|
|
703
703
|
contact_dist(A) {
|
|
704
704
|
return B.rawcontactmanifold_contact_dist(this.__wbg_ptr, A);
|
|
@@ -720,7 +720,7 @@ class PI {
|
|
|
720
720
|
}
|
|
721
721
|
solver_contact_point(A) {
|
|
722
722
|
const I = B.rawcontactmanifold_solver_contact_point(this.__wbg_ptr, A);
|
|
723
|
-
return I === 0 ? void 0 :
|
|
723
|
+
return I === 0 ? void 0 : a.__wrap(I);
|
|
724
724
|
}
|
|
725
725
|
solver_contact_dist(A) {
|
|
726
726
|
return B.rawcontactmanifold_solver_contact_dist(this.__wbg_ptr, A);
|
|
@@ -733,7 +733,7 @@ class PI {
|
|
|
733
733
|
}
|
|
734
734
|
solver_contact_tangent_velocity(A) {
|
|
735
735
|
const I = B.rawcontactmanifold_solver_contact_tangent_velocity(this.__wbg_ptr, A);
|
|
736
|
-
return
|
|
736
|
+
return a.__wrap(I);
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
739
|
const Fg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -816,7 +816,7 @@ class zI {
|
|
|
816
816
|
}
|
|
817
817
|
takeGravity() {
|
|
818
818
|
const A = B.rawdeserializedworld_takeGravity(this.__wbg_ptr);
|
|
819
|
-
return A === 0 ? void 0 :
|
|
819
|
+
return A === 0 ? void 0 : a.__wrap(A);
|
|
820
820
|
}
|
|
821
821
|
takeIntegrationParameters() {
|
|
822
822
|
const A = B.rawdeserializedworld_takeIntegrationParameters(this.__wbg_ptr);
|
|
@@ -903,27 +903,27 @@ class NA {
|
|
|
903
903
|
B.__wbg_rawgenericjoint_free(A, 0);
|
|
904
904
|
}
|
|
905
905
|
static spring(A, I, g, C, Q) {
|
|
906
|
-
s(C,
|
|
906
|
+
s(C, a), s(Q, a);
|
|
907
907
|
const E = B.rawgenericjoint_spring(A, I, g, C.__wbg_ptr, Q.__wbg_ptr);
|
|
908
908
|
return NA.__wrap(E);
|
|
909
909
|
}
|
|
910
910
|
static rope(A, I, g) {
|
|
911
|
-
s(I,
|
|
911
|
+
s(I, a), s(g, a);
|
|
912
912
|
const C = B.rawgenericjoint_rope(A, I.__wbg_ptr, g.__wbg_ptr);
|
|
913
913
|
return NA.__wrap(C);
|
|
914
914
|
}
|
|
915
915
|
static prismatic(A, I, g, C, Q, E) {
|
|
916
|
-
s(A,
|
|
916
|
+
s(A, a), s(I, a), s(g, a);
|
|
917
917
|
const D = B.rawgenericjoint_prismatic(A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C, Q, E);
|
|
918
918
|
return D === 0 ? void 0 : NA.__wrap(D);
|
|
919
919
|
}
|
|
920
920
|
static fixed(A, I, g, C) {
|
|
921
|
-
s(A,
|
|
921
|
+
s(A, a), s(I, b), s(g, a), s(C, b);
|
|
922
922
|
const Q = B.rawgenericjoint_fixed(A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr);
|
|
923
923
|
return NA.__wrap(Q);
|
|
924
924
|
}
|
|
925
925
|
static revolute(A, I) {
|
|
926
|
-
s(A,
|
|
926
|
+
s(A, a), s(I, a);
|
|
927
927
|
const g = B.rawgenericjoint_revolute(A.__wbg_ptr, I.__wbg_ptr);
|
|
928
928
|
return g === 0 ? void 0 : NA.__wrap(g);
|
|
929
929
|
}
|
|
@@ -964,17 +964,17 @@ class rA {
|
|
|
964
964
|
}
|
|
965
965
|
jointAnchor1(A) {
|
|
966
966
|
const I = B.rawimpulsejointset_jointAnchor1(this.__wbg_ptr, A);
|
|
967
|
-
return
|
|
967
|
+
return a.__wrap(I);
|
|
968
968
|
}
|
|
969
969
|
jointAnchor2(A) {
|
|
970
970
|
const I = B.rawimpulsejointset_jointAnchor2(this.__wbg_ptr, A);
|
|
971
|
-
return
|
|
971
|
+
return a.__wrap(I);
|
|
972
972
|
}
|
|
973
973
|
jointSetAnchor1(A, I) {
|
|
974
|
-
s(I,
|
|
974
|
+
s(I, a), B.rawimpulsejointset_jointSetAnchor1(this.__wbg_ptr, A, I.__wbg_ptr);
|
|
975
975
|
}
|
|
976
976
|
jointSetAnchor2(A, I) {
|
|
977
|
-
s(I,
|
|
977
|
+
s(I, a), B.rawimpulsejointset_jointSetAnchor2(this.__wbg_ptr, A, I.__wbg_ptr);
|
|
978
978
|
}
|
|
979
979
|
jointContactsEnabled(A) {
|
|
980
980
|
return B.rawimpulsejointset_jointContactsEnabled(this.__wbg_ptr, A) !== 0;
|
|
@@ -1160,10 +1160,10 @@ class tC {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
up() {
|
|
1162
1162
|
const A = B.rawcollidershapecasthit_normal2(this.__wbg_ptr);
|
|
1163
|
-
return
|
|
1163
|
+
return a.__wrap(A);
|
|
1164
1164
|
}
|
|
1165
1165
|
setUp(A) {
|
|
1166
|
-
s(A,
|
|
1166
|
+
s(A, a), B.rawkinematiccharactercontroller_setUp(this.__wbg_ptr, A.__wbg_ptr);
|
|
1167
1167
|
}
|
|
1168
1168
|
normalNudgeFactor() {
|
|
1169
1169
|
return B.rawkinematiccharactercontroller_normalNudgeFactor(this.__wbg_ptr);
|
|
@@ -1229,16 +1229,16 @@ class tC {
|
|
|
1229
1229
|
snapToGroundEnabled() {
|
|
1230
1230
|
return B.rawkinematiccharactercontroller_snapToGroundEnabled(this.__wbg_ptr) !== 0;
|
|
1231
1231
|
}
|
|
1232
|
-
computeColliderMovement(A, I, g, C, Q, E, D, o, w, h, G,
|
|
1232
|
+
computeColliderMovement(A, I, g, C, Q, E, D, o, w, h, G, K) {
|
|
1233
1233
|
try {
|
|
1234
|
-
s(I, dA), s(g, DA), s(C, P), s(Q, gA), s(D,
|
|
1234
|
+
s(I, dA), s(g, DA), s(C, P), s(Q, gA), s(D, a), B.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D.__wbg_ptr, o, Y(w) ? 4294967297 : Math.fround(w), h, Y(G) ? 4294967297 : G >>> 0, $(K));
|
|
1235
1235
|
} finally {
|
|
1236
1236
|
f[X++] = void 0;
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
1239
1239
|
computedMovement() {
|
|
1240
1240
|
const A = B.rawkinematiccharactercontroller_computedMovement(this.__wbg_ptr);
|
|
1241
|
-
return
|
|
1241
|
+
return a.__wrap(A);
|
|
1242
1242
|
}
|
|
1243
1243
|
computedGrounded() {
|
|
1244
1244
|
return B.rawkinematiccharactercontroller_computedGrounded(this.__wbg_ptr) !== 0;
|
|
@@ -1280,11 +1280,11 @@ class lA {
|
|
|
1280
1280
|
}
|
|
1281
1281
|
jointAnchor1(A) {
|
|
1282
1282
|
const I = B.rawmultibodyjointset_jointAnchor1(this.__wbg_ptr, A);
|
|
1283
|
-
return
|
|
1283
|
+
return a.__wrap(I);
|
|
1284
1284
|
}
|
|
1285
1285
|
jointAnchor2(A) {
|
|
1286
1286
|
const I = B.rawmultibodyjointset_jointAnchor2(this.__wbg_ptr, A);
|
|
1287
|
-
return
|
|
1287
|
+
return a.__wrap(I);
|
|
1288
1288
|
}
|
|
1289
1289
|
jointContactsEnabled(A) {
|
|
1290
1290
|
return B.rawmultibodyjointset_jointContactsEnabled(this.__wbg_ptr, A) !== 0;
|
|
@@ -1435,10 +1435,10 @@ class YC {
|
|
|
1435
1435
|
return B.rawphysicspipeline_timing_user_changes(this.__wbg_ptr);
|
|
1436
1436
|
}
|
|
1437
1437
|
step(A, I, g, C, Q, E, D, o, w, h) {
|
|
1438
|
-
s(A,
|
|
1438
|
+
s(A, a), s(I, ZA), s(g, qA), s(C, dA), s(Q, DA), s(E, P), s(D, gA), s(o, rA), s(w, lA), s(h, bI), B.rawphysicspipeline_step(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr, h.__wbg_ptr);
|
|
1439
1439
|
}
|
|
1440
|
-
stepWithEvents(A, I, g, C, Q, E, D, o, w, h, G,
|
|
1441
|
-
s(A,
|
|
1440
|
+
stepWithEvents(A, I, g, C, Q, E, D, o, w, h, G, K, N, M) {
|
|
1441
|
+
s(A, a), s(I, ZA), s(g, qA), s(C, dA), s(Q, DA), s(E, P), s(D, gA), s(o, rA), s(w, lA), s(h, bI), s(G, jg), B.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr, h.__wbg_ptr, G.__wbg_ptr, O(K), O(N), O(M));
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
1444
|
const Yg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -1473,15 +1473,15 @@ class eC {
|
|
|
1473
1473
|
B.rawpidcontroller_reset_integrals(this.__wbg_ptr);
|
|
1474
1474
|
}
|
|
1475
1475
|
apply_linear_correction(A, I, g, C, Q) {
|
|
1476
|
-
s(I, P), s(C,
|
|
1476
|
+
s(I, P), s(C, a), s(Q, a), B.rawpidcontroller_apply_linear_correction(this.__wbg_ptr, A, I.__wbg_ptr, g, C.__wbg_ptr, Q.__wbg_ptr);
|
|
1477
1477
|
}
|
|
1478
1478
|
apply_angular_correction(A, I, g, C, Q) {
|
|
1479
1479
|
s(I, P), B.rawpidcontroller_apply_angular_correction(this.__wbg_ptr, A, I.__wbg_ptr, g, C, Q);
|
|
1480
1480
|
}
|
|
1481
1481
|
linear_correction(A, I, g, C, Q) {
|
|
1482
|
-
s(I, P), s(C,
|
|
1482
|
+
s(I, P), s(C, a), s(Q, a);
|
|
1483
1483
|
const E = B.rawpidcontroller_linear_correction(this.__wbg_ptr, A, I.__wbg_ptr, g, C.__wbg_ptr, Q.__wbg_ptr);
|
|
1484
|
-
return
|
|
1484
|
+
return a.__wrap(E);
|
|
1485
1485
|
}
|
|
1486
1486
|
angular_correction(A, I, g, C, Q) {
|
|
1487
1487
|
return s(I, P), B.rawpidcontroller_angular_correction(this.__wbg_ptr, A, I.__wbg_ptr, g, C, Q);
|
|
@@ -1509,7 +1509,7 @@ class GI {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
point() {
|
|
1511
1511
|
const A = B.rawpointcolliderprojection_point(this.__wbg_ptr);
|
|
1512
|
-
return
|
|
1512
|
+
return a.__wrap(A);
|
|
1513
1513
|
}
|
|
1514
1514
|
isInside() {
|
|
1515
1515
|
return B.rawpointcolliderprojection_isInside(this.__wbg_ptr) !== 0;
|
|
@@ -1541,7 +1541,7 @@ class yI {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
point() {
|
|
1543
1543
|
const A = B.rawpointprojection_point(this.__wbg_ptr);
|
|
1544
|
-
return
|
|
1544
|
+
return a.__wrap(A);
|
|
1545
1545
|
}
|
|
1546
1546
|
isInside() {
|
|
1547
1547
|
return B.rawpointprojection_isInside(this.__wbg_ptr) !== 0;
|
|
@@ -1593,7 +1593,7 @@ class FI {
|
|
|
1593
1593
|
}
|
|
1594
1594
|
normal() {
|
|
1595
1595
|
const A = B.rawcollidershapecasthit_witness1(this.__wbg_ptr);
|
|
1596
|
-
return
|
|
1596
|
+
return a.__wrap(A);
|
|
1597
1597
|
}
|
|
1598
1598
|
time_of_impact() {
|
|
1599
1599
|
return B.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
|
|
@@ -1625,7 +1625,7 @@ class MI {
|
|
|
1625
1625
|
}
|
|
1626
1626
|
normal() {
|
|
1627
1627
|
const A = B.rawcollidershapecasthit_witness1(this.__wbg_ptr);
|
|
1628
|
-
return
|
|
1628
|
+
return a.__wrap(A);
|
|
1629
1629
|
}
|
|
1630
1630
|
time_of_impact() {
|
|
1631
1631
|
return B.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
|
|
@@ -1657,7 +1657,7 @@ class P {
|
|
|
1657
1657
|
}
|
|
1658
1658
|
rbTranslation(A) {
|
|
1659
1659
|
const I = B.rawrigidbodyset_rbTranslation(this.__wbg_ptr, A);
|
|
1660
|
-
return
|
|
1660
|
+
return a.__wrap(I);
|
|
1661
1661
|
}
|
|
1662
1662
|
rbRotation(A) {
|
|
1663
1663
|
const I = B.rawrigidbodyset_rbRotation(this.__wbg_ptr, A);
|
|
@@ -1674,7 +1674,7 @@ class P {
|
|
|
1674
1674
|
}
|
|
1675
1675
|
rbNextTranslation(A) {
|
|
1676
1676
|
const I = B.rawrigidbodyset_rbNextTranslation(this.__wbg_ptr, A);
|
|
1677
|
-
return
|
|
1677
|
+
return a.__wrap(I);
|
|
1678
1678
|
}
|
|
1679
1679
|
rbNextRotation(A) {
|
|
1680
1680
|
const I = B.rawrigidbodyset_rbNextRotation(this.__wbg_ptr, A);
|
|
@@ -1687,7 +1687,7 @@ class P {
|
|
|
1687
1687
|
B.rawrigidbodyset_rbSetRotation(this.__wbg_ptr, A, I, g);
|
|
1688
1688
|
}
|
|
1689
1689
|
rbSetLinvel(A, I, g) {
|
|
1690
|
-
s(I,
|
|
1690
|
+
s(I, a), B.rawrigidbodyset_rbSetLinvel(this.__wbg_ptr, A, I.__wbg_ptr, g);
|
|
1691
1691
|
}
|
|
1692
1692
|
rbSetAngvel(A, I, g) {
|
|
1693
1693
|
B.rawrigidbodyset_rbSetAngvel(this.__wbg_ptr, A, I, g);
|
|
@@ -1705,19 +1705,19 @@ class P {
|
|
|
1705
1705
|
B.rawrigidbodyset_rbSetAdditionalMass(this.__wbg_ptr, A, I, g);
|
|
1706
1706
|
}
|
|
1707
1707
|
rbSetAdditionalMassProperties(A, I, g, C, Q) {
|
|
1708
|
-
s(g,
|
|
1708
|
+
s(g, a), B.rawrigidbodyset_rbSetAdditionalMassProperties(this.__wbg_ptr, A, I, g.__wbg_ptr, C, Q);
|
|
1709
1709
|
}
|
|
1710
1710
|
rbLinvel(A) {
|
|
1711
1711
|
const I = B.rawrigidbodyset_rbLinvel(this.__wbg_ptr, A);
|
|
1712
|
-
return
|
|
1712
|
+
return a.__wrap(I);
|
|
1713
1713
|
}
|
|
1714
1714
|
rbAngvel(A) {
|
|
1715
1715
|
return B.rawrigidbodyset_rbAngvel(this.__wbg_ptr, A);
|
|
1716
1716
|
}
|
|
1717
1717
|
rbVelocityAtPoint(A, I) {
|
|
1718
|
-
s(I,
|
|
1718
|
+
s(I, a);
|
|
1719
1719
|
const g = B.rawrigidbodyset_rbVelocityAtPoint(this.__wbg_ptr, A, I.__wbg_ptr);
|
|
1720
|
-
return
|
|
1720
|
+
return a.__wrap(g);
|
|
1721
1721
|
}
|
|
1722
1722
|
rbLockTranslations(A, I, g) {
|
|
1723
1723
|
B.rawrigidbodyset_rbLockTranslations(this.__wbg_ptr, A, I, g);
|
|
@@ -1748,15 +1748,15 @@ class P {
|
|
|
1748
1748
|
}
|
|
1749
1749
|
rbEffectiveInvMass(A) {
|
|
1750
1750
|
const I = B.rawrigidbodyset_rbEffectiveInvMass(this.__wbg_ptr, A);
|
|
1751
|
-
return
|
|
1751
|
+
return a.__wrap(I);
|
|
1752
1752
|
}
|
|
1753
1753
|
rbLocalCom(A) {
|
|
1754
1754
|
const I = B.rawrigidbodyset_rbLocalCom(this.__wbg_ptr, A);
|
|
1755
|
-
return
|
|
1755
|
+
return a.__wrap(I);
|
|
1756
1756
|
}
|
|
1757
1757
|
rbWorldCom(A) {
|
|
1758
1758
|
const I = B.rawrigidbodyset_rbWorldCom(this.__wbg_ptr, A);
|
|
1759
|
-
return
|
|
1759
|
+
return a.__wrap(I);
|
|
1760
1760
|
}
|
|
1761
1761
|
rbInvPrincipalInertia(A) {
|
|
1762
1762
|
return B.rawrigidbodyset_rbInvPrincipalInertia(this.__wbg_ptr, A);
|
|
@@ -1831,10 +1831,10 @@ class P {
|
|
|
1831
1831
|
B.rawrigidbodyset_rbResetTorques(this.__wbg_ptr, A, I);
|
|
1832
1832
|
}
|
|
1833
1833
|
rbAddForce(A, I, g) {
|
|
1834
|
-
s(I,
|
|
1834
|
+
s(I, a), B.rawrigidbodyset_rbAddForce(this.__wbg_ptr, A, I.__wbg_ptr, g);
|
|
1835
1835
|
}
|
|
1836
1836
|
rbApplyImpulse(A, I, g) {
|
|
1837
|
-
s(I,
|
|
1837
|
+
s(I, a), B.rawrigidbodyset_rbApplyImpulse(this.__wbg_ptr, A, I.__wbg_ptr, g);
|
|
1838
1838
|
}
|
|
1839
1839
|
rbAddTorque(A, I, g) {
|
|
1840
1840
|
B.rawrigidbodyset_rbAddTorque(this.__wbg_ptr, A, I, g);
|
|
@@ -1843,10 +1843,10 @@ class P {
|
|
|
1843
1843
|
B.rawrigidbodyset_rbApplyTorqueImpulse(this.__wbg_ptr, A, I, g);
|
|
1844
1844
|
}
|
|
1845
1845
|
rbAddForceAtPoint(A, I, g, C) {
|
|
1846
|
-
s(I,
|
|
1846
|
+
s(I, a), s(g, a), B.rawrigidbodyset_rbAddForceAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C);
|
|
1847
1847
|
}
|
|
1848
1848
|
rbApplyImpulseAtPoint(A, I, g, C) {
|
|
1849
|
-
s(I,
|
|
1849
|
+
s(I, a), s(g, a), B.rawrigidbodyset_rbApplyImpulseAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C);
|
|
1850
1850
|
}
|
|
1851
1851
|
rbAdditionalSolverIterations(A) {
|
|
1852
1852
|
return B.rawrigidbodyset_rbAdditionalSolverIterations(this.__wbg_ptr, A) >>> 0;
|
|
@@ -1862,7 +1862,7 @@ class P {
|
|
|
1862
1862
|
}
|
|
1863
1863
|
rbUserForce(A) {
|
|
1864
1864
|
const I = B.rawrigidbodyset_rbUserForce(this.__wbg_ptr, A);
|
|
1865
|
-
return
|
|
1865
|
+
return a.__wrap(I);
|
|
1866
1866
|
}
|
|
1867
1867
|
rbUserTorque(A) {
|
|
1868
1868
|
return B.rawrigidbodyset_rbUserTorque(this.__wbg_ptr, A);
|
|
@@ -1871,8 +1871,8 @@ class P {
|
|
|
1871
1871
|
const A = B.rawrigidbodyset_new();
|
|
1872
1872
|
return this.__wbg_ptr = A >>> 0, HI.register(this, this.__wbg_ptr, this), this;
|
|
1873
1873
|
}
|
|
1874
|
-
createRigidBody(A, I, g, C, Q, E, D, o, w, h, G,
|
|
1875
|
-
return s(I,
|
|
1874
|
+
createRigidBody(A, I, g, C, Q, E, D, o, w, h, G, K, N, M, F, J, k, y, U, R, c, L) {
|
|
1875
|
+
return s(I, a), s(g, b), s(D, a), s(o, a), B.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C, Q, E, D.__wbg_ptr, o.__wbg_ptr, w, h, G, K, N, M, F, J, k, y, U, R, c, L);
|
|
1876
1876
|
}
|
|
1877
1877
|
remove(A, I, g, C, Q) {
|
|
1878
1878
|
s(I, qA), s(g, gA), s(C, rA), s(Q, lA), B.rawrigidbodyset_remove(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr);
|
|
@@ -1946,7 +1946,7 @@ class LC {
|
|
|
1946
1946
|
return this.__wbg_ptr = A >>> 0, Hg.register(this, this.__wbg_ptr, this), this;
|
|
1947
1947
|
}
|
|
1948
1948
|
serializeAll(A, I, g, C, Q, E, D, o, w) {
|
|
1949
|
-
return s(A,
|
|
1949
|
+
return s(A, a), s(I, ZA), s(g, qA), s(C, dA), s(Q, DA), s(E, P), s(D, gA), s(o, rA), s(w, lA), wI(B.rawserializationpipeline_serializeAll(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr));
|
|
1950
1950
|
}
|
|
1951
1951
|
deserializeAll(A) {
|
|
1952
1952
|
const I = B.rawserializationpipeline_deserializeAll(this.__wbg_ptr, O(A));
|
|
@@ -1983,7 +1983,7 @@ class e {
|
|
|
1983
1983
|
return e.__wrap(I);
|
|
1984
1984
|
}
|
|
1985
1985
|
static halfspace(A) {
|
|
1986
|
-
s(A,
|
|
1986
|
+
s(A, a);
|
|
1987
1987
|
const I = B.rawshape_halfspace(A.__wbg_ptr);
|
|
1988
1988
|
return e.__wrap(I);
|
|
1989
1989
|
}
|
|
@@ -1992,12 +1992,12 @@ class e {
|
|
|
1992
1992
|
return e.__wrap(g);
|
|
1993
1993
|
}
|
|
1994
1994
|
static voxels(A, I) {
|
|
1995
|
-
s(A,
|
|
1995
|
+
s(A, a);
|
|
1996
1996
|
const g = tI(I, B.__wbindgen_export_2), C = MA, Q = B.rawshape_voxels(A.__wbg_ptr, g, C);
|
|
1997
1997
|
return e.__wrap(Q);
|
|
1998
1998
|
}
|
|
1999
1999
|
static voxelsFromPoints(A, I) {
|
|
2000
|
-
s(A,
|
|
2000
|
+
s(A, a);
|
|
2001
2001
|
const g = HA(I, B.__wbindgen_export_2), C = MA, Q = B.rawshape_voxelsFromPoints(A.__wbg_ptr, g, C);
|
|
2002
2002
|
return e.__wrap(Q);
|
|
2003
2003
|
}
|
|
@@ -2011,22 +2011,22 @@ class e {
|
|
|
2011
2011
|
}
|
|
2012
2012
|
static heightfield(A, I) {
|
|
2013
2013
|
const g = HA(A, B.__wbindgen_export_2), C = MA;
|
|
2014
|
-
s(I,
|
|
2014
|
+
s(I, a);
|
|
2015
2015
|
const Q = B.rawshape_heightfield(g, C, I.__wbg_ptr);
|
|
2016
2016
|
return e.__wrap(Q);
|
|
2017
2017
|
}
|
|
2018
2018
|
static segment(A, I) {
|
|
2019
|
-
s(A,
|
|
2019
|
+
s(A, a), s(I, a);
|
|
2020
2020
|
const g = B.rawshape_segment(A.__wbg_ptr, I.__wbg_ptr);
|
|
2021
2021
|
return e.__wrap(g);
|
|
2022
2022
|
}
|
|
2023
2023
|
static triangle(A, I, g) {
|
|
2024
|
-
s(A,
|
|
2024
|
+
s(A, a), s(I, a), s(g, a);
|
|
2025
2025
|
const C = B.rawshape_triangle(A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr);
|
|
2026
2026
|
return e.__wrap(C);
|
|
2027
2027
|
}
|
|
2028
2028
|
static roundTriangle(A, I, g, C) {
|
|
2029
|
-
s(A,
|
|
2029
|
+
s(A, a), s(I, a), s(g, a);
|
|
2030
2030
|
const Q = B.rawshape_roundTriangle(A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C);
|
|
2031
2031
|
return e.__wrap(Q);
|
|
2032
2032
|
}
|
|
@@ -2047,34 +2047,34 @@ class e {
|
|
|
2047
2047
|
return Q === 0 ? void 0 : e.__wrap(Q);
|
|
2048
2048
|
}
|
|
2049
2049
|
castShape(A, I, g, C, Q, E, D, o, w, h) {
|
|
2050
|
-
s(A,
|
|
2050
|
+
s(A, a), s(I, b), s(g, a), s(C, e), s(Q, a), s(E, b), s(D, a);
|
|
2051
2051
|
const G = B.rawshape_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o, w, h);
|
|
2052
2052
|
return G === 0 ? void 0 : JI.__wrap(G);
|
|
2053
2053
|
}
|
|
2054
2054
|
intersectsShape(A, I, g, C, Q) {
|
|
2055
|
-
return s(A,
|
|
2055
|
+
return s(A, a), s(I, b), s(g, e), s(C, a), s(Q, b), B.rawshape_intersectsShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr) !== 0;
|
|
2056
2056
|
}
|
|
2057
2057
|
contactShape(A, I, g, C, Q, E) {
|
|
2058
|
-
s(A,
|
|
2058
|
+
s(A, a), s(I, b), s(g, e), s(C, a), s(Q, b);
|
|
2059
2059
|
const D = B.rawshape_contactShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E);
|
|
2060
2060
|
return D === 0 ? void 0 : II.__wrap(D);
|
|
2061
2061
|
}
|
|
2062
2062
|
containsPoint(A, I, g) {
|
|
2063
|
-
return s(A,
|
|
2063
|
+
return s(A, a), s(I, b), s(g, a), B.rawshape_containsPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr) !== 0;
|
|
2064
2064
|
}
|
|
2065
2065
|
projectPoint(A, I, g, C) {
|
|
2066
|
-
s(A,
|
|
2066
|
+
s(A, a), s(I, b), s(g, a);
|
|
2067
2067
|
const Q = B.rawshape_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C);
|
|
2068
2068
|
return yI.__wrap(Q);
|
|
2069
2069
|
}
|
|
2070
2070
|
intersectsRay(A, I, g, C, Q) {
|
|
2071
|
-
return s(A,
|
|
2071
|
+
return s(A, a), s(I, b), s(g, a), s(C, a), B.rawshape_intersectsRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q) !== 0;
|
|
2072
2072
|
}
|
|
2073
2073
|
castRay(A, I, g, C, Q, E) {
|
|
2074
|
-
return s(A,
|
|
2074
|
+
return s(A, a), s(I, b), s(g, a), s(C, a), B.rawshape_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E);
|
|
2075
2075
|
}
|
|
2076
2076
|
castRayAndGetNormal(A, I, g, C, Q, E) {
|
|
2077
|
-
s(A,
|
|
2077
|
+
s(A, a), s(I, b), s(g, a), s(C, a);
|
|
2078
2078
|
const D = B.rawshape_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E);
|
|
2079
2079
|
return D === 0 ? void 0 : MI.__wrap(D);
|
|
2080
2080
|
}
|
|
@@ -2101,19 +2101,19 @@ class JI {
|
|
|
2101
2101
|
}
|
|
2102
2102
|
witness1() {
|
|
2103
2103
|
const A = B.rawshapecasthit_witness1(this.__wbg_ptr);
|
|
2104
|
-
return
|
|
2104
|
+
return a.__wrap(A);
|
|
2105
2105
|
}
|
|
2106
2106
|
witness2() {
|
|
2107
2107
|
const A = B.rawcollidershapecasthit_witness1(this.__wbg_ptr);
|
|
2108
|
-
return
|
|
2108
|
+
return a.__wrap(A);
|
|
2109
2109
|
}
|
|
2110
2110
|
normal1() {
|
|
2111
2111
|
const A = B.rawcollidershapecasthit_witness2(this.__wbg_ptr);
|
|
2112
|
-
return
|
|
2112
|
+
return a.__wrap(A);
|
|
2113
2113
|
}
|
|
2114
2114
|
normal2() {
|
|
2115
2115
|
const A = B.rawcollidershapecasthit_normal1(this.__wbg_ptr);
|
|
2116
|
-
return
|
|
2116
|
+
return a.__wrap(A);
|
|
2117
2117
|
}
|
|
2118
2118
|
}
|
|
2119
2119
|
const fg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -2138,28 +2138,28 @@ class II {
|
|
|
2138
2138
|
}
|
|
2139
2139
|
point1() {
|
|
2140
2140
|
const A = B.rawpointprojection_point(this.__wbg_ptr);
|
|
2141
|
-
return
|
|
2141
|
+
return a.__wrap(A);
|
|
2142
2142
|
}
|
|
2143
2143
|
point2() {
|
|
2144
2144
|
const A = B.rawpointcolliderprojection_point(this.__wbg_ptr);
|
|
2145
|
-
return
|
|
2145
|
+
return a.__wrap(A);
|
|
2146
2146
|
}
|
|
2147
2147
|
normal1() {
|
|
2148
2148
|
const A = B.rawcontactforceevent_total_force(this.__wbg_ptr);
|
|
2149
|
-
return
|
|
2149
|
+
return a.__wrap(A);
|
|
2150
2150
|
}
|
|
2151
2151
|
normal2() {
|
|
2152
2152
|
const A = B.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
|
|
2153
|
-
return
|
|
2153
|
+
return a.__wrap(A);
|
|
2154
2154
|
}
|
|
2155
2155
|
}
|
|
2156
2156
|
const pI = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
2157
2157
|
}, unregister: () => {
|
|
2158
2158
|
} } : new FinalizationRegistry((i) => B.__wbg_rawvector_free(i >>> 0, 1));
|
|
2159
|
-
class
|
|
2159
|
+
class a {
|
|
2160
2160
|
static __wrap(A) {
|
|
2161
2161
|
A >>>= 0;
|
|
2162
|
-
const I = Object.create(
|
|
2162
|
+
const I = Object.create(a.prototype);
|
|
2163
2163
|
return I.__wbg_ptr = A, pI.register(I, I.__wbg_ptr, I), I;
|
|
2164
2164
|
}
|
|
2165
2165
|
__destroy_into_raw() {
|
|
@@ -2172,7 +2172,7 @@ class N {
|
|
|
2172
2172
|
}
|
|
2173
2173
|
static zero() {
|
|
2174
2174
|
const A = B.rawvector_zero();
|
|
2175
|
-
return
|
|
2175
|
+
return a.__wrap(A);
|
|
2176
2176
|
}
|
|
2177
2177
|
constructor(A, I) {
|
|
2178
2178
|
const g = B.rawvector_new(A, I);
|
|
@@ -2192,11 +2192,11 @@ class N {
|
|
|
2192
2192
|
}
|
|
2193
2193
|
xy() {
|
|
2194
2194
|
const A = B.rawvector_xy(this.__wbg_ptr);
|
|
2195
|
-
return
|
|
2195
|
+
return a.__wrap(A);
|
|
2196
2196
|
}
|
|
2197
2197
|
yx() {
|
|
2198
2198
|
const A = B.rawvector_yx(this.__wbg_ptr);
|
|
2199
|
-
return
|
|
2199
|
+
return a.__wrap(A);
|
|
2200
2200
|
}
|
|
2201
2201
|
}
|
|
2202
2202
|
async function xg(i) {
|
|
@@ -2310,20 +2310,20 @@ class mg {
|
|
|
2310
2310
|
this.x = A, this.y = I;
|
|
2311
2311
|
}
|
|
2312
2312
|
}
|
|
2313
|
-
class
|
|
2313
|
+
class S {
|
|
2314
2314
|
static new(A, I) {
|
|
2315
2315
|
return new mg(A, I);
|
|
2316
2316
|
}
|
|
2317
2317
|
static zeros() {
|
|
2318
|
-
return
|
|
2318
|
+
return S.new(0, 0);
|
|
2319
2319
|
}
|
|
2320
2320
|
static fromRaw(A) {
|
|
2321
2321
|
if (!A) return null;
|
|
2322
|
-
let I =
|
|
2322
|
+
let I = S.new(A.x, A.y);
|
|
2323
2323
|
return A.free(), I;
|
|
2324
2324
|
}
|
|
2325
2325
|
static intoRaw(A) {
|
|
2326
|
-
return new
|
|
2326
|
+
return new a(A.x, A.y);
|
|
2327
2327
|
}
|
|
2328
2328
|
static copy(A, I) {
|
|
2329
2329
|
A.x = I.x, A.y = I.y;
|
|
@@ -2391,7 +2391,7 @@ class mI {
|
|
|
2391
2391
|
}
|
|
2392
2392
|
translation() {
|
|
2393
2393
|
let A = this.rawSet.rbTranslation(this.handle);
|
|
2394
|
-
return
|
|
2394
|
+
return S.fromRaw(A);
|
|
2395
2395
|
}
|
|
2396
2396
|
rotation() {
|
|
2397
2397
|
let A = this.rawSet.rbRotation(this.handle);
|
|
@@ -2399,7 +2399,7 @@ class mI {
|
|
|
2399
2399
|
}
|
|
2400
2400
|
nextTranslation() {
|
|
2401
2401
|
let A = this.rawSet.rbNextTranslation(this.handle);
|
|
2402
|
-
return
|
|
2402
|
+
return S.fromRaw(A);
|
|
2403
2403
|
}
|
|
2404
2404
|
nextRotation() {
|
|
2405
2405
|
let A = this.rawSet.rbNextRotation(this.handle);
|
|
@@ -2409,7 +2409,7 @@ class mI {
|
|
|
2409
2409
|
this.rawSet.rbSetTranslation(this.handle, A.x, A.y, I);
|
|
2410
2410
|
}
|
|
2411
2411
|
setLinvel(A, I) {
|
|
2412
|
-
let g =
|
|
2412
|
+
let g = S.intoRaw(A);
|
|
2413
2413
|
this.rawSet.rbSetLinvel(this.handle, g, I), g.free();
|
|
2414
2414
|
}
|
|
2415
2415
|
gravityScale() {
|
|
@@ -2431,11 +2431,11 @@ class mI {
|
|
|
2431
2431
|
this.rawSet.rbSetNextKinematicRotation(this.handle, A);
|
|
2432
2432
|
}
|
|
2433
2433
|
linvel() {
|
|
2434
|
-
return
|
|
2434
|
+
return S.fromRaw(this.rawSet.rbLinvel(this.handle));
|
|
2435
2435
|
}
|
|
2436
2436
|
velocityAtPoint(A) {
|
|
2437
|
-
const I =
|
|
2438
|
-
let g =
|
|
2437
|
+
const I = S.intoRaw(A);
|
|
2438
|
+
let g = S.fromRaw(this.rawSet.rbVelocityAtPoint(this.handle, I));
|
|
2439
2439
|
return I.free(), g;
|
|
2440
2440
|
}
|
|
2441
2441
|
angvel() {
|
|
@@ -2445,16 +2445,16 @@ class mI {
|
|
|
2445
2445
|
return this.rawSet.rbMass(this.handle);
|
|
2446
2446
|
}
|
|
2447
2447
|
effectiveInvMass() {
|
|
2448
|
-
return
|
|
2448
|
+
return S.fromRaw(this.rawSet.rbEffectiveInvMass(this.handle));
|
|
2449
2449
|
}
|
|
2450
2450
|
invMass() {
|
|
2451
2451
|
return this.rawSet.rbInvMass(this.handle);
|
|
2452
2452
|
}
|
|
2453
2453
|
localCom() {
|
|
2454
|
-
return
|
|
2454
|
+
return S.fromRaw(this.rawSet.rbLocalCom(this.handle));
|
|
2455
2455
|
}
|
|
2456
2456
|
worldCom() {
|
|
2457
|
-
return
|
|
2457
|
+
return S.fromRaw(this.rawSet.rbWorldCom(this.handle));
|
|
2458
2458
|
}
|
|
2459
2459
|
invPrincipalInertia() {
|
|
2460
2460
|
return this.rawSet.rbInvPrincipalInertia(this.handle);
|
|
@@ -2526,7 +2526,7 @@ class mI {
|
|
|
2526
2526
|
this.rawSet.rbSetAdditionalMass(this.handle, A, I);
|
|
2527
2527
|
}
|
|
2528
2528
|
setAdditionalMassProperties(A, I, g, C) {
|
|
2529
|
-
let Q =
|
|
2529
|
+
let Q = S.intoRaw(I);
|
|
2530
2530
|
this.rawSet.rbSetAdditionalMassProperties(this.handle, A, Q, g, C), Q.free();
|
|
2531
2531
|
}
|
|
2532
2532
|
setAngularDamping(A) {
|
|
@@ -2539,11 +2539,11 @@ class mI {
|
|
|
2539
2539
|
this.rawSet.rbResetTorques(this.handle, A);
|
|
2540
2540
|
}
|
|
2541
2541
|
addForce(A, I) {
|
|
2542
|
-
const g =
|
|
2542
|
+
const g = S.intoRaw(A);
|
|
2543
2543
|
this.rawSet.rbAddForce(this.handle, g, I), g.free();
|
|
2544
2544
|
}
|
|
2545
2545
|
applyImpulse(A, I) {
|
|
2546
|
-
const g =
|
|
2546
|
+
const g = S.intoRaw(A);
|
|
2547
2547
|
this.rawSet.rbApplyImpulse(this.handle, g, I), g.free();
|
|
2548
2548
|
}
|
|
2549
2549
|
addTorque(A, I) {
|
|
@@ -2553,15 +2553,15 @@ class mI {
|
|
|
2553
2553
|
this.rawSet.rbApplyTorqueImpulse(this.handle, A, I);
|
|
2554
2554
|
}
|
|
2555
2555
|
addForceAtPoint(A, I, g) {
|
|
2556
|
-
const C =
|
|
2556
|
+
const C = S.intoRaw(A), Q = S.intoRaw(I);
|
|
2557
2557
|
this.rawSet.rbAddForceAtPoint(this.handle, C, Q, g), C.free(), Q.free();
|
|
2558
2558
|
}
|
|
2559
2559
|
applyImpulseAtPoint(A, I, g) {
|
|
2560
|
-
const C =
|
|
2560
|
+
const C = S.intoRaw(A), Q = S.intoRaw(I);
|
|
2561
2561
|
this.rawSet.rbApplyImpulseAtPoint(this.handle, C, Q, g), C.free(), Q.free();
|
|
2562
2562
|
}
|
|
2563
2563
|
userForce() {
|
|
2564
|
-
return
|
|
2564
|
+
return S.fromRaw(this.rawSet.rbUserForce(this.handle));
|
|
2565
2565
|
}
|
|
2566
2566
|
userTorque() {
|
|
2567
2567
|
return this.rawSet.rbUserTorque(this.handle);
|
|
@@ -2569,7 +2569,7 @@ class mI {
|
|
|
2569
2569
|
}
|
|
2570
2570
|
class eA {
|
|
2571
2571
|
constructor(A) {
|
|
2572
|
-
this.enabled = !0, this.status = A, this.translation =
|
|
2572
|
+
this.enabled = !0, this.status = A, this.translation = S.zeros(), this.rotation = j.identity(), this.gravityScale = 1, this.linvel = S.zeros(), this.mass = 0, this.massOnly = !1, this.centerOfMass = S.zeros(), this.translationsEnabledX = !0, this.translationsEnabledY = !0, this.angvel = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0, this.linearDamping = 0, this.angularDamping = 0, this.canSleep = !0, this.sleeping = !1, this.ccdEnabled = !1, this.softCcdPrediction = 0, this.dominanceGroup = 0, this.additionalSolverIterations = 0;
|
|
2573
2573
|
}
|
|
2574
2574
|
static dynamic() {
|
|
2575
2575
|
return new eA(cA.Dynamic);
|
|
@@ -2625,7 +2625,7 @@ class eA {
|
|
|
2625
2625
|
return this.angvel = A, this;
|
|
2626
2626
|
}
|
|
2627
2627
|
setAdditionalMassProperties(A, I, g) {
|
|
2628
|
-
return this.mass = A,
|
|
2628
|
+
return this.mass = A, S.copy(this.centerOfMass, I), this.principalAngularInertia = g, this.massOnly = !1, this;
|
|
2629
2629
|
}
|
|
2630
2630
|
enabledTranslations(A, I) {
|
|
2631
2631
|
return this.translationsEnabledX = A, this.translationsEnabledY = I, this;
|
|
@@ -2707,7 +2707,7 @@ class Xg {
|
|
|
2707
2707
|
this.map.forEach((I) => I.finalizeDeserialization(A));
|
|
2708
2708
|
}
|
|
2709
2709
|
createRigidBody(A, I) {
|
|
2710
|
-
let g =
|
|
2710
|
+
let g = S.intoRaw(I.translation), C = j.intoRaw(I.rotation), Q = S.intoRaw(I.linvel), E = S.intoRaw(I.centerOfMass), D = this.raw.createRigidBody(I.enabled, g, C, I.gravityScale, I.mass, I.massOnly, E, Q, I.angvel, I.principalAngularInertia, I.translationsEnabledX, I.translationsEnabledY, I.rotationsEnabled, I.linearDamping, I.angularDamping, I.status, I.canSleep, I.sleeping, I.softCcdPrediction, I.ccdEnabled, I.dominanceGroup, I.additionalSolverIterations);
|
|
2711
2711
|
g.free(), C.free(), Q.free(), E.free();
|
|
2712
2712
|
const o = new mI(this.raw, A, D);
|
|
2713
2713
|
return o.userData = I.userData, this.map.set(D, o), o;
|
|
@@ -2842,17 +2842,17 @@ class nA {
|
|
|
2842
2842
|
return this.rawSet.jointType(this.handle);
|
|
2843
2843
|
}
|
|
2844
2844
|
anchor1() {
|
|
2845
|
-
return
|
|
2845
|
+
return S.fromRaw(this.rawSet.jointAnchor1(this.handle));
|
|
2846
2846
|
}
|
|
2847
2847
|
anchor2() {
|
|
2848
|
-
return
|
|
2848
|
+
return S.fromRaw(this.rawSet.jointAnchor2(this.handle));
|
|
2849
2849
|
}
|
|
2850
2850
|
setAnchor1(A) {
|
|
2851
|
-
const I =
|
|
2851
|
+
const I = S.intoRaw(A);
|
|
2852
2852
|
this.rawSet.jointSetAnchor1(this.handle, I), I.free();
|
|
2853
2853
|
}
|
|
2854
2854
|
setAnchor2(A) {
|
|
2855
|
-
const I =
|
|
2855
|
+
const I = S.intoRaw(A);
|
|
2856
2856
|
this.rawSet.jointSetAnchor2(this.handle, I), I.free();
|
|
2857
2857
|
}
|
|
2858
2858
|
setContactsEnabled(A) {
|
|
@@ -2928,7 +2928,7 @@ class bA {
|
|
|
2928
2928
|
return C.anchor1 = A, C.anchor2 = I, C.axis = g, C.jointType = JA.Prismatic, C;
|
|
2929
2929
|
}
|
|
2930
2930
|
intoRaw() {
|
|
2931
|
-
let A, I, g =
|
|
2931
|
+
let A, I, g = S.intoRaw(this.anchor1), C = S.intoRaw(this.anchor2), Q = !1, E = 0, D = 0;
|
|
2932
2932
|
switch (this.jointType) {
|
|
2933
2933
|
case JA.Fixed:
|
|
2934
2934
|
let o = j.intoRaw(this.frame1), w = j.intoRaw(this.frame2);
|
|
@@ -2941,7 +2941,7 @@ class bA {
|
|
|
2941
2941
|
I = NA.rope(this.length, g, C);
|
|
2942
2942
|
break;
|
|
2943
2943
|
case JA.Prismatic:
|
|
2944
|
-
A =
|
|
2944
|
+
A = S.intoRaw(this.axis), this.limitsEnabled && (Q = !0, E = this.limits[0], D = this.limits[1]), I = NA.prismatic(g, C, A, Q, E, D), A.free();
|
|
2945
2945
|
break;
|
|
2946
2946
|
case JA.Revolute:
|
|
2947
2947
|
I = NA.revolute(g, C);
|
|
@@ -3111,7 +3111,7 @@ class BI {
|
|
|
3111
3111
|
}
|
|
3112
3112
|
static fromRaw(A) {
|
|
3113
3113
|
if (!A) return null;
|
|
3114
|
-
const I = new BI(A.time_of_impact(),
|
|
3114
|
+
const I = new BI(A.time_of_impact(), S.fromRaw(A.normal()), A.featureType(), A.featureId());
|
|
3115
3115
|
return A.free(), I;
|
|
3116
3116
|
}
|
|
3117
3117
|
}
|
|
@@ -3121,7 +3121,7 @@ class CI {
|
|
|
3121
3121
|
}
|
|
3122
3122
|
static fromRaw(A, I) {
|
|
3123
3123
|
if (!I) return null;
|
|
3124
|
-
const g = new CI(A.get(I.colliderHandle()), I.time_of_impact(),
|
|
3124
|
+
const g = new CI(A.get(I.colliderHandle()), I.time_of_impact(), S.fromRaw(I.normal()), I.featureType(), I.featureId());
|
|
3125
3125
|
return I.free(), g;
|
|
3126
3126
|
}
|
|
3127
3127
|
}
|
|
@@ -3141,7 +3141,7 @@ class EI {
|
|
|
3141
3141
|
}
|
|
3142
3142
|
static fromRaw(A) {
|
|
3143
3143
|
if (!A) return null;
|
|
3144
|
-
const I = new EI(
|
|
3144
|
+
const I = new EI(S.fromRaw(A.point()), A.isInside());
|
|
3145
3145
|
return A.free(), I;
|
|
3146
3146
|
}
|
|
3147
3147
|
}
|
|
@@ -3151,7 +3151,7 @@ class QI {
|
|
|
3151
3151
|
}
|
|
3152
3152
|
static fromRaw(A, I) {
|
|
3153
3153
|
if (!I) return null;
|
|
3154
|
-
const g = new QI(A.get(I.colliderHandle()),
|
|
3154
|
+
const g = new QI(A.get(I.colliderHandle()), S.fromRaw(I.point()), I.isInside(), I.featureType(), I.featureId());
|
|
3155
3155
|
return I.free(), g;
|
|
3156
3156
|
}
|
|
3157
3157
|
}
|
|
@@ -3161,7 +3161,7 @@ class vA {
|
|
|
3161
3161
|
}
|
|
3162
3162
|
static fromRaw(A, I) {
|
|
3163
3163
|
if (!I) return null;
|
|
3164
|
-
const g = new vA(I.time_of_impact(),
|
|
3164
|
+
const g = new vA(I.time_of_impact(), S.fromRaw(I.witness1()), S.fromRaw(I.witness2()), S.fromRaw(I.normal1()), S.fromRaw(I.normal2()));
|
|
3165
3165
|
return I.free(), g;
|
|
3166
3166
|
}
|
|
3167
3167
|
}
|
|
@@ -3171,7 +3171,7 @@ class iI extends vA {
|
|
|
3171
3171
|
}
|
|
3172
3172
|
static fromRaw(A, I) {
|
|
3173
3173
|
if (!I) return null;
|
|
3174
|
-
const g = new iI(A.get(I.colliderHandle()), I.time_of_impact(),
|
|
3174
|
+
const g = new iI(A.get(I.colliderHandle()), I.time_of_impact(), S.fromRaw(I.witness1()), S.fromRaw(I.witness2()), S.fromRaw(I.normal1()), S.fromRaw(I.normal2()));
|
|
3175
3175
|
return I.free(), g;
|
|
3176
3176
|
}
|
|
3177
3177
|
}
|
|
@@ -3183,43 +3183,43 @@ class EC {
|
|
|
3183
3183
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3184
3184
|
}
|
|
3185
3185
|
castRay(A, I, g, C, Q, E, D, o, w, h, G) {
|
|
3186
|
-
let
|
|
3187
|
-
return
|
|
3186
|
+
let K = S.intoRaw(C.origin), N = S.intoRaw(C.dir), M = RI.fromRaw(g, this.raw.castRay(A.raw, I.raw, g.raw, K, N, Q, E, D, o, w, h, G));
|
|
3187
|
+
return K.free(), N.free(), M;
|
|
3188
3188
|
}
|
|
3189
3189
|
castRayAndGetNormal(A, I, g, C, Q, E, D, o, w, h, G) {
|
|
3190
|
-
let
|
|
3191
|
-
return
|
|
3190
|
+
let K = S.intoRaw(C.origin), N = S.intoRaw(C.dir), M = CI.fromRaw(g, this.raw.castRayAndGetNormal(A.raw, I.raw, g.raw, K, N, Q, E, D, o, w, h, G));
|
|
3191
|
+
return K.free(), N.free(), M;
|
|
3192
3192
|
}
|
|
3193
|
-
intersectionsWithRay(A, I, g, C, Q, E, D, o, w, h, G,
|
|
3194
|
-
let
|
|
3195
|
-
this.raw.intersectionsWithRay(A.raw, I.raw, g.raw,
|
|
3193
|
+
intersectionsWithRay(A, I, g, C, Q, E, D, o, w, h, G, K) {
|
|
3194
|
+
let N = S.intoRaw(C.origin), M = S.intoRaw(C.dir);
|
|
3195
|
+
this.raw.intersectionsWithRay(A.raw, I.raw, g.raw, N, M, Q, E, (F) => D(CI.fromRaw(g, F)), o, w, h, G, K), N.free(), M.free();
|
|
3196
3196
|
}
|
|
3197
3197
|
intersectionWithShape(A, I, g, C, Q, E, D, o, w, h, G) {
|
|
3198
|
-
let
|
|
3199
|
-
return
|
|
3198
|
+
let K = S.intoRaw(C), N = j.intoRaw(Q), M = E.intoRaw(), F = this.raw.intersectionWithShape(A.raw, I.raw, g.raw, K, N, M, D, o, w, h, G);
|
|
3199
|
+
return K.free(), N.free(), M.free(), F;
|
|
3200
3200
|
}
|
|
3201
3201
|
projectPoint(A, I, g, C, Q, E, D, o, w, h) {
|
|
3202
|
-
let G =
|
|
3203
|
-
return G.free(),
|
|
3202
|
+
let G = S.intoRaw(C), K = QI.fromRaw(g, this.raw.projectPoint(A.raw, I.raw, g.raw, G, Q, E, D, o, w, h));
|
|
3203
|
+
return G.free(), K;
|
|
3204
3204
|
}
|
|
3205
3205
|
projectPointAndGetFeature(A, I, g, C, Q, E, D, o, w) {
|
|
3206
|
-
let h =
|
|
3206
|
+
let h = S.intoRaw(C), G = QI.fromRaw(g, this.raw.projectPointAndGetFeature(A.raw, I.raw, g.raw, h, Q, E, D, o, w));
|
|
3207
3207
|
return h.free(), G;
|
|
3208
3208
|
}
|
|
3209
3209
|
intersectionsWithPoint(A, I, g, C, Q, E, D, o, w, h) {
|
|
3210
|
-
let G =
|
|
3210
|
+
let G = S.intoRaw(C);
|
|
3211
3211
|
this.raw.intersectionsWithPoint(A.raw, I.raw, g.raw, G, Q, E, D, o, w, h), G.free();
|
|
3212
3212
|
}
|
|
3213
|
-
castShape(A, I, g, C, Q, E, D, o, w, h, G,
|
|
3214
|
-
let J =
|
|
3213
|
+
castShape(A, I, g, C, Q, E, D, o, w, h, G, K, N, M, F) {
|
|
3214
|
+
let J = S.intoRaw(C), k = j.intoRaw(Q), y = S.intoRaw(E), U = D.intoRaw(), R = iI.fromRaw(g, this.raw.castShape(A.raw, I.raw, g.raw, J, k, y, U, o, w, h, G, K, N, M, F));
|
|
3215
3215
|
return J.free(), k.free(), y.free(), U.free(), R;
|
|
3216
3216
|
}
|
|
3217
|
-
intersectionsWithShape(A, I, g, C, Q, E, D, o, w, h, G,
|
|
3218
|
-
let
|
|
3219
|
-
this.raw.intersectionsWithShape(A.raw, I.raw, g.raw,
|
|
3217
|
+
intersectionsWithShape(A, I, g, C, Q, E, D, o, w, h, G, K) {
|
|
3218
|
+
let N = S.intoRaw(C), M = j.intoRaw(Q), F = E.intoRaw();
|
|
3219
|
+
this.raw.intersectionsWithShape(A.raw, I.raw, g.raw, N, M, F, D, o, w, h, G, K), N.free(), M.free(), F.free();
|
|
3220
3220
|
}
|
|
3221
3221
|
collidersWithAabbIntersectingAabb(A, I, g, C, Q, E) {
|
|
3222
|
-
let D =
|
|
3222
|
+
let D = S.intoRaw(C), o = S.intoRaw(Q);
|
|
3223
3223
|
this.raw.collidersWithAabbIntersectingAabb(A.raw, I.raw, g.raw, D, o, E), D.free(), o.free();
|
|
3224
3224
|
}
|
|
3225
3225
|
}
|
|
@@ -3257,13 +3257,13 @@ class DC {
|
|
|
3257
3257
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3258
3258
|
}
|
|
3259
3259
|
normal() {
|
|
3260
|
-
return
|
|
3260
|
+
return S.fromRaw(this.raw.normal());
|
|
3261
3261
|
}
|
|
3262
3262
|
localNormal1() {
|
|
3263
|
-
return
|
|
3263
|
+
return S.fromRaw(this.raw.local_n1());
|
|
3264
3264
|
}
|
|
3265
3265
|
localNormal2() {
|
|
3266
|
-
return
|
|
3266
|
+
return S.fromRaw(this.raw.local_n2());
|
|
3267
3267
|
}
|
|
3268
3268
|
subshape1() {
|
|
3269
3269
|
return this.raw.subshape1();
|
|
@@ -3275,10 +3275,10 @@ class DC {
|
|
|
3275
3275
|
return this.raw.num_contacts();
|
|
3276
3276
|
}
|
|
3277
3277
|
localContactPoint1(A) {
|
|
3278
|
-
return
|
|
3278
|
+
return S.fromRaw(this.raw.contact_local_p1(A));
|
|
3279
3279
|
}
|
|
3280
3280
|
localContactPoint2(A) {
|
|
3281
|
-
return
|
|
3281
|
+
return S.fromRaw(this.raw.contact_local_p2(A));
|
|
3282
3282
|
}
|
|
3283
3283
|
contactDist(A) {
|
|
3284
3284
|
return this.raw.contact_dist(A);
|
|
@@ -3299,7 +3299,7 @@ class DC {
|
|
|
3299
3299
|
return this.raw.num_solver_contacts();
|
|
3300
3300
|
}
|
|
3301
3301
|
solverContactPoint(A) {
|
|
3302
|
-
return
|
|
3302
|
+
return S.fromRaw(this.raw.solver_contact_point(A));
|
|
3303
3303
|
}
|
|
3304
3304
|
solverContactDist(A) {
|
|
3305
3305
|
return this.raw.solver_contact_dist(A);
|
|
@@ -3311,7 +3311,7 @@ class DC {
|
|
|
3311
3311
|
return this.raw.solver_contact_restitution(A);
|
|
3312
3312
|
}
|
|
3313
3313
|
solverContactTangentVelocity(A) {
|
|
3314
|
-
return
|
|
3314
|
+
return S.fromRaw(this.raw.solver_contact_tangent_velocity(A));
|
|
3315
3315
|
}
|
|
3316
3316
|
}
|
|
3317
3317
|
class XA {
|
|
@@ -3320,7 +3320,7 @@ class XA {
|
|
|
3320
3320
|
}
|
|
3321
3321
|
static fromRaw(A) {
|
|
3322
3322
|
if (!A) return null;
|
|
3323
|
-
const I = new XA(A.distance(),
|
|
3323
|
+
const I = new XA(A.distance(), S.fromRaw(A.point1()), S.fromRaw(A.point2()), S.fromRaw(A.normal1()), S.fromRaw(A.normal2()));
|
|
3324
3324
|
return A.free(), I;
|
|
3325
3325
|
}
|
|
3326
3326
|
}
|
|
@@ -3338,22 +3338,22 @@ class SA {
|
|
|
3338
3338
|
case aA.Capsule:
|
|
3339
3339
|
return o = A.coHalfHeight(I), w = A.coRadius(I), new Bg(o, w);
|
|
3340
3340
|
case aA.Segment:
|
|
3341
|
-
return E = A.coVertices(I), new Eg(
|
|
3341
|
+
return E = A.coVertices(I), new Eg(S.new(E[0], E[1]), S.new(E[2], E[3]));
|
|
3342
3342
|
case aA.Polyline:
|
|
3343
3343
|
return E = A.coVertices(I), D = A.coIndices(I), new og(E, D);
|
|
3344
3344
|
case aA.Triangle:
|
|
3345
|
-
return E = A.coVertices(I), new ig(
|
|
3345
|
+
return E = A.coVertices(I), new ig(S.new(E[0], E[1]), S.new(E[2], E[3]), S.new(E[4], E[5]));
|
|
3346
3346
|
case aA.RoundTriangle:
|
|
3347
|
-
return E = A.coVertices(I), Q = A.coRoundRadius(I), new Dg(
|
|
3347
|
+
return E = A.coVertices(I), Q = A.coRoundRadius(I), new Dg(S.new(E[0], E[1]), S.new(E[2], E[3]), S.new(E[4], E[5]), Q);
|
|
3348
3348
|
case aA.HalfSpace:
|
|
3349
|
-
return h =
|
|
3349
|
+
return h = S.fromRaw(A.coHalfspaceNormal(I)), new gg(h);
|
|
3350
3350
|
case aA.Voxels:
|
|
3351
|
-
const G = A.coVoxelData(I),
|
|
3352
|
-
return new wg(G,
|
|
3351
|
+
const G = A.coVoxelData(I), K = A.coVoxelSize(I);
|
|
3352
|
+
return new wg(G, K);
|
|
3353
3353
|
case aA.TriMesh:
|
|
3354
3354
|
E = A.coVertices(I), D = A.coIndices(I);
|
|
3355
|
-
const
|
|
3356
|
-
return new Gg(E, D,
|
|
3355
|
+
const N = A.coTriMeshFlags(I);
|
|
3356
|
+
return new Gg(E, D, N);
|
|
3357
3357
|
case aA.HeightField:
|
|
3358
3358
|
const M = A.coHeightfieldScale(I), F = A.coHeightfieldHeights(I);
|
|
3359
3359
|
return new hg(F, M);
|
|
@@ -3366,35 +3366,35 @@ class SA {
|
|
|
3366
3366
|
}
|
|
3367
3367
|
}
|
|
3368
3368
|
castShape(A, I, g, C, Q, E, D, o, w, h) {
|
|
3369
|
-
let G =
|
|
3370
|
-
return G.free(),
|
|
3369
|
+
let G = S.intoRaw(A), K = j.intoRaw(I), N = S.intoRaw(g), M = S.intoRaw(Q), F = j.intoRaw(E), J = S.intoRaw(D), k = this.intoRaw(), y = C.intoRaw(), U = vA.fromRaw(null, k.castShape(G, K, N, y, M, F, J, o, w, h));
|
|
3370
|
+
return G.free(), K.free(), N.free(), M.free(), F.free(), J.free(), k.free(), y.free(), U;
|
|
3371
3371
|
}
|
|
3372
3372
|
intersectsShape(A, I, g, C, Q) {
|
|
3373
|
-
let E =
|
|
3374
|
-
return E.free(), D.free(), o.free(), w.free(), h.free(), G.free(),
|
|
3373
|
+
let E = S.intoRaw(A), D = j.intoRaw(I), o = S.intoRaw(C), w = j.intoRaw(Q), h = this.intoRaw(), G = g.intoRaw(), K = h.intersectsShape(E, D, G, o, w);
|
|
3374
|
+
return E.free(), D.free(), o.free(), w.free(), h.free(), G.free(), K;
|
|
3375
3375
|
}
|
|
3376
3376
|
contactShape(A, I, g, C, Q, E) {
|
|
3377
|
-
let D =
|
|
3378
|
-
return D.free(), o.free(), w.free(), h.free(), G.free(),
|
|
3377
|
+
let D = S.intoRaw(A), o = j.intoRaw(I), w = S.intoRaw(C), h = j.intoRaw(Q), G = this.intoRaw(), K = g.intoRaw(), N = XA.fromRaw(G.contactShape(D, o, K, w, h, E));
|
|
3378
|
+
return D.free(), o.free(), w.free(), h.free(), G.free(), K.free(), N;
|
|
3379
3379
|
}
|
|
3380
3380
|
containsPoint(A, I, g) {
|
|
3381
|
-
let C =
|
|
3381
|
+
let C = S.intoRaw(A), Q = j.intoRaw(I), E = S.intoRaw(g), D = this.intoRaw(), o = D.containsPoint(C, Q, E);
|
|
3382
3382
|
return C.free(), Q.free(), E.free(), D.free(), o;
|
|
3383
3383
|
}
|
|
3384
3384
|
projectPoint(A, I, g, C) {
|
|
3385
|
-
let Q =
|
|
3385
|
+
let Q = S.intoRaw(A), E = j.intoRaw(I), D = S.intoRaw(g), o = this.intoRaw(), w = EI.fromRaw(o.projectPoint(Q, E, D, C));
|
|
3386
3386
|
return Q.free(), E.free(), D.free(), o.free(), w;
|
|
3387
3387
|
}
|
|
3388
3388
|
intersectsRay(A, I, g, C) {
|
|
3389
|
-
let Q =
|
|
3389
|
+
let Q = S.intoRaw(I), E = j.intoRaw(g), D = S.intoRaw(A.origin), o = S.intoRaw(A.dir), w = this.intoRaw(), h = w.intersectsRay(Q, E, D, o, C);
|
|
3390
3390
|
return Q.free(), E.free(), D.free(), o.free(), w.free(), h;
|
|
3391
3391
|
}
|
|
3392
3392
|
castRay(A, I, g, C, Q) {
|
|
3393
|
-
let E =
|
|
3393
|
+
let E = S.intoRaw(I), D = j.intoRaw(g), o = S.intoRaw(A.origin), w = S.intoRaw(A.dir), h = this.intoRaw(), G = h.castRay(E, D, o, w, C, Q);
|
|
3394
3394
|
return E.free(), D.free(), o.free(), w.free(), h.free(), G;
|
|
3395
3395
|
}
|
|
3396
3396
|
castRayAndGetNormal(A, I, g, C, Q) {
|
|
3397
|
-
let E =
|
|
3397
|
+
let E = S.intoRaw(I), D = j.intoRaw(g), o = S.intoRaw(A.origin), w = S.intoRaw(A.dir), h = this.intoRaw(), G = BI.fromRaw(h.castRayAndGetNormal(E, D, o, w, C, Q));
|
|
3398
3398
|
return E.free(), D.free(), o.free(), w.free(), h.free(), G;
|
|
3399
3399
|
}
|
|
3400
3400
|
}
|
|
@@ -3416,13 +3416,13 @@ class gg extends SA {
|
|
|
3416
3416
|
super(), this.type = sA.HalfSpace, this.normal = A;
|
|
3417
3417
|
}
|
|
3418
3418
|
intoRaw() {
|
|
3419
|
-
let A =
|
|
3419
|
+
let A = S.intoRaw(this.normal), I = e.halfspace(A);
|
|
3420
3420
|
return A.free(), I;
|
|
3421
3421
|
}
|
|
3422
3422
|
}
|
|
3423
3423
|
class Cg extends SA {
|
|
3424
3424
|
constructor(A, I) {
|
|
3425
|
-
super(), this.type = sA.Cuboid, this.halfExtents =
|
|
3425
|
+
super(), this.type = sA.Cuboid, this.halfExtents = S.new(A, I);
|
|
3426
3426
|
}
|
|
3427
3427
|
intoRaw() {
|
|
3428
3428
|
return e.cuboid(this.halfExtents.x, this.halfExtents.y);
|
|
@@ -3430,7 +3430,7 @@ class Cg extends SA {
|
|
|
3430
3430
|
}
|
|
3431
3431
|
class Qg extends SA {
|
|
3432
3432
|
constructor(A, I, g) {
|
|
3433
|
-
super(), this.type = sA.RoundCuboid, this.halfExtents =
|
|
3433
|
+
super(), this.type = sA.RoundCuboid, this.halfExtents = S.new(A, I), this.borderRadius = g;
|
|
3434
3434
|
}
|
|
3435
3435
|
intoRaw() {
|
|
3436
3436
|
return e.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius);
|
|
@@ -3449,7 +3449,7 @@ class Eg extends SA {
|
|
|
3449
3449
|
super(), this.type = sA.Segment, this.a = A, this.b = I;
|
|
3450
3450
|
}
|
|
3451
3451
|
intoRaw() {
|
|
3452
|
-
let A =
|
|
3452
|
+
let A = S.intoRaw(this.a), I = S.intoRaw(this.b), g = e.segment(A, I);
|
|
3453
3453
|
return A.free(), I.free(), g;
|
|
3454
3454
|
}
|
|
3455
3455
|
}
|
|
@@ -3458,7 +3458,7 @@ class ig extends SA {
|
|
|
3458
3458
|
super(), this.type = sA.Triangle, this.a = A, this.b = I, this.c = g;
|
|
3459
3459
|
}
|
|
3460
3460
|
intoRaw() {
|
|
3461
|
-
let A =
|
|
3461
|
+
let A = S.intoRaw(this.a), I = S.intoRaw(this.b), g = S.intoRaw(this.c), C = e.triangle(A, I, g);
|
|
3462
3462
|
return A.free(), I.free(), g.free(), C;
|
|
3463
3463
|
}
|
|
3464
3464
|
}
|
|
@@ -3467,7 +3467,7 @@ class Dg extends SA {
|
|
|
3467
3467
|
super(), this.type = sA.RoundTriangle, this.a = A, this.b = I, this.c = g, this.borderRadius = C;
|
|
3468
3468
|
}
|
|
3469
3469
|
intoRaw() {
|
|
3470
|
-
let A =
|
|
3470
|
+
let A = S.intoRaw(this.a), I = S.intoRaw(this.b), g = S.intoRaw(this.c), C = e.roundTriangle(A, I, g, this.borderRadius);
|
|
3471
3471
|
return A.free(), I.free(), g.free(), C;
|
|
3472
3472
|
}
|
|
3473
3473
|
}
|
|
@@ -3484,7 +3484,7 @@ class wg extends SA {
|
|
|
3484
3484
|
super(), this.type = sA.Voxels, this.data = A, this.voxelSize = I;
|
|
3485
3485
|
}
|
|
3486
3486
|
intoRaw() {
|
|
3487
|
-
let A, I =
|
|
3487
|
+
let A, I = S.intoRaw(this.voxelSize);
|
|
3488
3488
|
return A = this.data instanceof Int32Array ? e.voxels(I, this.data) : e.voxelsFromPoints(I, this.data), I.free(), A;
|
|
3489
3489
|
}
|
|
3490
3490
|
}
|
|
@@ -3517,7 +3517,7 @@ class hg extends SA {
|
|
|
3517
3517
|
super(), this.type = sA.HeightField, this.heights = A, this.scale = I;
|
|
3518
3518
|
}
|
|
3519
3519
|
intoRaw() {
|
|
3520
|
-
let A =
|
|
3520
|
+
let A = S.intoRaw(this.scale), I = e.heightfield(this.heights, A);
|
|
3521
3521
|
return A.free(), I;
|
|
3522
3522
|
}
|
|
3523
3523
|
}
|
|
@@ -3528,9 +3528,9 @@ class oC {
|
|
|
3528
3528
|
free() {
|
|
3529
3529
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3530
3530
|
}
|
|
3531
|
-
step(A, I, g, C, Q, E, D, o, w, h, G,
|
|
3532
|
-
let
|
|
3533
|
-
G ? this.raw.stepWithEvents(
|
|
3531
|
+
step(A, I, g, C, Q, E, D, o, w, h, G, K) {
|
|
3532
|
+
let N = S.intoRaw(A);
|
|
3533
|
+
G ? this.raw.stepWithEvents(N, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw, h.raw, G.raw, K, K ? K.filterContactPair : null, K ? K.filterIntersectionPair : null) : this.raw.step(N, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw, h.raw), N.free();
|
|
3534
3534
|
}
|
|
3535
3535
|
}
|
|
3536
3536
|
class XI {
|
|
@@ -3541,7 +3541,7 @@ class XI {
|
|
|
3541
3541
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3542
3542
|
}
|
|
3543
3543
|
serializeAll(A, I, g, C, Q, E, D, o, w) {
|
|
3544
|
-
let h =
|
|
3544
|
+
let h = S.intoRaw(A);
|
|
3545
3545
|
const G = this.raw.serializeAll(h, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw);
|
|
3546
3546
|
return h.free(), G;
|
|
3547
3547
|
}
|
|
@@ -3578,7 +3578,7 @@ class sC {
|
|
|
3578
3578
|
return this.raw.up();
|
|
3579
3579
|
}
|
|
3580
3580
|
setUp(A) {
|
|
3581
|
-
let I =
|
|
3581
|
+
let I = S.intoRaw(A);
|
|
3582
3582
|
return this.raw.setUp(I);
|
|
3583
3583
|
}
|
|
3584
3584
|
applyImpulsesToDynamicBodies() {
|
|
@@ -3654,11 +3654,11 @@ class sC {
|
|
|
3654
3654
|
return this.raw.snapToGroundEnabled();
|
|
3655
3655
|
}
|
|
3656
3656
|
computeColliderMovement(A, I, g, C, Q) {
|
|
3657
|
-
let E =
|
|
3657
|
+
let E = S.intoRaw(I);
|
|
3658
3658
|
this.raw.computeColliderMovement(this.params.dt, this.broadPhase.raw, this.narrowPhase.raw, this.bodies.raw, this.colliders.raw, A.handle, E, this._applyImpulsesToDynamicBodies, this._characterMass, g, C, this.colliders.castClosure(Q)), E.free();
|
|
3659
3659
|
}
|
|
3660
3660
|
computedMovement() {
|
|
3661
|
-
return
|
|
3661
|
+
return S.fromRaw(this.raw.computedMovement());
|
|
3662
3662
|
}
|
|
3663
3663
|
computedGrounded() {
|
|
3664
3664
|
return this.raw.computedGrounded();
|
|
@@ -3669,7 +3669,7 @@ class sC {
|
|
|
3669
3669
|
computedCollision(A, I) {
|
|
3670
3670
|
if (this.raw.computedCollision(A, this.rawCharacterCollision)) {
|
|
3671
3671
|
let g = this.rawCharacterCollision;
|
|
3672
|
-
return (I = I ?? new hC()).translationDeltaApplied =
|
|
3672
|
+
return (I = I ?? new hC()).translationDeltaApplied = S.fromRaw(g.translationDeltaApplied()), I.translationDeltaRemaining = S.fromRaw(g.translationDeltaRemaining()), I.toi = g.toi(), I.witness1 = S.fromRaw(g.worldWitness1()), I.witness2 = S.fromRaw(g.worldWitness2()), I.normal1 = S.fromRaw(g.worldNormal1()), I.normal2 = S.fromRaw(g.worldNormal2()), I.collider = this.colliders.get(g.handle()), I;
|
|
3673
3673
|
}
|
|
3674
3674
|
return null;
|
|
3675
3675
|
}
|
|
@@ -3700,29 +3700,29 @@ class KC {
|
|
|
3700
3700
|
this.raw.reset_integrals();
|
|
3701
3701
|
}
|
|
3702
3702
|
applyLinearCorrection(A, I, g) {
|
|
3703
|
-
let C =
|
|
3703
|
+
let C = S.intoRaw(I), Q = S.intoRaw(g);
|
|
3704
3704
|
this.raw.apply_linear_correction(this.params.dt, this.bodies.raw, A.handle, C, Q), C.free(), Q.free();
|
|
3705
3705
|
}
|
|
3706
3706
|
applyAngularCorrection(A, I, g) {
|
|
3707
3707
|
this.raw.apply_angular_correction(this.params.dt, this.bodies.raw, A.handle, I, g);
|
|
3708
3708
|
}
|
|
3709
3709
|
linearCorrection(A, I, g) {
|
|
3710
|
-
let C =
|
|
3711
|
-
return C.free(), Q.free(),
|
|
3710
|
+
let C = S.intoRaw(I), Q = S.intoRaw(g), E = this.raw.linear_correction(this.params.dt, this.bodies.raw, A.handle, C, Q);
|
|
3711
|
+
return C.free(), Q.free(), S.fromRaw(E);
|
|
3712
3712
|
}
|
|
3713
3713
|
angularCorrection(A, I, g) {
|
|
3714
3714
|
return this.raw.angular_correction(this.params.dt, this.bodies.raw, A.handle, I, g);
|
|
3715
3715
|
}
|
|
3716
3716
|
}
|
|
3717
3717
|
class cI {
|
|
3718
|
-
constructor(A, I, g, C, Q, E, D, o, w, h, G,
|
|
3719
|
-
this.gravity = A, this.integrationParameters = new vg(I), this.islands = new BC(g), this.broadPhase = new EC(C), this.narrowPhase = new iC(Q), this.bodies = new Xg(E), this.colliders = new aC(D), this.impulseJoints = new $g(o), this.multibodyJoints = new CC(w), this.ccdSolver = new QC(h), this.physicsPipeline = new oC(G), this.serializationPipeline = new XI(
|
|
3718
|
+
constructor(A, I, g, C, Q, E, D, o, w, h, G, K, N) {
|
|
3719
|
+
this.gravity = A, this.integrationParameters = new vg(I), this.islands = new BC(g), this.broadPhase = new EC(C), this.narrowPhase = new iC(Q), this.bodies = new Xg(E), this.colliders = new aC(D), this.impulseJoints = new $g(o), this.multibodyJoints = new CC(w), this.ccdSolver = new QC(h), this.physicsPipeline = new oC(G), this.serializationPipeline = new XI(K), this.debugRenderPipeline = new GC(N), this.characterControllers = /* @__PURE__ */ new Set(), this.pidControllers = /* @__PURE__ */ new Set(), this.impulseJoints.finalizeDeserialization(this.bodies), this.bodies.finalizeDeserialization(this.colliders), this.colliders.finalizeDeserialization(this.bodies);
|
|
3720
3720
|
}
|
|
3721
3721
|
free() {
|
|
3722
3722
|
this.integrationParameters.free(), this.islands.free(), this.broadPhase.free(), this.narrowPhase.free(), this.bodies.free(), this.colliders.free(), this.impulseJoints.free(), this.multibodyJoints.free(), this.ccdSolver.free(), this.physicsPipeline.free(), this.serializationPipeline.free(), this.debugRenderPipeline.free(), this.characterControllers.forEach((A) => A.free()), this.pidControllers.forEach((A) => A.free()), this.integrationParameters = void 0, this.islands = void 0, this.broadPhase = void 0, this.narrowPhase = void 0, this.bodies = void 0, this.colliders = void 0, this.ccdSolver = void 0, this.impulseJoints = void 0, this.multibodyJoints = void 0, this.physicsPipeline = void 0, this.serializationPipeline = void 0, this.debugRenderPipeline = void 0, this.characterControllers = void 0, this.pidControllers = void 0;
|
|
3723
3723
|
}
|
|
3724
3724
|
static fromRaw(A) {
|
|
3725
|
-
return A ? new cI(
|
|
3725
|
+
return A ? new cI(S.fromRaw(A.takeGravity()), A.takeIntegrationParameters(), A.takeIslandManager(), A.takeBroadPhase(), A.takeNarrowPhase(), A.takeBodies(), A.takeColliders(), A.takeImpulseJoints(), A.takeMultibodyJoints()) : null;
|
|
3726
3726
|
}
|
|
3727
3727
|
takeSnapshot() {
|
|
3728
3728
|
return this.serializationPipeline.serializeAll(this.gravity, this.integrationParameters, this.islands, this.broadPhase, this.narrowPhase, this.bodies, this.colliders, this.impulseJoints, this.multibodyJoints);
|
|
@@ -3851,8 +3851,8 @@ class cI {
|
|
|
3851
3851
|
intersectionsWithPoint(A, I, g, C, Q, E, D) {
|
|
3852
3852
|
this.broadPhase.intersectionsWithPoint(this.narrowPhase, this.bodies, this.colliders, A, this.colliders.castClosure(I), g, C, Q ? Q.handle : null, E ? E.handle : null, this.colliders.castClosure(D));
|
|
3853
3853
|
}
|
|
3854
|
-
castShape(A, I, g, C, Q, E, D, o, w, h, G,
|
|
3855
|
-
return this.broadPhase.castShape(this.narrowPhase, this.bodies, this.colliders, A, I, g, C, Q, E, D, o, w, h ? h.handle : null, G ? G.handle : null, this.colliders.castClosure(
|
|
3854
|
+
castShape(A, I, g, C, Q, E, D, o, w, h, G, K) {
|
|
3855
|
+
return this.broadPhase.castShape(this.narrowPhase, this.bodies, this.colliders, A, I, g, C, Q, E, D, o, w, h ? h.handle : null, G ? G.handle : null, this.colliders.castClosure(K));
|
|
3856
3856
|
}
|
|
3857
3857
|
intersectionsWithShape(A, I, g, C, Q, E, D, o, w) {
|
|
3858
3858
|
this.broadPhase.intersectionsWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, g, this.colliders.castClosure(C), Q, E, D ? D.handle : null, o ? o.handle : null, this.colliders.castClosure(w));
|
|
@@ -3941,13 +3941,13 @@ class SC {
|
|
|
3941
3941
|
return this.raw.collider2();
|
|
3942
3942
|
}
|
|
3943
3943
|
totalForce() {
|
|
3944
|
-
return
|
|
3944
|
+
return S.fromRaw(this.raw.total_force());
|
|
3945
3945
|
}
|
|
3946
3946
|
totalForceMagnitude() {
|
|
3947
3947
|
return this.raw.total_force_magnitude();
|
|
3948
3948
|
}
|
|
3949
3949
|
maxForceDirection() {
|
|
3950
|
-
return
|
|
3950
|
+
return S.fromRaw(this.raw.max_force_direction());
|
|
3951
3951
|
}
|
|
3952
3952
|
maxForceMagnitude() {
|
|
3953
3953
|
return this.raw.max_force_magnitude();
|
|
@@ -4002,10 +4002,10 @@ class vI {
|
|
|
4002
4002
|
return this.colliderSet.raw.contains(this.handle);
|
|
4003
4003
|
}
|
|
4004
4004
|
translation() {
|
|
4005
|
-
return
|
|
4005
|
+
return S.fromRaw(this.colliderSet.raw.coTranslation(this.handle));
|
|
4006
4006
|
}
|
|
4007
4007
|
translationWrtParent() {
|
|
4008
|
-
return
|
|
4008
|
+
return S.fromRaw(this.colliderSet.raw.coTranslationWrtParent(this.handle));
|
|
4009
4009
|
}
|
|
4010
4010
|
rotation() {
|
|
4011
4011
|
return j.fromRaw(this.colliderSet.raw.coRotation(this.handle));
|
|
@@ -4090,7 +4090,7 @@ class vI {
|
|
|
4090
4090
|
this.colliderSet.raw.coSetMass(this.handle, A);
|
|
4091
4091
|
}
|
|
4092
4092
|
setMassProperties(A, I, g) {
|
|
4093
|
-
let C =
|
|
4093
|
+
let C = S.intoRaw(I);
|
|
4094
4094
|
this.colliderSet.raw.coSetMassProperties(this.handle, A, C, g), C.free();
|
|
4095
4095
|
}
|
|
4096
4096
|
setTranslation(A) {
|
|
@@ -4109,10 +4109,10 @@ class vI {
|
|
|
4109
4109
|
return this.colliderSet.raw.coShapeType(this.handle);
|
|
4110
4110
|
}
|
|
4111
4111
|
halfExtents() {
|
|
4112
|
-
return
|
|
4112
|
+
return S.fromRaw(this.colliderSet.raw.coHalfExtents(this.handle));
|
|
4113
4113
|
}
|
|
4114
4114
|
setHalfExtents(A) {
|
|
4115
|
-
const I =
|
|
4115
|
+
const I = S.intoRaw(A);
|
|
4116
4116
|
this.colliderSet.raw.coSetHalfExtents(this.handle, I);
|
|
4117
4117
|
}
|
|
4118
4118
|
radius() {
|
|
@@ -4153,7 +4153,7 @@ class vI {
|
|
|
4153
4153
|
}
|
|
4154
4154
|
heightfieldScale() {
|
|
4155
4155
|
let A = this.colliderSet.raw.coHeightfieldScale(this.handle);
|
|
4156
|
-
return
|
|
4156
|
+
return S.fromRaw(A);
|
|
4157
4157
|
}
|
|
4158
4158
|
parent() {
|
|
4159
4159
|
return this._parent;
|
|
@@ -4180,42 +4180,42 @@ class vI {
|
|
|
4180
4180
|
return this.colliderSet.raw.coSolverGroups(this.handle);
|
|
4181
4181
|
}
|
|
4182
4182
|
containsPoint(A) {
|
|
4183
|
-
let I =
|
|
4183
|
+
let I = S.intoRaw(A), g = this.colliderSet.raw.coContainsPoint(this.handle, I);
|
|
4184
4184
|
return I.free(), g;
|
|
4185
4185
|
}
|
|
4186
4186
|
projectPoint(A, I) {
|
|
4187
|
-
let g =
|
|
4187
|
+
let g = S.intoRaw(A), C = EI.fromRaw(this.colliderSet.raw.coProjectPoint(this.handle, g, I));
|
|
4188
4188
|
return g.free(), C;
|
|
4189
4189
|
}
|
|
4190
4190
|
intersectsRay(A, I) {
|
|
4191
|
-
let g =
|
|
4191
|
+
let g = S.intoRaw(A.origin), C = S.intoRaw(A.dir), Q = this.colliderSet.raw.coIntersectsRay(this.handle, g, C, I);
|
|
4192
4192
|
return g.free(), C.free(), Q;
|
|
4193
4193
|
}
|
|
4194
4194
|
castShape(A, I, g, C, Q, E, D, o) {
|
|
4195
|
-
let w =
|
|
4196
|
-
return w.free(), h.free(), G.free(),
|
|
4195
|
+
let w = S.intoRaw(A), h = S.intoRaw(g), G = j.intoRaw(C), K = S.intoRaw(Q), N = I.intoRaw(), M = vA.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, w, N, h, G, K, E, D, o));
|
|
4196
|
+
return w.free(), h.free(), G.free(), K.free(), N.free(), M;
|
|
4197
4197
|
}
|
|
4198
4198
|
castCollider(A, I, g, C, Q, E) {
|
|
4199
|
-
let D =
|
|
4199
|
+
let D = S.intoRaw(A), o = S.intoRaw(g), w = iI.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, D, I.handle, o, C, Q, E));
|
|
4200
4200
|
return D.free(), o.free(), w;
|
|
4201
4201
|
}
|
|
4202
4202
|
intersectsShape(A, I, g) {
|
|
4203
|
-
let C =
|
|
4203
|
+
let C = S.intoRaw(I), Q = j.intoRaw(g), E = A.intoRaw(), D = this.colliderSet.raw.coIntersectsShape(this.handle, E, C, Q);
|
|
4204
4204
|
return C.free(), Q.free(), E.free(), D;
|
|
4205
4205
|
}
|
|
4206
4206
|
contactShape(A, I, g, C) {
|
|
4207
|
-
let Q =
|
|
4207
|
+
let Q = S.intoRaw(I), E = j.intoRaw(g), D = A.intoRaw(), o = XA.fromRaw(this.colliderSet.raw.coContactShape(this.handle, D, Q, E, C));
|
|
4208
4208
|
return Q.free(), E.free(), D.free(), o;
|
|
4209
4209
|
}
|
|
4210
4210
|
contactCollider(A, I) {
|
|
4211
4211
|
return XA.fromRaw(this.colliderSet.raw.coContactCollider(this.handle, A.handle, I));
|
|
4212
4212
|
}
|
|
4213
4213
|
castRay(A, I, g) {
|
|
4214
|
-
let C =
|
|
4214
|
+
let C = S.intoRaw(A.origin), Q = S.intoRaw(A.dir), E = this.colliderSet.raw.coCastRay(this.handle, C, Q, I, g);
|
|
4215
4215
|
return C.free(), Q.free(), E;
|
|
4216
4216
|
}
|
|
4217
4217
|
castRayAndGetNormal(A, I, g) {
|
|
4218
|
-
let C =
|
|
4218
|
+
let C = S.intoRaw(A.origin), Q = S.intoRaw(A.dir), E = BI.fromRaw(this.colliderSet.raw.coCastRayAndGetNormal(this.handle, C, Q, I, g));
|
|
4219
4219
|
return C.free(), Q.free(), E;
|
|
4220
4220
|
}
|
|
4221
4221
|
}
|
|
@@ -4224,7 +4224,7 @@ class vI {
|
|
|
4224
4224
|
})(TA || (TA = {}));
|
|
4225
4225
|
class oA {
|
|
4226
4226
|
constructor(A) {
|
|
4227
|
-
this.enabled = !0, this.shape = A, this.massPropsMode = TA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation = j.identity(), this.translation =
|
|
4227
|
+
this.enabled = !0, this.shape = A, this.massPropsMode = TA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation = j.identity(), this.translation = S.zeros(), this.isSensor = !1, this.collisionGroups = 4294967295, this.solverGroups = 4294967295, this.frictionCombineRule = gI.Average, this.restitutionCombineRule = gI.Average, this.activeCollisionTypes = KI.DEFAULT, this.activeEvents = hI.NONE, this.activeHooks = sI.NONE, this.mass = 0, this.centerOfMass = S.zeros(), this.contactForceEventThreshold = 0, this.contactSkin = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0;
|
|
4228
4228
|
}
|
|
4229
4229
|
static ball(A) {
|
|
4230
4230
|
const I = new Ig(A);
|
|
@@ -4313,7 +4313,7 @@ class oA {
|
|
|
4313
4313
|
return this.massPropsMode = TA.Mass, this.mass = A, this;
|
|
4314
4314
|
}
|
|
4315
4315
|
setMassProperties(A, I, g) {
|
|
4316
|
-
return this.massPropsMode = TA.MassProps, this.mass = A,
|
|
4316
|
+
return this.massPropsMode = TA.MassProps, this.mass = A, S.copy(this.centerOfMass, I), this.principalAngularInertia = g, this;
|
|
4317
4317
|
}
|
|
4318
4318
|
setRestitution(A) {
|
|
4319
4319
|
return this.restitution = A, this;
|
|
@@ -4364,7 +4364,7 @@ class aC {
|
|
|
4364
4364
|
createCollider(A, I, g) {
|
|
4365
4365
|
let C = g != null && g != null;
|
|
4366
4366
|
if (C && isNaN(g)) throw Error("Cannot create a collider with a parent rigid-body handle that is not a number.");
|
|
4367
|
-
let Q = I.shape.intoRaw(), E =
|
|
4367
|
+
let Q = I.shape.intoRaw(), E = S.intoRaw(I.translation), D = j.intoRaw(I.rotation), o = S.intoRaw(I.centerOfMass), w = this.raw.createCollider(I.enabled, Q, E, D, I.massPropsMode, I.mass, o, I.principalAngularInertia, I.density, I.friction, I.restitution, I.frictionCombineRule, I.restitutionCombineRule, I.isSensor, I.collisionGroups, I.solverGroups, I.activeCollisionTypes, I.activeHooks, I.activeEvents, I.contactForceEventThreshold, I.contactSkin, C, C ? g : 0, A.raw);
|
|
4368
4368
|
Q.free(), E.free(), D.free(), o.free();
|
|
4369
4369
|
let h = C ? A.get(g) : null, G = new vI(this, w, h, I.shape);
|
|
4370
4370
|
return this.map.set(w, G), G;
|
|
@@ -4462,7 +4462,7 @@ function TC(i) {
|
|
|
4462
4462
|
A = i, B.reserve_memory(A);
|
|
4463
4463
|
}
|
|
4464
4464
|
UA[45] = 62, UA[95] = 63;
|
|
4465
|
-
var FA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector2: mg, VectorOps:
|
|
4465
|
+
var FA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector2: mg, VectorOps: S, RotationOps: j, get RigidBodyType() {
|
|
4466
4466
|
return cA;
|
|
4467
4467
|
}, RigidBody: mI, RigidBodyDesc: eA, RigidBodySet: Xg, IntegrationParameters: vg, get JointType() {
|
|
4468
4468
|
return JA;
|
|
@@ -4658,6 +4658,9 @@ class WC {
|
|
|
4658
4658
|
if (this.objectStates.clear(), this.inputs.clear(), this.inputNameMap.clear(), this.layerStates.clear(), this.physicsEngine && (this.physicsEngine.destroy(), this.physicsEngine = null), this.artboard.objects.forEach((I) => {
|
|
4659
4659
|
this.objectStates.set(I.id, {
|
|
4660
4660
|
...I.transform,
|
|
4661
|
+
width: I.width,
|
|
4662
|
+
height: I.height,
|
|
4663
|
+
cornerRadius: I.cornerRadius ?? I.corner_radius,
|
|
4661
4664
|
opacity: I.opacity !== void 0 ? I.opacity : 1,
|
|
4662
4665
|
visible: I.visible !== void 0 ? I.visible : I.isVisible !== void 0 ? I.isVisible : !0,
|
|
4663
4666
|
blendMode: I.blendMode || "Normal",
|
|
@@ -4817,10 +4820,10 @@ class WC {
|
|
|
4817
4820
|
for (const o of E.transitions)
|
|
4818
4821
|
this.checkConditions(o.conditions) && (g.push(o.targetStateId), D = !0, C = !0, o.conditions && o.conditions.forEach((w) => {
|
|
4819
4822
|
var G;
|
|
4820
|
-
const h = (G = this.activeStateMachine) == null ? void 0 : G.inputs.find((
|
|
4823
|
+
const h = (G = this.activeStateMachine) == null ? void 0 : G.inputs.find((K) => K.id === w.inputId);
|
|
4821
4824
|
if (h && typeof h.value == "object" && h.value.type === "Number" && (this.setInternalInput(w.inputId, 0), this.inputNameMap.has(h.name))) {
|
|
4822
|
-
const
|
|
4823
|
-
|
|
4825
|
+
const K = this.inputNameMap.get(h.name);
|
|
4826
|
+
K == null || K.forEach((N) => this.setInternalInput(N, 0));
|
|
4824
4827
|
}
|
|
4825
4828
|
}));
|
|
4826
4829
|
D || g.push(Q);
|
|
@@ -4909,8 +4912,8 @@ class WC {
|
|
|
4909
4912
|
const C = (D = (E = this.activeStateMachine) == null ? void 0 : E.logicNodes) == null ? void 0 : D.find((w) => w.id === A);
|
|
4910
4913
|
if (C) {
|
|
4911
4914
|
const w = (h, G) => {
|
|
4912
|
-
const
|
|
4913
|
-
return
|
|
4915
|
+
const K = C.inputs.find((N) => N.id === h);
|
|
4916
|
+
return K ? K.sourceId ? this.evaluateLogicTree(K.sourceId, K.sourceHandleId, g) : K.value !== void 0 ? K.value : G : G;
|
|
4914
4917
|
};
|
|
4915
4918
|
switch (C.op) {
|
|
4916
4919
|
case PA.AND:
|
|
@@ -4960,11 +4963,11 @@ class WC {
|
|
|
4960
4963
|
if (I.phase === "entry")
|
|
4961
4964
|
I.time += A, I.time >= I.animation.duration && ((E = (Q = (C = this.artboard) == null ? void 0 : C.objects.find((G) => G.id === g)) == null ? void 0 : Q.triggers) == null || E.find((G) => G.id === I.triggerId), I.phase = "hold", I.elapsedHold = 0, I.time = I.animation.duration), this.applyAnimation(I.animation, I.time);
|
|
4962
4965
|
else if (I.phase === "hold") {
|
|
4963
|
-
const G = (w = (o = (D = this.artboard) == null ? void 0 : D.objects.find((
|
|
4964
|
-
if (I.elapsedHold += A * 1e3, I.elapsedHold >=
|
|
4966
|
+
const G = (w = (o = (D = this.artboard) == null ? void 0 : D.objects.find((N) => N.id === g)) == null ? void 0 : o.triggers) == null ? void 0 : w.find((N) => N.id === I.triggerId), K = (G == null ? void 0 : G.duration) || 0;
|
|
4967
|
+
if (I.elapsedHold += A * 1e3, I.elapsedHold >= K)
|
|
4965
4968
|
if (G != null && G.exitAnimationId) {
|
|
4966
|
-
const
|
|
4967
|
-
|
|
4969
|
+
const N = (h = this.artboard) == null ? void 0 : h.animations.find((M) => M.id === G.exitAnimationId);
|
|
4970
|
+
N ? (I.phase = "exit", I.animation = N, I.time = 0) : this.activeTriggers.delete(g);
|
|
4968
4971
|
} else
|
|
4969
4972
|
this.activeTriggers.delete(g);
|
|
4970
4973
|
} else I.phase === "exit" && (I.time += A, I.time >= I.animation.duration ? this.activeTriggers.delete(g) : this.applyAnimation(I.animation, I.time));
|
|
@@ -4981,12 +4984,12 @@ class WC {
|
|
|
4981
4984
|
const G = this.objectStates.get(g.targetId);
|
|
4982
4985
|
G && (g.copyX && (I.x = I.x + (G.x - I.x) * C), g.copyY && (I.y = I.y + (G.y - I.y) * C), (Q = g.limitX) != null && Q.enabled && (I.x = Math.max(g.limitX.min, Math.min(g.limitX.max, I.x))), (E = g.limitY) != null && E.enabled && (I.y = Math.max(g.limitY.min, Math.min(g.limitY.max, I.y))));
|
|
4983
4986
|
} else if (g.type === "FollowPointer") {
|
|
4984
|
-
const G = ((D = this._lastPointerPos) == null ? void 0 : D.x) ?? I.x,
|
|
4985
|
-
I.x = I.x + (G - I.x) * C, I.y = I.y + (
|
|
4987
|
+
const G = ((D = this._lastPointerPos) == null ? void 0 : D.x) ?? I.x, K = ((o = this._lastPointerPos) == null ? void 0 : o.y) ?? I.y;
|
|
4988
|
+
I.x = I.x + (G - I.x) * C, I.y = I.y + (K - I.y) * C, (w = g.limitX) != null && w.enabled && (I.x = Math.max(g.limitX.min, Math.min(g.limitX.max, I.x))), (h = g.limitY) != null && h.enabled && (I.y = Math.max(g.limitY.min, Math.min(g.limitY.max, I.y)));
|
|
4986
4989
|
} else if (g.type === "Distance") {
|
|
4987
4990
|
const G = this.objectStates.get(g.targetId);
|
|
4988
4991
|
if (G) {
|
|
4989
|
-
const
|
|
4992
|
+
const K = I.x - G.x, N = I.y - G.y, M = Math.sqrt(K * K + N * N), F = g.distance || 0;
|
|
4990
4993
|
let J = M;
|
|
4991
4994
|
switch (g.mode) {
|
|
4992
4995
|
case "exact":
|
|
@@ -5004,7 +5007,7 @@ class WC {
|
|
|
5004
5007
|
}
|
|
5005
5008
|
if (M > 0) {
|
|
5006
5009
|
const k = J / M;
|
|
5007
|
-
I.x = G.x +
|
|
5010
|
+
I.x = G.x + K * k, I.y = G.y + N * k;
|
|
5008
5011
|
} else M === 0 && J > 0 && (I.x = G.x + J);
|
|
5009
5012
|
}
|
|
5010
5013
|
}
|
|
@@ -5028,10 +5031,10 @@ class WC {
|
|
|
5028
5031
|
if (!this.artboard) return;
|
|
5029
5032
|
let C = null;
|
|
5030
5033
|
const Q = (h, G) => {
|
|
5031
|
-
let
|
|
5032
|
-
G === "click" ?
|
|
5033
|
-
const
|
|
5034
|
-
return G === "move" &&
|
|
5034
|
+
let K = G;
|
|
5035
|
+
G === "click" ? K = "onClick" : G === "down" ? K = "onPointerDown" : G === "up" ? K = "onPointerUp" : G === "blur" && (K = "onPointerLeave");
|
|
5036
|
+
const N = /* @__PURE__ */ new Set([K]);
|
|
5037
|
+
return G === "move" && N.add("onPointerEnter").add("hover").add("onPointerLeave").add("blur"), K === "onClick" && N.add("click"), K === "onPointerDown" && N.add("pointerDown"), K === "onPointerUp" && N.add("pointerUp"), !!((h.interactions || []).some((J) => N.has(J.event)) || (h.triggers || []).some((J) => N.has(J.eventType)));
|
|
5035
5038
|
};
|
|
5036
5039
|
let E = null;
|
|
5037
5040
|
for (let h = this.artboard.objects.length - 1; h >= 0; h--) {
|
|
@@ -5075,9 +5078,9 @@ class WC {
|
|
|
5075
5078
|
});
|
|
5076
5079
|
}
|
|
5077
5080
|
if (C.type === "Component" && C.variant === "dropdown" && A === "down") {
|
|
5078
|
-
const G = C.options || {},
|
|
5081
|
+
const G = C.options || {}, K = !G.isOpen;
|
|
5079
5082
|
if (G.isOpen) {
|
|
5080
|
-
const
|
|
5083
|
+
const N = ((o = C.geometry) == null ? void 0 : o.height) ?? C.height ?? 40, M = G.optionsList || [], F = G.itemHeight || 32, J = G.listPadding ?? 4, k = this.getWorldTransform(C.id), y = g - (k.y + N / 2 + 4);
|
|
5081
5084
|
if (y >= 0) {
|
|
5082
5085
|
const U = Math.floor((y - J) / F);
|
|
5083
5086
|
if (U >= 0 && U < M.length) {
|
|
@@ -5093,11 +5096,11 @@ class WC {
|
|
|
5093
5096
|
}
|
|
5094
5097
|
}
|
|
5095
5098
|
}
|
|
5096
|
-
if (
|
|
5097
|
-
const
|
|
5098
|
-
|
|
5099
|
+
if (K && this.activeDropdownId && this.activeDropdownId !== C.id) {
|
|
5100
|
+
const N = this.artboard.objects.find((M) => M.id === this.activeDropdownId);
|
|
5101
|
+
N && N.options && (N.options.isOpen = !1);
|
|
5099
5102
|
}
|
|
5100
|
-
G.isOpen =
|
|
5103
|
+
G.isOpen = K, this.activeDropdownId = K ? C.id : null;
|
|
5101
5104
|
}
|
|
5102
5105
|
if (C.type === "Component" && C.variant === "button" && A === "down" && this.onComponentChange && this.onComponentChange({
|
|
5103
5106
|
objectId: C.id,
|
|
@@ -5106,7 +5109,7 @@ class WC {
|
|
|
5106
5109
|
property: "click",
|
|
5107
5110
|
value: !0
|
|
5108
5111
|
}), A === "click") {
|
|
5109
|
-
const G = (w = this.artboard) == null ? void 0 : w.objects.find((
|
|
5112
|
+
const G = (w = this.artboard) == null ? void 0 : w.objects.find((K) => K.id === C.id);
|
|
5110
5113
|
(G == null ? void 0 : G.type) === "Component" && G.variant === "inputbox" ? (this.focusedId = C.id, console.log(`[Engine] Focus set to: ${C.id}`)) : this.focusedId = null;
|
|
5111
5114
|
}
|
|
5112
5115
|
} else A === "click" && (this.focusedId = null);
|
|
@@ -5168,10 +5171,10 @@ class WC {
|
|
|
5168
5171
|
}
|
|
5169
5172
|
}
|
|
5170
5173
|
getWorldTransform(A) {
|
|
5171
|
-
var
|
|
5174
|
+
var K;
|
|
5172
5175
|
const I = this.objectStates.get(A);
|
|
5173
5176
|
if (!I) return { x: 0, y: 0, scaleX: 1, scaleY: 1, rotation: 0 };
|
|
5174
|
-
const g = (
|
|
5177
|
+
const g = (K = this.artboard) == null ? void 0 : K.objects.find((N) => N.id === A);
|
|
5175
5178
|
if (!g || !g.parentId)
|
|
5176
5179
|
return {
|
|
5177
5180
|
x: I.x,
|
|
@@ -5192,14 +5195,14 @@ class WC {
|
|
|
5192
5195
|
hitTest(A, I, g) {
|
|
5193
5196
|
var U, R;
|
|
5194
5197
|
if (!this.objectStates.get(A.id)) return !1;
|
|
5195
|
-
const Q = ((U = A.geometry) == null ? void 0 : U.width) ?? A.width ?? 100, E = ((R = A.geometry) == null ? void 0 : R.height) ?? A.height ?? 100, D = this.getWorldTransform(A.id), o = I - D.x, w = g - D.y, h = -D.rotation * (Math.PI / 180), G = Math.cos(h),
|
|
5196
|
-
return Math.abs(
|
|
5198
|
+
const Q = ((U = A.geometry) == null ? void 0 : U.width) ?? A.width ?? 100, E = ((R = A.geometry) == null ? void 0 : R.height) ?? A.height ?? 100, D = this.getWorldTransform(A.id), o = I - D.x, w = g - D.y, h = -D.rotation * (Math.PI / 180), G = Math.cos(h), K = Math.sin(h), N = o * G - w * K, M = o * K + w * G, F = D.scaleX, J = D.scaleY, k = Q * Math.abs(F), y = E * Math.abs(J);
|
|
5199
|
+
return Math.abs(N) <= k / 2 && Math.abs(M) <= y / 2;
|
|
5197
5200
|
}
|
|
5198
5201
|
updateSliderValueFromPointer(A, I, g) {
|
|
5199
5202
|
var L;
|
|
5200
5203
|
if (!this.objectStates.get(A.id)) return;
|
|
5201
|
-
const Q = A.options || {}, E = ((L = A.geometry) == null ? void 0 : L.width) ?? A.width ?? 200, D = this.getWorldTransform(A.id), o = I - D.x, w = g - D.y, h = -D.rotation * (Math.PI / 180), G = Math.cos(h),
|
|
5202
|
-
let k = (
|
|
5204
|
+
const Q = A.options || {}, E = ((L = A.geometry) == null ? void 0 : L.width) ?? A.width ?? 200, D = this.getWorldTransform(A.id), o = I - D.x, w = g - D.y, h = -D.rotation * (Math.PI / 180), G = Math.cos(h), K = Math.sin(h), N = o * G - w * K, M = Q.thumbWidth ?? 16, F = E - M;
|
|
5205
|
+
let k = (N + F / 2) / F;
|
|
5203
5206
|
k = Math.max(0, Math.min(1, k));
|
|
5204
5207
|
const y = Q.min ?? 0, U = Q.max ?? 100, R = Q.step || 1;
|
|
5205
5208
|
let c = y + k * (U - y);
|
|
@@ -5222,17 +5225,17 @@ class WC {
|
|
|
5222
5225
|
const D = this.interpolate(g.keyframes, I);
|
|
5223
5226
|
if (g.property.includes(".")) {
|
|
5224
5227
|
const G = (g.property || "").split(".");
|
|
5225
|
-
let
|
|
5226
|
-
for (let
|
|
5227
|
-
if (!
|
|
5228
|
+
let K = E;
|
|
5229
|
+
for (let N = 0; N < G.length - 1; N++) {
|
|
5230
|
+
if (!K[G[N]]) {
|
|
5228
5231
|
let M = C;
|
|
5229
|
-
for (let F = 0; F <=
|
|
5232
|
+
for (let F = 0; F <= N; F++)
|
|
5230
5233
|
M = M ? M[G[F]] : null;
|
|
5231
|
-
|
|
5234
|
+
K[G[N]] = M ? JSON.parse(JSON.stringify(M)) : {};
|
|
5232
5235
|
}
|
|
5233
|
-
|
|
5236
|
+
K = K[G[N]];
|
|
5234
5237
|
}
|
|
5235
|
-
|
|
5238
|
+
K[G[G.length - 1]] = D;
|
|
5236
5239
|
} else
|
|
5237
5240
|
E[g.property] = D;
|
|
5238
5241
|
if (this.physicsEngine && ((h = C == null ? void 0 : C.physics) != null && h.enabled) && C.physics.bodyType === "Static")
|
|
@@ -5266,15 +5269,15 @@ class WC {
|
|
|
5266
5269
|
}
|
|
5267
5270
|
interpolateColor(A, I, g) {
|
|
5268
5271
|
const C = (G) => {
|
|
5269
|
-
const
|
|
5272
|
+
const K = G.replace("#", "");
|
|
5270
5273
|
return {
|
|
5271
|
-
r: parseInt(
|
|
5272
|
-
g: parseInt(
|
|
5273
|
-
b: parseInt(
|
|
5274
|
+
r: parseInt(K.substring(0, 2), 16),
|
|
5275
|
+
g: parseInt(K.substring(2, 4), 16),
|
|
5276
|
+
b: parseInt(K.substring(4, 6), 16)
|
|
5274
5277
|
};
|
|
5275
5278
|
}, Q = C(A), E = C(I), D = Math.round(Q.r + (E.r - Q.r) * g), o = Math.round(Q.g + (E.g - Q.g) * g), w = Math.round(Q.b + (E.b - Q.b) * g), h = (G) => {
|
|
5276
|
-
const
|
|
5277
|
-
return
|
|
5279
|
+
const K = Math.max(0, Math.min(255, G)).toString(16);
|
|
5280
|
+
return K.length === 1 ? "0" + K : K;
|
|
5278
5281
|
};
|
|
5279
5282
|
return `#${h(D)}${h(o)}${h(w)}`;
|
|
5280
5283
|
}
|
|
@@ -5295,9 +5298,9 @@ class WC {
|
|
|
5295
5298
|
let h = this.imageCache.get(w);
|
|
5296
5299
|
if (h || (h = new Image(), h.src = w, this.imageCache.set(w, h)), h.complete && h.naturalWidth > 0) {
|
|
5297
5300
|
A.save(), A.globalAlpha = this.artboard.backgroundOpacity ?? 1;
|
|
5298
|
-
const G = h.naturalWidth / h.naturalHeight,
|
|
5299
|
-
let
|
|
5300
|
-
|
|
5301
|
+
const G = h.naturalWidth / h.naturalHeight, K = C / Q;
|
|
5302
|
+
let N, M, F, J;
|
|
5303
|
+
K > G ? (N = C, M = C / G) : (M = Q, N = Q * G), F = -N / 2, J = -M / 2, A.drawImage(h, F, J, N, M), A.restore();
|
|
5301
5304
|
}
|
|
5302
5305
|
}
|
|
5303
5306
|
A.beginPath(), A.rect(-C / 2, -Q / 2, C, Q), A.clip();
|
|
@@ -5309,8 +5312,8 @@ class WC {
|
|
|
5309
5312
|
const h = this.objectStates.get(w.id), G = (h == null ? void 0 : h.geometry) || w.geometry;
|
|
5310
5313
|
if (G && G.isMask && (h == null ? void 0 : h.visible) !== !1) {
|
|
5311
5314
|
A.save(), this.applyObjectTransform(A, w.id);
|
|
5312
|
-
const
|
|
5313
|
-
this.applyPath(A, G,
|
|
5315
|
+
const K = G.width || 0, N = G.height || 0;
|
|
5316
|
+
this.applyPath(A, G, K, N), A.clip(), o++;
|
|
5314
5317
|
} else
|
|
5315
5318
|
this.renderObject(A, w, D);
|
|
5316
5319
|
}
|
|
@@ -5347,9 +5350,9 @@ class WC {
|
|
|
5347
5350
|
D = o = 1;
|
|
5348
5351
|
break;
|
|
5349
5352
|
}
|
|
5350
|
-
const
|
|
5353
|
+
const K = g * D, N = C * o;
|
|
5351
5354
|
let M = 0, F = 0;
|
|
5352
|
-
return E.includes("Left") ? M = 0 : E.includes("Right") ? M = A -
|
|
5355
|
+
return E.includes("Left") ? M = 0 : E.includes("Right") ? M = A - K : M = (A - K) / 2, E.includes("Top") ? F = 0 : E.includes("Bottom") ? F = I - N : F = (I - N) / 2, { scaleX: D, scaleY: o, tx: M, ty: F };
|
|
5353
5356
|
}
|
|
5354
5357
|
mapFontWeight(A) {
|
|
5355
5358
|
const I = A.toLowerCase();
|
|
@@ -5363,21 +5366,19 @@ class WC {
|
|
|
5363
5366
|
return;
|
|
5364
5367
|
}
|
|
5365
5368
|
A.roundRect || (A.roundRect = (k, y, U, R, c) => (this.drawRoundRect(A, k, y, U, R, c), A));
|
|
5366
|
-
const Q = C.geometry
|
|
5369
|
+
const Q = C.geometry ? { ...I.geometry, ...C.geometry } : I.geometry, E = C.style ? { ...I.style, ...C.style } : I.style;
|
|
5367
5370
|
if (C.visible === !1)
|
|
5368
5371
|
return;
|
|
5369
|
-
const
|
|
5372
|
+
const D = Q.width || 0, o = Q.height || 0, w = C.x, h = C.y;
|
|
5370
5373
|
A.save();
|
|
5371
|
-
const
|
|
5372
|
-
A.globalAlpha =
|
|
5373
|
-
const
|
|
5374
|
-
if (
|
|
5375
|
-
const k =
|
|
5374
|
+
const G = A.globalAlpha, K = C.opacity !== void 0 ? C.opacity : 1;
|
|
5375
|
+
A.globalAlpha = G * K;
|
|
5376
|
+
const N = C.compositeOperation || C.blendMode;
|
|
5377
|
+
if (N && N !== "Normal") {
|
|
5378
|
+
const k = N.toLowerCase();
|
|
5376
5379
|
["multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"].includes(k) && (A.globalCompositeOperation = k);
|
|
5377
5380
|
}
|
|
5378
|
-
A.translate(
|
|
5379
|
-
const K = C.style || I.style;
|
|
5380
|
-
if (Q.type === "Text") {
|
|
5381
|
+
if (A.translate(w, h), A.rotate(C.rotation * Math.PI / 180), A.scale(C.scale_x, C.scale_y), Q.type === "Text") {
|
|
5381
5382
|
let k = Q.text || "";
|
|
5382
5383
|
if (Q.textInputId) {
|
|
5383
5384
|
const t = this.inputs.get(Q.textInputId);
|
|
@@ -5392,13 +5393,13 @@ class WC {
|
|
|
5392
5393
|
const L = this.mapFontWeight(R), r = Math.max(1, Q.fontSize || 16);
|
|
5393
5394
|
A.font = `${c} ${L} ${r}px "${Q.fontFamily || "Inter"}", sans-serif`;
|
|
5394
5395
|
const p = Q.textVerticalAlign || "top";
|
|
5395
|
-
let q = -
|
|
5396
|
-
p === "middle" || p === "center" ? (A.textBaseline = "middle", q = 0) : p === "bottom" ? (A.textBaseline = "bottom", q =
|
|
5396
|
+
let q = -o / 2;
|
|
5397
|
+
p === "middle" || p === "center" ? (A.textBaseline = "middle", q = 0) : p === "bottom" ? (A.textBaseline = "bottom", q = o / 2) : (A.textBaseline = "top", q = -o / 2);
|
|
5397
5398
|
const AA = Q.textAlign || "left";
|
|
5398
5399
|
A.textAlign = AA;
|
|
5399
|
-
let GA = -
|
|
5400
|
-
AA === "center" && (GA = 0), AA === "right" && (GA =
|
|
5401
|
-
const v = Q.letterSpacing || 0, W = Q.paragraphSpacing || 0, T = (Q.lineHeight || 1.2) * r, IA = (Q.width ||
|
|
5400
|
+
let GA = -D / 2;
|
|
5401
|
+
AA === "center" && (GA = 0), AA === "right" && (GA = D / 2);
|
|
5402
|
+
const v = Q.letterSpacing || 0, W = Q.paragraphSpacing || 0, T = (Q.lineHeight || 1.2) * r, IA = (Q.width || D || 200) + 15, x = (t) => {
|
|
5402
5403
|
if (v === 0) return A.measureText(t).width;
|
|
5403
5404
|
let n = 0;
|
|
5404
5405
|
for (let l = 0; l < t.length; l++)
|
|
@@ -5455,18 +5456,18 @@ class WC {
|
|
|
5455
5456
|
}
|
|
5456
5457
|
}
|
|
5457
5458
|
};
|
|
5458
|
-
if (
|
|
5459
|
-
const t = A.globalAlpha, n = this.createCanvasFill(A,
|
|
5460
|
-
A.fillStyle = n ||
|
|
5459
|
+
if (E.fill) {
|
|
5460
|
+
const t = A.globalAlpha, n = this.createCanvasFill(A, E.fill, D, o);
|
|
5461
|
+
A.fillStyle = n || E.fill.color || "#000000", A.globalAlpha = t * (E.fill.opacity ?? 1);
|
|
5461
5462
|
let l = 0, Z = kA;
|
|
5462
5463
|
d.forEach((V) => {
|
|
5463
5464
|
const BA = y.indexOf(V.text, l);
|
|
5464
5465
|
BA !== -1 && (m(V.text, GA, Z, !1, BA), l = BA + V.text.length, Z += T + (V.isParaEnd ? W : 0));
|
|
5465
5466
|
}), A.globalAlpha = t;
|
|
5466
5467
|
}
|
|
5467
|
-
if (
|
|
5468
|
+
if (E.stroke && E.stroke.width > 0) {
|
|
5468
5469
|
const t = A.globalAlpha;
|
|
5469
|
-
A.strokeStyle =
|
|
5470
|
+
A.strokeStyle = E.stroke.color, A.lineWidth = E.stroke.width, A.globalAlpha = t * (E.stroke.opacity ?? 1);
|
|
5470
5471
|
let n = 0, l = kA;
|
|
5471
5472
|
d.forEach((Z) => {
|
|
5472
5473
|
const V = y.indexOf(Z.text, n);
|
|
@@ -5482,13 +5483,13 @@ class WC {
|
|
|
5482
5483
|
console.error(`[ExodeUI] Image load failed: ${k.substring(0, 100)}${k.length > 100 ? "..." : ""}`);
|
|
5483
5484
|
}, y.src = k, this.imageCache.set(k, y)), y.complete && y.naturalWidth > 0) {
|
|
5484
5485
|
const U = Q.corner_radius ?? Q.cornerRadius ?? 0;
|
|
5485
|
-
U !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: U },
|
|
5486
|
+
U !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: U }, D, o), A.clip(), A.drawImage(y, -D / 2, -o / 2, D, o), A.restore()) : A.drawImage(y, -D / 2, -o / 2, D, o);
|
|
5486
5487
|
}
|
|
5487
5488
|
}
|
|
5488
5489
|
} else if (Q.type === "SVG") {
|
|
5489
5490
|
const k = Q.svgContent;
|
|
5490
5491
|
if (k) {
|
|
5491
|
-
const y =
|
|
5492
|
+
const y = E.palette || [], U = I.id + "_" + y.join("_");
|
|
5492
5493
|
let R = this.imageCache.get(U);
|
|
5493
5494
|
if (!R) {
|
|
5494
5495
|
R = new Image();
|
|
@@ -5504,44 +5505,44 @@ class WC {
|
|
|
5504
5505
|
}
|
|
5505
5506
|
if (R.complete && R.naturalWidth > 0) {
|
|
5506
5507
|
const c = Q.corner_radius ?? Q.cornerRadius ?? 0;
|
|
5507
|
-
c !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: c },
|
|
5508
|
+
c !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: c }, D, o), A.clip(), A.drawImage(R, -D / 2, -o / 2, D, o), A.restore()) : A.drawImage(R, -D / 2, -o / 2, D, o);
|
|
5508
5509
|
}
|
|
5509
5510
|
}
|
|
5510
5511
|
} else if (Q.type === "LineGraph")
|
|
5511
|
-
this.renderLineGraph(A, Q,
|
|
5512
|
+
this.renderLineGraph(A, Q, D, o);
|
|
5512
5513
|
else if (I.type === "Shape") {
|
|
5513
|
-
if (this.applyPath(A, Q,
|
|
5514
|
-
if (A.shadowColor =
|
|
5515
|
-
const k = parseInt(
|
|
5516
|
-
A.shadowColor = `rgba(${k}, ${y}, ${U}, ${
|
|
5514
|
+
if (this.applyPath(A, Q, D, o), A.save(), E.shadow && E.shadow.opacity > 0) {
|
|
5515
|
+
if (A.shadowColor = E.shadow.color, E.shadow.opacity < 1 && E.shadow.color.startsWith("#")) {
|
|
5516
|
+
const k = parseInt(E.shadow.color.slice(1, 3), 16), y = parseInt(E.shadow.color.slice(3, 5), 16), U = parseInt(E.shadow.color.slice(5, 7), 16);
|
|
5517
|
+
A.shadowColor = `rgba(${k}, ${y}, ${U}, ${E.shadow.opacity})`;
|
|
5517
5518
|
}
|
|
5518
|
-
A.shadowBlur =
|
|
5519
|
+
A.shadowBlur = E.shadow.blur, A.shadowOffsetX = E.shadow.offsetX, A.shadowOffsetY = E.shadow.offsetY;
|
|
5519
5520
|
}
|
|
5520
|
-
if (
|
|
5521
|
-
const k = A.globalAlpha, y = this.createCanvasFill(A,
|
|
5522
|
-
y ? A.fillStyle = y : A.fillStyle =
|
|
5521
|
+
if (E.blur && E.blur.amount > 0 && (A.filter = `blur(${E.blur.amount}px)`), E.fill) {
|
|
5522
|
+
const k = A.globalAlpha, y = this.createCanvasFill(A, E.fill, D, o);
|
|
5523
|
+
y ? A.fillStyle = y : A.fillStyle = E.fill.color || "transparent", A.globalAlpha = k * (E.fill.opacity ?? 1), A.fill(), A.globalAlpha = k;
|
|
5523
5524
|
}
|
|
5524
|
-
if (
|
|
5525
|
+
if (E.stroke && E.stroke.width > 0) {
|
|
5525
5526
|
const k = A.globalAlpha;
|
|
5526
|
-
A.strokeStyle =
|
|
5527
|
+
A.strokeStyle = E.stroke.color, A.lineWidth = E.stroke.width, A.globalAlpha = k * (E.stroke.opacity ?? 1), A.stroke(), A.globalAlpha = k;
|
|
5527
5528
|
}
|
|
5528
5529
|
A.restore();
|
|
5529
5530
|
} else if (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) {
|
|
5530
|
-
const k = I.width ||
|
|
5531
|
-
if (A.save(),
|
|
5532
|
-
if (A.shadowColor =
|
|
5533
|
-
const c = parseInt(
|
|
5534
|
-
A.shadowColor = `rgba(${c}, ${L}, ${r}, ${
|
|
5531
|
+
const k = C.width !== void 0 ? C.width : I.width || D, y = C.height !== void 0 ? C.height : I.height || o, U = C.cornerRadius !== void 0 ? C.cornerRadius : I.cornerRadius ?? I.corner_radius ?? 0;
|
|
5532
|
+
if (A.save(), E.shadow && E.shadow.opacity > 0) {
|
|
5533
|
+
if (A.shadowColor = E.shadow.color, E.shadow.opacity < 1 && E.shadow.color.startsWith("#")) {
|
|
5534
|
+
const c = parseInt(E.shadow.color.slice(1, 3), 16), L = parseInt(E.shadow.color.slice(3, 5), 16), r = parseInt(E.shadow.color.slice(5, 7), 16);
|
|
5535
|
+
A.shadowColor = `rgba(${c}, ${L}, ${r}, ${E.shadow.opacity})`;
|
|
5535
5536
|
}
|
|
5536
|
-
A.shadowBlur =
|
|
5537
|
+
A.shadowBlur = E.shadow.blur, A.shadowOffsetX = E.shadow.offsetX, A.shadowOffsetY = E.shadow.offsetY;
|
|
5537
5538
|
}
|
|
5538
|
-
if (A.beginPath(), A.roundRect(-k / 2, -y / 2, k, y, U),
|
|
5539
|
-
const c = A.globalAlpha, L = this.createCanvasFill(A,
|
|
5540
|
-
A.fillStyle = L ||
|
|
5539
|
+
if (A.beginPath(), A.roundRect(-k / 2, -y / 2, k, y, U), E.fill && E.fill.type !== "None") {
|
|
5540
|
+
const c = A.globalAlpha, L = this.createCanvasFill(A, E.fill, k, y);
|
|
5541
|
+
A.fillStyle = L || E.fill.color || "transparent", A.globalAlpha = c * (E.fill.opacity ?? 1), A.fill(), A.globalAlpha = c;
|
|
5541
5542
|
}
|
|
5542
|
-
if (
|
|
5543
|
+
if (E.stroke && E.stroke.width > 0 && E.stroke.isEnabled !== !1) {
|
|
5543
5544
|
const c = A.globalAlpha;
|
|
5544
|
-
A.strokeStyle =
|
|
5545
|
+
A.strokeStyle = E.stroke.color || "#000000", A.lineWidth = E.stroke.width, A.globalAlpha = c * (E.stroke.opacity ?? 1), A.stroke(), A.globalAlpha = c;
|
|
5545
5546
|
}
|
|
5546
5547
|
A.restore(), (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), A.roundRect(-k / 2, -y / 2, k, y, U), A.clip());
|
|
5547
5548
|
} else I.type === "Component" && I.variant === "inputbox" ? this.renderInputBox(A, I) : I.type === "Component" && I.variant === "button" ? this.renderButton(A, I) : I.type === "Component" && I.variant === "toggle_button" ? this.renderToggleButton(A, I) : I.type === "Component" && I.variant === "toggle" ? this.renderToggle(A, I) : I.type === "Component" && I.variant === "slider" ? this.renderSlider(A, I) : I.type === "Component" && I.variant === "dropdown" && this.renderDropdown(A, I);
|
|
@@ -5570,7 +5571,7 @@ class WC {
|
|
|
5570
5571
|
}
|
|
5571
5572
|
applyPath(A, I, g, C) {
|
|
5572
5573
|
if (A.beginPath(), I.type === "Rectangle") {
|
|
5573
|
-
const Q = I.
|
|
5574
|
+
const Q = I.cornerRadius ?? I.corner_radius ?? 0;
|
|
5574
5575
|
A.roundRect(-g / 2, -C / 2, g, C, Q);
|
|
5575
5576
|
} else if (I.type === "Ellipse")
|
|
5576
5577
|
A.ellipse(0, 0, g / 2, C / 2, 0, 0, Math.PI * 2);
|
|
@@ -5579,8 +5580,8 @@ class WC {
|
|
|
5579
5580
|
else if (I.type === "Star") {
|
|
5580
5581
|
const Q = I.inner_radius || 20, E = I.outer_radius || 50, D = I.points || 5;
|
|
5581
5582
|
for (let o = 0; o < D * 2; o++) {
|
|
5582
|
-
const w = o * Math.PI / D - Math.PI / 2, h = o % 2 === 0 ? E : Q, G = h * Math.cos(w),
|
|
5583
|
-
o === 0 ? A.moveTo(G,
|
|
5583
|
+
const w = o * Math.PI / D - Math.PI / 2, h = o % 2 === 0 ? E : Q, G = h * Math.cos(w), K = h * Math.sin(w);
|
|
5584
|
+
o === 0 ? A.moveTo(G, K) : A.lineTo(G, K);
|
|
5584
5585
|
}
|
|
5585
5586
|
A.closePath();
|
|
5586
5587
|
} else I.type === "Path" && I.points && (I.points.forEach((Q, E) => {
|
|
@@ -5589,7 +5590,7 @@ class WC {
|
|
|
5589
5590
|
}
|
|
5590
5591
|
renderInputBox(A, I) {
|
|
5591
5592
|
var Z, V, BA, RA;
|
|
5592
|
-
const g = ((V = (Z = I.objectStates) == null ? void 0 : Z.get(I.id)) == null ? void 0 : V.options) || I.options || {}, C = ((BA = I.geometry) == null ? void 0 : BA.width) || 250, Q = ((RA = I.geometry) == null ? void 0 : RA.height) || 45, E = this.focusedId === I.id, D = this.lastHoveredObjectId === I.id, o = g.previewState || "default", w = o !== "default" ? o : E ? "focused" : D ? "hovered" : "default", h = g.label || { visible: !0, text: "Label" }, G = g.helperText || { visible: !1, text: "Helper text" },
|
|
5593
|
+
const g = ((V = (Z = I.objectStates) == null ? void 0 : Z.get(I.id)) == null ? void 0 : V.options) || I.options || {}, C = ((BA = I.geometry) == null ? void 0 : BA.width) || 250, Q = ((RA = I.geometry) == null ? void 0 : RA.height) || 45, E = this.focusedId === I.id, D = this.lastHoveredObjectId === I.id, o = g.previewState || "default", w = o !== "default" ? o : E ? "focused" : D ? "hovered" : "default", h = g.label || { visible: !0, text: "Label" }, G = g.helperText || { visible: !1, text: "Helper text" }, K = g.leftIcon || { visible: !1 }, N = g.rightIcon || { visible: !1 }, M = g.multiline === !0, F = g.cornerRadius ?? 8, J = g.corners || { tl: F, tr: F, bl: F, br: F }, k = [J.tl, J.tr, J.br, J.bl];
|
|
5593
5594
|
let y = g.backgroundColor || "rgba(31, 41, 55, 1)", U = g.borderColor || "rgba(55, 65, 81, 1)", R = g.borderWidth ?? 1.5, c = g.color || "#ffffff", L = g.placeholderColor || "rgba(156, 163, 175, 1)", r = g.fontSize || 14;
|
|
5594
5595
|
const p = `${w}Style`, q = g[p];
|
|
5595
5596
|
q ? (q.backgroundColor !== void 0 && (y = q.backgroundColor), q.borderColor !== void 0 && (U = q.borderColor), q.borderWidth !== void 0 && (R = q.borderWidth), q.color !== void 0 && (c = q.color), q.placeholderColor !== void 0 && (L = q.placeholderColor), q.fontSize !== void 0 && (r = q.fontSize)) : w === "focused" ? (U = g.focusBorderColor || "rgba(59, 130, 246, 1)", R = Math.max(R, 2)) : w === "hovered" || w === "hover" ? (U = g.hoverBorderColor || U, y = g.hoverBackgroundColor || y) : w === "disabled" ? (y = g.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", U = g.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : w === "error" && (U = "rgba(239, 68, 68, 1)", R = Math.max(R, 2)), A.beginPath(), A.roundRect(-C / 2, -Q / 2, C, Q, k), A.fillStyle = y, A.fill(), R > 0 && (A.strokeStyle = U, A.lineWidth = R, A.stroke(), (w === "focused" || w === "focus") && (A.save(), A.beginPath(), A.roundRect(-C / 2 - 2, -Q / 2 - 2, C + 4, Q + 4, k.map((CA) => CA + 2)), A.strokeStyle = "rgba(59, 130, 246, 0.3)", A.lineWidth = 2, A.stroke(), A.restore()));
|
|
@@ -5602,10 +5603,10 @@ class WC {
|
|
|
5602
5603
|
}
|
|
5603
5604
|
A.restore();
|
|
5604
5605
|
};
|
|
5605
|
-
AA(
|
|
5606
|
+
AA(K, !0), AA(N, !1);
|
|
5606
5607
|
const GA = g.text || "", v = g.placeholder || "Enter text...", W = !GA, T = GA || v, IA = W ? L : c, x = r, d = g.fontFamily || "Inter", hA = g.fontWeight || 400;
|
|
5607
5608
|
A.font = `${hA} ${x}px "${d}", sans-serif`, A.fillStyle = IA, A.textAlign = "left", A.textBaseline = M ? "top" : "middle";
|
|
5608
|
-
const kA = g.inputPadding ?? 16, u =
|
|
5609
|
+
const kA = g.inputPadding ?? 16, u = K.visible ? (K.offset ?? 16) + (K.size || 14) / 2 + 8 : kA, m = N.visible ? (N.offset ?? 16) + (N.size || 14) / 2 + 8 : kA, t = -(C / 2) + u, n = C - u - m, l = g.inputType === "password" ? "•".repeat(T.length) : T;
|
|
5609
5610
|
if (A.save(), A.beginPath(), A.rect(t - 2, -Q / 2 + 4, n + 4, Q - 8), A.clip(), M) {
|
|
5610
5611
|
const CA = l.split(`
|
|
5611
5612
|
`);
|
|
@@ -5643,7 +5644,7 @@ class WC {
|
|
|
5643
5644
|
}
|
|
5644
5645
|
}
|
|
5645
5646
|
renderSlider(A, I) {
|
|
5646
|
-
const { geometry: g, options: C } = I, Q = g.width || 200, E = C || {}, D = E.value ?? 50, o = E.min ?? 0, h = (E.max ?? 100) - o, G = h === 0 ? 0 : (D - o) / h,
|
|
5647
|
+
const { geometry: g, options: C } = I, Q = g.width || 200, E = C || {}, D = E.value ?? 50, o = E.min ?? 0, h = (E.max ?? 100) - o, G = h === 0 ? 0 : (D - o) / h, K = E.trackHeight || 4, N = E.trackRoundedness ?? 2, M = E.trackShape ?? "Rectangle", F = E.trackPath || "", J = E.activeColor || "#3b82f6", k = E.inactiveColor || "#374151", y = E.thumbShape || "Ellipse", U = E.thumbWidth ?? 16, R = E.thumbHeight ?? 16, c = E.thumbRoundedness ?? 0, L = E.thumbColor || "#ffffff", r = E.thumbPath || "", p = E.thumbIcon || "", q = E.showValueTooltip ?? !1, AA = E.tooltipBgColor || "#333333", GA = E.tooltipColor || "#ffffff", v = E.tooltipOffsetX ?? 0, W = E.tooltipOffsetY ?? -25, T = (u, m, t, n, l, Z, V) => {
|
|
5647
5648
|
if ((u === "Custom" || u === "Icon") && V)
|
|
5648
5649
|
try {
|
|
5649
5650
|
const BA = new Path2D(V);
|
|
@@ -5674,9 +5675,9 @@ class WC {
|
|
|
5674
5675
|
} else u === "Line" && (A.moveTo(m - n / 2, t), A.lineTo(m + n / 2, t));
|
|
5675
5676
|
A.fill();
|
|
5676
5677
|
};
|
|
5677
|
-
A.fillStyle = k, M === "Line" ? (A.strokeStyle = k, A.lineWidth =
|
|
5678
|
+
A.fillStyle = k, M === "Line" ? (A.strokeStyle = k, A.lineWidth = K, A.beginPath(), A.moveTo(-Q / 2, 0), A.lineTo(Q / 2, 0), A.stroke()) : T(M, 0, 0, Q, K, N, F);
|
|
5678
5679
|
const IA = Q * G, x = -Q / 2 + IA;
|
|
5679
|
-
if (IA > 0 && (A.fillStyle = J, M === "Line" ? (A.strokeStyle = J, A.lineWidth =
|
|
5680
|
+
if (IA > 0 && (A.fillStyle = J, M === "Line" ? (A.strokeStyle = J, A.lineWidth = K, A.beginPath(), A.moveTo(-Q / 2, 0), A.lineTo(x, 0), A.stroke()) : M === "Rectangle" && (A.beginPath(), A.roundRect(-Q / 2, -K / 2, IA, K, N), A.fill())), A.save(), A.translate(x, 0), A.shadowColor = "rgba(0,0,0,0.2)", A.shadowBlur = 4, A.shadowOffsetY = 1, A.fillStyle = L, T(y, 0, 0, U, R, c, y === "Icon" ? p : r), A.restore(), q) {
|
|
5680
5681
|
A.save(), A.translate(x + v, W);
|
|
5681
5682
|
const u = Math.round(D).toString();
|
|
5682
5683
|
A.font = "10px Inter, sans-serif";
|
|
@@ -5687,25 +5688,25 @@ class WC {
|
|
|
5687
5688
|
if (d.visible !== !1) {
|
|
5688
5689
|
const u = d.text || "Label", m = d.fontSize || 12, t = d.color || "rgba(156, 163, 175, 1)", n = d.offset ?? 8;
|
|
5689
5690
|
A.font = `600 ${m}px "${kA}", sans-serif`, A.fillStyle = t, A.textAlign = "left", A.textBaseline = "bottom";
|
|
5690
|
-
const l = -(Q / 2), Z = -(
|
|
5691
|
+
const l = -(Q / 2), Z = -(K / 2) - n;
|
|
5691
5692
|
A.fillText(u, l, Z);
|
|
5692
5693
|
}
|
|
5693
5694
|
if (hA.visible === !0) {
|
|
5694
5695
|
const u = hA.text || "Helper text", m = hA.fontSize || 11, t = hA.color || "rgba(156, 163, 175, 1)", n = hA.offset ?? 6;
|
|
5695
5696
|
A.font = `400 ${m}px "${kA}", sans-serif`, A.fillStyle = t, A.textAlign = "left", A.textBaseline = "top";
|
|
5696
|
-
const l = -(Q / 2), Z =
|
|
5697
|
+
const l = -(Q / 2), Z = K / 2 + n;
|
|
5697
5698
|
A.fillText(u, l, Z);
|
|
5698
5699
|
}
|
|
5699
5700
|
}
|
|
5700
5701
|
renderDropdown(A, I) {
|
|
5701
5702
|
if (!this.objectStates.get(I.id)) return;
|
|
5702
|
-
const C = I.options || {}, Q = I.geometry.width || 160, E = I.geometry.height || 40, D = -Q / 2, o = -E / 2, w = C.cornerRadius ?? 6, h = C.isOpen || !1, G = C.disabled || !1,
|
|
5703
|
-
let
|
|
5704
|
-
G ? (
|
|
5703
|
+
const C = I.options || {}, Q = I.geometry.width || 160, E = I.geometry.height || 40, D = -Q / 2, o = -E / 2, w = C.cornerRadius ?? 6, h = C.isOpen || !1, G = C.disabled || !1, K = this.lastHoveredObjectId === I.id;
|
|
5704
|
+
let N = C.backgroundColor || "#ffffff", M = C.borderColor || "#e5e7eb", F = C.color || "#333333";
|
|
5705
|
+
G ? (N = C.disabledBackgroundColor || "#f3f4f6", M = C.disabledBorderColor || "#e5e7eb", F = C.disabledColor || "#9ca3af") : h ? (N = C.activeBackgroundColor || N, M = C.activeBorderColor || M, F = C.activeColor || F) : K && (N = C.hoverBackgroundColor || N, M = C.hoverBorderColor || M, F = C.hoverColor || F), A.beginPath();
|
|
5705
5706
|
const J = (v, W, T, IA, x, d) => {
|
|
5706
5707
|
IA < 0 && (IA = 0), x < 0 && (x = 0), d = Math.min(d, Math.min(IA, x) / 2), v.moveTo(W + d, T), v.lineTo(W + IA - d, T), v.arcTo(W + IA, T, W + IA, T + d, d), v.lineTo(W + IA, T + x - d), v.arcTo(W + IA, T + x, W + IA - d, T + x, d), v.lineTo(W + d, T + x), v.arcTo(W, T + x, W, T + x - d, d), v.lineTo(W, T + d), v.arcTo(W, T, W + d, T, d), v.closePath();
|
|
5707
5708
|
};
|
|
5708
|
-
J(A, D, o, Q, E, w), A.fillStyle =
|
|
5709
|
+
J(A, D, o, Q, E, w), A.fillStyle = N, A.fill();
|
|
5709
5710
|
const k = C.borderWidth ?? 1;
|
|
5710
5711
|
k > 0 && (A.strokeStyle = M, A.lineWidth = k, A.stroke());
|
|
5711
5712
|
const y = 12, U = C.chevronType || "chevron", R = C.chevronSize || 16, c = (h ? C.openIconColor : C.closedIconColor) || C.chevronColor || "#6b7280";
|
|
@@ -5752,32 +5753,32 @@ class WC {
|
|
|
5752
5753
|
}
|
|
5753
5754
|
renderButton(A, I) {
|
|
5754
5755
|
var y, U, R, c;
|
|
5755
|
-
const g = I.options || {}, C = ((y = I.geometry) == null ? void 0 : y.width) || 120, Q = ((U = I.geometry) == null ? void 0 : U.height) || 40, E = -C / 2, D = -Q / 2, o = this.lastHoveredObjectId === I.id, w = g.cornerRadius ?? 8, h = g.bgShape || "Rectangle", G = o ? ((R = g.hoverStyle) == null ? void 0 : R.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6",
|
|
5756
|
+
const g = I.options || {}, C = ((y = I.geometry) == null ? void 0 : y.width) || 120, Q = ((U = I.geometry) == null ? void 0 : U.height) || 40, E = -C / 2, D = -Q / 2, o = this.lastHoveredObjectId === I.id, w = g.cornerRadius ?? 8, h = g.bgShape || "Rectangle", G = o ? ((R = g.hoverStyle) == null ? void 0 : R.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6", K = g.label || {}, N = o ? ((c = g.hoverStyle) == null ? void 0 : c.textColor) || K.color || "#ffffff" : K.color || "#ffffff", M = g.icon || { enabled: !1 };
|
|
5756
5757
|
A.save(), A.beginPath(), h === "Rectangle" ? A.roundRect(E, D, C, Q, w) : h === "Ellipse" || h === "Circle" ? A.ellipse(0, 0, C / 2, Q / 2, 0, 0, Math.PI * 2) : h === "Pill" && A.roundRect(E, D, C, Q, Q / 2), A.fillStyle = G, A.fill();
|
|
5757
|
-
const F =
|
|
5758
|
-
A.font = `${
|
|
5758
|
+
const F = K.fontSize || 14, J = K.fontFamily || "Inter";
|
|
5759
|
+
A.font = `${K.fontWeight || 400} ${F}px "${J}", sans-serif`, A.fillStyle = N, A.textAlign = "center", A.textBaseline = "middle";
|
|
5759
5760
|
let k = 0;
|
|
5760
5761
|
if (M.enabled && M.svgPath) {
|
|
5761
|
-
const L = M.size || 16, r = M.gap || 8, p = M.position === "left" ? -(A.measureText(
|
|
5762
|
+
const L = M.size || 16, r = M.gap || 8, p = M.position === "left" ? -(A.measureText(K.text || "").width / 2 + L / 2 + r / 2) : A.measureText(K.text || "").width / 2 + L / 2 + r / 2;
|
|
5762
5763
|
A.save(), A.translate(p, 0);
|
|
5763
5764
|
const q = new Path2D(M.svgPath), AA = L / 24;
|
|
5764
|
-
A.scale(AA, AA), A.translate(-12, -12), A.fillStyle = M.color ||
|
|
5765
|
+
A.scale(AA, AA), A.translate(-12, -12), A.fillStyle = M.color || N, A.fill(q), A.restore(), k = M.position === "left" ? L / 2 + r / 2 : -(L / 2 + r / 2);
|
|
5765
5766
|
}
|
|
5766
|
-
A.fillText(
|
|
5767
|
+
A.fillText(K.text || "Button", k, 0), A.restore();
|
|
5767
5768
|
}
|
|
5768
5769
|
renderToggleButton(A, I) {
|
|
5769
5770
|
var F, J;
|
|
5770
|
-
const g = I.options || {}, C = g.checked ?? !1, Q = ((F = I.geometry) == null ? void 0 : F.width) || 120, E = ((J = I.geometry) == null ? void 0 : J.height) || 40, D = -Q / 2, o = -E / 2, w = g.cornerRadius ?? 8, h = g.label || {}, G = C ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151",
|
|
5771
|
+
const g = I.options || {}, C = g.checked ?? !1, Q = ((F = I.geometry) == null ? void 0 : F.width) || 120, E = ((J = I.geometry) == null ? void 0 : J.height) || 40, D = -Q / 2, o = -E / 2, w = g.cornerRadius ?? 8, h = g.label || {}, G = C ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151", K = C ? g.activeTextColor || "#ffffff" : g.inactiveTextColor || "#9ca3af";
|
|
5771
5772
|
A.save(), A.beginPath(), A.roundRect(D, o, Q, E, w), A.fillStyle = G, A.fill();
|
|
5772
|
-
const
|
|
5773
|
-
A.font = `${h.fontWeight || 600} ${
|
|
5773
|
+
const N = h.fontSize || 14, M = h.fontFamily || "Inter";
|
|
5774
|
+
A.font = `${h.fontWeight || 600} ${N}px "${M}", sans-serif`, A.fillStyle = K, A.textAlign = "center", A.textBaseline = "middle", A.fillText(h.text || "Toggle", 0, 0), A.restore();
|
|
5774
5775
|
}
|
|
5775
5776
|
renderToggle(A, I) {
|
|
5776
5777
|
var k, y;
|
|
5777
5778
|
const g = I.options || {}, C = ((k = I.geometry) == null ? void 0 : k.width) || 52, Q = ((y = I.geometry) == null ? void 0 : y.height) || 30, E = -C / 2, D = -Q / 2, o = g.checked ?? !1, w = g.cornerRadius ?? Q / 2;
|
|
5778
5779
|
A.beginPath(), A.roundRect(E, D, C, Q, w), A.fillStyle = o ? g.activeColor || "#10b981" : g.inactiveColor || "#374151", g.disabled && (A.globalAlpha *= 0.5), A.fill();
|
|
5779
|
-
const h = 3, G = Q - h * 2,
|
|
5780
|
-
if (A.beginPath(), A.arc(F +
|
|
5780
|
+
const h = 3, G = Q - h * 2, K = G / 2, N = E + h, M = E + C - h - G, F = o ? M : N, J = D + h;
|
|
5781
|
+
if (A.beginPath(), A.arc(F + K, J + K, K, 0, Math.PI * 2), A.fillStyle = g.knobColor || "#ffffff", A.fill(), g.disabled && (A.globalAlpha *= 2), g.label && g.label.text) {
|
|
5781
5782
|
const U = g.label, R = U.fontSize || 14, c = U.fontWeight || 400, L = U.fontFamily || "Inter";
|
|
5782
5783
|
A.font = `${c} ${R}px "${L}", sans-serif`, A.fillStyle = U.color || "#f3f4f6", A.textBaseline = "middle";
|
|
5783
5784
|
const r = U.gap || 10;
|
|
@@ -5825,11 +5826,11 @@ class WC {
|
|
|
5825
5826
|
const w = D - E, h = g / (o - 1), G = (F) => {
|
|
5826
5827
|
const J = w === 0 ? 0.5 : (F - E) / w;
|
|
5827
5828
|
return C / 2 - J * C;
|
|
5828
|
-
},
|
|
5829
|
-
if (I.showXAxis && (A.beginPath(), A.strokeStyle = I.xAxisColor ||
|
|
5829
|
+
}, K = (F) => F * h - g / 2, N = I.axisColor || "#333333";
|
|
5830
|
+
if (I.showXAxis && (A.beginPath(), A.strokeStyle = I.xAxisColor || N, A.lineWidth = 1, A.moveTo(-g / 2, C / 2), A.lineTo(g / 2, C / 2), A.stroke()), I.showYAxis && (A.beginPath(), A.strokeStyle = I.yAxisColor || N, A.lineWidth = 1, A.moveTo(-g / 2, -C / 2), A.lineTo(-g / 2, C / 2), A.stroke()), A.fillStyle = I.axisLabelColor || "#333333", A.font = `${I.axisLabelFontSize || 10}px Inter, sans-serif`, I.showXLabels) {
|
|
5830
5831
|
A.textAlign = "center", A.textBaseline = "top";
|
|
5831
5832
|
for (let F = 0; F < o; F++) {
|
|
5832
|
-
const J =
|
|
5833
|
+
const J = K(F);
|
|
5833
5834
|
A.fillText(`${F + 1}`, J, C / 2 + 5);
|
|
5834
5835
|
}
|
|
5835
5836
|
}
|
|
@@ -5843,34 +5844,34 @@ class WC {
|
|
|
5843
5844
|
const J = F._resolvedData;
|
|
5844
5845
|
if (!(!J || J.length < 2)) {
|
|
5845
5846
|
if (F.showArea) {
|
|
5846
|
-
if (A.beginPath(), A.moveTo(
|
|
5847
|
+
if (A.beginPath(), A.moveTo(K(0), C / 2), A.lineTo(K(0), G(J[0])), F.smoothing && J.length > 2)
|
|
5847
5848
|
for (let y = 0; y < J.length - 1; y++) {
|
|
5848
5849
|
const U = J[y === 0 ? y : y - 1], R = J[y], c = J[y + 1], L = J[y + 1 === J.length - 1 ? y + 1 : y + 2];
|
|
5849
5850
|
for (let r = 1; r <= M; r++) {
|
|
5850
5851
|
const p = r / M, q = this._catmullRom(U, R, c, L, p);
|
|
5851
|
-
A.lineTo(
|
|
5852
|
+
A.lineTo(K(y + p), G(q));
|
|
5852
5853
|
}
|
|
5853
5854
|
}
|
|
5854
5855
|
else
|
|
5855
5856
|
for (let y = 1; y < J.length; y++)
|
|
5856
|
-
A.lineTo(
|
|
5857
|
-
A.lineTo(
|
|
5857
|
+
A.lineTo(K(y), G(J[y]));
|
|
5858
|
+
A.lineTo(K(J.length - 1), C / 2), A.closePath();
|
|
5858
5859
|
const k = A.globalAlpha;
|
|
5859
5860
|
A.globalAlpha = k * (I.areaOpacity ?? 0.3), A.fillStyle = F.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = k;
|
|
5860
5861
|
}
|
|
5861
|
-
if (A.beginPath(), A.strokeStyle = F.lineColor || "#3b82f6", A.lineWidth = F.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(
|
|
5862
|
+
if (A.beginPath(), A.strokeStyle = F.lineColor || "#3b82f6", A.lineWidth = F.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(K(0), G(J[0])), F.smoothing && J.length > 2)
|
|
5862
5863
|
for (let k = 0; k < J.length - 1; k++) {
|
|
5863
5864
|
const y = J[k === 0 ? k : k - 1], U = J[k], R = J[k + 1], c = J[k + 1 === J.length - 1 ? k + 1 : k + 2];
|
|
5864
5865
|
for (let L = 1; L <= M; L++) {
|
|
5865
5866
|
const r = L / M, p = this._catmullRom(y, U, R, c, r);
|
|
5866
|
-
A.lineTo(
|
|
5867
|
+
A.lineTo(K(k + r), G(p));
|
|
5867
5868
|
}
|
|
5868
5869
|
}
|
|
5869
5870
|
else
|
|
5870
5871
|
for (let k = 1; k < J.length; k++)
|
|
5871
|
-
A.lineTo(
|
|
5872
|
+
A.lineTo(K(k), G(J[k]));
|
|
5872
5873
|
A.stroke(), F.showPoints && J.forEach((k, y) => {
|
|
5873
|
-
const U =
|
|
5874
|
+
const U = K(y), R = G(k);
|
|
5874
5875
|
A.beginPath(), A.arc(U, R, (F.pointSize || 6) / 2, 0, Math.PI * 2), A.fillStyle = F.pointFill || "#ffffff", A.fill(), A.strokeStyle = F.pointStrokeColor || F.lineColor || "#3b82f6", A.lineWidth = F.pointStrokeWidth || 1, A.stroke();
|
|
5875
5876
|
});
|
|
5876
5877
|
}
|
|
@@ -5894,22 +5895,22 @@ class WC {
|
|
|
5894
5895
|
if (I.type === "Solid")
|
|
5895
5896
|
return I.color;
|
|
5896
5897
|
if (I.type === "LinearGradient" && I.stops) {
|
|
5897
|
-
const G = (((Q = I.start) == null ? void 0 : Q[0]) ?? 0) * g - g / 2,
|
|
5898
|
+
const G = (((Q = I.start) == null ? void 0 : Q[0]) ?? 0) * g - g / 2, K = (((E = I.start) == null ? void 0 : E[1]) ?? 0) * C - C / 2, N = (((D = I.end) == null ? void 0 : D[0]) ?? 1) * g - g / 2, M = (((o = I.end) == null ? void 0 : o[1]) ?? 0) * C - C / 2, F = A.createLinearGradient(G, K, N, M);
|
|
5898
5899
|
return I.stops.forEach((J) => F.addColorStop(J.offset, J.color)), F;
|
|
5899
5900
|
}
|
|
5900
5901
|
if (I.type === "RadialGradient" && I.stops) {
|
|
5901
|
-
const G = (((w = I.center) == null ? void 0 : w[0]) ?? 0.5) * g - g / 2,
|
|
5902
|
+
const G = (((w = I.center) == null ? void 0 : w[0]) ?? 0.5) * g - g / 2, K = (((h = I.center) == null ? void 0 : h[1]) ?? 0.5) * C - C / 2, N = (I.radius ?? 0.5) * Math.max(g, C), M = A.createRadialGradient(G, K, 0, G, K, N);
|
|
5902
5903
|
return I.stops.forEach((F) => M.addColorStop(F.offset, F.color)), M;
|
|
5903
5904
|
}
|
|
5904
5905
|
if (I.type === "Pattern" && I.url) {
|
|
5905
5906
|
let G = this.imageCache.get(I.url);
|
|
5906
5907
|
if (G || (G = new Image(), G.src = I.url, this.imageCache.set(I.url, G)), G.complete && G.naturalWidth > 0) {
|
|
5907
|
-
const
|
|
5908
|
-
if (
|
|
5909
|
-
const
|
|
5910
|
-
|
|
5908
|
+
const K = A.createPattern(G, "repeat");
|
|
5909
|
+
if (K && (I.scaleX !== void 0 || I.offsetX !== void 0)) {
|
|
5910
|
+
const N = new DOMMatrix(), M = I.scaleX ?? 1, F = I.scaleY ?? 1, J = I.offsetX ?? 0, k = I.offsetY ?? 0, y = I.rotation ?? 0;
|
|
5911
|
+
N.translateSelf(J, k), N.rotateSelf(y), N.scaleSelf(M, F), K.setTransform(N);
|
|
5911
5912
|
}
|
|
5912
|
-
return
|
|
5913
|
+
return K;
|
|
5913
5914
|
}
|
|
5914
5915
|
}
|
|
5915
5916
|
return I.color || null;
|
|
@@ -5924,24 +5925,24 @@ class WC {
|
|
|
5924
5925
|
}
|
|
5925
5926
|
let o = [0, 0, 0, 0];
|
|
5926
5927
|
typeof D == "number" ? o = [D, D, D, D] : Array.isArray(D) && (D.length === 1 ? o = [D[0], D[0], D[0], D[0]] : D.length === 2 ? o = [D[0], D[1], D[0], D[1]] : D.length === 4 && (o = D));
|
|
5927
|
-
const w = Math.min(Math.abs(C) / 2, Math.abs(Q) / 2), h = Math.max(0, Math.min(Number(o[0]) || 0, w)), G = Math.max(0, Math.min(Number(o[1]) || 0, w)),
|
|
5928
|
-
A.moveTo(I + h, g), A.lineTo(I + C - G, g), G > 0 ? A.arcTo(I + C, g, I + C, g + G, G) : A.lineTo(I + C, g), A.lineTo(I + C, g + Q -
|
|
5928
|
+
const w = Math.min(Math.abs(C) / 2, Math.abs(Q) / 2), h = Math.max(0, Math.min(Number(o[0]) || 0, w)), G = Math.max(0, Math.min(Number(o[1]) || 0, w)), K = Math.max(0, Math.min(Number(o[2]) || 0, w)), N = Math.max(0, Math.min(Number(o[3]) || 0, w));
|
|
5929
|
+
A.moveTo(I + h, g), A.lineTo(I + C - G, g), G > 0 ? A.arcTo(I + C, g, I + C, g + G, G) : A.lineTo(I + C, g), A.lineTo(I + C, g + Q - K), K > 0 ? A.arcTo(I + C, g + Q, I + C - K, g + Q, K) : A.lineTo(I + C, g + Q), A.lineTo(I + N, g + Q), N > 0 ? A.arcTo(I, g + Q, I, g + Q - N, N) : A.lineTo(I, g + Q), A.lineTo(I, g + h), h > 0 ? A.arcTo(I, g, I + h, g, h) : A.lineTo(I, g), A.closePath();
|
|
5929
5930
|
}
|
|
5930
5931
|
}
|
|
5931
5932
|
const XC = FC(
|
|
5932
5933
|
({ artboard: i, src: A, className: I, style: g, autoPlay: C = !0, fit: Q = "Contain", alignment: E = "Center", onReady: D, onTrigger: o, onInputUpdate: w, onComponentChange: h }, G) => {
|
|
5933
|
-
const
|
|
5934
|
-
MC(G, () =>
|
|
5935
|
-
console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"),
|
|
5934
|
+
const K = DI(null), N = DI(new WC()), M = DI(), F = DI(0);
|
|
5935
|
+
MC(G, () => K.current), jA(() => {
|
|
5936
|
+
console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"), N.current.setLayout(Q, E);
|
|
5936
5937
|
}, [Q, E]), jA(() => {
|
|
5937
|
-
o &&
|
|
5938
|
+
o && N.current.setTriggerCallback(o);
|
|
5938
5939
|
}, [o]), jA(() => {
|
|
5939
|
-
w &&
|
|
5940
|
+
w && N.current.setInputUpdateCallback(w);
|
|
5940
5941
|
}, [w]), jA(() => {
|
|
5941
|
-
h &&
|
|
5942
|
+
h && N.current.setComponentChangeCallback(h);
|
|
5942
5943
|
}, [h]), jA(() => {
|
|
5943
5944
|
(async () => {
|
|
5944
|
-
const y =
|
|
5945
|
+
const y = N.current;
|
|
5945
5946
|
let U = i;
|
|
5946
5947
|
if (!U && A)
|
|
5947
5948
|
try {
|
|
@@ -5953,7 +5954,7 @@ const XC = FC(
|
|
|
5953
5954
|
U && (y.load(U), D && D(y));
|
|
5954
5955
|
})();
|
|
5955
5956
|
}, [i, A]), jA(() => {
|
|
5956
|
-
const k =
|
|
5957
|
+
const k = N.current, y = K.current;
|
|
5957
5958
|
if (!y) return;
|
|
5958
5959
|
const U = y.getContext("2d");
|
|
5959
5960
|
if (!U) return;
|
|
@@ -5970,25 +5971,25 @@ const XC = FC(
|
|
|
5970
5971
|
}, [C]);
|
|
5971
5972
|
const J = (k, y) => {
|
|
5972
5973
|
const U = k.currentTarget.getBoundingClientRect(), R = k.clientX - U.left, c = k.clientY - U.top, L = U.width, r = U.height;
|
|
5973
|
-
|
|
5974
|
+
N.current.handlePointerInput(y, R, c, L, r);
|
|
5974
5975
|
};
|
|
5975
5976
|
return /* @__PURE__ */ yC(
|
|
5976
5977
|
"canvas",
|
|
5977
5978
|
{
|
|
5978
|
-
ref:
|
|
5979
|
+
ref: K,
|
|
5979
5980
|
style: { width: "100%", height: "100%", outline: "none", ...g },
|
|
5980
5981
|
className: I,
|
|
5981
5982
|
tabIndex: 0,
|
|
5982
5983
|
onPointerDown: (k) => {
|
|
5983
5984
|
var y;
|
|
5984
|
-
J(k, "down"), (y =
|
|
5985
|
+
J(k, "down"), (y = K.current) == null || y.focus();
|
|
5985
5986
|
},
|
|
5986
5987
|
onPointerUp: (k) => J(k, "up"),
|
|
5987
5988
|
onPointerMove: (k) => J(k, "move"),
|
|
5988
5989
|
onPointerLeave: (k) => J(k, "blur"),
|
|
5989
5990
|
onClick: (k) => J(k, "click"),
|
|
5990
5991
|
onKeyDown: (k) => {
|
|
5991
|
-
k.key === "Backspace" || k.key === "Enter" || k.key,
|
|
5992
|
+
k.key === "Backspace" || k.key === "Enter" || k.key, N.current.handleKeyDown(k.nativeEvent);
|
|
5992
5993
|
}
|
|
5993
5994
|
}
|
|
5994
5995
|
);
|