exodeui 2.6.29 → 2.6.30
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/engine.d.ts +2 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +1047 -999
- package/dist/types.d.ts +15 -3
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var MC = Object.defineProperty;
|
|
2
2
|
var JC = (D, A, I) => A in D ? MC(D, A, { enumerable: !0, configurable: !0, writable: !0, value: I }) : D[A] = I;
|
|
3
|
-
var
|
|
3
|
+
var z = (D, A, I) => JC(D, typeof A != "symbol" ? A + "" : A, I);
|
|
4
4
|
import { jsx as UC } from "react/jsx-runtime";
|
|
5
|
-
import { forwardRef as RC, useRef as wI, useImperativeHandle as tC, useEffect as eA, useState as cC, useCallback as
|
|
5
|
+
import { forwardRef as RC, useRef as wI, useImperativeHandle as tC, useEffect as eA, useState as cC, useCallback as nA } from "react";
|
|
6
6
|
var YC = /* @__PURE__ */ ((D) => (D.Equal = "Equal", D.NotEqual = "NotEqual", D.GreaterThan = "GreaterThan", D.LessThan = "LessThan", D.GreaterEqual = "GreaterEqual", D.LessEqual = "LessEqual", D.IsTrue = "IsTrue", D.IsFalse = "IsFalse", D))(YC || {}), VA = /* @__PURE__ */ ((D) => (D.AND = "AND", D.OR = "OR", D.NOT = "NOT", D.XOR = "XOR", D))(VA || {});
|
|
7
7
|
let E;
|
|
8
8
|
const v = new Array(128).fill(void 0);
|
|
@@ -31,7 +31,7 @@ let zA = null;
|
|
|
31
31
|
function OI(D, A) {
|
|
32
32
|
return D >>>= 0, Wg.decode((zA !== null && zA.byteLength !== 0 || (zA = new Uint8Array(E.memory.buffer)), zA).subarray(D, D + A));
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function n(D) {
|
|
35
35
|
return D == null;
|
|
36
36
|
}
|
|
37
37
|
let ZA = null;
|
|
@@ -76,18 +76,18 @@ function dA(D, A) {
|
|
|
76
76
|
const I = A(4 * D.length, 4) >>> 0;
|
|
77
77
|
return jg().set(D, I / 4), UA = D.length, I;
|
|
78
78
|
}
|
|
79
|
-
const yI = Object.freeze({ LinX: 0, 0: "LinX", LinY: 1, 1: "LinY", AngX: 2, 2: "AngX" }), fA = Object.freeze({ Revolute: 0, 0: "Revolute", Fixed: 1, 1: "Fixed", Prismatic: 2, 2: "Prismatic", Rope: 3, 3: "Rope", Spring: 4, 4: "Spring", Generic: 5, 5: "Generic" }), FA = Object.freeze({ Ball: 0, 0: "Ball", Cuboid: 1, 1: "Cuboid", Capsule: 2, 2: "Capsule", Segment: 3, 3: "Segment", Polyline: 4, 4: "Polyline", Triangle: 5, 5: "Triangle", TriMesh: 6, 6: "TriMesh", HeightField: 7, 7: "HeightField", Compound: 8, 8: "Compound", ConvexPolygon: 9, 9: "ConvexPolygon", RoundCuboid: 10, 10: "RoundCuboid", RoundTriangle: 11, 11: "RoundTriangle", RoundConvexPolygon: 12, 12: "RoundConvexPolygon", HalfSpace: 13, 13: "HalfSpace", Voxels: 14, 14: "Voxels" }),
|
|
79
|
+
const yI = Object.freeze({ LinX: 0, 0: "LinX", LinY: 1, 1: "LinY", AngX: 2, 2: "AngX" }), fA = Object.freeze({ Revolute: 0, 0: "Revolute", Fixed: 1, 1: "Fixed", Prismatic: 2, 2: "Prismatic", Rope: 3, 3: "Rope", Spring: 4, 4: "Spring", Generic: 5, 5: "Generic" }), FA = Object.freeze({ Ball: 0, 0: "Ball", Cuboid: 1, 1: "Cuboid", Capsule: 2, 2: "Capsule", Segment: 3, 3: "Segment", Polyline: 4, 4: "Polyline", Triangle: 5, 5: "Triangle", TriMesh: 6, 6: "TriMesh", HeightField: 7, 7: "HeightField", Compound: 8, 8: "Compound", ConvexPolygon: 9, 9: "ConvexPolygon", RoundCuboid: 10, 10: "RoundCuboid", RoundTriangle: 11, 11: "RoundTriangle", RoundConvexPolygon: 12, 12: "RoundConvexPolygon", HalfSpace: 13, 13: "HalfSpace", Voxels: 14, 14: "Voxels" }), nI = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
80
80
|
}, unregister: () => {
|
|
81
81
|
} } : new FinalizationRegistry((D) => E.__wbg_rawbroadphase_free(D >>> 0, 1));
|
|
82
82
|
class bA {
|
|
83
83
|
static __wrap(A) {
|
|
84
84
|
A >>>= 0;
|
|
85
85
|
const I = Object.create(bA.prototype);
|
|
86
|
-
return I.__wbg_ptr = A,
|
|
86
|
+
return I.__wbg_ptr = A, nI.register(I, I.__wbg_ptr, I), I;
|
|
87
87
|
}
|
|
88
88
|
__destroy_into_raw() {
|
|
89
89
|
const A = this.__wbg_ptr;
|
|
90
|
-
return this.__wbg_ptr = 0,
|
|
90
|
+
return this.__wbg_ptr = 0, nI.unregister(this), A;
|
|
91
91
|
}
|
|
92
92
|
free() {
|
|
93
93
|
const A = this.__destroy_into_raw();
|
|
@@ -95,87 +95,87 @@ class bA {
|
|
|
95
95
|
}
|
|
96
96
|
constructor() {
|
|
97
97
|
const A = E.rawbroadphase_new();
|
|
98
|
-
return this.__wbg_ptr = A >>> 0,
|
|
98
|
+
return this.__wbg_ptr = A >>> 0, nI.register(this, this.__wbg_ptr, this), this;
|
|
99
99
|
}
|
|
100
|
-
castRay(A, I, C, g, Q, B, i, o,
|
|
100
|
+
castRay(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
101
101
|
try {
|
|
102
|
-
K(A, GA), K(I, EA), K(C, wA), K(g,
|
|
103
|
-
const a = E.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o,
|
|
102
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M);
|
|
103
|
+
const a = E.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o, n(h) ? 4294967297 : h >>> 0, !n(s), n(s) ? 0 : s, !n(G), n(G) ? 0 : G, DA(w));
|
|
104
104
|
return a === 0 ? void 0 : gg.__wrap(a);
|
|
105
105
|
} finally {
|
|
106
106
|
v[CA++] = void 0;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
castRayAndGetNormal(A, I, C, g, Q, B, i, o,
|
|
109
|
+
castRayAndGetNormal(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
110
110
|
try {
|
|
111
|
-
K(A, GA), K(I, EA), K(C, wA), K(g,
|
|
112
|
-
const a = E.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o,
|
|
111
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M);
|
|
112
|
+
const a = E.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o, n(h) ? 4294967297 : h >>> 0, !n(s), n(s) ? 0 : s, !n(G), n(G) ? 0 : G, DA(w));
|
|
113
113
|
return a === 0 ? void 0 : JI.__wrap(a);
|
|
114
114
|
} finally {
|
|
115
115
|
v[CA++] = void 0;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
intersectionsWithRay(A, I, C, g, Q, B, i, o,
|
|
118
|
+
intersectionsWithRay(A, I, C, g, Q, B, i, o, h, s, G, w, a) {
|
|
119
119
|
try {
|
|
120
|
-
K(A, GA), K(I, EA), K(C, wA), K(g,
|
|
120
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M), E.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, DA(o), h, n(s) ? 4294967297 : s >>> 0, !n(G), n(G) ? 0 : G, !n(w), n(w) ? 0 : w, DA(a));
|
|
121
121
|
} finally {
|
|
122
122
|
v[CA++] = void 0, v[CA++] = void 0;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
intersectionWithShape(A, I, C, g, Q, B, i, o,
|
|
125
|
+
intersectionWithShape(A, I, C, g, Q, B, i, o, h, s, G) {
|
|
126
126
|
try {
|
|
127
127
|
const N = E.__wbindgen_add_to_stack_pointer(-16);
|
|
128
|
-
K(A, GA), K(I, EA), K(C, wA), K(g,
|
|
129
|
-
var
|
|
130
|
-
return
|
|
128
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, u), K(B, H), E.rawbroadphase_intersectionWithShape(N, this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i, n(o) ? 4294967297 : o >>> 0, !n(h), n(h) ? 0 : h, !n(s), n(s) ? 0 : s, DA(G));
|
|
129
|
+
var w = SA().getInt32(N + 0, !0), a = SA().getFloat64(N + 8, !0);
|
|
130
|
+
return w === 0 ? void 0 : a;
|
|
131
131
|
} finally {
|
|
132
132
|
E.__wbindgen_add_to_stack_pointer(16), v[CA++] = void 0;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
projectPoint(A, I, C, g, Q, B, i, o,
|
|
135
|
+
projectPoint(A, I, C, g, Q, B, i, o, h, s) {
|
|
136
136
|
try {
|
|
137
|
-
K(A, GA), K(I, EA), K(C, wA), K(g,
|
|
138
|
-
const
|
|
139
|
-
return
|
|
137
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M);
|
|
138
|
+
const G = E.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, n(i) ? 4294967297 : i >>> 0, !n(o), n(o) ? 0 : o, !n(h), n(h) ? 0 : h, DA(s));
|
|
139
|
+
return G === 0 ? void 0 : GI.__wrap(G);
|
|
140
140
|
} finally {
|
|
141
141
|
v[CA++] = void 0;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
projectPointAndGetFeature(A, I, C, g, Q, B, i, o,
|
|
144
|
+
projectPointAndGetFeature(A, I, C, g, Q, B, i, o, h) {
|
|
145
145
|
try {
|
|
146
|
-
K(A, GA), K(I, EA), K(C, wA), K(g,
|
|
147
|
-
const
|
|
148
|
-
return
|
|
146
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M);
|
|
147
|
+
const s = E.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, n(B) ? 4294967297 : B >>> 0, !n(i), n(i) ? 0 : i, !n(o), n(o) ? 0 : o, DA(h));
|
|
148
|
+
return s === 0 ? void 0 : GI.__wrap(s);
|
|
149
149
|
} finally {
|
|
150
150
|
v[CA++] = void 0;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
intersectionsWithPoint(A, I, C, g, Q, B, i, o,
|
|
153
|
+
intersectionsWithPoint(A, I, C, g, Q, B, i, o, h, s) {
|
|
154
154
|
try {
|
|
155
|
-
K(A, GA), K(I, EA), K(C, wA), K(g,
|
|
155
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M), E.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, DA(Q), B, n(i) ? 4294967297 : i >>> 0, !n(o), n(o) ? 0 : o, !n(h), n(h) ? 0 : h, DA(s));
|
|
156
156
|
} finally {
|
|
157
157
|
v[CA++] = void 0, v[CA++] = void 0;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
castShape(A, I, C, g, Q, B, i, o,
|
|
160
|
+
castShape(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S) {
|
|
161
161
|
try {
|
|
162
|
-
K(A, GA), K(I, EA), K(C, wA), K(g,
|
|
163
|
-
const
|
|
164
|
-
return
|
|
162
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, u), K(B, M), K(i, H);
|
|
163
|
+
const k = E.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o, h, s, G, n(w) ? 4294967297 : w >>> 0, !n(a), n(a) ? 0 : a, !n(N), n(N) ? 0 : N, DA(S));
|
|
164
|
+
return k === 0 ? void 0 : FI.__wrap(k);
|
|
165
165
|
} finally {
|
|
166
166
|
v[CA++] = void 0;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
intersectionsWithShape(A, I, C, g, Q, B, i, o,
|
|
169
|
+
intersectionsWithShape(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
170
170
|
try {
|
|
171
|
-
K(A, GA), K(I, EA), K(C, wA), K(g,
|
|
171
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, u), K(B, H), E.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, DA(i), o, n(h) ? 4294967297 : h >>> 0, !n(s), n(s) ? 0 : s, !n(G), n(G) ? 0 : G, DA(w));
|
|
172
172
|
} finally {
|
|
173
173
|
v[CA++] = void 0, v[CA++] = void 0;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
collidersWithAabbIntersectingAabb(A, I, C, g, Q, B) {
|
|
177
177
|
try {
|
|
178
|
-
K(A, GA), K(I, EA), K(C, wA), K(g,
|
|
178
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M), E.rawbroadphase_collidersWithAabbIntersectingAabb(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, DA(B));
|
|
179
179
|
} finally {
|
|
180
180
|
v[CA++] = void 0;
|
|
181
181
|
}
|
|
@@ -219,30 +219,30 @@ class xg {
|
|
|
219
219
|
}
|
|
220
220
|
translationDeltaApplied() {
|
|
221
221
|
const A = E.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
|
|
222
|
-
return
|
|
222
|
+
return M.__wrap(A);
|
|
223
223
|
}
|
|
224
224
|
translationDeltaRemaining() {
|
|
225
225
|
const A = E.rawcharactercollision_translationDeltaRemaining(this.__wbg_ptr);
|
|
226
|
-
return
|
|
226
|
+
return M.__wrap(A);
|
|
227
227
|
}
|
|
228
228
|
toi() {
|
|
229
229
|
return E.rawcharactercollision_toi(this.__wbg_ptr);
|
|
230
230
|
}
|
|
231
231
|
worldWitness1() {
|
|
232
232
|
const A = E.rawcharactercollision_worldWitness1(this.__wbg_ptr);
|
|
233
|
-
return
|
|
233
|
+
return M.__wrap(A);
|
|
234
234
|
}
|
|
235
235
|
worldWitness2() {
|
|
236
236
|
const A = E.rawcharactercollision_worldWitness2(this.__wbg_ptr);
|
|
237
|
-
return
|
|
237
|
+
return M.__wrap(A);
|
|
238
238
|
}
|
|
239
239
|
worldNormal1() {
|
|
240
240
|
const A = E.rawcharactercollision_worldNormal1(this.__wbg_ptr);
|
|
241
|
-
return
|
|
241
|
+
return M.__wrap(A);
|
|
242
242
|
}
|
|
243
243
|
worldNormal2() {
|
|
244
244
|
const A = E.rawcharactercollision_worldNormal2(this.__wbg_ptr);
|
|
245
|
-
return
|
|
245
|
+
return M.__wrap(A);
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
const lI = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -264,7 +264,7 @@ class wA {
|
|
|
264
264
|
}
|
|
265
265
|
coTranslation(A) {
|
|
266
266
|
const I = E.rawcolliderset_coTranslation(this.__wbg_ptr, A);
|
|
267
|
-
return
|
|
267
|
+
return M.__wrap(I);
|
|
268
268
|
}
|
|
269
269
|
coRotation(A) {
|
|
270
270
|
const I = E.rawcolliderset_coRotation(this.__wbg_ptr, A);
|
|
@@ -272,7 +272,7 @@ class wA {
|
|
|
272
272
|
}
|
|
273
273
|
coTranslationWrtParent(A) {
|
|
274
274
|
const I = E.rawcolliderset_coTranslationWrtParent(this.__wbg_ptr, A);
|
|
275
|
-
return I === 0 ? void 0 :
|
|
275
|
+
return I === 0 ? void 0 : M.__wrap(I);
|
|
276
276
|
}
|
|
277
277
|
coRotationWrtParent(A) {
|
|
278
278
|
const I = E.rawcolliderset_coRotationWrtParent(this.__wbg_ptr, A);
|
|
@@ -298,14 +298,14 @@ class wA {
|
|
|
298
298
|
}
|
|
299
299
|
coHalfspaceNormal(A) {
|
|
300
300
|
const I = E.rawcolliderset_coHalfspaceNormal(this.__wbg_ptr, A);
|
|
301
|
-
return I === 0 ? void 0 :
|
|
301
|
+
return I === 0 ? void 0 : M.__wrap(I);
|
|
302
302
|
}
|
|
303
303
|
coHalfExtents(A) {
|
|
304
304
|
const I = E.rawcolliderset_coHalfExtents(this.__wbg_ptr, A);
|
|
305
|
-
return I === 0 ? void 0 :
|
|
305
|
+
return I === 0 ? void 0 : M.__wrap(I);
|
|
306
306
|
}
|
|
307
307
|
coSetHalfExtents(A, I) {
|
|
308
|
-
K(I,
|
|
308
|
+
K(I, M), E.rawcolliderset_coSetHalfExtents(this.__wbg_ptr, A, I.__wbg_ptr);
|
|
309
309
|
}
|
|
310
310
|
coRadius(A) {
|
|
311
311
|
const I = E.rawcolliderset_coRadius(this.__wbg_ptr, A);
|
|
@@ -341,7 +341,7 @@ class wA {
|
|
|
341
341
|
}
|
|
342
342
|
coVoxelSize(A) {
|
|
343
343
|
const I = E.rawcolliderset_coVoxelSize(this.__wbg_ptr, A);
|
|
344
|
-
return I === 0 ? void 0 :
|
|
344
|
+
return I === 0 ? void 0 : M.__wrap(I);
|
|
345
345
|
}
|
|
346
346
|
coSetVoxel(A, I, C, g) {
|
|
347
347
|
E.rawcolliderset_coSetVoxel(this.__wbg_ptr, A, I, C, g);
|
|
@@ -393,7 +393,7 @@ class wA {
|
|
|
393
393
|
}
|
|
394
394
|
coHeightfieldScale(A) {
|
|
395
395
|
const I = E.rawcolliderset_coHeightfieldScale(this.__wbg_ptr, A);
|
|
396
|
-
return I === 0 ? void 0 :
|
|
396
|
+
return I === 0 ? void 0 : M.__wrap(I);
|
|
397
397
|
}
|
|
398
398
|
coParent(A) {
|
|
399
399
|
try {
|
|
@@ -451,23 +451,23 @@ class wA {
|
|
|
451
451
|
return E.rawcolliderset_coContactForceEventThreshold(this.__wbg_ptr, A);
|
|
452
452
|
}
|
|
453
453
|
coContainsPoint(A, I) {
|
|
454
|
-
return K(I,
|
|
454
|
+
return K(I, M), E.rawcolliderset_coContainsPoint(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
|
|
455
455
|
}
|
|
456
|
-
coCastShape(A, I, C, g, Q, B, i, o,
|
|
457
|
-
K(I,
|
|
458
|
-
const
|
|
459
|
-
return
|
|
456
|
+
coCastShape(A, I, C, g, Q, B, i, o, h) {
|
|
457
|
+
K(I, M), K(C, H), K(g, M), K(Q, u), K(B, M);
|
|
458
|
+
const s = E.rawcolliderset_coCastShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i, o, h);
|
|
459
|
+
return s === 0 ? void 0 : RI.__wrap(s);
|
|
460
460
|
}
|
|
461
461
|
coCastCollider(A, I, C, g, Q, B, i) {
|
|
462
|
-
K(I,
|
|
462
|
+
K(I, M), K(g, M);
|
|
463
463
|
const o = E.rawcolliderset_coCastCollider(this.__wbg_ptr, A, I.__wbg_ptr, C, g.__wbg_ptr, Q, B, i);
|
|
464
464
|
return o === 0 ? void 0 : FI.__wrap(o);
|
|
465
465
|
}
|
|
466
466
|
coIntersectsShape(A, I, C, g) {
|
|
467
|
-
return K(I, H), K(C,
|
|
467
|
+
return K(I, H), K(C, M), K(g, u), E.rawcolliderset_coIntersectsShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr) !== 0;
|
|
468
468
|
}
|
|
469
469
|
coContactShape(A, I, C, g, Q) {
|
|
470
|
-
K(I, H), K(C,
|
|
470
|
+
K(I, H), K(C, M), K(g, u);
|
|
471
471
|
const B = E.rawcolliderset_coContactShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q);
|
|
472
472
|
return B === 0 ? void 0 : gI.__wrap(B);
|
|
473
473
|
}
|
|
@@ -476,18 +476,18 @@ class wA {
|
|
|
476
476
|
return g === 0 ? void 0 : gI.__wrap(g);
|
|
477
477
|
}
|
|
478
478
|
coProjectPoint(A, I, C) {
|
|
479
|
-
K(I,
|
|
479
|
+
K(I, M);
|
|
480
480
|
const g = E.rawcolliderset_coProjectPoint(this.__wbg_ptr, A, I.__wbg_ptr, C);
|
|
481
481
|
return MI.__wrap(g);
|
|
482
482
|
}
|
|
483
483
|
coIntersectsRay(A, I, C, g) {
|
|
484
|
-
return K(I,
|
|
484
|
+
return K(I, M), K(C, M), E.rawcolliderset_coIntersectsRay(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g) !== 0;
|
|
485
485
|
}
|
|
486
486
|
coCastRay(A, I, C, g, Q) {
|
|
487
|
-
return K(I,
|
|
487
|
+
return K(I, M), K(C, M), E.rawcolliderset_coCastRay(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q);
|
|
488
488
|
}
|
|
489
489
|
coCastRayAndGetNormal(A, I, C, g, Q) {
|
|
490
|
-
K(I,
|
|
490
|
+
K(I, M), K(C, M);
|
|
491
491
|
const B = E.rawcolliderset_coCastRayAndGetNormal(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q);
|
|
492
492
|
return B === 0 ? void 0 : UI.__wrap(B);
|
|
493
493
|
}
|
|
@@ -540,7 +540,7 @@ class wA {
|
|
|
540
540
|
E.rawcolliderset_coSetMass(this.__wbg_ptr, A, I);
|
|
541
541
|
}
|
|
542
542
|
coSetMassProperties(A, I, C, g) {
|
|
543
|
-
K(C,
|
|
543
|
+
K(C, M), E.rawcolliderset_coSetMassProperties(this.__wbg_ptr, A, I, C.__wbg_ptr, g);
|
|
544
544
|
}
|
|
545
545
|
constructor() {
|
|
546
546
|
const A = E.rawcolliderset_new();
|
|
@@ -552,10 +552,10 @@ class wA {
|
|
|
552
552
|
contains(A) {
|
|
553
553
|
return E.rawcolliderset_contains(this.__wbg_ptr, A) !== 0;
|
|
554
554
|
}
|
|
555
|
-
createCollider(A, I, C, g, Q, B, i, o,
|
|
555
|
+
createCollider(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S, k, y, U, c, t, J, R, e, Y) {
|
|
556
556
|
try {
|
|
557
557
|
const b = E.__wbindgen_add_to_stack_pointer(-16);
|
|
558
|
-
K(I, H), K(C,
|
|
558
|
+
K(I, H), K(C, M), K(g, u), K(i, M), K(Y, EA), E.rawcolliderset_createCollider(b, this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, i.__wbg_ptr, o, h, s, G, w, a, N, S, k, y, U, c, t, J, R, e, Y.__wbg_ptr);
|
|
559
559
|
var r = SA().getInt32(b + 0, !0), L = SA().getFloat64(b + 8, !0);
|
|
560
560
|
return r === 0 ? void 0 : L;
|
|
561
561
|
} finally {
|
|
@@ -563,7 +563,7 @@ class wA {
|
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
remove(A, I, C, g) {
|
|
566
|
-
K(I,
|
|
566
|
+
K(I, qA), K(C, EA), E.rawcolliderset_remove(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
|
|
567
567
|
}
|
|
568
568
|
isHandleValid(A) {
|
|
569
569
|
return E.rawcolliderset_contains(this.__wbg_ptr, A) !== 0;
|
|
@@ -601,19 +601,19 @@ class FI {
|
|
|
601
601
|
}
|
|
602
602
|
witness1() {
|
|
603
603
|
const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
|
|
604
|
-
return
|
|
604
|
+
return M.__wrap(A);
|
|
605
605
|
}
|
|
606
606
|
witness2() {
|
|
607
607
|
const A = E.rawcollidershapecasthit_witness2(this.__wbg_ptr);
|
|
608
|
-
return
|
|
608
|
+
return M.__wrap(A);
|
|
609
609
|
}
|
|
610
610
|
normal1() {
|
|
611
611
|
const A = E.rawcollidershapecasthit_normal1(this.__wbg_ptr);
|
|
612
|
-
return
|
|
612
|
+
return M.__wrap(A);
|
|
613
613
|
}
|
|
614
614
|
normal2() {
|
|
615
615
|
const A = E.rawcollidershapecasthit_normal2(this.__wbg_ptr);
|
|
616
|
-
return
|
|
616
|
+
return M.__wrap(A);
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
const Mg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -641,14 +641,14 @@ class _I {
|
|
|
641
641
|
}
|
|
642
642
|
total_force() {
|
|
643
643
|
const A = E.rawcontactforceevent_total_force(this.__wbg_ptr);
|
|
644
|
-
return
|
|
644
|
+
return M.__wrap(A);
|
|
645
645
|
}
|
|
646
646
|
total_force_magnitude() {
|
|
647
647
|
return E.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr);
|
|
648
648
|
}
|
|
649
649
|
max_force_direction() {
|
|
650
650
|
const A = E.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
|
|
651
|
-
return
|
|
651
|
+
return M.__wrap(A);
|
|
652
652
|
}
|
|
653
653
|
max_force_magnitude() {
|
|
654
654
|
return E.rawcontactforceevent_max_force_magnitude(this.__wbg_ptr);
|
|
@@ -673,15 +673,15 @@ class $I {
|
|
|
673
673
|
}
|
|
674
674
|
normal() {
|
|
675
675
|
const A = E.rawcontactmanifold_normal(this.__wbg_ptr);
|
|
676
|
-
return
|
|
676
|
+
return M.__wrap(A);
|
|
677
677
|
}
|
|
678
678
|
local_n1() {
|
|
679
679
|
const A = E.rawcontactmanifold_local_n1(this.__wbg_ptr);
|
|
680
|
-
return
|
|
680
|
+
return M.__wrap(A);
|
|
681
681
|
}
|
|
682
682
|
local_n2() {
|
|
683
683
|
const A = E.rawcontactmanifold_local_n2(this.__wbg_ptr);
|
|
684
|
-
return
|
|
684
|
+
return M.__wrap(A);
|
|
685
685
|
}
|
|
686
686
|
subshape1() {
|
|
687
687
|
return E.rawcontactmanifold_subshape1(this.__wbg_ptr) >>> 0;
|
|
@@ -694,11 +694,11 @@ class $I {
|
|
|
694
694
|
}
|
|
695
695
|
contact_local_p1(A) {
|
|
696
696
|
const I = E.rawcontactmanifold_contact_local_p1(this.__wbg_ptr, A);
|
|
697
|
-
return I === 0 ? void 0 :
|
|
697
|
+
return I === 0 ? void 0 : M.__wrap(I);
|
|
698
698
|
}
|
|
699
699
|
contact_local_p2(A) {
|
|
700
700
|
const I = E.rawcontactmanifold_contact_local_p2(this.__wbg_ptr, A);
|
|
701
|
-
return I === 0 ? void 0 :
|
|
701
|
+
return I === 0 ? void 0 : M.__wrap(I);
|
|
702
702
|
}
|
|
703
703
|
contact_dist(A) {
|
|
704
704
|
return E.rawcontactmanifold_contact_dist(this.__wbg_ptr, A);
|
|
@@ -720,7 +720,7 @@ class $I {
|
|
|
720
720
|
}
|
|
721
721
|
solver_contact_point(A) {
|
|
722
722
|
const I = E.rawcontactmanifold_solver_contact_point(this.__wbg_ptr, A);
|
|
723
|
-
return I === 0 ? void 0 :
|
|
723
|
+
return I === 0 ? void 0 : M.__wrap(I);
|
|
724
724
|
}
|
|
725
725
|
solver_contact_dist(A) {
|
|
726
726
|
return E.rawcontactmanifold_solver_contact_dist(this.__wbg_ptr, A);
|
|
@@ -733,7 +733,7 @@ class $I {
|
|
|
733
733
|
}
|
|
734
734
|
solver_contact_tangent_velocity(A) {
|
|
735
735
|
const I = E.rawcontactmanifold_solver_contact_tangent_velocity(this.__wbg_ptr, A);
|
|
736
|
-
return
|
|
736
|
+
return M.__wrap(I);
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
739
|
const Ug = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -816,7 +816,7 @@ class Ig {
|
|
|
816
816
|
}
|
|
817
817
|
takeGravity() {
|
|
818
818
|
const A = E.rawdeserializedworld_takeGravity(this.__wbg_ptr);
|
|
819
|
-
return A === 0 ? void 0 :
|
|
819
|
+
return A === 0 ? void 0 : M.__wrap(A);
|
|
820
820
|
}
|
|
821
821
|
takeIntegrationParameters() {
|
|
822
822
|
const A = E.rawdeserializedworld_takeIntegrationParameters(this.__wbg_ptr);
|
|
@@ -824,7 +824,7 @@ class Ig {
|
|
|
824
824
|
}
|
|
825
825
|
takeIslandManager() {
|
|
826
826
|
const A = E.rawdeserializedworld_takeIslandManager(this.__wbg_ptr);
|
|
827
|
-
return A === 0 ? void 0 :
|
|
827
|
+
return A === 0 ? void 0 : qA.__wrap(A);
|
|
828
828
|
}
|
|
829
829
|
takeBroadPhase() {
|
|
830
830
|
const A = E.rawdeserializedworld_takeBroadPhase(this.__wbg_ptr);
|
|
@@ -903,43 +903,43 @@ class MA {
|
|
|
903
903
|
E.__wbg_rawgenericjoint_free(A, 0);
|
|
904
904
|
}
|
|
905
905
|
static spring(A, I, C, g, Q) {
|
|
906
|
-
K(g,
|
|
906
|
+
K(g, M), K(Q, M);
|
|
907
907
|
const B = E.rawgenericjoint_spring(A, I, C, g.__wbg_ptr, Q.__wbg_ptr);
|
|
908
908
|
return MA.__wrap(B);
|
|
909
909
|
}
|
|
910
910
|
static rope(A, I, C) {
|
|
911
|
-
K(I,
|
|
911
|
+
K(I, M), K(C, M);
|
|
912
912
|
const g = E.rawgenericjoint_rope(A, I.__wbg_ptr, C.__wbg_ptr);
|
|
913
913
|
return MA.__wrap(g);
|
|
914
914
|
}
|
|
915
915
|
static prismatic(A, I, C, g, Q, B) {
|
|
916
|
-
K(A,
|
|
916
|
+
K(A, M), K(I, M), K(C, M);
|
|
917
917
|
const i = E.rawgenericjoint_prismatic(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g, Q, B);
|
|
918
918
|
return i === 0 ? void 0 : MA.__wrap(i);
|
|
919
919
|
}
|
|
920
920
|
static fixed(A, I, C, g) {
|
|
921
|
-
K(A,
|
|
921
|
+
K(A, M), K(I, u), K(C, M), K(g, u);
|
|
922
922
|
const Q = E.rawgenericjoint_fixed(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr);
|
|
923
923
|
return MA.__wrap(Q);
|
|
924
924
|
}
|
|
925
925
|
static revolute(A, I) {
|
|
926
|
-
K(A,
|
|
926
|
+
K(A, M), K(I, M);
|
|
927
927
|
const C = E.rawgenericjoint_revolute(A.__wbg_ptr, I.__wbg_ptr);
|
|
928
928
|
return C === 0 ? void 0 : MA.__wrap(C);
|
|
929
929
|
}
|
|
930
930
|
}
|
|
931
|
-
const
|
|
931
|
+
const qI = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
932
932
|
}, unregister: () => {
|
|
933
933
|
} } : new FinalizationRegistry((D) => E.__wbg_rawimpulsejointset_free(D >>> 0, 1));
|
|
934
934
|
class lA {
|
|
935
935
|
static __wrap(A) {
|
|
936
936
|
A >>>= 0;
|
|
937
937
|
const I = Object.create(lA.prototype);
|
|
938
|
-
return I.__wbg_ptr = A,
|
|
938
|
+
return I.__wbg_ptr = A, qI.register(I, I.__wbg_ptr, I), I;
|
|
939
939
|
}
|
|
940
940
|
__destroy_into_raw() {
|
|
941
941
|
const A = this.__wbg_ptr;
|
|
942
|
-
return this.__wbg_ptr = 0,
|
|
942
|
+
return this.__wbg_ptr = 0, qI.unregister(this), A;
|
|
943
943
|
}
|
|
944
944
|
free() {
|
|
945
945
|
const A = this.__destroy_into_raw();
|
|
@@ -964,17 +964,17 @@ class lA {
|
|
|
964
964
|
}
|
|
965
965
|
jointAnchor1(A) {
|
|
966
966
|
const I = E.rawimpulsejointset_jointAnchor1(this.__wbg_ptr, A);
|
|
967
|
-
return
|
|
967
|
+
return M.__wrap(I);
|
|
968
968
|
}
|
|
969
969
|
jointAnchor2(A) {
|
|
970
970
|
const I = E.rawimpulsejointset_jointAnchor2(this.__wbg_ptr, A);
|
|
971
|
-
return
|
|
971
|
+
return M.__wrap(I);
|
|
972
972
|
}
|
|
973
973
|
jointSetAnchor1(A, I) {
|
|
974
|
-
K(I,
|
|
974
|
+
K(I, M), E.rawimpulsejointset_jointSetAnchor1(this.__wbg_ptr, A, I.__wbg_ptr);
|
|
975
975
|
}
|
|
976
976
|
jointSetAnchor2(A, I) {
|
|
977
|
-
K(I,
|
|
977
|
+
K(I, M), E.rawimpulsejointset_jointSetAnchor2(this.__wbg_ptr, A, I.__wbg_ptr);
|
|
978
978
|
}
|
|
979
979
|
jointContactsEnabled(A) {
|
|
980
980
|
return E.rawimpulsejointset_jointContactsEnabled(this.__wbg_ptr, A) !== 0;
|
|
@@ -1008,7 +1008,7 @@ class lA {
|
|
|
1008
1008
|
}
|
|
1009
1009
|
constructor() {
|
|
1010
1010
|
const A = E.rawimpulsejointset_new();
|
|
1011
|
-
return this.__wbg_ptr = A >>> 0,
|
|
1011
|
+
return this.__wbg_ptr = A >>> 0, qI.register(this, this.__wbg_ptr, this), this;
|
|
1012
1012
|
}
|
|
1013
1013
|
createJoint(A, I, C, g) {
|
|
1014
1014
|
return K(A, MA), E.rawimpulsejointset_createJoint(this.__wbg_ptr, A.__wbg_ptr, I, C, g);
|
|
@@ -1116,10 +1116,10 @@ class jA {
|
|
|
1116
1116
|
const pI = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1117
1117
|
}, unregister: () => {
|
|
1118
1118
|
} } : new FinalizationRegistry((D) => E.__wbg_rawislandmanager_free(D >>> 0, 1));
|
|
1119
|
-
class
|
|
1119
|
+
class qA {
|
|
1120
1120
|
static __wrap(A) {
|
|
1121
1121
|
A >>>= 0;
|
|
1122
|
-
const I = Object.create(
|
|
1122
|
+
const I = Object.create(qA.prototype);
|
|
1123
1123
|
return I.__wbg_ptr = A, pI.register(I, I.__wbg_ptr, I), I;
|
|
1124
1124
|
}
|
|
1125
1125
|
__destroy_into_raw() {
|
|
@@ -1160,10 +1160,10 @@ class LC {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
up() {
|
|
1162
1162
|
const A = E.rawcollidershapecasthit_normal2(this.__wbg_ptr);
|
|
1163
|
-
return
|
|
1163
|
+
return M.__wrap(A);
|
|
1164
1164
|
}
|
|
1165
1165
|
setUp(A) {
|
|
1166
|
-
K(A,
|
|
1166
|
+
K(A, M), E.rawkinematiccharactercontroller_setUp(this.__wbg_ptr, A.__wbg_ptr);
|
|
1167
1167
|
}
|
|
1168
1168
|
normalNudgeFactor() {
|
|
1169
1169
|
return E.rawkinematiccharactercontroller_normalNudgeFactor(this.__wbg_ptr);
|
|
@@ -1229,16 +1229,16 @@ class LC {
|
|
|
1229
1229
|
snapToGroundEnabled() {
|
|
1230
1230
|
return E.rawkinematiccharactercontroller_snapToGroundEnabled(this.__wbg_ptr) !== 0;
|
|
1231
1231
|
}
|
|
1232
|
-
computeColliderMovement(A, I, C, g, Q, B, i, o,
|
|
1232
|
+
computeColliderMovement(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
1233
1233
|
try {
|
|
1234
|
-
K(I, bA), K(C, GA), K(g, EA), K(Q, wA), K(i,
|
|
1234
|
+
K(I, bA), K(C, GA), K(g, EA), K(Q, wA), K(i, M), E.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i.__wbg_ptr, o, n(h) ? 4294967297 : Math.fround(h), s, n(G) ? 4294967297 : G >>> 0, DA(w));
|
|
1235
1235
|
} finally {
|
|
1236
1236
|
v[CA++] = void 0;
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
1239
1239
|
computedMovement() {
|
|
1240
1240
|
const A = E.rawkinematiccharactercontroller_computedMovement(this.__wbg_ptr);
|
|
1241
|
-
return
|
|
1241
|
+
return M.__wrap(A);
|
|
1242
1242
|
}
|
|
1243
1243
|
computedGrounded() {
|
|
1244
1244
|
return E.rawkinematiccharactercontroller_computedGrounded(this.__wbg_ptr) !== 0;
|
|
@@ -1280,11 +1280,11 @@ class HA {
|
|
|
1280
1280
|
}
|
|
1281
1281
|
jointAnchor1(A) {
|
|
1282
1282
|
const I = E.rawmultibodyjointset_jointAnchor1(this.__wbg_ptr, A);
|
|
1283
|
-
return
|
|
1283
|
+
return M.__wrap(I);
|
|
1284
1284
|
}
|
|
1285
1285
|
jointAnchor2(A) {
|
|
1286
1286
|
const I = E.rawmultibodyjointset_jointAnchor2(this.__wbg_ptr, A);
|
|
1287
|
-
return
|
|
1287
|
+
return M.__wrap(I);
|
|
1288
1288
|
}
|
|
1289
1289
|
jointContactsEnabled(A) {
|
|
1290
1290
|
return E.rawmultibodyjointset_jointContactsEnabled(this.__wbg_ptr, A) !== 0;
|
|
@@ -1367,7 +1367,7 @@ class GA {
|
|
|
1367
1367
|
const rg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1368
1368
|
}, unregister: () => {
|
|
1369
1369
|
} } : new FinalizationRegistry((D) => E.__wbg_rawphysicspipeline_free(D >>> 0, 1));
|
|
1370
|
-
class
|
|
1370
|
+
class nC {
|
|
1371
1371
|
__destroy_into_raw() {
|
|
1372
1372
|
const A = this.__wbg_ptr;
|
|
1373
1373
|
return this.__wbg_ptr = 0, rg.unregister(this), A;
|
|
@@ -1434,11 +1434,11 @@ class qC {
|
|
|
1434
1434
|
timing_user_changes() {
|
|
1435
1435
|
return E.rawphysicspipeline_timing_user_changes(this.__wbg_ptr);
|
|
1436
1436
|
}
|
|
1437
|
-
step(A, I, C, g, Q, B, i, o,
|
|
1438
|
-
K(A,
|
|
1437
|
+
step(A, I, C, g, Q, B, i, o, h, s) {
|
|
1438
|
+
K(A, M), K(I, jA), K(C, qA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(h, HA), K(s, WI), E.rawphysicspipeline_step(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr, s.__wbg_ptr);
|
|
1439
1439
|
}
|
|
1440
|
-
stepWithEvents(A, I, C, g, Q, B, i, o,
|
|
1441
|
-
K(A,
|
|
1440
|
+
stepWithEvents(A, I, C, g, Q, B, i, o, h, s, G, w, a, N) {
|
|
1441
|
+
K(A, M), K(I, jA), K(C, qA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(h, HA), K(s, WI), K(G, Xg), E.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr, s.__wbg_ptr, G.__wbg_ptr, $(w), $(a), $(N));
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
1444
|
const Lg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -1473,32 +1473,32 @@ class lC {
|
|
|
1473
1473
|
E.rawpidcontroller_reset_integrals(this.__wbg_ptr);
|
|
1474
1474
|
}
|
|
1475
1475
|
apply_linear_correction(A, I, C, g, Q) {
|
|
1476
|
-
K(I, EA), K(g,
|
|
1476
|
+
K(I, EA), K(g, M), K(Q, M), E.rawpidcontroller_apply_linear_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g.__wbg_ptr, Q.__wbg_ptr);
|
|
1477
1477
|
}
|
|
1478
1478
|
apply_angular_correction(A, I, C, g, Q) {
|
|
1479
1479
|
K(I, EA), E.rawpidcontroller_apply_angular_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g, Q);
|
|
1480
1480
|
}
|
|
1481
1481
|
linear_correction(A, I, C, g, Q) {
|
|
1482
|
-
K(I, EA), K(g,
|
|
1482
|
+
K(I, EA), K(g, M), K(Q, M);
|
|
1483
1483
|
const B = E.rawpidcontroller_linear_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g.__wbg_ptr, Q.__wbg_ptr);
|
|
1484
|
-
return
|
|
1484
|
+
return M.__wrap(B);
|
|
1485
1485
|
}
|
|
1486
1486
|
angular_correction(A, I, C, g, Q) {
|
|
1487
1487
|
return K(I, EA), E.rawpidcontroller_angular_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g, Q);
|
|
1488
1488
|
}
|
|
1489
1489
|
}
|
|
1490
|
-
const
|
|
1490
|
+
const ng = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1491
1491
|
}, unregister: () => {
|
|
1492
1492
|
} } : new FinalizationRegistry((D) => E.__wbg_rawpointcolliderprojection_free(D >>> 0, 1));
|
|
1493
1493
|
class GI {
|
|
1494
1494
|
static __wrap(A) {
|
|
1495
1495
|
A >>>= 0;
|
|
1496
1496
|
const I = Object.create(GI.prototype);
|
|
1497
|
-
return I.__wbg_ptr = A,
|
|
1497
|
+
return I.__wbg_ptr = A, ng.register(I, I.__wbg_ptr, I), I;
|
|
1498
1498
|
}
|
|
1499
1499
|
__destroy_into_raw() {
|
|
1500
1500
|
const A = this.__wbg_ptr;
|
|
1501
|
-
return this.__wbg_ptr = 0,
|
|
1501
|
+
return this.__wbg_ptr = 0, ng.unregister(this), A;
|
|
1502
1502
|
}
|
|
1503
1503
|
free() {
|
|
1504
1504
|
const A = this.__destroy_into_raw();
|
|
@@ -1509,7 +1509,7 @@ class GI {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
point() {
|
|
1511
1511
|
const A = E.rawpointcolliderprojection_point(this.__wbg_ptr);
|
|
1512
|
-
return
|
|
1512
|
+
return M.__wrap(A);
|
|
1513
1513
|
}
|
|
1514
1514
|
isInside() {
|
|
1515
1515
|
return E.rawpointcolliderprojection_isInside(this.__wbg_ptr) !== 0;
|
|
@@ -1541,24 +1541,24 @@ class MI {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
point() {
|
|
1543
1543
|
const A = E.rawpointprojection_point(this.__wbg_ptr);
|
|
1544
|
-
return
|
|
1544
|
+
return M.__wrap(A);
|
|
1545
1545
|
}
|
|
1546
1546
|
isInside() {
|
|
1547
1547
|
return E.rawpointprojection_isInside(this.__wbg_ptr) !== 0;
|
|
1548
1548
|
}
|
|
1549
1549
|
}
|
|
1550
|
-
const
|
|
1550
|
+
const qg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1551
1551
|
}, unregister: () => {
|
|
1552
1552
|
} } : new FinalizationRegistry((D) => E.__wbg_rawraycolliderhit_free(D >>> 0, 1));
|
|
1553
1553
|
class gg {
|
|
1554
1554
|
static __wrap(A) {
|
|
1555
1555
|
A >>>= 0;
|
|
1556
1556
|
const I = Object.create(gg.prototype);
|
|
1557
|
-
return I.__wbg_ptr = A,
|
|
1557
|
+
return I.__wbg_ptr = A, qg.register(I, I.__wbg_ptr, I), I;
|
|
1558
1558
|
}
|
|
1559
1559
|
__destroy_into_raw() {
|
|
1560
1560
|
const A = this.__wbg_ptr;
|
|
1561
|
-
return this.__wbg_ptr = 0,
|
|
1561
|
+
return this.__wbg_ptr = 0, qg.unregister(this), A;
|
|
1562
1562
|
}
|
|
1563
1563
|
free() {
|
|
1564
1564
|
const A = this.__destroy_into_raw();
|
|
@@ -1593,7 +1593,7 @@ class JI {
|
|
|
1593
1593
|
}
|
|
1594
1594
|
normal() {
|
|
1595
1595
|
const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
|
|
1596
|
-
return
|
|
1596
|
+
return M.__wrap(A);
|
|
1597
1597
|
}
|
|
1598
1598
|
time_of_impact() {
|
|
1599
1599
|
return E.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
|
|
@@ -1625,7 +1625,7 @@ class UI {
|
|
|
1625
1625
|
}
|
|
1626
1626
|
normal() {
|
|
1627
1627
|
const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
|
|
1628
|
-
return
|
|
1628
|
+
return M.__wrap(A);
|
|
1629
1629
|
}
|
|
1630
1630
|
time_of_impact() {
|
|
1631
1631
|
return E.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
|
|
@@ -1657,7 +1657,7 @@ class EA {
|
|
|
1657
1657
|
}
|
|
1658
1658
|
rbTranslation(A) {
|
|
1659
1659
|
const I = E.rawrigidbodyset_rbTranslation(this.__wbg_ptr, A);
|
|
1660
|
-
return
|
|
1660
|
+
return M.__wrap(I);
|
|
1661
1661
|
}
|
|
1662
1662
|
rbRotation(A) {
|
|
1663
1663
|
const I = E.rawrigidbodyset_rbRotation(this.__wbg_ptr, A);
|
|
@@ -1674,7 +1674,7 @@ class EA {
|
|
|
1674
1674
|
}
|
|
1675
1675
|
rbNextTranslation(A) {
|
|
1676
1676
|
const I = E.rawrigidbodyset_rbNextTranslation(this.__wbg_ptr, A);
|
|
1677
|
-
return
|
|
1677
|
+
return M.__wrap(I);
|
|
1678
1678
|
}
|
|
1679
1679
|
rbNextRotation(A) {
|
|
1680
1680
|
const I = E.rawrigidbodyset_rbNextRotation(this.__wbg_ptr, A);
|
|
@@ -1687,7 +1687,7 @@ class EA {
|
|
|
1687
1687
|
E.rawrigidbodyset_rbSetRotation(this.__wbg_ptr, A, I, C);
|
|
1688
1688
|
}
|
|
1689
1689
|
rbSetLinvel(A, I, C) {
|
|
1690
|
-
K(I,
|
|
1690
|
+
K(I, M), E.rawrigidbodyset_rbSetLinvel(this.__wbg_ptr, A, I.__wbg_ptr, C);
|
|
1691
1691
|
}
|
|
1692
1692
|
rbSetAngvel(A, I, C) {
|
|
1693
1693
|
E.rawrigidbodyset_rbSetAngvel(this.__wbg_ptr, A, I, C);
|
|
@@ -1705,19 +1705,19 @@ class EA {
|
|
|
1705
1705
|
E.rawrigidbodyset_rbSetAdditionalMass(this.__wbg_ptr, A, I, C);
|
|
1706
1706
|
}
|
|
1707
1707
|
rbSetAdditionalMassProperties(A, I, C, g, Q) {
|
|
1708
|
-
K(C,
|
|
1708
|
+
K(C, M), E.rawrigidbodyset_rbSetAdditionalMassProperties(this.__wbg_ptr, A, I, C.__wbg_ptr, g, Q);
|
|
1709
1709
|
}
|
|
1710
1710
|
rbLinvel(A) {
|
|
1711
1711
|
const I = E.rawrigidbodyset_rbLinvel(this.__wbg_ptr, A);
|
|
1712
|
-
return
|
|
1712
|
+
return M.__wrap(I);
|
|
1713
1713
|
}
|
|
1714
1714
|
rbAngvel(A) {
|
|
1715
1715
|
return E.rawrigidbodyset_rbAngvel(this.__wbg_ptr, A);
|
|
1716
1716
|
}
|
|
1717
1717
|
rbVelocityAtPoint(A, I) {
|
|
1718
|
-
K(I,
|
|
1718
|
+
K(I, M);
|
|
1719
1719
|
const C = E.rawrigidbodyset_rbVelocityAtPoint(this.__wbg_ptr, A, I.__wbg_ptr);
|
|
1720
|
-
return
|
|
1720
|
+
return M.__wrap(C);
|
|
1721
1721
|
}
|
|
1722
1722
|
rbLockTranslations(A, I, C) {
|
|
1723
1723
|
E.rawrigidbodyset_rbLockTranslations(this.__wbg_ptr, A, I, C);
|
|
@@ -1748,15 +1748,15 @@ class EA {
|
|
|
1748
1748
|
}
|
|
1749
1749
|
rbEffectiveInvMass(A) {
|
|
1750
1750
|
const I = E.rawrigidbodyset_rbEffectiveInvMass(this.__wbg_ptr, A);
|
|
1751
|
-
return
|
|
1751
|
+
return M.__wrap(I);
|
|
1752
1752
|
}
|
|
1753
1753
|
rbLocalCom(A) {
|
|
1754
1754
|
const I = E.rawrigidbodyset_rbLocalCom(this.__wbg_ptr, A);
|
|
1755
|
-
return
|
|
1755
|
+
return M.__wrap(I);
|
|
1756
1756
|
}
|
|
1757
1757
|
rbWorldCom(A) {
|
|
1758
1758
|
const I = E.rawrigidbodyset_rbWorldCom(this.__wbg_ptr, A);
|
|
1759
|
-
return
|
|
1759
|
+
return M.__wrap(I);
|
|
1760
1760
|
}
|
|
1761
1761
|
rbInvPrincipalInertia(A) {
|
|
1762
1762
|
return E.rawrigidbodyset_rbInvPrincipalInertia(this.__wbg_ptr, A);
|
|
@@ -1831,10 +1831,10 @@ class EA {
|
|
|
1831
1831
|
E.rawrigidbodyset_rbResetTorques(this.__wbg_ptr, A, I);
|
|
1832
1832
|
}
|
|
1833
1833
|
rbAddForce(A, I, C) {
|
|
1834
|
-
K(I,
|
|
1834
|
+
K(I, M), E.rawrigidbodyset_rbAddForce(this.__wbg_ptr, A, I.__wbg_ptr, C);
|
|
1835
1835
|
}
|
|
1836
1836
|
rbApplyImpulse(A, I, C) {
|
|
1837
|
-
K(I,
|
|
1837
|
+
K(I, M), E.rawrigidbodyset_rbApplyImpulse(this.__wbg_ptr, A, I.__wbg_ptr, C);
|
|
1838
1838
|
}
|
|
1839
1839
|
rbAddTorque(A, I, C) {
|
|
1840
1840
|
E.rawrigidbodyset_rbAddTorque(this.__wbg_ptr, A, I, C);
|
|
@@ -1843,10 +1843,10 @@ class EA {
|
|
|
1843
1843
|
E.rawrigidbodyset_rbApplyTorqueImpulse(this.__wbg_ptr, A, I, C);
|
|
1844
1844
|
}
|
|
1845
1845
|
rbAddForceAtPoint(A, I, C, g) {
|
|
1846
|
-
K(I,
|
|
1846
|
+
K(I, M), K(C, M), E.rawrigidbodyset_rbAddForceAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
|
|
1847
1847
|
}
|
|
1848
1848
|
rbApplyImpulseAtPoint(A, I, C, g) {
|
|
1849
|
-
K(I,
|
|
1849
|
+
K(I, M), K(C, M), E.rawrigidbodyset_rbApplyImpulseAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
|
|
1850
1850
|
}
|
|
1851
1851
|
rbAdditionalSolverIterations(A) {
|
|
1852
1852
|
return E.rawrigidbodyset_rbAdditionalSolverIterations(this.__wbg_ptr, A) >>> 0;
|
|
@@ -1862,7 +1862,7 @@ class EA {
|
|
|
1862
1862
|
}
|
|
1863
1863
|
rbUserForce(A) {
|
|
1864
1864
|
const I = E.rawrigidbodyset_rbUserForce(this.__wbg_ptr, A);
|
|
1865
|
-
return
|
|
1865
|
+
return M.__wrap(I);
|
|
1866
1866
|
}
|
|
1867
1867
|
rbUserTorque(A) {
|
|
1868
1868
|
return E.rawrigidbodyset_rbUserTorque(this.__wbg_ptr, A);
|
|
@@ -1871,11 +1871,11 @@ class EA {
|
|
|
1871
1871
|
const A = E.rawrigidbodyset_new();
|
|
1872
1872
|
return this.__wbg_ptr = A >>> 0, bI.register(this, this.__wbg_ptr, this), this;
|
|
1873
1873
|
}
|
|
1874
|
-
createRigidBody(A, I, C, g, Q, B, i, o,
|
|
1875
|
-
return K(I,
|
|
1874
|
+
createRigidBody(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S, k, y, U, c, t, J, R) {
|
|
1875
|
+
return K(I, M), K(C, u), K(i, M), K(o, M), E.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q, B, i.__wbg_ptr, o.__wbg_ptr, h, s, G, w, a, N, S, k, y, U, c, t, J, R);
|
|
1876
1876
|
}
|
|
1877
1877
|
remove(A, I, C, g, Q) {
|
|
1878
|
-
K(I,
|
|
1878
|
+
K(I, qA), K(C, wA), K(g, lA), K(Q, HA), E.rawrigidbodyset_remove(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr);
|
|
1879
1879
|
}
|
|
1880
1880
|
len() {
|
|
1881
1881
|
return E.rawrigidbodyset_len(this.__wbg_ptr) >>> 0;
|
|
@@ -1932,7 +1932,7 @@ class u {
|
|
|
1932
1932
|
const fg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1933
1933
|
}, unregister: () => {
|
|
1934
1934
|
} } : new FinalizationRegistry((D) => E.__wbg_rawserializationpipeline_free(D >>> 0, 1));
|
|
1935
|
-
class
|
|
1935
|
+
class qC {
|
|
1936
1936
|
__destroy_into_raw() {
|
|
1937
1937
|
const A = this.__wbg_ptr;
|
|
1938
1938
|
return this.__wbg_ptr = 0, fg.unregister(this), A;
|
|
@@ -1945,8 +1945,8 @@ class nC {
|
|
|
1945
1945
|
const A = E.rawccdsolver_new();
|
|
1946
1946
|
return this.__wbg_ptr = A >>> 0, fg.register(this, this.__wbg_ptr, this), this;
|
|
1947
1947
|
}
|
|
1948
|
-
serializeAll(A, I, C, g, Q, B, i, o,
|
|
1949
|
-
return K(A,
|
|
1948
|
+
serializeAll(A, I, C, g, Q, B, i, o, h) {
|
|
1949
|
+
return K(A, M), K(I, jA), K(C, qA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(h, HA), sI(E.rawserializationpipeline_serializeAll(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr));
|
|
1950
1950
|
}
|
|
1951
1951
|
deserializeAll(A) {
|
|
1952
1952
|
const I = E.rawserializationpipeline_deserializeAll(this.__wbg_ptr, $(A));
|
|
@@ -1983,7 +1983,7 @@ class H {
|
|
|
1983
1983
|
return H.__wrap(I);
|
|
1984
1984
|
}
|
|
1985
1985
|
static halfspace(A) {
|
|
1986
|
-
K(A,
|
|
1986
|
+
K(A, M);
|
|
1987
1987
|
const I = E.rawshape_halfspace(A.__wbg_ptr);
|
|
1988
1988
|
return H.__wrap(I);
|
|
1989
1989
|
}
|
|
@@ -1992,12 +1992,12 @@ class H {
|
|
|
1992
1992
|
return H.__wrap(C);
|
|
1993
1993
|
}
|
|
1994
1994
|
static voxels(A, I) {
|
|
1995
|
-
K(A,
|
|
1995
|
+
K(A, M);
|
|
1996
1996
|
const C = LI(I, E.__wbindgen_export_2), g = UA, Q = E.rawshape_voxels(A.__wbg_ptr, C, g);
|
|
1997
1997
|
return H.__wrap(Q);
|
|
1998
1998
|
}
|
|
1999
1999
|
static voxelsFromPoints(A, I) {
|
|
2000
|
-
K(A,
|
|
2000
|
+
K(A, M);
|
|
2001
2001
|
const C = dA(I, E.__wbindgen_export_2), g = UA, Q = E.rawshape_voxelsFromPoints(A.__wbg_ptr, C, g);
|
|
2002
2002
|
return H.__wrap(Q);
|
|
2003
2003
|
}
|
|
@@ -2011,22 +2011,22 @@ class H {
|
|
|
2011
2011
|
}
|
|
2012
2012
|
static heightfield(A, I) {
|
|
2013
2013
|
const C = dA(A, E.__wbindgen_export_2), g = UA;
|
|
2014
|
-
K(I,
|
|
2014
|
+
K(I, M);
|
|
2015
2015
|
const Q = E.rawshape_heightfield(C, g, I.__wbg_ptr);
|
|
2016
2016
|
return H.__wrap(Q);
|
|
2017
2017
|
}
|
|
2018
2018
|
static segment(A, I) {
|
|
2019
|
-
K(A,
|
|
2019
|
+
K(A, M), K(I, M);
|
|
2020
2020
|
const C = E.rawshape_segment(A.__wbg_ptr, I.__wbg_ptr);
|
|
2021
2021
|
return H.__wrap(C);
|
|
2022
2022
|
}
|
|
2023
2023
|
static triangle(A, I, C) {
|
|
2024
|
-
K(A,
|
|
2024
|
+
K(A, M), K(I, M), K(C, M);
|
|
2025
2025
|
const g = E.rawshape_triangle(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr);
|
|
2026
2026
|
return H.__wrap(g);
|
|
2027
2027
|
}
|
|
2028
2028
|
static roundTriangle(A, I, C, g) {
|
|
2029
|
-
K(A,
|
|
2029
|
+
K(A, M), K(I, M), K(C, M);
|
|
2030
2030
|
const Q = E.rawshape_roundTriangle(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g);
|
|
2031
2031
|
return H.__wrap(Q);
|
|
2032
2032
|
}
|
|
@@ -2046,35 +2046,35 @@ class H {
|
|
|
2046
2046
|
const C = dA(A, E.__wbindgen_export_2), g = UA, Q = E.rawshape_roundConvexPolyline(C, g, I);
|
|
2047
2047
|
return Q === 0 ? void 0 : H.__wrap(Q);
|
|
2048
2048
|
}
|
|
2049
|
-
castShape(A, I, C, g, Q, B, i, o,
|
|
2050
|
-
K(A,
|
|
2051
|
-
const
|
|
2052
|
-
return
|
|
2049
|
+
castShape(A, I, C, g, Q, B, i, o, h, s) {
|
|
2050
|
+
K(A, M), K(I, u), K(C, M), K(g, H), K(Q, M), K(B, u), K(i, M);
|
|
2051
|
+
const G = E.rawshape_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o, h, s);
|
|
2052
|
+
return G === 0 ? void 0 : RI.__wrap(G);
|
|
2053
2053
|
}
|
|
2054
2054
|
intersectsShape(A, I, C, g, Q) {
|
|
2055
|
-
return K(A,
|
|
2055
|
+
return K(A, M), K(I, u), K(C, H), K(g, M), K(Q, u), E.rawshape_intersectsShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr) !== 0;
|
|
2056
2056
|
}
|
|
2057
2057
|
contactShape(A, I, C, g, Q, B) {
|
|
2058
|
-
K(A,
|
|
2058
|
+
K(A, M), K(I, u), K(C, H), K(g, M), K(Q, u);
|
|
2059
2059
|
const i = E.rawshape_contactShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B);
|
|
2060
2060
|
return i === 0 ? void 0 : gI.__wrap(i);
|
|
2061
2061
|
}
|
|
2062
2062
|
containsPoint(A, I, C) {
|
|
2063
|
-
return K(A,
|
|
2063
|
+
return K(A, M), K(I, u), K(C, M), E.rawshape_containsPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr) !== 0;
|
|
2064
2064
|
}
|
|
2065
2065
|
projectPoint(A, I, C, g) {
|
|
2066
|
-
K(A,
|
|
2066
|
+
K(A, M), K(I, u), K(C, M);
|
|
2067
2067
|
const Q = E.rawshape_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g);
|
|
2068
2068
|
return MI.__wrap(Q);
|
|
2069
2069
|
}
|
|
2070
2070
|
intersectsRay(A, I, C, g, Q) {
|
|
2071
|
-
return K(A,
|
|
2071
|
+
return K(A, M), K(I, u), K(C, M), K(g, M), E.rawshape_intersectsRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q) !== 0;
|
|
2072
2072
|
}
|
|
2073
2073
|
castRay(A, I, C, g, Q, B) {
|
|
2074
|
-
return K(A,
|
|
2074
|
+
return K(A, M), K(I, u), K(C, M), K(g, M), E.rawshape_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B);
|
|
2075
2075
|
}
|
|
2076
2076
|
castRayAndGetNormal(A, I, C, g, Q, B) {
|
|
2077
|
-
K(A,
|
|
2077
|
+
K(A, M), K(I, u), K(C, M), K(g, M);
|
|
2078
2078
|
const i = E.rawshape_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B);
|
|
2079
2079
|
return i === 0 ? void 0 : UI.__wrap(i);
|
|
2080
2080
|
}
|
|
@@ -2101,19 +2101,19 @@ class RI {
|
|
|
2101
2101
|
}
|
|
2102
2102
|
witness1() {
|
|
2103
2103
|
const A = E.rawshapecasthit_witness1(this.__wbg_ptr);
|
|
2104
|
-
return
|
|
2104
|
+
return M.__wrap(A);
|
|
2105
2105
|
}
|
|
2106
2106
|
witness2() {
|
|
2107
2107
|
const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
|
|
2108
|
-
return
|
|
2108
|
+
return M.__wrap(A);
|
|
2109
2109
|
}
|
|
2110
2110
|
normal1() {
|
|
2111
2111
|
const A = E.rawcollidershapecasthit_witness2(this.__wbg_ptr);
|
|
2112
|
-
return
|
|
2112
|
+
return M.__wrap(A);
|
|
2113
2113
|
}
|
|
2114
2114
|
normal2() {
|
|
2115
2115
|
const A = E.rawcollidershapecasthit_normal1(this.__wbg_ptr);
|
|
2116
|
-
return
|
|
2116
|
+
return M.__wrap(A);
|
|
2117
2117
|
}
|
|
2118
2118
|
}
|
|
2119
2119
|
const Zg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -2138,28 +2138,28 @@ class gI {
|
|
|
2138
2138
|
}
|
|
2139
2139
|
point1() {
|
|
2140
2140
|
const A = E.rawpointprojection_point(this.__wbg_ptr);
|
|
2141
|
-
return
|
|
2141
|
+
return M.__wrap(A);
|
|
2142
2142
|
}
|
|
2143
2143
|
point2() {
|
|
2144
2144
|
const A = E.rawpointcolliderprojection_point(this.__wbg_ptr);
|
|
2145
|
-
return
|
|
2145
|
+
return M.__wrap(A);
|
|
2146
2146
|
}
|
|
2147
2147
|
normal1() {
|
|
2148
2148
|
const A = E.rawcontactforceevent_total_force(this.__wbg_ptr);
|
|
2149
|
-
return
|
|
2149
|
+
return M.__wrap(A);
|
|
2150
2150
|
}
|
|
2151
2151
|
normal2() {
|
|
2152
2152
|
const A = E.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
|
|
2153
|
-
return
|
|
2153
|
+
return M.__wrap(A);
|
|
2154
2154
|
}
|
|
2155
2155
|
}
|
|
2156
2156
|
const TI = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
2157
2157
|
}, unregister: () => {
|
|
2158
2158
|
} } : new FinalizationRegistry((D) => E.__wbg_rawvector_free(D >>> 0, 1));
|
|
2159
|
-
class
|
|
2159
|
+
class M {
|
|
2160
2160
|
static __wrap(A) {
|
|
2161
2161
|
A >>>= 0;
|
|
2162
|
-
const I = Object.create(
|
|
2162
|
+
const I = Object.create(M.prototype);
|
|
2163
2163
|
return I.__wbg_ptr = A, TI.register(I, I.__wbg_ptr, I), I;
|
|
2164
2164
|
}
|
|
2165
2165
|
__destroy_into_raw() {
|
|
@@ -2172,7 +2172,7 @@ class y {
|
|
|
2172
2172
|
}
|
|
2173
2173
|
static zero() {
|
|
2174
2174
|
const A = E.rawvector_zero();
|
|
2175
|
-
return
|
|
2175
|
+
return M.__wrap(A);
|
|
2176
2176
|
}
|
|
2177
2177
|
constructor(A, I) {
|
|
2178
2178
|
const C = E.rawvector_new(A, I);
|
|
@@ -2192,11 +2192,11 @@ class y {
|
|
|
2192
2192
|
}
|
|
2193
2193
|
xy() {
|
|
2194
2194
|
const A = E.rawvector_xy(this.__wbg_ptr);
|
|
2195
|
-
return
|
|
2195
|
+
return M.__wrap(A);
|
|
2196
2196
|
}
|
|
2197
2197
|
yx() {
|
|
2198
2198
|
const A = E.rawvector_yx(this.__wbg_ptr);
|
|
2199
|
-
return
|
|
2199
|
+
return M.__wrap(A);
|
|
2200
2200
|
}
|
|
2201
2201
|
}
|
|
2202
2202
|
async function vg(D) {
|
|
@@ -2221,8 +2221,8 @@ async function vg(D) {
|
|
|
2221
2221
|
return $(j(Q).call(j(B), j(i), j(o)));
|
|
2222
2222
|
}, arguments);
|
|
2223
2223
|
}, g.wbg.__wbg_call_b8adc8b1d0a0d8eb = function() {
|
|
2224
|
-
return hI(function(Q, B, i, o,
|
|
2225
|
-
return $(j(Q).call(j(B), j(i), j(o), j(
|
|
2224
|
+
return hI(function(Q, B, i, o, h) {
|
|
2225
|
+
return $(j(Q).call(j(B), j(i), j(o), j(h)));
|
|
2226
2226
|
}, arguments);
|
|
2227
2227
|
}, g.wbg.__wbg_length_3b4f022188ae8db6 = function(Q) {
|
|
2228
2228
|
return j(Q).length;
|
|
@@ -2252,16 +2252,16 @@ async function vg(D) {
|
|
|
2252
2252
|
j(Q).set(j(B), i >>> 0);
|
|
2253
2253
|
}, g.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
|
2254
2254
|
const Q = typeof global > "u" ? null : global;
|
|
2255
|
-
return
|
|
2255
|
+
return n(Q) ? 0 : $(Q);
|
|
2256
2256
|
}, g.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
|
2257
2257
|
const Q = typeof globalThis > "u" ? null : globalThis;
|
|
2258
|
-
return
|
|
2258
|
+
return n(Q) ? 0 : $(Q);
|
|
2259
2259
|
}, g.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
|
2260
2260
|
const Q = typeof self > "u" ? null : self;
|
|
2261
|
-
return
|
|
2261
|
+
return n(Q) ? 0 : $(Q);
|
|
2262
2262
|
}, g.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
|
2263
2263
|
const Q = typeof window > "u" ? null : window;
|
|
2264
|
-
return
|
|
2264
|
+
return n(Q) ? 0 : $(Q);
|
|
2265
2265
|
}, g.wbg.__wbindgen_boolean_get = function(Q) {
|
|
2266
2266
|
const B = j(Q);
|
|
2267
2267
|
return typeof B == "boolean" ? B ? 1 : 0 : 2;
|
|
@@ -2273,7 +2273,7 @@ async function vg(D) {
|
|
|
2273
2273
|
return $(E.memory);
|
|
2274
2274
|
}, g.wbg.__wbindgen_number_get = function(Q, B) {
|
|
2275
2275
|
const i = j(B), o = typeof i == "number" ? i : void 0;
|
|
2276
|
-
SA().setFloat64(Q + 8,
|
|
2276
|
+
SA().setFloat64(Q + 8, n(o) ? 0 : o, !0), SA().setInt32(Q + 0, !n(o), !0);
|
|
2277
2277
|
}, g.wbg.__wbindgen_number_new = function(Q) {
|
|
2278
2278
|
return $(Q);
|
|
2279
2279
|
}, g.wbg.__wbindgen_object_clone_ref = function(Q) {
|
|
@@ -2310,20 +2310,20 @@ class ug {
|
|
|
2310
2310
|
this.x = A, this.y = I;
|
|
2311
2311
|
}
|
|
2312
2312
|
}
|
|
2313
|
-
class
|
|
2313
|
+
class F {
|
|
2314
2314
|
static new(A, I) {
|
|
2315
2315
|
return new ug(A, I);
|
|
2316
2316
|
}
|
|
2317
2317
|
static zeros() {
|
|
2318
|
-
return
|
|
2318
|
+
return F.new(0, 0);
|
|
2319
2319
|
}
|
|
2320
2320
|
static fromRaw(A) {
|
|
2321
2321
|
if (!A) return null;
|
|
2322
|
-
let I =
|
|
2322
|
+
let I = F.new(A.x, A.y);
|
|
2323
2323
|
return A.free(), I;
|
|
2324
2324
|
}
|
|
2325
2325
|
static intoRaw(A) {
|
|
2326
|
-
return new
|
|
2326
|
+
return new M(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 PI {
|
|
|
2391
2391
|
}
|
|
2392
2392
|
translation() {
|
|
2393
2393
|
let A = this.rawSet.rbTranslation(this.handle);
|
|
2394
|
-
return
|
|
2394
|
+
return F.fromRaw(A);
|
|
2395
2395
|
}
|
|
2396
2396
|
rotation() {
|
|
2397
2397
|
let A = this.rawSet.rbRotation(this.handle);
|
|
@@ -2399,7 +2399,7 @@ class PI {
|
|
|
2399
2399
|
}
|
|
2400
2400
|
nextTranslation() {
|
|
2401
2401
|
let A = this.rawSet.rbNextTranslation(this.handle);
|
|
2402
|
-
return
|
|
2402
|
+
return F.fromRaw(A);
|
|
2403
2403
|
}
|
|
2404
2404
|
nextRotation() {
|
|
2405
2405
|
let A = this.rawSet.rbNextRotation(this.handle);
|
|
@@ -2409,7 +2409,7 @@ class PI {
|
|
|
2409
2409
|
this.rawSet.rbSetTranslation(this.handle, A.x, A.y, I);
|
|
2410
2410
|
}
|
|
2411
2411
|
setLinvel(A, I) {
|
|
2412
|
-
let C =
|
|
2412
|
+
let C = F.intoRaw(A);
|
|
2413
2413
|
this.rawSet.rbSetLinvel(this.handle, C, I), C.free();
|
|
2414
2414
|
}
|
|
2415
2415
|
gravityScale() {
|
|
@@ -2431,11 +2431,11 @@ class PI {
|
|
|
2431
2431
|
this.rawSet.rbSetNextKinematicRotation(this.handle, A);
|
|
2432
2432
|
}
|
|
2433
2433
|
linvel() {
|
|
2434
|
-
return
|
|
2434
|
+
return F.fromRaw(this.rawSet.rbLinvel(this.handle));
|
|
2435
2435
|
}
|
|
2436
2436
|
velocityAtPoint(A) {
|
|
2437
|
-
const I =
|
|
2438
|
-
let C =
|
|
2437
|
+
const I = F.intoRaw(A);
|
|
2438
|
+
let C = F.fromRaw(this.rawSet.rbVelocityAtPoint(this.handle, I));
|
|
2439
2439
|
return I.free(), C;
|
|
2440
2440
|
}
|
|
2441
2441
|
angvel() {
|
|
@@ -2445,16 +2445,16 @@ class PI {
|
|
|
2445
2445
|
return this.rawSet.rbMass(this.handle);
|
|
2446
2446
|
}
|
|
2447
2447
|
effectiveInvMass() {
|
|
2448
|
-
return
|
|
2448
|
+
return F.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 F.fromRaw(this.rawSet.rbLocalCom(this.handle));
|
|
2455
2455
|
}
|
|
2456
2456
|
worldCom() {
|
|
2457
|
-
return
|
|
2457
|
+
return F.fromRaw(this.rawSet.rbWorldCom(this.handle));
|
|
2458
2458
|
}
|
|
2459
2459
|
invPrincipalInertia() {
|
|
2460
2460
|
return this.rawSet.rbInvPrincipalInertia(this.handle);
|
|
@@ -2526,7 +2526,7 @@ class PI {
|
|
|
2526
2526
|
this.rawSet.rbSetAdditionalMass(this.handle, A, I);
|
|
2527
2527
|
}
|
|
2528
2528
|
setAdditionalMassProperties(A, I, C, g) {
|
|
2529
|
-
let Q =
|
|
2529
|
+
let Q = F.intoRaw(I);
|
|
2530
2530
|
this.rawSet.rbSetAdditionalMassProperties(this.handle, A, Q, C, g), Q.free();
|
|
2531
2531
|
}
|
|
2532
2532
|
setAngularDamping(A) {
|
|
@@ -2539,11 +2539,11 @@ class PI {
|
|
|
2539
2539
|
this.rawSet.rbResetTorques(this.handle, A);
|
|
2540
2540
|
}
|
|
2541
2541
|
addForce(A, I) {
|
|
2542
|
-
const C =
|
|
2542
|
+
const C = F.intoRaw(A);
|
|
2543
2543
|
this.rawSet.rbAddForce(this.handle, C, I), C.free();
|
|
2544
2544
|
}
|
|
2545
2545
|
applyImpulse(A, I) {
|
|
2546
|
-
const C =
|
|
2546
|
+
const C = F.intoRaw(A);
|
|
2547
2547
|
this.rawSet.rbApplyImpulse(this.handle, C, I), C.free();
|
|
2548
2548
|
}
|
|
2549
2549
|
addTorque(A, I) {
|
|
@@ -2553,15 +2553,15 @@ class PI {
|
|
|
2553
2553
|
this.rawSet.rbApplyTorqueImpulse(this.handle, A, I);
|
|
2554
2554
|
}
|
|
2555
2555
|
addForceAtPoint(A, I, C) {
|
|
2556
|
-
const g =
|
|
2556
|
+
const g = F.intoRaw(A), Q = F.intoRaw(I);
|
|
2557
2557
|
this.rawSet.rbAddForceAtPoint(this.handle, g, Q, C), g.free(), Q.free();
|
|
2558
2558
|
}
|
|
2559
2559
|
applyImpulseAtPoint(A, I, C) {
|
|
2560
|
-
const g =
|
|
2560
|
+
const g = F.intoRaw(A), Q = F.intoRaw(I);
|
|
2561
2561
|
this.rawSet.rbApplyImpulseAtPoint(this.handle, g, Q, C), g.free(), Q.free();
|
|
2562
2562
|
}
|
|
2563
2563
|
userForce() {
|
|
2564
|
-
return
|
|
2564
|
+
return F.fromRaw(this.rawSet.rbUserForce(this.handle));
|
|
2565
2565
|
}
|
|
2566
2566
|
userTorque() {
|
|
2567
2567
|
return this.rawSet.rbUserTorque(this.handle);
|
|
@@ -2569,7 +2569,7 @@ class PI {
|
|
|
2569
2569
|
}
|
|
2570
2570
|
class rA {
|
|
2571
2571
|
constructor(A) {
|
|
2572
|
-
this.enabled = !0, this.status = A, this.translation =
|
|
2572
|
+
this.enabled = !0, this.status = A, this.translation = F.zeros(), this.rotation = AA.identity(), this.gravityScale = 1, this.linvel = F.zeros(), this.mass = 0, this.massOnly = !1, this.centerOfMass = F.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 rA(YA.Dynamic);
|
|
@@ -2625,7 +2625,7 @@ class rA {
|
|
|
2625
2625
|
return this.angvel = A, this;
|
|
2626
2626
|
}
|
|
2627
2627
|
setAdditionalMassProperties(A, I, C) {
|
|
2628
|
-
return this.mass = A,
|
|
2628
|
+
return this.mass = A, F.copy(this.centerOfMass, I), this.principalAngularInertia = C, 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 Pg {
|
|
|
2707
2707
|
this.map.forEach((I) => I.finalizeDeserialization(A));
|
|
2708
2708
|
}
|
|
2709
2709
|
createRigidBody(A, I) {
|
|
2710
|
-
let C =
|
|
2710
|
+
let C = F.intoRaw(I.translation), g = AA.intoRaw(I.rotation), Q = F.intoRaw(I.linvel), B = F.intoRaw(I.centerOfMass), i = this.raw.createRigidBody(I.enabled, C, g, I.gravityScale, I.mass, I.massOnly, B, 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
|
C.free(), g.free(), Q.free(), B.free();
|
|
2712
2712
|
const o = new PI(this.raw, A, i);
|
|
2713
2713
|
return o.userData = I.userData, this.map.set(i, o), o;
|
|
@@ -2842,17 +2842,17 @@ class pA {
|
|
|
2842
2842
|
return this.rawSet.jointType(this.handle);
|
|
2843
2843
|
}
|
|
2844
2844
|
anchor1() {
|
|
2845
|
-
return
|
|
2845
|
+
return F.fromRaw(this.rawSet.jointAnchor1(this.handle));
|
|
2846
2846
|
}
|
|
2847
2847
|
anchor2() {
|
|
2848
|
-
return
|
|
2848
|
+
return F.fromRaw(this.rawSet.jointAnchor2(this.handle));
|
|
2849
2849
|
}
|
|
2850
2850
|
setAnchor1(A) {
|
|
2851
|
-
const I =
|
|
2851
|
+
const I = F.intoRaw(A);
|
|
2852
2852
|
this.rawSet.jointSetAnchor1(this.handle, I), I.free();
|
|
2853
2853
|
}
|
|
2854
2854
|
setAnchor2(A) {
|
|
2855
|
-
const I =
|
|
2855
|
+
const I = F.intoRaw(A);
|
|
2856
2856
|
this.rawSet.jointSetAnchor2(this.handle, I), I.free();
|
|
2857
2857
|
}
|
|
2858
2858
|
setContactsEnabled(A) {
|
|
@@ -2928,11 +2928,11 @@ class OA {
|
|
|
2928
2928
|
return g.anchor1 = A, g.anchor2 = I, g.axis = C, g.jointType = RA.Prismatic, g;
|
|
2929
2929
|
}
|
|
2930
2930
|
intoRaw() {
|
|
2931
|
-
let A, I, C =
|
|
2931
|
+
let A, I, C = F.intoRaw(this.anchor1), g = F.intoRaw(this.anchor2), Q = !1, B = 0, i = 0;
|
|
2932
2932
|
switch (this.jointType) {
|
|
2933
2933
|
case RA.Fixed:
|
|
2934
|
-
let o = AA.intoRaw(this.frame1),
|
|
2935
|
-
I = MA.fixed(C, o, g,
|
|
2934
|
+
let o = AA.intoRaw(this.frame1), h = AA.intoRaw(this.frame2);
|
|
2935
|
+
I = MA.fixed(C, o, g, h), o.free(), h.free();
|
|
2936
2936
|
break;
|
|
2937
2937
|
case RA.Spring:
|
|
2938
2938
|
I = MA.spring(this.length, this.stiffness, this.damping, C, g);
|
|
@@ -2941,7 +2941,7 @@ class OA {
|
|
|
2941
2941
|
I = MA.rope(this.length, C, g);
|
|
2942
2942
|
break;
|
|
2943
2943
|
case RA.Prismatic:
|
|
2944
|
-
A =
|
|
2944
|
+
A = F.intoRaw(this.axis), this.limitsEnabled && (Q = !0, B = this.limits[0], i = this.limits[1]), I = MA.prismatic(C, g, A, Q, B, i), A.free();
|
|
2945
2945
|
break;
|
|
2946
2946
|
case RA.Revolute:
|
|
2947
2947
|
I = MA.revolute(C, g);
|
|
@@ -3085,7 +3085,7 @@ class iC {
|
|
|
3085
3085
|
}
|
|
3086
3086
|
class DC {
|
|
3087
3087
|
constructor(A) {
|
|
3088
|
-
this.raw = A || new
|
|
3088
|
+
this.raw = A || new qA();
|
|
3089
3089
|
}
|
|
3090
3090
|
free() {
|
|
3091
3091
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
@@ -3111,7 +3111,7 @@ class EI {
|
|
|
3111
3111
|
}
|
|
3112
3112
|
static fromRaw(A) {
|
|
3113
3113
|
if (!A) return null;
|
|
3114
|
-
const I = new EI(A.time_of_impact(),
|
|
3114
|
+
const I = new EI(A.time_of_impact(), F.fromRaw(A.normal()), A.featureType(), A.featureId());
|
|
3115
3115
|
return A.free(), I;
|
|
3116
3116
|
}
|
|
3117
3117
|
}
|
|
@@ -3121,7 +3121,7 @@ class QI {
|
|
|
3121
3121
|
}
|
|
3122
3122
|
static fromRaw(A, I) {
|
|
3123
3123
|
if (!I) return null;
|
|
3124
|
-
const C = new QI(A.get(I.colliderHandle()), I.time_of_impact(),
|
|
3124
|
+
const C = new QI(A.get(I.colliderHandle()), I.time_of_impact(), F.fromRaw(I.normal()), I.featureType(), I.featureId());
|
|
3125
3125
|
return I.free(), C;
|
|
3126
3126
|
}
|
|
3127
3127
|
}
|
|
@@ -3141,7 +3141,7 @@ class iI {
|
|
|
3141
3141
|
}
|
|
3142
3142
|
static fromRaw(A) {
|
|
3143
3143
|
if (!A) return null;
|
|
3144
|
-
const I = new iI(
|
|
3144
|
+
const I = new iI(F.fromRaw(A.point()), A.isInside());
|
|
3145
3145
|
return A.free(), I;
|
|
3146
3146
|
}
|
|
3147
3147
|
}
|
|
@@ -3151,7 +3151,7 @@ class BI {
|
|
|
3151
3151
|
}
|
|
3152
3152
|
static fromRaw(A, I) {
|
|
3153
3153
|
if (!I) return null;
|
|
3154
|
-
const C = new BI(A.get(I.colliderHandle()),
|
|
3154
|
+
const C = new BI(A.get(I.colliderHandle()), F.fromRaw(I.point()), I.isInside(), I.featureType(), I.featureId());
|
|
3155
3155
|
return I.free(), C;
|
|
3156
3156
|
}
|
|
3157
3157
|
}
|
|
@@ -3161,7 +3161,7 @@ class PA {
|
|
|
3161
3161
|
}
|
|
3162
3162
|
static fromRaw(A, I) {
|
|
3163
3163
|
if (!I) return null;
|
|
3164
|
-
const C = new PA(I.time_of_impact(),
|
|
3164
|
+
const C = new PA(I.time_of_impact(), F.fromRaw(I.witness1()), F.fromRaw(I.witness2()), F.fromRaw(I.normal1()), F.fromRaw(I.normal2()));
|
|
3165
3165
|
return I.free(), C;
|
|
3166
3166
|
}
|
|
3167
3167
|
}
|
|
@@ -3171,7 +3171,7 @@ class DI extends PA {
|
|
|
3171
3171
|
}
|
|
3172
3172
|
static fromRaw(A, I) {
|
|
3173
3173
|
if (!I) return null;
|
|
3174
|
-
const C = new DI(A.get(I.colliderHandle()), I.time_of_impact(),
|
|
3174
|
+
const C = new DI(A.get(I.colliderHandle()), I.time_of_impact(), F.fromRaw(I.witness1()), F.fromRaw(I.witness2()), F.fromRaw(I.normal1()), F.fromRaw(I.normal2()));
|
|
3175
3175
|
return I.free(), C;
|
|
3176
3176
|
}
|
|
3177
3177
|
}
|
|
@@ -3182,44 +3182,44 @@ class oC {
|
|
|
3182
3182
|
free() {
|
|
3183
3183
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3184
3184
|
}
|
|
3185
|
-
castRay(A, I, C, g, Q, B, i, o,
|
|
3186
|
-
let
|
|
3187
|
-
return
|
|
3185
|
+
castRay(A, I, C, g, Q, B, i, o, h, s, G) {
|
|
3186
|
+
let w = F.intoRaw(g.origin), a = F.intoRaw(g.dir), N = cI.fromRaw(C, this.raw.castRay(A.raw, I.raw, C.raw, w, a, Q, B, i, o, h, s, G));
|
|
3187
|
+
return w.free(), a.free(), N;
|
|
3188
3188
|
}
|
|
3189
|
-
castRayAndGetNormal(A, I, C, g, Q, B, i, o,
|
|
3190
|
-
let
|
|
3191
|
-
return
|
|
3189
|
+
castRayAndGetNormal(A, I, C, g, Q, B, i, o, h, s, G) {
|
|
3190
|
+
let w = F.intoRaw(g.origin), a = F.intoRaw(g.dir), N = QI.fromRaw(C, this.raw.castRayAndGetNormal(A.raw, I.raw, C.raw, w, a, Q, B, i, o, h, s, G));
|
|
3191
|
+
return w.free(), a.free(), N;
|
|
3192
3192
|
}
|
|
3193
|
-
intersectionsWithRay(A, I, C, g, Q, B, i, o,
|
|
3194
|
-
let a =
|
|
3195
|
-
this.raw.intersectionsWithRay(A.raw, I.raw, C.raw, a, N, Q, B, (S) => i(QI.fromRaw(C, S)), o,
|
|
3193
|
+
intersectionsWithRay(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
3194
|
+
let a = F.intoRaw(g.origin), N = F.intoRaw(g.dir);
|
|
3195
|
+
this.raw.intersectionsWithRay(A.raw, I.raw, C.raw, a, N, Q, B, (S) => i(QI.fromRaw(C, S)), o, h, s, G, w), a.free(), N.free();
|
|
3196
3196
|
}
|
|
3197
|
-
intersectionWithShape(A, I, C, g, Q, B, i, o,
|
|
3198
|
-
let
|
|
3199
|
-
return
|
|
3197
|
+
intersectionWithShape(A, I, C, g, Q, B, i, o, h, s, G) {
|
|
3198
|
+
let w = F.intoRaw(g), a = AA.intoRaw(Q), N = B.intoRaw(), S = this.raw.intersectionWithShape(A.raw, I.raw, C.raw, w, a, N, i, o, h, s, G);
|
|
3199
|
+
return w.free(), a.free(), N.free(), S;
|
|
3200
3200
|
}
|
|
3201
|
-
projectPoint(A, I, C, g, Q, B, i, o,
|
|
3202
|
-
let
|
|
3203
|
-
return
|
|
3201
|
+
projectPoint(A, I, C, g, Q, B, i, o, h, s) {
|
|
3202
|
+
let G = F.intoRaw(g), w = BI.fromRaw(C, this.raw.projectPoint(A.raw, I.raw, C.raw, G, Q, B, i, o, h, s));
|
|
3203
|
+
return G.free(), w;
|
|
3204
3204
|
}
|
|
3205
|
-
projectPointAndGetFeature(A, I, C, g, Q, B, i, o,
|
|
3206
|
-
let
|
|
3207
|
-
return
|
|
3205
|
+
projectPointAndGetFeature(A, I, C, g, Q, B, i, o, h) {
|
|
3206
|
+
let s = F.intoRaw(g), G = BI.fromRaw(C, this.raw.projectPointAndGetFeature(A.raw, I.raw, C.raw, s, Q, B, i, o, h));
|
|
3207
|
+
return s.free(), G;
|
|
3208
3208
|
}
|
|
3209
|
-
intersectionsWithPoint(A, I, C, g, Q, B, i, o,
|
|
3210
|
-
let
|
|
3211
|
-
this.raw.intersectionsWithPoint(A.raw, I.raw, C.raw,
|
|
3209
|
+
intersectionsWithPoint(A, I, C, g, Q, B, i, o, h, s) {
|
|
3210
|
+
let G = F.intoRaw(g);
|
|
3211
|
+
this.raw.intersectionsWithPoint(A.raw, I.raw, C.raw, G, Q, B, i, o, h, s), G.free();
|
|
3212
3212
|
}
|
|
3213
|
-
castShape(A, I, C, g, Q, B, i, o,
|
|
3214
|
-
let
|
|
3215
|
-
return
|
|
3213
|
+
castShape(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S) {
|
|
3214
|
+
let k = F.intoRaw(g), y = AA.intoRaw(Q), U = F.intoRaw(B), c = i.intoRaw(), t = DI.fromRaw(C, this.raw.castShape(A.raw, I.raw, C.raw, k, y, U, c, o, h, s, G, w, a, N, S));
|
|
3215
|
+
return k.free(), y.free(), U.free(), c.free(), t;
|
|
3216
3216
|
}
|
|
3217
|
-
intersectionsWithShape(A, I, C, g, Q, B, i, o,
|
|
3218
|
-
let a =
|
|
3219
|
-
this.raw.intersectionsWithShape(A.raw, I.raw, C.raw, a, N, S, i, o,
|
|
3217
|
+
intersectionsWithShape(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
3218
|
+
let a = F.intoRaw(g), N = AA.intoRaw(Q), S = B.intoRaw();
|
|
3219
|
+
this.raw.intersectionsWithShape(A.raw, I.raw, C.raw, a, N, S, i, o, h, s, G, w), a.free(), N.free(), S.free();
|
|
3220
3220
|
}
|
|
3221
3221
|
collidersWithAabbIntersectingAabb(A, I, C, g, Q, B) {
|
|
3222
|
-
let i =
|
|
3222
|
+
let i = F.intoRaw(g), o = F.intoRaw(Q);
|
|
3223
3223
|
this.raw.collidersWithAabbIntersectingAabb(A.raw, I.raw, C.raw, i, o, B), i.free(), o.free();
|
|
3224
3224
|
}
|
|
3225
3225
|
}
|
|
@@ -3257,13 +3257,13 @@ class hC {
|
|
|
3257
3257
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3258
3258
|
}
|
|
3259
3259
|
normal() {
|
|
3260
|
-
return
|
|
3260
|
+
return F.fromRaw(this.raw.normal());
|
|
3261
3261
|
}
|
|
3262
3262
|
localNormal1() {
|
|
3263
|
-
return
|
|
3263
|
+
return F.fromRaw(this.raw.local_n1());
|
|
3264
3264
|
}
|
|
3265
3265
|
localNormal2() {
|
|
3266
|
-
return
|
|
3266
|
+
return F.fromRaw(this.raw.local_n2());
|
|
3267
3267
|
}
|
|
3268
3268
|
subshape1() {
|
|
3269
3269
|
return this.raw.subshape1();
|
|
@@ -3275,10 +3275,10 @@ class hC {
|
|
|
3275
3275
|
return this.raw.num_contacts();
|
|
3276
3276
|
}
|
|
3277
3277
|
localContactPoint1(A) {
|
|
3278
|
-
return
|
|
3278
|
+
return F.fromRaw(this.raw.contact_local_p1(A));
|
|
3279
3279
|
}
|
|
3280
3280
|
localContactPoint2(A) {
|
|
3281
|
-
return
|
|
3281
|
+
return F.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 hC {
|
|
|
3299
3299
|
return this.raw.num_solver_contacts();
|
|
3300
3300
|
}
|
|
3301
3301
|
solverContactPoint(A) {
|
|
3302
|
-
return
|
|
3302
|
+
return F.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 hC {
|
|
|
3311
3311
|
return this.raw.solver_contact_restitution(A);
|
|
3312
3312
|
}
|
|
3313
3313
|
solverContactTangentVelocity(A) {
|
|
3314
|
-
return
|
|
3314
|
+
return F.fromRaw(this.raw.solver_contact_tangent_velocity(A));
|
|
3315
3315
|
}
|
|
3316
3316
|
}
|
|
3317
3317
|
class uA {
|
|
@@ -3320,14 +3320,14 @@ class uA {
|
|
|
3320
3320
|
}
|
|
3321
3321
|
static fromRaw(A) {
|
|
3322
3322
|
if (!A) return null;
|
|
3323
|
-
const I = new uA(A.distance(),
|
|
3323
|
+
const I = new uA(A.distance(), F.fromRaw(A.point1()), F.fromRaw(A.point2()), F.fromRaw(A.normal1()), F.fromRaw(A.normal2()));
|
|
3324
3324
|
return A.free(), I;
|
|
3325
3325
|
}
|
|
3326
3326
|
}
|
|
3327
3327
|
class yA {
|
|
3328
3328
|
static fromRaw(A, I) {
|
|
3329
3329
|
const C = A.coShapeType(I);
|
|
3330
|
-
let g, Q, B, i, o,
|
|
3330
|
+
let g, Q, B, i, o, h, s;
|
|
3331
3331
|
switch (C) {
|
|
3332
3332
|
case FA.Ball:
|
|
3333
3333
|
return new Bg(A.coRadius(I));
|
|
@@ -3336,20 +3336,20 @@ class yA {
|
|
|
3336
3336
|
case FA.RoundCuboid:
|
|
3337
3337
|
return g = A.coHalfExtents(I), Q = A.coRoundRadius(I), new Dg(g.x, g.y, Q);
|
|
3338
3338
|
case FA.Capsule:
|
|
3339
|
-
return o = A.coHalfHeight(I),
|
|
3339
|
+
return o = A.coHalfHeight(I), h = A.coRadius(I), new og(o, h);
|
|
3340
3340
|
case FA.Segment:
|
|
3341
|
-
return B = A.coVertices(I), new wg(
|
|
3341
|
+
return B = A.coVertices(I), new wg(F.new(B[0], B[1]), F.new(B[2], B[3]));
|
|
3342
3342
|
case FA.Polyline:
|
|
3343
3343
|
return B = A.coVertices(I), i = A.coIndices(I), new Gg(B, i);
|
|
3344
3344
|
case FA.Triangle:
|
|
3345
|
-
return B = A.coVertices(I), new hg(
|
|
3345
|
+
return B = A.coVertices(I), new hg(F.new(B[0], B[1]), F.new(B[2], B[3]), F.new(B[4], B[5]));
|
|
3346
3346
|
case FA.RoundTriangle:
|
|
3347
|
-
return B = A.coVertices(I), Q = A.coRoundRadius(I), new sg(
|
|
3347
|
+
return B = A.coVertices(I), Q = A.coRoundRadius(I), new sg(F.new(B[0], B[1]), F.new(B[2], B[3]), F.new(B[4], B[5]), Q);
|
|
3348
3348
|
case FA.HalfSpace:
|
|
3349
|
-
return
|
|
3349
|
+
return s = F.fromRaw(A.coHalfspaceNormal(I)), new Eg(s);
|
|
3350
3350
|
case FA.Voxels:
|
|
3351
|
-
const
|
|
3352
|
-
return new ag(
|
|
3351
|
+
const G = A.coVoxelData(I), w = A.coVoxelSize(I);
|
|
3352
|
+
return new ag(G, w);
|
|
3353
3353
|
case FA.TriMesh:
|
|
3354
3354
|
B = A.coVertices(I), i = A.coIndices(I);
|
|
3355
3355
|
const a = A.coTriMeshFlags(I);
|
|
@@ -3365,37 +3365,37 @@ class yA {
|
|
|
3365
3365
|
throw new Error("unknown shape type: " + C);
|
|
3366
3366
|
}
|
|
3367
3367
|
}
|
|
3368
|
-
castShape(A, I, C, g, Q, B, i, o,
|
|
3369
|
-
let
|
|
3370
|
-
return
|
|
3368
|
+
castShape(A, I, C, g, Q, B, i, o, h, s) {
|
|
3369
|
+
let G = F.intoRaw(A), w = AA.intoRaw(I), a = F.intoRaw(C), N = F.intoRaw(Q), S = AA.intoRaw(B), k = F.intoRaw(i), y = this.intoRaw(), U = g.intoRaw(), c = PA.fromRaw(null, y.castShape(G, w, a, U, N, S, k, o, h, s));
|
|
3370
|
+
return G.free(), w.free(), a.free(), N.free(), S.free(), k.free(), y.free(), U.free(), c;
|
|
3371
3371
|
}
|
|
3372
3372
|
intersectsShape(A, I, C, g, Q) {
|
|
3373
|
-
let B =
|
|
3374
|
-
return B.free(), i.free(), o.free(),
|
|
3373
|
+
let B = F.intoRaw(A), i = AA.intoRaw(I), o = F.intoRaw(g), h = AA.intoRaw(Q), s = this.intoRaw(), G = C.intoRaw(), w = s.intersectsShape(B, i, G, o, h);
|
|
3374
|
+
return B.free(), i.free(), o.free(), h.free(), s.free(), G.free(), w;
|
|
3375
3375
|
}
|
|
3376
3376
|
contactShape(A, I, C, g, Q, B) {
|
|
3377
|
-
let i =
|
|
3378
|
-
return i.free(), o.free(),
|
|
3377
|
+
let i = F.intoRaw(A), o = AA.intoRaw(I), h = F.intoRaw(g), s = AA.intoRaw(Q), G = this.intoRaw(), w = C.intoRaw(), a = uA.fromRaw(G.contactShape(i, o, w, h, s, B));
|
|
3378
|
+
return i.free(), o.free(), h.free(), s.free(), G.free(), w.free(), a;
|
|
3379
3379
|
}
|
|
3380
3380
|
containsPoint(A, I, C) {
|
|
3381
|
-
let g =
|
|
3381
|
+
let g = F.intoRaw(A), Q = AA.intoRaw(I), B = F.intoRaw(C), i = this.intoRaw(), o = i.containsPoint(g, Q, B);
|
|
3382
3382
|
return g.free(), Q.free(), B.free(), i.free(), o;
|
|
3383
3383
|
}
|
|
3384
3384
|
projectPoint(A, I, C, g) {
|
|
3385
|
-
let Q =
|
|
3386
|
-
return Q.free(), B.free(), i.free(), o.free(),
|
|
3385
|
+
let Q = F.intoRaw(A), B = AA.intoRaw(I), i = F.intoRaw(C), o = this.intoRaw(), h = iI.fromRaw(o.projectPoint(Q, B, i, g));
|
|
3386
|
+
return Q.free(), B.free(), i.free(), o.free(), h;
|
|
3387
3387
|
}
|
|
3388
3388
|
intersectsRay(A, I, C, g) {
|
|
3389
|
-
let Q =
|
|
3390
|
-
return Q.free(), B.free(), i.free(), o.free(),
|
|
3389
|
+
let Q = F.intoRaw(I), B = AA.intoRaw(C), i = F.intoRaw(A.origin), o = F.intoRaw(A.dir), h = this.intoRaw(), s = h.intersectsRay(Q, B, i, o, g);
|
|
3390
|
+
return Q.free(), B.free(), i.free(), o.free(), h.free(), s;
|
|
3391
3391
|
}
|
|
3392
3392
|
castRay(A, I, C, g, Q) {
|
|
3393
|
-
let B =
|
|
3394
|
-
return B.free(), i.free(), o.free(),
|
|
3393
|
+
let B = F.intoRaw(I), i = AA.intoRaw(C), o = F.intoRaw(A.origin), h = F.intoRaw(A.dir), s = this.intoRaw(), G = s.castRay(B, i, o, h, g, Q);
|
|
3394
|
+
return B.free(), i.free(), o.free(), h.free(), s.free(), G;
|
|
3395
3395
|
}
|
|
3396
3396
|
castRayAndGetNormal(A, I, C, g, Q) {
|
|
3397
|
-
let B =
|
|
3398
|
-
return B.free(), i.free(), o.free(),
|
|
3397
|
+
let B = F.intoRaw(I), i = AA.intoRaw(C), o = F.intoRaw(A.origin), h = F.intoRaw(A.dir), s = this.intoRaw(), G = EI.fromRaw(s.castRayAndGetNormal(B, i, o, h, g, Q));
|
|
3398
|
+
return B.free(), i.free(), o.free(), h.free(), s.free(), G;
|
|
3399
3399
|
}
|
|
3400
3400
|
}
|
|
3401
3401
|
(function(D) {
|
|
@@ -3416,13 +3416,13 @@ class Eg extends yA {
|
|
|
3416
3416
|
super(), this.type = kA.HalfSpace, this.normal = A;
|
|
3417
3417
|
}
|
|
3418
3418
|
intoRaw() {
|
|
3419
|
-
let A =
|
|
3419
|
+
let A = F.intoRaw(this.normal), I = H.halfspace(A);
|
|
3420
3420
|
return A.free(), I;
|
|
3421
3421
|
}
|
|
3422
3422
|
}
|
|
3423
3423
|
class ig extends yA {
|
|
3424
3424
|
constructor(A, I) {
|
|
3425
|
-
super(), this.type = kA.Cuboid, this.halfExtents =
|
|
3425
|
+
super(), this.type = kA.Cuboid, this.halfExtents = F.new(A, I);
|
|
3426
3426
|
}
|
|
3427
3427
|
intoRaw() {
|
|
3428
3428
|
return H.cuboid(this.halfExtents.x, this.halfExtents.y);
|
|
@@ -3430,7 +3430,7 @@ class ig extends yA {
|
|
|
3430
3430
|
}
|
|
3431
3431
|
class Dg extends yA {
|
|
3432
3432
|
constructor(A, I, C) {
|
|
3433
|
-
super(), this.type = kA.RoundCuboid, this.halfExtents =
|
|
3433
|
+
super(), this.type = kA.RoundCuboid, this.halfExtents = F.new(A, I), this.borderRadius = C;
|
|
3434
3434
|
}
|
|
3435
3435
|
intoRaw() {
|
|
3436
3436
|
return H.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius);
|
|
@@ -3449,7 +3449,7 @@ class wg extends yA {
|
|
|
3449
3449
|
super(), this.type = kA.Segment, this.a = A, this.b = I;
|
|
3450
3450
|
}
|
|
3451
3451
|
intoRaw() {
|
|
3452
|
-
let A =
|
|
3452
|
+
let A = F.intoRaw(this.a), I = F.intoRaw(this.b), C = H.segment(A, I);
|
|
3453
3453
|
return A.free(), I.free(), C;
|
|
3454
3454
|
}
|
|
3455
3455
|
}
|
|
@@ -3458,7 +3458,7 @@ class hg extends yA {
|
|
|
3458
3458
|
super(), this.type = kA.Triangle, this.a = A, this.b = I, this.c = C;
|
|
3459
3459
|
}
|
|
3460
3460
|
intoRaw() {
|
|
3461
|
-
let A =
|
|
3461
|
+
let A = F.intoRaw(this.a), I = F.intoRaw(this.b), C = F.intoRaw(this.c), g = H.triangle(A, I, C);
|
|
3462
3462
|
return A.free(), I.free(), C.free(), g;
|
|
3463
3463
|
}
|
|
3464
3464
|
}
|
|
@@ -3467,7 +3467,7 @@ class sg extends yA {
|
|
|
3467
3467
|
super(), this.type = kA.RoundTriangle, this.a = A, this.b = I, this.c = C, this.borderRadius = g;
|
|
3468
3468
|
}
|
|
3469
3469
|
intoRaw() {
|
|
3470
|
-
let A =
|
|
3470
|
+
let A = F.intoRaw(this.a), I = F.intoRaw(this.b), C = F.intoRaw(this.c), g = H.roundTriangle(A, I, C, this.borderRadius);
|
|
3471
3471
|
return A.free(), I.free(), C.free(), g;
|
|
3472
3472
|
}
|
|
3473
3473
|
}
|
|
@@ -3484,7 +3484,7 @@ class ag extends yA {
|
|
|
3484
3484
|
super(), this.type = kA.Voxels, this.data = A, this.voxelSize = I;
|
|
3485
3485
|
}
|
|
3486
3486
|
intoRaw() {
|
|
3487
|
-
let A, I =
|
|
3487
|
+
let A, I = F.intoRaw(this.voxelSize);
|
|
3488
3488
|
return A = this.data instanceof Int32Array ? H.voxels(I, this.data) : H.voxelsFromPoints(I, this.data), I.free(), A;
|
|
3489
3489
|
}
|
|
3490
3490
|
}
|
|
@@ -3517,33 +3517,33 @@ class Sg extends yA {
|
|
|
3517
3517
|
super(), this.type = kA.HeightField, this.heights = A, this.scale = I;
|
|
3518
3518
|
}
|
|
3519
3519
|
intoRaw() {
|
|
3520
|
-
let A =
|
|
3520
|
+
let A = F.intoRaw(this.scale), I = H.heightfield(this.heights, A);
|
|
3521
3521
|
return A.free(), I;
|
|
3522
3522
|
}
|
|
3523
3523
|
}
|
|
3524
3524
|
class sC {
|
|
3525
3525
|
constructor(A) {
|
|
3526
|
-
this.raw = A || new
|
|
3526
|
+
this.raw = A || new nC();
|
|
3527
3527
|
}
|
|
3528
3528
|
free() {
|
|
3529
3529
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3530
3530
|
}
|
|
3531
|
-
step(A, I, C, g, Q, B, i, o,
|
|
3532
|
-
let a =
|
|
3533
|
-
|
|
3531
|
+
step(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
3532
|
+
let a = F.intoRaw(A);
|
|
3533
|
+
G ? this.raw.stepWithEvents(a, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, h.raw, s.raw, G.raw, w, w ? w.filterContactPair : null, w ? w.filterIntersectionPair : null) : this.raw.step(a, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, h.raw, s.raw), a.free();
|
|
3534
3534
|
}
|
|
3535
3535
|
}
|
|
3536
3536
|
class VI {
|
|
3537
3537
|
constructor(A) {
|
|
3538
|
-
this.raw = A || new
|
|
3538
|
+
this.raw = A || new qC();
|
|
3539
3539
|
}
|
|
3540
3540
|
free() {
|
|
3541
3541
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3542
3542
|
}
|
|
3543
|
-
serializeAll(A, I, C, g, Q, B, i, o,
|
|
3544
|
-
let
|
|
3545
|
-
const
|
|
3546
|
-
return
|
|
3543
|
+
serializeAll(A, I, C, g, Q, B, i, o, h) {
|
|
3544
|
+
let s = F.intoRaw(A);
|
|
3545
|
+
const G = this.raw.serializeAll(s, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, h.raw);
|
|
3546
|
+
return s.free(), G;
|
|
3547
3547
|
}
|
|
3548
3548
|
deserializeAll(A) {
|
|
3549
3549
|
return YI.fromRaw(this.raw.deserializeAll(A));
|
|
@@ -3578,7 +3578,7 @@ class SC {
|
|
|
3578
3578
|
return this.raw.up();
|
|
3579
3579
|
}
|
|
3580
3580
|
setUp(A) {
|
|
3581
|
-
let I =
|
|
3581
|
+
let I = F.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, C, g, Q) {
|
|
3657
|
-
let B =
|
|
3657
|
+
let B = F.intoRaw(I);
|
|
3658
3658
|
this.raw.computeColliderMovement(this.params.dt, this.broadPhase.raw, this.narrowPhase.raw, this.bodies.raw, this.colliders.raw, A.handle, B, this._applyImpulsesToDynamicBodies, this._characterMass, C, g, this.colliders.castClosure(Q)), B.free();
|
|
3659
3659
|
}
|
|
3660
3660
|
computedMovement() {
|
|
3661
|
-
return
|
|
3661
|
+
return F.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 C = this.rawCharacterCollision;
|
|
3672
|
-
return (I = I ?? new KC()).translationDeltaApplied =
|
|
3672
|
+
return (I = I ?? new KC()).translationDeltaApplied = F.fromRaw(C.translationDeltaApplied()), I.translationDeltaRemaining = F.fromRaw(C.translationDeltaRemaining()), I.toi = C.toi(), I.witness1 = F.fromRaw(C.worldWitness1()), I.witness2 = F.fromRaw(C.worldWitness2()), I.normal1 = F.fromRaw(C.worldNormal1()), I.normal2 = F.fromRaw(C.worldNormal2()), I.collider = this.colliders.get(C.handle()), I;
|
|
3673
3673
|
}
|
|
3674
3674
|
return null;
|
|
3675
3675
|
}
|
|
@@ -3700,29 +3700,29 @@ class NC {
|
|
|
3700
3700
|
this.raw.reset_integrals();
|
|
3701
3701
|
}
|
|
3702
3702
|
applyLinearCorrection(A, I, C) {
|
|
3703
|
-
let g =
|
|
3703
|
+
let g = F.intoRaw(I), Q = F.intoRaw(C);
|
|
3704
3704
|
this.raw.apply_linear_correction(this.params.dt, this.bodies.raw, A.handle, g, Q), g.free(), Q.free();
|
|
3705
3705
|
}
|
|
3706
3706
|
applyAngularCorrection(A, I, C) {
|
|
3707
3707
|
this.raw.apply_angular_correction(this.params.dt, this.bodies.raw, A.handle, I, C);
|
|
3708
3708
|
}
|
|
3709
3709
|
linearCorrection(A, I, C) {
|
|
3710
|
-
let g =
|
|
3711
|
-
return g.free(), Q.free(),
|
|
3710
|
+
let g = F.intoRaw(I), Q = F.intoRaw(C), B = this.raw.linear_correction(this.params.dt, this.bodies.raw, A.handle, g, Q);
|
|
3711
|
+
return g.free(), Q.free(), F.fromRaw(B);
|
|
3712
3712
|
}
|
|
3713
3713
|
angularCorrection(A, I, C) {
|
|
3714
3714
|
return this.raw.angular_correction(this.params.dt, this.bodies.raw, A.handle, I, C);
|
|
3715
3715
|
}
|
|
3716
3716
|
}
|
|
3717
3717
|
class YI {
|
|
3718
|
-
constructor(A, I, C, g, Q, B, i, o,
|
|
3719
|
-
this.gravity = A, this.integrationParameters = new Vg(I), this.islands = new DC(C), this.broadPhase = new oC(g), this.narrowPhase = new wC(Q), this.bodies = new Pg(B), this.colliders = new yC(i), this.impulseJoints = new gC(o), this.multibodyJoints = new EC(
|
|
3718
|
+
constructor(A, I, C, g, Q, B, i, o, h, s, G, w, a) {
|
|
3719
|
+
this.gravity = A, this.integrationParameters = new Vg(I), this.islands = new DC(C), this.broadPhase = new oC(g), this.narrowPhase = new wC(Q), this.bodies = new Pg(B), this.colliders = new yC(i), this.impulseJoints = new gC(o), this.multibodyJoints = new EC(h), this.ccdSolver = new iC(s), this.physicsPipeline = new sC(G), this.serializationPipeline = new VI(w), this.debugRenderPipeline = new aC(a), 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 YI(
|
|
3725
|
+
return A ? new YI(F.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);
|
|
@@ -3835,12 +3835,12 @@ class YI {
|
|
|
3835
3835
|
castRayAndGetNormal(A, I, C, g, Q, B, i, o) {
|
|
3836
3836
|
return this.broadPhase.castRayAndGetNormal(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, i ? i.handle : null, this.colliders.castClosure(o));
|
|
3837
3837
|
}
|
|
3838
|
-
intersectionsWithRay(A, I, C, g, Q, B, i, o,
|
|
3839
|
-
this.broadPhase.intersectionsWithRay(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, i ? i.handle : null, o ? o.handle : null, this.colliders.castClosure(
|
|
3838
|
+
intersectionsWithRay(A, I, C, g, Q, B, i, o, h) {
|
|
3839
|
+
this.broadPhase.intersectionsWithRay(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, i ? i.handle : null, o ? o.handle : null, this.colliders.castClosure(h));
|
|
3840
3840
|
}
|
|
3841
3841
|
intersectionWithShape(A, I, C, g, Q, B, i, o) {
|
|
3842
|
-
let
|
|
3843
|
-
return
|
|
3842
|
+
let h = this.broadPhase.intersectionWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, i ? i.handle : null, this.colliders.castClosure(o));
|
|
3843
|
+
return h != null ? this.colliders.get(h) : null;
|
|
3844
3844
|
}
|
|
3845
3845
|
projectPoint(A, I, C, g, Q, B, i) {
|
|
3846
3846
|
return this.broadPhase.projectPoint(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q ? Q.handle : null, B ? B.handle : null, this.colliders.castClosure(i));
|
|
@@ -3851,11 +3851,11 @@ class YI {
|
|
|
3851
3851
|
intersectionsWithPoint(A, I, C, g, Q, B, i) {
|
|
3852
3852
|
this.broadPhase.intersectionsWithPoint(this.narrowPhase, this.bodies, this.colliders, A, this.colliders.castClosure(I), C, g, Q ? Q.handle : null, B ? B.handle : null, this.colliders.castClosure(i));
|
|
3853
3853
|
}
|
|
3854
|
-
castShape(A, I, C, g, Q, B, i, o,
|
|
3855
|
-
return this.broadPhase.castShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, i, o,
|
|
3854
|
+
castShape(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
3855
|
+
return this.broadPhase.castShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, i, o, h, s ? s.handle : null, G ? G.handle : null, this.colliders.castClosure(w));
|
|
3856
3856
|
}
|
|
3857
|
-
intersectionsWithShape(A, I, C, g, Q, B, i, o,
|
|
3858
|
-
this.broadPhase.intersectionsWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, this.colliders.castClosure(g), Q, B, i ? i.handle : null, o ? o.handle : null, this.colliders.castClosure(
|
|
3857
|
+
intersectionsWithShape(A, I, C, g, Q, B, i, o, h) {
|
|
3858
|
+
this.broadPhase.intersectionsWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, this.colliders.castClosure(g), Q, B, i ? i.handle : null, o ? o.handle : null, this.colliders.castClosure(h));
|
|
3859
3859
|
}
|
|
3860
3860
|
collidersWithAabbIntersectingAabb(A, I, C) {
|
|
3861
3861
|
this.broadPhase.collidersWithAabbIntersectingAabb(this.narrowPhase, this.bodies, this.colliders, A, I, this.colliders.castClosure(C));
|
|
@@ -3941,13 +3941,13 @@ class kC {
|
|
|
3941
3941
|
return this.raw.collider2();
|
|
3942
3942
|
}
|
|
3943
3943
|
totalForce() {
|
|
3944
|
-
return
|
|
3944
|
+
return F.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 F.fromRaw(this.raw.max_force_direction());
|
|
3951
3951
|
}
|
|
3952
3952
|
maxForceMagnitude() {
|
|
3953
3953
|
return this.raw.max_force_magnitude();
|
|
@@ -4002,10 +4002,10 @@ class zI {
|
|
|
4002
4002
|
return this.colliderSet.raw.contains(this.handle);
|
|
4003
4003
|
}
|
|
4004
4004
|
translation() {
|
|
4005
|
-
return
|
|
4005
|
+
return F.fromRaw(this.colliderSet.raw.coTranslation(this.handle));
|
|
4006
4006
|
}
|
|
4007
4007
|
translationWrtParent() {
|
|
4008
|
-
return
|
|
4008
|
+
return F.fromRaw(this.colliderSet.raw.coTranslationWrtParent(this.handle));
|
|
4009
4009
|
}
|
|
4010
4010
|
rotation() {
|
|
4011
4011
|
return AA.fromRaw(this.colliderSet.raw.coRotation(this.handle));
|
|
@@ -4090,7 +4090,7 @@ class zI {
|
|
|
4090
4090
|
this.colliderSet.raw.coSetMass(this.handle, A);
|
|
4091
4091
|
}
|
|
4092
4092
|
setMassProperties(A, I, C) {
|
|
4093
|
-
let g =
|
|
4093
|
+
let g = F.intoRaw(I);
|
|
4094
4094
|
this.colliderSet.raw.coSetMassProperties(this.handle, A, g, C), g.free();
|
|
4095
4095
|
}
|
|
4096
4096
|
setTranslation(A) {
|
|
@@ -4109,10 +4109,10 @@ class zI {
|
|
|
4109
4109
|
return this.colliderSet.raw.coShapeType(this.handle);
|
|
4110
4110
|
}
|
|
4111
4111
|
halfExtents() {
|
|
4112
|
-
return
|
|
4112
|
+
return F.fromRaw(this.colliderSet.raw.coHalfExtents(this.handle));
|
|
4113
4113
|
}
|
|
4114
4114
|
setHalfExtents(A) {
|
|
4115
|
-
const I =
|
|
4115
|
+
const I = F.intoRaw(A);
|
|
4116
4116
|
this.colliderSet.raw.coSetHalfExtents(this.handle, I);
|
|
4117
4117
|
}
|
|
4118
4118
|
radius() {
|
|
@@ -4153,7 +4153,7 @@ class zI {
|
|
|
4153
4153
|
}
|
|
4154
4154
|
heightfieldScale() {
|
|
4155
4155
|
let A = this.colliderSet.raw.coHeightfieldScale(this.handle);
|
|
4156
|
-
return
|
|
4156
|
+
return F.fromRaw(A);
|
|
4157
4157
|
}
|
|
4158
4158
|
parent() {
|
|
4159
4159
|
return this._parent;
|
|
@@ -4180,42 +4180,42 @@ class zI {
|
|
|
4180
4180
|
return this.colliderSet.raw.coSolverGroups(this.handle);
|
|
4181
4181
|
}
|
|
4182
4182
|
containsPoint(A) {
|
|
4183
|
-
let I =
|
|
4183
|
+
let I = F.intoRaw(A), C = this.colliderSet.raw.coContainsPoint(this.handle, I);
|
|
4184
4184
|
return I.free(), C;
|
|
4185
4185
|
}
|
|
4186
4186
|
projectPoint(A, I) {
|
|
4187
|
-
let C =
|
|
4187
|
+
let C = F.intoRaw(A), g = iI.fromRaw(this.colliderSet.raw.coProjectPoint(this.handle, C, I));
|
|
4188
4188
|
return C.free(), g;
|
|
4189
4189
|
}
|
|
4190
4190
|
intersectsRay(A, I) {
|
|
4191
|
-
let C =
|
|
4191
|
+
let C = F.intoRaw(A.origin), g = F.intoRaw(A.dir), Q = this.colliderSet.raw.coIntersectsRay(this.handle, C, g, I);
|
|
4192
4192
|
return C.free(), g.free(), Q;
|
|
4193
4193
|
}
|
|
4194
4194
|
castShape(A, I, C, g, Q, B, i, o) {
|
|
4195
|
-
let
|
|
4196
|
-
return
|
|
4195
|
+
let h = F.intoRaw(A), s = F.intoRaw(C), G = AA.intoRaw(g), w = F.intoRaw(Q), a = I.intoRaw(), N = PA.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, h, a, s, G, w, B, i, o));
|
|
4196
|
+
return h.free(), s.free(), G.free(), w.free(), a.free(), N;
|
|
4197
4197
|
}
|
|
4198
4198
|
castCollider(A, I, C, g, Q, B) {
|
|
4199
|
-
let i =
|
|
4200
|
-
return i.free(), o.free(),
|
|
4199
|
+
let i = F.intoRaw(A), o = F.intoRaw(C), h = DI.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, i, I.handle, o, g, Q, B));
|
|
4200
|
+
return i.free(), o.free(), h;
|
|
4201
4201
|
}
|
|
4202
4202
|
intersectsShape(A, I, C) {
|
|
4203
|
-
let g =
|
|
4203
|
+
let g = F.intoRaw(I), Q = AA.intoRaw(C), B = A.intoRaw(), i = this.colliderSet.raw.coIntersectsShape(this.handle, B, g, Q);
|
|
4204
4204
|
return g.free(), Q.free(), B.free(), i;
|
|
4205
4205
|
}
|
|
4206
4206
|
contactShape(A, I, C, g) {
|
|
4207
|
-
let Q =
|
|
4207
|
+
let Q = F.intoRaw(I), B = AA.intoRaw(C), i = A.intoRaw(), o = uA.fromRaw(this.colliderSet.raw.coContactShape(this.handle, i, Q, B, g));
|
|
4208
4208
|
return Q.free(), B.free(), i.free(), o;
|
|
4209
4209
|
}
|
|
4210
4210
|
contactCollider(A, I) {
|
|
4211
4211
|
return uA.fromRaw(this.colliderSet.raw.coContactCollider(this.handle, A.handle, I));
|
|
4212
4212
|
}
|
|
4213
4213
|
castRay(A, I, C) {
|
|
4214
|
-
let g =
|
|
4214
|
+
let g = F.intoRaw(A.origin), Q = F.intoRaw(A.dir), B = this.colliderSet.raw.coCastRay(this.handle, g, Q, I, C);
|
|
4215
4215
|
return g.free(), Q.free(), B;
|
|
4216
4216
|
}
|
|
4217
4217
|
castRayAndGetNormal(A, I, C) {
|
|
4218
|
-
let g =
|
|
4218
|
+
let g = F.intoRaw(A.origin), Q = F.intoRaw(A.dir), B = EI.fromRaw(this.colliderSet.raw.coCastRayAndGetNormal(this.handle, g, Q, I, C));
|
|
4219
4219
|
return g.free(), Q.free(), B;
|
|
4220
4220
|
}
|
|
4221
4221
|
}
|
|
@@ -4224,7 +4224,7 @@ class zI {
|
|
|
4224
4224
|
})(WA || (WA = {}));
|
|
4225
4225
|
class KA {
|
|
4226
4226
|
constructor(A) {
|
|
4227
|
-
this.enabled = !0, this.shape = A, this.massPropsMode = WA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation = AA.identity(), this.translation =
|
|
4227
|
+
this.enabled = !0, this.shape = A, this.massPropsMode = WA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation = AA.identity(), this.translation = F.zeros(), this.isSensor = !1, this.collisionGroups = 4294967295, this.solverGroups = 4294967295, this.frictionCombineRule = CI.Average, this.restitutionCombineRule = CI.Average, this.activeCollisionTypes = SI.DEFAULT, this.activeEvents = aI.NONE, this.activeHooks = KI.NONE, this.mass = 0, this.centerOfMass = F.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 Bg(A);
|
|
@@ -4313,7 +4313,7 @@ class KA {
|
|
|
4313
4313
|
return this.massPropsMode = WA.Mass, this.mass = A, this;
|
|
4314
4314
|
}
|
|
4315
4315
|
setMassProperties(A, I, C) {
|
|
4316
|
-
return this.massPropsMode = WA.MassProps, this.mass = A,
|
|
4316
|
+
return this.massPropsMode = WA.MassProps, this.mass = A, F.copy(this.centerOfMass, I), this.principalAngularInertia = C, this;
|
|
4317
4317
|
}
|
|
4318
4318
|
setRestitution(A) {
|
|
4319
4319
|
return this.restitution = A, this;
|
|
@@ -4364,10 +4364,10 @@ class yC {
|
|
|
4364
4364
|
createCollider(A, I, C) {
|
|
4365
4365
|
let g = C != null && C != null;
|
|
4366
4366
|
if (g && isNaN(C)) throw Error("Cannot create a collider with a parent rigid-body handle that is not a number.");
|
|
4367
|
-
let Q = I.shape.intoRaw(), B =
|
|
4367
|
+
let Q = I.shape.intoRaw(), B = F.intoRaw(I.translation), i = AA.intoRaw(I.rotation), o = F.intoRaw(I.centerOfMass), h = this.raw.createCollider(I.enabled, Q, B, i, 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, g, g ? C : 0, A.raw);
|
|
4368
4368
|
Q.free(), B.free(), i.free(), o.free();
|
|
4369
|
-
let
|
|
4370
|
-
return this.map.set(
|
|
4369
|
+
let s = g ? A.get(C) : null, G = new zI(this, h, s, I.shape);
|
|
4370
|
+
return this.map.set(h, G), G;
|
|
4371
4371
|
}
|
|
4372
4372
|
remove(A, I, C, g) {
|
|
4373
4373
|
this.raw.remove(A, I.raw, C.raw, g), this.unmap(A);
|
|
@@ -4393,24 +4393,24 @@ class yC {
|
|
|
4393
4393
|
}
|
|
4394
4394
|
function dC(D, A, I, C) {
|
|
4395
4395
|
return new (I || (I = Promise))(function(g, Q) {
|
|
4396
|
-
function B(
|
|
4396
|
+
function B(h) {
|
|
4397
4397
|
try {
|
|
4398
|
-
o(C.next(
|
|
4399
|
-
} catch (
|
|
4400
|
-
Q(
|
|
4398
|
+
o(C.next(h));
|
|
4399
|
+
} catch (s) {
|
|
4400
|
+
Q(s);
|
|
4401
4401
|
}
|
|
4402
4402
|
}
|
|
4403
|
-
function i(
|
|
4403
|
+
function i(h) {
|
|
4404
4404
|
try {
|
|
4405
|
-
o(C.throw(
|
|
4406
|
-
} catch (
|
|
4407
|
-
Q(
|
|
4405
|
+
o(C.throw(h));
|
|
4406
|
+
} catch (s) {
|
|
4407
|
+
Q(s);
|
|
4408
4408
|
}
|
|
4409
4409
|
}
|
|
4410
|
-
function o(
|
|
4411
|
-
var
|
|
4412
|
-
|
|
4413
|
-
|
|
4410
|
+
function o(h) {
|
|
4411
|
+
var s;
|
|
4412
|
+
h.done ? g(h.value) : (s = h.value, s instanceof I ? s : new I(function(G) {
|
|
4413
|
+
G(s);
|
|
4414
4414
|
})).then(B, i);
|
|
4415
4415
|
}
|
|
4416
4416
|
o((C = C.apply(D, [])).next());
|
|
@@ -4420,8 +4420,8 @@ for (var fC = { byteLength: function(D) {
|
|
|
4420
4420
|
var A = Og(D), I = A[0], C = A[1];
|
|
4421
4421
|
return 3 * (I + C) / 4 - C;
|
|
4422
4422
|
}, toByteArray: function(D) {
|
|
4423
|
-
var A, I, C = Og(D), g = C[0], Q = C[1], B = new bC(function(
|
|
4424
|
-
return 3 * (
|
|
4423
|
+
var A, I, C = Og(D), g = C[0], Q = C[1], B = new bC(function(h, s, G) {
|
|
4424
|
+
return 3 * (s + G) / 4 - G;
|
|
4425
4425
|
}(0, g, Q)), i = 0, o = Q > 0 ? g - 4 : g;
|
|
4426
4426
|
for (I = 0; I < o; I += 4) A = tA[D.charCodeAt(I)] << 18 | tA[D.charCodeAt(I + 1)] << 12 | tA[D.charCodeAt(I + 2)] << 6 | tA[D.charCodeAt(I + 3)], B[i++] = A >> 16 & 255, B[i++] = A >> 8 & 255, B[i++] = 255 & A;
|
|
4427
4427
|
return Q === 2 && (A = tA[D.charCodeAt(I)] << 2 | tA[D.charCodeAt(I + 1)] >> 4, B[i++] = 255 & A), Q === 1 && (A = tA[D.charCodeAt(I)] << 10 | tA[D.charCodeAt(I + 1)] << 4 | tA[D.charCodeAt(I + 2)] >> 2, B[i++] = A >> 8 & 255, B[i++] = 255 & A), B;
|
|
@@ -4462,7 +4462,7 @@ function jC(D) {
|
|
|
4462
4462
|
A = D, E.reserve_memory(A);
|
|
4463
4463
|
}
|
|
4464
4464
|
tA[45] = 62, tA[95] = 63;
|
|
4465
|
-
var JA = Object.freeze({ __proto__: null, version: WC, reserveMemory: jC, Vector2: ug, VectorOps:
|
|
4465
|
+
var JA = Object.freeze({ __proto__: null, version: WC, reserveMemory: jC, Vector2: ug, VectorOps: F, RotationOps: AA, get RigidBodyType() {
|
|
4466
4466
|
return YA;
|
|
4467
4467
|
}, RigidBody: PI, RigidBodyDesc: rA, RigidBodySet: Pg, IntegrationParameters: Vg, get JointType() {
|
|
4468
4468
|
return RA;
|
|
@@ -4495,10 +4495,10 @@ var JA = Object.freeze({ __proto__: null, version: WC, reserveMemory: jC, Vector
|
|
|
4495
4495
|
}, PidController: NC });
|
|
4496
4496
|
class mC {
|
|
4497
4497
|
constructor() {
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4498
|
+
z(this, "world", null);
|
|
4499
|
+
z(this, "bodies", /* @__PURE__ */ new Map());
|
|
4500
|
+
z(this, "colliders", /* @__PURE__ */ new Map());
|
|
4501
|
+
z(this, "initialized", !1);
|
|
4502
4502
|
}
|
|
4503
4503
|
async init(A) {
|
|
4504
4504
|
this.initialized || (await JA.init(), this.world = new JA.World(new JA.Vector2(A.x, A.y)), this.initialized = !0);
|
|
@@ -4598,42 +4598,42 @@ class mC {
|
|
|
4598
4598
|
}
|
|
4599
4599
|
class xC {
|
|
4600
4600
|
constructor() {
|
|
4601
|
-
|
|
4602
|
-
|
|
4601
|
+
z(this, "artboard", null);
|
|
4602
|
+
z(this, "objectStates", /* @__PURE__ */ new Map());
|
|
4603
4603
|
// Physics State
|
|
4604
|
-
|
|
4604
|
+
z(this, "physicsEngine", null);
|
|
4605
4605
|
// State Machine State
|
|
4606
|
-
|
|
4607
|
-
|
|
4606
|
+
z(this, "activeStateMachine", null);
|
|
4607
|
+
z(this, "inputs", /* @__PURE__ */ new Map());
|
|
4608
4608
|
// id -> value
|
|
4609
|
-
|
|
4609
|
+
z(this, "inputNameMap", /* @__PURE__ */ new Map());
|
|
4610
4610
|
// name -> id[] mapping
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4611
|
+
z(this, "layerStates", /* @__PURE__ */ new Map());
|
|
4612
|
+
z(this, "imageCache", /* @__PURE__ */ new Map());
|
|
4613
|
+
z(this, "layout", { fit: "Contain", alignment: "Center" });
|
|
4614
|
+
z(this, "onTrigger");
|
|
4615
|
+
z(this, "onInputUpdate");
|
|
4616
|
+
z(this, "onComponentChange");
|
|
4617
4617
|
// Specific Component Listeners
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4618
|
+
z(this, "onToggle");
|
|
4619
|
+
z(this, "onInputChange");
|
|
4620
|
+
z(this, "onInputFocus");
|
|
4621
|
+
z(this, "onInputBlur");
|
|
4622
4622
|
// Track triggers that were just fired in the current frame
|
|
4623
|
-
|
|
4623
|
+
z(this, "justFiredTriggers", /* @__PURE__ */ new Set());
|
|
4624
4624
|
// Track currently hovered object for Enter/Leave events
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4625
|
+
z(this, "lastHoveredObjectId", null);
|
|
4626
|
+
z(this, "_lastPointerPos", null);
|
|
4627
|
+
z(this, "_prevPointerPos", null);
|
|
4628
4628
|
// Interaction State
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4629
|
+
z(this, "focusedId", null);
|
|
4630
|
+
z(this, "draggingSliderId", null);
|
|
4631
|
+
z(this, "activeDropdownId", null);
|
|
4632
|
+
z(this, "draggingListViewId", null);
|
|
4633
4633
|
// Physics/Animation State
|
|
4634
|
-
|
|
4634
|
+
z(this, "objectVelocities", /* @__PURE__ */ new Map());
|
|
4635
4635
|
// Trigger Management
|
|
4636
|
-
|
|
4636
|
+
z(this, "activeTriggers", /* @__PURE__ */ new Map());
|
|
4637
4637
|
}
|
|
4638
4638
|
setTriggerCallback(A) {
|
|
4639
4639
|
this.onTrigger = A;
|
|
@@ -4709,8 +4709,8 @@ class xC {
|
|
|
4709
4709
|
...I.transform,
|
|
4710
4710
|
width: C,
|
|
4711
4711
|
height: g,
|
|
4712
|
-
|
|
4713
|
-
opacity: I.opacity !== void 0 ? I.opacity :
|
|
4712
|
+
corner_radius: I.corner_radius ?? I.cornerRadius ?? I.geometry.corner_radius ?? I.geometry.cornerRadius ?? 0,
|
|
4713
|
+
opacity: I.opacity !== void 0 ? I.opacity : 100,
|
|
4714
4714
|
visible: I.visible !== void 0 ? I.visible : I.isVisible !== void 0 ? I.isVisible : !0,
|
|
4715
4715
|
blendMode: I.blendMode || "Normal",
|
|
4716
4716
|
// We need to store style state to animate it
|
|
@@ -4819,10 +4819,10 @@ class xC {
|
|
|
4819
4819
|
const B = this.activeStateMachine.layers.find((i) => i.name === A);
|
|
4820
4820
|
if (B)
|
|
4821
4821
|
for (const i of I) {
|
|
4822
|
-
const o = B.states.find((
|
|
4822
|
+
const o = B.states.find((h) => h.id === i);
|
|
4823
4823
|
if (o) {
|
|
4824
|
-
let
|
|
4825
|
-
o.animationId && (
|
|
4824
|
+
let h = null;
|
|
4825
|
+
o.animationId && (h = this.artboard.animations.find((s) => s.id === o.animationId) || null), h || (h = this.artboard.animations.find((s) => s.name === o.name || s.id === o.name || o.name === "Entry" && s.name === "Rotate") || null), h && (g.push({ animation: h, state: o }), Q = Math.max(Q, h.duration));
|
|
4826
4826
|
}
|
|
4827
4827
|
}
|
|
4828
4828
|
}
|
|
@@ -4856,22 +4856,22 @@ class xC {
|
|
|
4856
4856
|
var B, i, o;
|
|
4857
4857
|
let C;
|
|
4858
4858
|
if (this.inputs.has(A)) {
|
|
4859
|
-
const
|
|
4860
|
-
|
|
4859
|
+
const h = (B = this.activeStateMachine) == null ? void 0 : B.inputs.find((s) => s.id === A);
|
|
4860
|
+
h && typeof h.value == "object" && (C = h.value.type);
|
|
4861
4861
|
} else {
|
|
4862
|
-
const
|
|
4863
|
-
if (
|
|
4864
|
-
const
|
|
4865
|
-
|
|
4862
|
+
const h = this.inputNameMap.get(A);
|
|
4863
|
+
if (h && h.length > 0) {
|
|
4864
|
+
const s = (i = this.activeStateMachine) == null ? void 0 : i.inputs.find((G) => G.id === h[0]);
|
|
4865
|
+
s && typeof s.value == "object" && (C = s.value.type);
|
|
4866
4866
|
}
|
|
4867
4867
|
}
|
|
4868
4868
|
let g = I;
|
|
4869
4869
|
C === "Trigger" && (I === 1 ? g = !0 : I === 0 && (g = !1)), this.inputs.has(A) && this.setInternalInput(A, g);
|
|
4870
4870
|
const Q = this.inputNameMap.get(A);
|
|
4871
|
-
Q && Q.forEach((
|
|
4872
|
-
if (
|
|
4873
|
-
const
|
|
4874
|
-
|
|
4871
|
+
Q && Q.forEach((h) => this.setInternalInput(h, g)), C === "Trigger" && g === !0 && (this.justFiredTriggers.add(A), Q && Q.forEach((h) => this.justFiredTriggers.add(h))), Array.isArray(g) && ((o = this.artboard) == null || o.objects.forEach((h) => {
|
|
4872
|
+
if (h.inputId === A || h.name === A) {
|
|
4873
|
+
const s = this.objectStates.get(h.id);
|
|
4874
|
+
s && s.options && (h.type === "ListView" || h.variant === "listview" ? s.options.items = g : (h.type === "Dropdown" || h.variant === "dropdown") && (s.options.optionsList = g));
|
|
4875
4875
|
}
|
|
4876
4876
|
})), this.evaluateTransitions();
|
|
4877
4877
|
}
|
|
@@ -4886,12 +4886,12 @@ class xC {
|
|
|
4886
4886
|
if (!B) continue;
|
|
4887
4887
|
let i = !1;
|
|
4888
4888
|
for (const o of B.transitions)
|
|
4889
|
-
this.checkConditions(o.conditions) && (C.push(o.targetStateId), i = !0, g = !0, o.conditions && o.conditions.forEach((
|
|
4890
|
-
var
|
|
4891
|
-
const
|
|
4892
|
-
if (
|
|
4893
|
-
const
|
|
4894
|
-
|
|
4889
|
+
this.checkConditions(o.conditions) && (C.push(o.targetStateId), i = !0, g = !0, o.conditions && o.conditions.forEach((h) => {
|
|
4890
|
+
var G;
|
|
4891
|
+
const s = (G = this.activeStateMachine) == null ? void 0 : G.inputs.find((w) => w.id === h.inputId);
|
|
4892
|
+
if (s && typeof s.value == "object" && s.value.type === "Number" && (this.setInternalInput(h.inputId, 0), this.inputNameMap.has(s.name))) {
|
|
4893
|
+
const w = this.inputNameMap.get(s.name);
|
|
4894
|
+
w == null || w.forEach((a) => this.setInternalInput(a, 0));
|
|
4895
4895
|
}
|
|
4896
4896
|
}));
|
|
4897
4897
|
i || C.push(Q);
|
|
@@ -4900,10 +4900,10 @@ class xC {
|
|
|
4900
4900
|
const Q = this.findGlobalTransition(A, I.currentStateIds);
|
|
4901
4901
|
Q && (C.length = 0, C.push(Q.targetStateId), g = !0, Q.conditions && Q.conditions.forEach((B) => {
|
|
4902
4902
|
var o;
|
|
4903
|
-
const i = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((
|
|
4903
|
+
const i = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((h) => h.id === B.inputId);
|
|
4904
4904
|
if (i && typeof i.value == "object" && i.value.type === "Number" && (this.setInternalInput(B.inputId, 0), this.inputNameMap.has(i.name))) {
|
|
4905
|
-
const
|
|
4906
|
-
|
|
4905
|
+
const h = this.inputNameMap.get(i.name);
|
|
4906
|
+
h == null || h.forEach((s) => this.setInternalInput(s, 0));
|
|
4907
4907
|
}
|
|
4908
4908
|
}));
|
|
4909
4909
|
}
|
|
@@ -4977,33 +4977,33 @@ class xC {
|
|
|
4977
4977
|
var B, i, o;
|
|
4978
4978
|
if (C.has(A)) return !1;
|
|
4979
4979
|
C.add(A);
|
|
4980
|
-
const g = (i = (B = this.activeStateMachine) == null ? void 0 : B.logicNodes) == null ? void 0 : i.find((
|
|
4980
|
+
const g = (i = (B = this.activeStateMachine) == null ? void 0 : B.logicNodes) == null ? void 0 : i.find((h) => h.id === A);
|
|
4981
4981
|
if (g) {
|
|
4982
|
-
const
|
|
4983
|
-
const
|
|
4984
|
-
return
|
|
4982
|
+
const h = (s, G) => {
|
|
4983
|
+
const w = g.inputs.find((a) => a.id === s);
|
|
4984
|
+
return w ? w.sourceId ? this.evaluateLogicTree(w.sourceId, w.sourceHandleId, C) : w.value !== void 0 ? w.value : G : G;
|
|
4985
4985
|
};
|
|
4986
4986
|
switch (g.op) {
|
|
4987
4987
|
case VA.AND:
|
|
4988
|
-
return
|
|
4988
|
+
return h("a", !1) && h("b", !1);
|
|
4989
4989
|
case VA.OR:
|
|
4990
|
-
return
|
|
4990
|
+
return h("a", !1) || h("b", !1);
|
|
4991
4991
|
case VA.NOT:
|
|
4992
|
-
return !
|
|
4992
|
+
return !h("in", !1);
|
|
4993
4993
|
case VA.XOR:
|
|
4994
|
-
return !!
|
|
4994
|
+
return !!h("a", !1) != !!h("b", !1);
|
|
4995
4995
|
default:
|
|
4996
4996
|
return 0;
|
|
4997
4997
|
}
|
|
4998
4998
|
}
|
|
4999
4999
|
let Q = this.inputs.get(A);
|
|
5000
5000
|
if (this.justFiredTriggers.has(A) && (Q = !0), I && Q !== void 0) {
|
|
5001
|
-
const
|
|
5002
|
-
if (
|
|
5003
|
-
const
|
|
5004
|
-
if (I === "source-greater") return Q >
|
|
5005
|
-
if (I === "source-less") return Q <
|
|
5006
|
-
if (I === "source-equal") return Q ===
|
|
5001
|
+
const h = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((s) => s.id === A);
|
|
5002
|
+
if (h && h.value.type === "Number" && typeof Q == "number") {
|
|
5003
|
+
const s = h.value.defaultValue ?? h.value.value;
|
|
5004
|
+
if (I === "source-greater") return Q > s;
|
|
5005
|
+
if (I === "source-less") return Q < s;
|
|
5006
|
+
if (I === "source-equal") return Q === s;
|
|
5007
5007
|
}
|
|
5008
5008
|
if (I === "source-true") return Q === !0;
|
|
5009
5009
|
if (I === "source-false") return Q === !1;
|
|
@@ -5027,14 +5027,14 @@ class xC {
|
|
|
5027
5027
|
this.applyAnimation(C.animation, I.time);
|
|
5028
5028
|
}));
|
|
5029
5029
|
})), this.solveConstraints(A), this.activeTriggers.forEach((I, C) => {
|
|
5030
|
-
var g, Q, B, i, o,
|
|
5030
|
+
var g, Q, B, i, o, h, s;
|
|
5031
5031
|
if (I.phase === "entry")
|
|
5032
|
-
I.time += A, I.time >= I.animation.duration && ((B = (Q = (g = this.artboard) == null ? void 0 : g.objects.find((
|
|
5032
|
+
I.time += A, I.time >= I.animation.duration && ((B = (Q = (g = this.artboard) == null ? void 0 : g.objects.find((G) => G.id === C)) == null ? void 0 : Q.triggers) == null || B.find((G) => G.id === I.triggerId), I.phase = "hold", I.elapsedHold = 0, I.time = I.animation.duration), this.applyAnimation(I.animation, I.time);
|
|
5033
5033
|
else if (I.phase === "hold") {
|
|
5034
|
-
const
|
|
5035
|
-
if (I.elapsedHold += A * 1e3, I.elapsedHold >=
|
|
5036
|
-
if (
|
|
5037
|
-
const a = (
|
|
5034
|
+
const G = (h = (o = (i = this.artboard) == null ? void 0 : i.objects.find((a) => a.id === C)) == null ? void 0 : o.triggers) == null ? void 0 : h.find((a) => a.id === I.triggerId), w = (G == null ? void 0 : G.duration) || 0;
|
|
5035
|
+
if (I.elapsedHold += A * 1e3, I.elapsedHold >= w)
|
|
5036
|
+
if (G != null && G.exitAnimationId) {
|
|
5037
|
+
const a = (s = this.artboard) == null ? void 0 : s.animations.find((N) => N.id === G.exitAnimationId);
|
|
5038
5038
|
a ? (I.phase = "exit", I.animation = a, I.time = 0) : this.activeTriggers.delete(C);
|
|
5039
5039
|
} else
|
|
5040
5040
|
this.activeTriggers.delete(C);
|
|
@@ -5046,58 +5046,58 @@ class xC {
|
|
|
5046
5046
|
if (!I.constraints || I.constraints.length === 0) return;
|
|
5047
5047
|
const C = this.objectStates.get(I.id);
|
|
5048
5048
|
C && I.constraints.forEach((g) => {
|
|
5049
|
-
var B, i, o,
|
|
5049
|
+
var B, i, o, h, s, G;
|
|
5050
5050
|
const Q = g.strength ?? 1;
|
|
5051
5051
|
if (g.type === "Translation") {
|
|
5052
|
-
const
|
|
5053
|
-
if (
|
|
5052
|
+
const w = this.objectStates.get(g.targetId);
|
|
5053
|
+
if (w) {
|
|
5054
5054
|
const a = g.useSpring, N = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 };
|
|
5055
5055
|
if (a) {
|
|
5056
|
-
const { x: S, y:
|
|
5057
|
-
g.copyX && (C.x = S), g.copyY && (C.y =
|
|
5056
|
+
const { x: S, y: k, vx: y, vy: U } = this.computeSpring(C.x, C.y, N.vx, N.vy, w.x, w.y, g, A);
|
|
5057
|
+
g.copyX && (C.x = S), g.copyY && (C.y = k), this.objectVelocities.set(I.id, { vx: y, vy: U });
|
|
5058
5058
|
} else
|
|
5059
|
-
g.copyX && (C.x = C.x + (
|
|
5059
|
+
g.copyX && (C.x = C.x + (w.x - C.x) * Q), g.copyY && (C.y = C.y + (w.y - C.y) * Q);
|
|
5060
5060
|
(B = g.limitX) != null && B.enabled && (C.x = Math.max(g.limitX.min, Math.min(g.limitX.max, C.x))), (i = g.limitY) != null && i.enabled && (C.y = Math.max(g.limitY.min, Math.min(g.limitY.max, C.y)));
|
|
5061
5061
|
}
|
|
5062
5062
|
} else if (g.type === "FollowPointer") {
|
|
5063
|
-
const
|
|
5063
|
+
const w = ((o = this._lastPointerPos) == null ? void 0 : o.x) ?? C.x, a = ((h = this._lastPointerPos) == null ? void 0 : h.y) ?? C.y;
|
|
5064
5064
|
if (g.useSpring) {
|
|
5065
|
-
const S = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 }, { x:
|
|
5066
|
-
C.x =
|
|
5065
|
+
const S = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 }, { x: k, y, vx: U, vy: c } = this.computeSpring(C.x, C.y, S.vx, S.vy, w, a, g, A);
|
|
5066
|
+
C.x = k, C.y = y, this.objectVelocities.set(I.id, { vx: U, vy: c });
|
|
5067
5067
|
} else
|
|
5068
|
-
C.x = C.x + (
|
|
5069
|
-
(
|
|
5068
|
+
C.x = C.x + (w - C.x) * Q, C.y = C.y + (a - C.y) * Q;
|
|
5069
|
+
(s = g.limitX) != null && s.enabled && (C.x = Math.max(g.limitX.min, Math.min(g.limitX.max, C.x))), (G = g.limitY) != null && G.enabled && (C.y = Math.max(g.limitY.min, Math.min(g.limitY.max, C.y)));
|
|
5070
5070
|
} else if (g.type === "Distance") {
|
|
5071
|
-
const
|
|
5072
|
-
if (
|
|
5073
|
-
const a = C.x -
|
|
5074
|
-
let
|
|
5071
|
+
const w = this.objectStates.get(g.targetId);
|
|
5072
|
+
if (w) {
|
|
5073
|
+
const a = C.x - w.x, N = C.y - w.y, S = Math.sqrt(a * a + N * N), k = g.distance || 0;
|
|
5074
|
+
let y = S;
|
|
5075
5075
|
switch (g.mode) {
|
|
5076
5076
|
case "exact":
|
|
5077
|
-
|
|
5077
|
+
y = k;
|
|
5078
5078
|
break;
|
|
5079
5079
|
case "minimum":
|
|
5080
|
-
|
|
5080
|
+
y = Math.max(k, S);
|
|
5081
5081
|
break;
|
|
5082
5082
|
case "maximum":
|
|
5083
|
-
|
|
5083
|
+
y = Math.min(k, S);
|
|
5084
5084
|
break;
|
|
5085
5085
|
case "clamped":
|
|
5086
|
-
|
|
5086
|
+
y = Math.max(0, Math.min(k, S));
|
|
5087
5087
|
break;
|
|
5088
5088
|
}
|
|
5089
5089
|
if (S > 0) {
|
|
5090
|
-
const
|
|
5091
|
-
C.x =
|
|
5092
|
-
} else S === 0 &&
|
|
5090
|
+
const U = y / S;
|
|
5091
|
+
C.x = w.x + a * U, C.y = w.y + N * U;
|
|
5092
|
+
} else S === 0 && y > 0 && (C.x = w.x + y);
|
|
5093
5093
|
}
|
|
5094
5094
|
}
|
|
5095
5095
|
});
|
|
5096
5096
|
});
|
|
5097
5097
|
}
|
|
5098
5098
|
computeSpring(A, I, C, g, Q, B, i, o) {
|
|
5099
|
-
const
|
|
5100
|
-
return { x: t, y: J, vx:
|
|
5099
|
+
const h = i.stiffness ?? 100, s = i.damping ?? 10, G = i.mass ?? 1, w = -h * (A - Q), a = -h * (I - B), N = -s * C, S = -s * g, k = (w + N) / G, y = (a + S) / G, U = C + k * o, c = g + y * o, t = A + U * o, J = I + c * o;
|
|
5100
|
+
return { x: t, y: J, vx: U, vy: c };
|
|
5101
5101
|
}
|
|
5102
5102
|
handlePointerInput(A, I, C, g, Q) {
|
|
5103
5103
|
if (!this.artboard) return;
|
|
@@ -5112,21 +5112,21 @@ class xC {
|
|
|
5112
5112
|
this._prevPointerPos = this._lastPointerPos, this._lastPointerPos = { x: i, y: o }, this.updateInput("mouseX", i), this.updateInput("mouseY", o), this.handlePointerEvent(A, i, o);
|
|
5113
5113
|
}
|
|
5114
5114
|
handlePointerEvent(A, I, C) {
|
|
5115
|
-
var o,
|
|
5115
|
+
var o, h, s, G;
|
|
5116
5116
|
if (!this.artboard) return;
|
|
5117
5117
|
let g = null;
|
|
5118
|
-
const Q = (
|
|
5119
|
-
var
|
|
5118
|
+
const Q = (w, a) => {
|
|
5119
|
+
var c;
|
|
5120
5120
|
let N = a;
|
|
5121
5121
|
a === "click" ? N = "onClick" : a === "down" ? N = "onPointerDown" : a === "up" ? N = "onPointerUp" : a === "blur" && (N = "onPointerLeave");
|
|
5122
5122
|
const S = /* @__PURE__ */ new Set([N]);
|
|
5123
5123
|
a === "move" && S.add("onPointerEnter").add("hover").add("onPointerLeave").add("blur"), N === "onClick" && S.add("click"), N === "onPointerDown" && S.add("pointerDown"), N === "onPointerUp" && S.add("pointerUp");
|
|
5124
|
-
const
|
|
5125
|
-
return !!(
|
|
5124
|
+
const k = ["button", "toggle", "toggle_button", "dropdown", "listview", "inputbox", "slider"];
|
|
5125
|
+
return !!(w.type === "Component" && k.includes(w.variant) || k.includes((c = w.type) == null ? void 0 : c.toLowerCase()) || (w.interactions || []).some((t) => S.has(t.event)) || (w.triggers || []).some((t) => S.has(t.eventType)));
|
|
5126
5126
|
};
|
|
5127
5127
|
let B = null;
|
|
5128
|
-
for (let
|
|
5129
|
-
const a = this.artboard.objects[
|
|
5128
|
+
for (let w = this.artboard.objects.length - 1; w >= 0; w--) {
|
|
5129
|
+
const a = this.artboard.objects[w], N = this.objectStates.get(a.id);
|
|
5130
5130
|
if (N && N.visible !== !1 && N.opacity > 0 && this.hitTest(a, I, C) && (B || (B = a), Q(a, A))) {
|
|
5131
5131
|
g = a;
|
|
5132
5132
|
break;
|
|
@@ -5136,29 +5136,29 @@ class xC {
|
|
|
5136
5136
|
const i = (g == null ? void 0 : g.id) || null;
|
|
5137
5137
|
if (A === "move") {
|
|
5138
5138
|
if (this.draggingSliderId) {
|
|
5139
|
-
const
|
|
5140
|
-
|
|
5139
|
+
const w = this.artboard.objects.find((a) => a.id === this.draggingSliderId);
|
|
5140
|
+
w && this.updateSliderValueFromPointer(w, I, C);
|
|
5141
5141
|
return;
|
|
5142
5142
|
}
|
|
5143
5143
|
if (this.draggingListViewId) {
|
|
5144
|
-
const
|
|
5145
|
-
|
|
5144
|
+
const w = this.artboard.objects.find((a) => a.id === this.draggingListViewId);
|
|
5145
|
+
w && this.updateListViewScrollFromPointer(w);
|
|
5146
5146
|
return;
|
|
5147
5147
|
}
|
|
5148
5148
|
g && g.type === "Component" && g.variant === "listview" && this.updateListViewHoverFromPointer(g, I, C), i !== this.lastHoveredObjectId && (console.log(`[Engine] HOVER CHANGE: ${this.lastHoveredObjectId} -> ${i}`), this.lastHoveredObjectId && this.fireEventForObject(this.lastHoveredObjectId, "onPointerLeave"), i && this.fireEventForObject(i, "onPointerEnter"), this.lastHoveredObjectId = i);
|
|
5149
5149
|
return;
|
|
5150
5150
|
}
|
|
5151
5151
|
if ((A === "up" || A === "blur") && (this.draggingSliderId = null, this.draggingListViewId = null), this.activeDropdownId && A === "down") {
|
|
5152
|
-
const
|
|
5153
|
-
if (
|
|
5154
|
-
const a = this.objectStates.get(
|
|
5152
|
+
const w = this.artboard.objects.find((a) => a.id === this.activeDropdownId);
|
|
5153
|
+
if (w && (w.type === "Dropdown" || w.variant === "dropdown")) {
|
|
5154
|
+
const a = this.objectStates.get(w.id), N = (a == null ? void 0 : a.options) || w.options || {}, S = w.geometry || {}, k = S.width ?? w.width ?? 200, y = S.height ?? w.height ?? 40, U = N.optionsList || [], c = N.itemHeight || 32, t = N.listPadding ?? 4, J = U.length * c + t * 2, R = this.getWorldTransform(w.id), e = k * Math.abs(R.scaleX), Y = y * Math.abs(R.scaleY), r = R.y + Y / 2 + 4, L = Math.abs(I - R.x) <= e / 2, b = C >= r && C <= r + J * Math.abs(R.scaleY);
|
|
5155
5155
|
if (L && b) {
|
|
5156
|
-
const
|
|
5157
|
-
if (m >= 0 && m <
|
|
5158
|
-
const QA =
|
|
5159
|
-
N.selectedOption = QA, N.isOpen = !1, this.activeDropdownId = null,
|
|
5160
|
-
objectId:
|
|
5161
|
-
componentName:
|
|
5156
|
+
const P = Math.abs(R.scaleY), IA = C - (r + t * P), m = Math.floor(IA / (c * P));
|
|
5157
|
+
if (m >= 0 && m < U.length) {
|
|
5158
|
+
const QA = U[m];
|
|
5159
|
+
N.selectedOption = QA, N.isOpen = !1, this.activeDropdownId = null, w.inputId && this.setInternalInput(w.inputId, QA), this.onComponentChange && this.onComponentChange({
|
|
5160
|
+
objectId: w.id,
|
|
5161
|
+
componentName: w.name,
|
|
5162
5162
|
variant: "dropdown",
|
|
5163
5163
|
property: "selectedOption",
|
|
5164
5164
|
value: QA
|
|
@@ -5169,43 +5169,43 @@ class xC {
|
|
|
5169
5169
|
}
|
|
5170
5170
|
}
|
|
5171
5171
|
if (g) {
|
|
5172
|
-
let
|
|
5172
|
+
let w = g, a = g;
|
|
5173
5173
|
for (; a && a.parentId; ) {
|
|
5174
|
-
const S = this.artboard.objects.find((
|
|
5174
|
+
const S = this.artboard.objects.find((k) => k.id === a.parentId);
|
|
5175
5175
|
if (S && S.type === "Component") {
|
|
5176
|
-
|
|
5176
|
+
w = S;
|
|
5177
5177
|
break;
|
|
5178
5178
|
}
|
|
5179
5179
|
a = S;
|
|
5180
5180
|
}
|
|
5181
5181
|
let N = A;
|
|
5182
|
-
if (A === "click" ? N = "onClick" : A === "down" ? N = "onPointerDown" : A === "up" ? N = "onPointerUp" : A === "blur" && (N = "onPointerLeave"), this.fireEventForObject(g.id, N),
|
|
5183
|
-
const S = this.objectStates.get(
|
|
5184
|
-
|
|
5185
|
-
objectId:
|
|
5186
|
-
componentName:
|
|
5182
|
+
if (A === "click" ? N = "onClick" : A === "down" ? N = "onPointerDown" : A === "up" ? N = "onPointerUp" : A === "blur" && (N = "onPointerLeave"), this.fireEventForObject(g.id, N), w !== g && this.fireEventForObject(w.id, N), w.type === "Component" && w.variant === "toggle_button" && A === "down") {
|
|
5183
|
+
const S = this.objectStates.get(w.id), k = (S == null ? void 0 : S.options) || w.options || {};
|
|
5184
|
+
k.checked = !k.checked, w.inputId && this.setInternalInput(w.inputId, k.checked), this.onComponentChange && this.onComponentChange({
|
|
5185
|
+
objectId: w.id,
|
|
5186
|
+
componentName: w.name,
|
|
5187
5187
|
variant: "toggle_button",
|
|
5188
5188
|
property: "checked",
|
|
5189
|
-
value:
|
|
5189
|
+
value: k.checked
|
|
5190
5190
|
});
|
|
5191
5191
|
}
|
|
5192
|
-
if (
|
|
5193
|
-
const S = this.objectStates.get(
|
|
5194
|
-
|
|
5195
|
-
objectId:
|
|
5196
|
-
componentName:
|
|
5192
|
+
if (w.type === "Component" && w.variant === "toggle" && A === "down") {
|
|
5193
|
+
const S = this.objectStates.get(w.id), k = (S == null ? void 0 : S.options) || w.options || {};
|
|
5194
|
+
k.checked = !k.checked, w.inputId && this.setInternalInput(w.inputId, k.checked), this.onComponentChange && this.onComponentChange({
|
|
5195
|
+
objectId: w.id,
|
|
5196
|
+
componentName: w.name,
|
|
5197
5197
|
variant: "toggle",
|
|
5198
5198
|
property: "checked",
|
|
5199
|
-
value:
|
|
5200
|
-
}), this.onToggle && this.onToggle(
|
|
5199
|
+
value: k.checked
|
|
5200
|
+
}), this.onToggle && this.onToggle(w.name, k.checked);
|
|
5201
5201
|
}
|
|
5202
|
-
if (
|
|
5203
|
-
const S = this.objectStates.get(
|
|
5204
|
-
if (
|
|
5205
|
-
const
|
|
5206
|
-
|
|
5202
|
+
if (w.type === "Component" && w.variant === "dropdown" && A === "down") {
|
|
5203
|
+
const S = this.objectStates.get(w.id), k = (S == null ? void 0 : S.options) || w.options || {}, y = !k.isOpen;
|
|
5204
|
+
if (y && this.activeDropdownId && this.activeDropdownId !== w.id) {
|
|
5205
|
+
const U = this.artboard.objects.find((c) => c.id === this.activeDropdownId);
|
|
5206
|
+
U && U.options && (U.options.isOpen = !1);
|
|
5207
5207
|
}
|
|
5208
|
-
|
|
5208
|
+
k.isOpen = y, this.activeDropdownId = y ? w.id : null;
|
|
5209
5209
|
}
|
|
5210
5210
|
if (g.type === "Component" && g.variant === "button" && A === "down" && this.onComponentChange && this.onComponentChange({
|
|
5211
5211
|
objectId: g.id,
|
|
@@ -5217,12 +5217,12 @@ class xC {
|
|
|
5217
5217
|
this.draggingListViewId = g.id;
|
|
5218
5218
|
const S = this.getListViewItemIndexAtPointer(g, I, C);
|
|
5219
5219
|
if (S !== null) {
|
|
5220
|
-
const
|
|
5221
|
-
|
|
5222
|
-
const
|
|
5223
|
-
|
|
5224
|
-
const
|
|
5225
|
-
|
|
5220
|
+
const k = g.options || {};
|
|
5221
|
+
k.activeItemIndex = S;
|
|
5222
|
+
const y = this.objectStates.get(g.id);
|
|
5223
|
+
y && y.options && (y.options.activeItemIndex = S);
|
|
5224
|
+
const U = (k.items || [])[S], c = typeof U == "string" ? U : U.label || U.value || S;
|
|
5225
|
+
y && y.options && (y.options.selectedValue = c), g.inputId && this.setInternalInput(g.inputId, c), this.onComponentChange && (this.onComponentChange({
|
|
5226
5226
|
objectId: g.id,
|
|
5227
5227
|
componentName: g.name,
|
|
5228
5228
|
variant: "listview",
|
|
@@ -5233,29 +5233,29 @@ class xC {
|
|
|
5233
5233
|
componentName: g.name,
|
|
5234
5234
|
variant: "listview",
|
|
5235
5235
|
property: "selected",
|
|
5236
|
-
value:
|
|
5236
|
+
value: c
|
|
5237
5237
|
}));
|
|
5238
5238
|
}
|
|
5239
5239
|
}
|
|
5240
5240
|
if (g.type === "Component" && g.variant === "slider" && A === "down" && (this.draggingSliderId = g.id, this.updateSliderValueFromPointer(g, I, C)), A === "click") {
|
|
5241
|
-
const S = (o = this.artboard) == null ? void 0 : o.objects.find((
|
|
5241
|
+
const S = (o = this.artboard) == null ? void 0 : o.objects.find((y) => y.id === g.id), k = this.focusedId;
|
|
5242
5242
|
if ((S == null ? void 0 : S.type) === "Component" && S.variant === "inputbox") {
|
|
5243
|
-
if (this.focusedId = g.id, console.log(`[Engine] Focus set to: ${g.id}`),
|
|
5244
|
-
if (
|
|
5245
|
-
const
|
|
5246
|
-
|
|
5243
|
+
if (this.focusedId = g.id, console.log(`[Engine] Focus set to: ${g.id}`), k !== this.focusedId) {
|
|
5244
|
+
if (k) {
|
|
5245
|
+
const y = (h = this.artboard) == null ? void 0 : h.objects.find((U) => U.id === k);
|
|
5246
|
+
y && this.onInputBlur && this.onInputBlur(y.name);
|
|
5247
5247
|
}
|
|
5248
5248
|
this.onInputFocus && this.onInputFocus(S.name);
|
|
5249
5249
|
}
|
|
5250
|
-
} else if (this.focusedId = null,
|
|
5251
|
-
const
|
|
5252
|
-
|
|
5250
|
+
} else if (this.focusedId = null, k) {
|
|
5251
|
+
const y = (s = this.artboard) == null ? void 0 : s.objects.find((U) => U.id === k);
|
|
5252
|
+
y && this.onInputBlur && this.onInputBlur(y.name);
|
|
5253
5253
|
}
|
|
5254
5254
|
}
|
|
5255
5255
|
} else if (A === "click") {
|
|
5256
|
-
const
|
|
5257
|
-
if (this.focusedId = null,
|
|
5258
|
-
const a = (
|
|
5256
|
+
const w = this.focusedId;
|
|
5257
|
+
if (this.focusedId = null, w) {
|
|
5258
|
+
const a = (G = this.artboard) == null ? void 0 : G.objects.find((N) => N.id === w);
|
|
5259
5259
|
a && this.onInputBlur && this.onInputBlur(a.name);
|
|
5260
5260
|
}
|
|
5261
5261
|
}
|
|
@@ -5292,35 +5292,35 @@ class xC {
|
|
|
5292
5292
|
}
|
|
5293
5293
|
fireEventForObject(A, I) {
|
|
5294
5294
|
if (!this.artboard) return;
|
|
5295
|
-
const C = this.artboard.objects.find((
|
|
5295
|
+
const C = this.artboard.objects.find((h) => h.id === A);
|
|
5296
5296
|
if (!C) return;
|
|
5297
5297
|
console.log(`[Engine] Firing event ${I} on ${C.name}`);
|
|
5298
5298
|
const g = /* @__PURE__ */ new Set([I]);
|
|
5299
5299
|
I === "onPointerEnter" && g.add("hover"), I === "onPointerLeave" && g.add("blur"), I === "onPointerDown" && g.add("pointerDown"), I === "onPointerUp" && g.add("pointerUp");
|
|
5300
|
-
const B = (C.interactions || []).find((
|
|
5300
|
+
const B = (C.interactions || []).find((h) => g.has(h.event));
|
|
5301
5301
|
if (B)
|
|
5302
5302
|
if (console.log(`[Engine] Interaction matched: ${I} (as ${B.event}) -> ${B.targetInputId}`), B.action === "setInput") {
|
|
5303
|
-
let
|
|
5304
|
-
|
|
5303
|
+
let h = B.value;
|
|
5304
|
+
h === "toggle" && (h = !this.inputs.get(B.targetInputId)), this.updateInput(B.targetInputId, h);
|
|
5305
5305
|
} else B.action === "fireTrigger" && this.updateInput(B.targetInputId, !0);
|
|
5306
|
-
const o = (C.triggers || []).find((
|
|
5306
|
+
const o = (C.triggers || []).find((h) => g.has(h.eventType));
|
|
5307
5307
|
if (o && o.entryAnimationId) {
|
|
5308
5308
|
console.log(`[Engine] Trigger matched: ${I} (as ${o.eventType}) -> Animation ${o.entryAnimationId}`);
|
|
5309
|
-
const
|
|
5310
|
-
|
|
5309
|
+
const h = this.artboard.animations.find((s) => s.id === o.entryAnimationId);
|
|
5310
|
+
h && (this.activeTriggers.set(C.id, {
|
|
5311
5311
|
triggerId: o.id,
|
|
5312
|
-
animation:
|
|
5312
|
+
animation: h,
|
|
5313
5313
|
time: 0,
|
|
5314
5314
|
phase: "entry",
|
|
5315
5315
|
elapsedHold: 0
|
|
5316
|
-
}), this.onTrigger && this.onTrigger(o.name,
|
|
5316
|
+
}), this.onTrigger && this.onTrigger(o.name, h.name));
|
|
5317
5317
|
}
|
|
5318
5318
|
}
|
|
5319
5319
|
getWorldTransform(A) {
|
|
5320
|
-
var
|
|
5320
|
+
var w;
|
|
5321
5321
|
const I = this.objectStates.get(A);
|
|
5322
5322
|
if (!I) return { x: 0, y: 0, scaleX: 1, scaleY: 1, rotation: 0 };
|
|
5323
|
-
const C = (
|
|
5323
|
+
const C = (w = this.artboard) == null ? void 0 : w.objects.find((a) => a.id === A);
|
|
5324
5324
|
if (!C || !C.parentId)
|
|
5325
5325
|
return {
|
|
5326
5326
|
x: I.x,
|
|
@@ -5329,33 +5329,33 @@ class xC {
|
|
|
5329
5329
|
scaleY: I.scale_y ?? 1,
|
|
5330
5330
|
rotation: I.rotation ?? 0
|
|
5331
5331
|
};
|
|
5332
|
-
const g = this.getWorldTransform(C.parentId), Q = g.rotation * (Math.PI / 180), B = Math.cos(Q), i = Math.sin(Q), o = I.x * g.scaleX,
|
|
5332
|
+
const g = this.getWorldTransform(C.parentId), Q = g.rotation * (Math.PI / 180), B = Math.cos(Q), i = Math.sin(Q), o = I.x * g.scaleX, h = I.y * g.scaleY, s = g.x + (o * B - h * i), G = g.y + (o * i + h * B);
|
|
5333
5333
|
return {
|
|
5334
|
-
x:
|
|
5335
|
-
y:
|
|
5334
|
+
x: s,
|
|
5335
|
+
y: G,
|
|
5336
5336
|
scaleX: (I.scale_x ?? 1) * g.scaleX,
|
|
5337
5337
|
scaleY: (I.scale_y ?? 1) * g.scaleY,
|
|
5338
5338
|
rotation: g.rotation + (I.rotation ?? 0)
|
|
5339
5339
|
};
|
|
5340
5340
|
}
|
|
5341
5341
|
hitTest(A, I, C) {
|
|
5342
|
-
var
|
|
5342
|
+
var c, t;
|
|
5343
5343
|
if (!this.objectStates.get(A.id)) return !1;
|
|
5344
|
-
const Q = ((
|
|
5345
|
-
return Math.abs(a) <=
|
|
5344
|
+
const Q = ((c = A.geometry) == null ? void 0 : c.width) ?? A.width ?? 100, B = ((t = A.geometry) == null ? void 0 : t.height) ?? A.height ?? 100, i = this.getWorldTransform(A.id), o = I - i.x, h = C - i.y, s = -i.rotation * (Math.PI / 180), G = Math.cos(s), w = Math.sin(s), a = o * G - h * w, N = o * w + h * G, S = i.scaleX, k = i.scaleY, y = Q * Math.abs(S), U = B * Math.abs(k);
|
|
5345
|
+
return Math.abs(a) <= y / 2 && Math.abs(N) <= U / 2;
|
|
5346
5346
|
}
|
|
5347
5347
|
updateSliderValueFromPointer(A, I, C) {
|
|
5348
|
-
var
|
|
5348
|
+
var e;
|
|
5349
5349
|
const g = this.objectStates.get(A.id);
|
|
5350
5350
|
if (!g) return;
|
|
5351
|
-
const Q = A.options || {}, B = ((
|
|
5352
|
-
let
|
|
5353
|
-
|
|
5354
|
-
const
|
|
5355
|
-
let J =
|
|
5356
|
-
t > 0 && (J = Math.round(J / t) * t), J = Math.max(
|
|
5357
|
-
const
|
|
5358
|
-
|
|
5351
|
+
const Q = A.options || {}, B = ((e = A.geometry) == null ? void 0 : e.width) ?? A.width ?? 200, i = this.getWorldTransform(A.id), o = I - i.x, h = C - i.y, s = -i.rotation * (Math.PI / 180), G = Math.cos(s), w = Math.sin(s), a = o * G - h * w, N = Q.thumbWidth ?? 16, S = B - N;
|
|
5352
|
+
let y = (a + S / 2) / S;
|
|
5353
|
+
y = Math.max(0, Math.min(1, y));
|
|
5354
|
+
const U = Q.min ?? 0, c = Q.max ?? 100, t = Q.step || 1;
|
|
5355
|
+
let J = U + y * (c - U);
|
|
5356
|
+
t > 0 && (J = Math.round(J / t) * t), J = Math.max(U, Math.min(c, J));
|
|
5357
|
+
const R = g.options || {};
|
|
5358
|
+
R.value !== J && (g.options = { ...R, value: J }, A.inputId && this.setInternalInput(A.inputId, J), this.onComponentChange && this.onComponentChange({
|
|
5359
5359
|
objectId: A.id,
|
|
5360
5360
|
componentName: A.name,
|
|
5361
5361
|
variant: "slider",
|
|
@@ -5365,35 +5365,35 @@ class xC {
|
|
|
5365
5365
|
}
|
|
5366
5366
|
applyAnimation(A, I) {
|
|
5367
5367
|
A.tracks.forEach((C) => {
|
|
5368
|
-
var o,
|
|
5369
|
-
const g = (o = this.artboard) == null ? void 0 : o.objects.find((
|
|
5370
|
-
if (((
|
|
5368
|
+
var o, h, s;
|
|
5369
|
+
const g = (o = this.artboard) == null ? void 0 : o.objects.find((G) => G.id === C.object_id);
|
|
5370
|
+
if (((h = g == null ? void 0 : g.physics) == null ? void 0 : h.enabled) && g.physics.bodyType !== "Static" && (["x", "y", "rotation"].includes(C.property) || C.property.startsWith("transform.")))
|
|
5371
5371
|
return;
|
|
5372
5372
|
const B = this.objectStates.get(C.object_id);
|
|
5373
5373
|
if (!B) return;
|
|
5374
5374
|
const i = this.interpolate(C.keyframes, I);
|
|
5375
5375
|
if (C.property.includes(".")) {
|
|
5376
|
-
const
|
|
5377
|
-
let
|
|
5378
|
-
for (let a = 0; a <
|
|
5379
|
-
if (typeof
|
|
5376
|
+
const G = (C.property || "").split(".");
|
|
5377
|
+
let w = B;
|
|
5378
|
+
for (let a = 0; a < G.length - 1; a++) {
|
|
5379
|
+
if (typeof w[G[a]] != "object" || w[G[a]] === null) {
|
|
5380
5380
|
let N = g;
|
|
5381
5381
|
for (let S = 0; S <= a; S++)
|
|
5382
|
-
N = N ? N[
|
|
5383
|
-
|
|
5382
|
+
N = N ? N[G[S]] : null;
|
|
5383
|
+
w[G[a]] = N ? JSON.parse(JSON.stringify(N)) : {};
|
|
5384
5384
|
}
|
|
5385
|
-
|
|
5385
|
+
w = w[G[a]];
|
|
5386
5386
|
}
|
|
5387
|
-
|
|
5387
|
+
w[G[G.length - 1]] = i;
|
|
5388
5388
|
} else
|
|
5389
5389
|
B[C.property] = i;
|
|
5390
|
-
if (this.physicsEngine && ((
|
|
5390
|
+
if (this.physicsEngine && ((s = g == null ? void 0 : g.physics) != null && s.enabled) && g.physics.bodyType === "Static")
|
|
5391
5391
|
if (C.property === "x" || C.property === "transform.x") {
|
|
5392
|
-
const
|
|
5393
|
-
|
|
5392
|
+
const G = this.physicsEngine.getPosition(C.object_id);
|
|
5393
|
+
G && this.physicsEngine.setPosition(C.object_id, i, G.y);
|
|
5394
5394
|
} else if (C.property === "y" || C.property === "transform.y") {
|
|
5395
|
-
const
|
|
5396
|
-
|
|
5395
|
+
const G = this.physicsEngine.getPosition(C.object_id);
|
|
5396
|
+
G && this.physicsEngine.setPosition(C.object_id, G.x, i);
|
|
5397
5397
|
} else (C.property === "rotation" || C.property === "transform.rotation") && this.physicsEngine.setRotation(C.object_id, i * (Math.PI / 180));
|
|
5398
5398
|
});
|
|
5399
5399
|
}
|
|
@@ -5415,29 +5415,29 @@ class xC {
|
|
|
5415
5415
|
return !isNaN(i) && !isNaN(o) ? Math.round(i + (o - i) * B).toString() : C.value;
|
|
5416
5416
|
}
|
|
5417
5417
|
return Array.isArray(C.value) && Array.isArray(g.value) ? C.value.length === g.value.length ? C.value.map((i, o) => {
|
|
5418
|
-
const
|
|
5419
|
-
return typeof i == "number" && typeof
|
|
5418
|
+
const h = g.value[o];
|
|
5419
|
+
return typeof i == "number" && typeof h == "number" ? i + (h - i) * B : B < 0.5 ? i : h;
|
|
5420
5420
|
}) : B < 0.5 ? C.value : g.value : typeof C.value == "object" && typeof g.value == "object" && C.value !== null && g.value !== null ? C.value.type && g.value.type ? this.interpolateFill(C.value, g.value, B) : B < 0.5 ? C.value : g.value : typeof C.value == "number" && typeof g.value == "number" ? C.value + (g.value - C.value) * B : B < 0.5 ? C.value : g.value;
|
|
5421
5421
|
}
|
|
5422
5422
|
interpolateColor(A, I, C) {
|
|
5423
5423
|
var N, S;
|
|
5424
|
-
const g = ((S = (N = this.artboard) == null ? void 0 : N.tokens) == null ? void 0 : S.colors) || {}, Q = g[A] || A, B = g[I] || I, i = (
|
|
5425
|
-
if (!
|
|
5426
|
-
const
|
|
5427
|
-
return
|
|
5428
|
-
r: parseInt(
|
|
5429
|
-
g: parseInt(
|
|
5430
|
-
b: parseInt(
|
|
5424
|
+
const g = ((S = (N = this.artboard) == null ? void 0 : N.tokens) == null ? void 0 : S.colors) || {}, Q = g[A] || A, B = g[I] || I, i = (k) => {
|
|
5425
|
+
if (!k) return { r: 0, g: 0, b: 0 };
|
|
5426
|
+
const y = k.startsWith("#") ? k.replace("#", "") : "000000";
|
|
5427
|
+
return y.length === 3 ? {
|
|
5428
|
+
r: parseInt(y[0] + y[0], 16),
|
|
5429
|
+
g: parseInt(y[1] + y[1], 16),
|
|
5430
|
+
b: parseInt(y[2] + y[2], 16)
|
|
5431
5431
|
} : {
|
|
5432
|
-
r: parseInt(
|
|
5433
|
-
g: parseInt(
|
|
5434
|
-
b: parseInt(
|
|
5432
|
+
r: parseInt(y.substring(0, 2), 16),
|
|
5433
|
+
g: parseInt(y.substring(2, 4), 16),
|
|
5434
|
+
b: parseInt(y.substring(4, 6), 16)
|
|
5435
5435
|
};
|
|
5436
|
-
}, o = i(Q),
|
|
5437
|
-
const
|
|
5438
|
-
return
|
|
5436
|
+
}, o = i(Q), h = i(B), s = Math.round(o.r + (h.r - o.r) * C), G = Math.round(o.g + (h.g - o.g) * C), w = Math.round(o.b + (h.b - o.b) * C), a = (k) => {
|
|
5437
|
+
const y = Math.max(0, Math.min(255, k)).toString(16);
|
|
5438
|
+
return y.length === 1 ? "0" + y : y;
|
|
5439
5439
|
};
|
|
5440
|
-
return `#${a(
|
|
5440
|
+
return `#${a(s)}${a(G)}${a(w)}`;
|
|
5441
5441
|
}
|
|
5442
5442
|
interpolateStops(A, I, C) {
|
|
5443
5443
|
return !A || !I || A.length !== I.length ? C < 0.5 ? A : I : A.map((g, Q) => {
|
|
@@ -5476,101 +5476,100 @@ class xC {
|
|
|
5476
5476
|
this.layout.alignment
|
|
5477
5477
|
);
|
|
5478
5478
|
if (A.save(), A.translate(B.tx, B.ty), A.scale(B.scaleX, B.scaleY), A.translate(g / 2, Q / 2), this.artboard.backgroundVisible !== !1 && (A.fillStyle = this.artboard.backgroundColor || "#000000", A.fillRect(-g / 2, -Q / 2, g, Q)), this.artboard.backgroundImage) {
|
|
5479
|
-
const
|
|
5480
|
-
let
|
|
5481
|
-
if (
|
|
5482
|
-
A.save(), A.globalAlpha = this.artboard.backgroundOpacity ??
|
|
5483
|
-
const
|
|
5484
|
-
let a, N, S,
|
|
5485
|
-
|
|
5479
|
+
const h = this.artboard.backgroundImage;
|
|
5480
|
+
let s = this.imageCache.get(h);
|
|
5481
|
+
if (s || (s = new Image(), s.src = h, this.imageCache.set(h, s)), s.complete && s.naturalWidth > 0) {
|
|
5482
|
+
A.save(), A.globalAlpha = this.normalizeOpacity(this.artboard.backgroundOpacity ?? 100);
|
|
5483
|
+
const G = s.naturalWidth / s.naturalHeight, w = g / Q;
|
|
5484
|
+
let a, N, S, k;
|
|
5485
|
+
w > G ? (a = g, N = g / G) : (N = Q, a = Q * G), S = -a / 2, k = -N / 2, A.drawImage(s, S, k, a, N), A.restore();
|
|
5486
5486
|
}
|
|
5487
5487
|
}
|
|
5488
5488
|
A.beginPath(), A.rect(-g / 2, -Q / 2, g, Q), A.clip();
|
|
5489
5489
|
const i = /* @__PURE__ */ new Map();
|
|
5490
|
-
this.artboard.objects.forEach((
|
|
5490
|
+
this.artboard.objects.forEach((h) => i.set(h.id, h));
|
|
5491
5491
|
let o = 0;
|
|
5492
|
-
for (this.artboard.objects.forEach((
|
|
5493
|
-
var
|
|
5494
|
-
if (!
|
|
5495
|
-
const
|
|
5496
|
-
if (a && a.isMask && (
|
|
5497
|
-
A.save(), this.applyObjectTransform(A,
|
|
5498
|
-
const N = (a == null ? void 0 : a.width) || ((
|
|
5492
|
+
for (this.artboard.objects.forEach((h) => {
|
|
5493
|
+
var s, G;
|
|
5494
|
+
if (!h.parentId) {
|
|
5495
|
+
const w = this.objectStates.get(h.id), a = (w == null ? void 0 : w.geometry) || h.geometry;
|
|
5496
|
+
if (a && a.isMask && (w == null ? void 0 : w.visible) !== !1) {
|
|
5497
|
+
A.save(), this.applyObjectTransform(A, h.id);
|
|
5498
|
+
const N = (a == null ? void 0 : a.width) || ((s = h.geometry) == null ? void 0 : s.width) || h.width || 0, S = (a == null ? void 0 : a.height) || ((G = h.geometry) == null ? void 0 : G.height) || h.height || 0;
|
|
5499
5499
|
this.applyPath(A, a, N, S), A.clip(), o++;
|
|
5500
5500
|
} else
|
|
5501
|
-
this.renderObject(A,
|
|
5501
|
+
this.renderObject(A, h, i);
|
|
5502
5502
|
}
|
|
5503
5503
|
}); o > 0; )
|
|
5504
5504
|
A.restore(), o--;
|
|
5505
5505
|
A.restore();
|
|
5506
5506
|
}
|
|
5507
5507
|
calculateTransform(A, I, C, g, Q, B) {
|
|
5508
|
-
let i = 1, o = 1,
|
|
5509
|
-
const
|
|
5508
|
+
let i = 1, o = 1, h = 1;
|
|
5509
|
+
const s = C / g, G = A / I;
|
|
5510
5510
|
switch (Q) {
|
|
5511
5511
|
case "Contain":
|
|
5512
|
-
|
|
5512
|
+
G > s ? h = I / g : h = A / C, i = o = h;
|
|
5513
5513
|
break;
|
|
5514
5514
|
case "Cover":
|
|
5515
|
-
|
|
5515
|
+
G > s ? h = A / C : h = I / g, i = o = h;
|
|
5516
5516
|
break;
|
|
5517
5517
|
case "Fill":
|
|
5518
5518
|
i = A / C, o = I / g;
|
|
5519
5519
|
break;
|
|
5520
5520
|
case "FitWidth":
|
|
5521
|
-
|
|
5521
|
+
h = A / C, i = o = h;
|
|
5522
5522
|
break;
|
|
5523
5523
|
case "FitHeight":
|
|
5524
|
-
|
|
5524
|
+
h = I / g, i = o = h;
|
|
5525
5525
|
break;
|
|
5526
5526
|
case "None":
|
|
5527
5527
|
i = o = 1;
|
|
5528
5528
|
break;
|
|
5529
5529
|
case "ScaleDown":
|
|
5530
|
-
|
|
5530
|
+
h = Math.min(A / C, I / g), h > 1 && (h = 1), i = o = h;
|
|
5531
5531
|
break;
|
|
5532
5532
|
default:
|
|
5533
5533
|
i = o = 1;
|
|
5534
5534
|
break;
|
|
5535
5535
|
}
|
|
5536
|
-
const
|
|
5536
|
+
const w = C * i, a = g * o;
|
|
5537
5537
|
let N = 0, S = 0;
|
|
5538
|
-
return B.includes("Left") ? N = 0 : B.includes("Right") ? N = A -
|
|
5538
|
+
return B.includes("Left") ? N = 0 : B.includes("Right") ? N = A - w : N = (A - w) / 2, B.includes("Top") ? S = 0 : B.includes("Bottom") ? S = I - a : S = (I - a) / 2, { scaleX: i, scaleY: o, tx: N, ty: S };
|
|
5539
5539
|
}
|
|
5540
5540
|
mapFontWeight(A) {
|
|
5541
5541
|
const I = A.toLowerCase();
|
|
5542
5542
|
return /^\d+$/.test(I) ? I : I.includes("thin") ? "100" : I.includes("extra light") || I.includes("extralight") ? "200" : I.includes("light") ? "300" : I.includes("medium") ? "500" : I.includes("semibold") || I.includes("semi bold") ? "600" : I.includes("bold") ? "700" : I.includes("extra bold") || I.includes("extrabold") ? "800" : I.includes("black") || I.includes("heavy") ? "900" : "400";
|
|
5543
5543
|
}
|
|
5544
5544
|
renderObject(A, I, C) {
|
|
5545
|
-
var
|
|
5545
|
+
var U, c, t;
|
|
5546
5546
|
const g = this.objectStates.get(I.id);
|
|
5547
5547
|
if (!g) {
|
|
5548
5548
|
console.warn("No state for object:", I.id);
|
|
5549
5549
|
return;
|
|
5550
5550
|
}
|
|
5551
|
-
A.roundRect || (A.roundRect = (J,
|
|
5551
|
+
A.roundRect || (A.roundRect = (J, R, e, Y, r) => (this.drawRoundRect(A, J, R, e, Y, r), A));
|
|
5552
5552
|
const Q = g.geometry ? { ...I.geometry, ...g.geometry } : I.geometry, B = g.style ? { ...I.style, ...g.style } : I.style;
|
|
5553
|
-
let i = (Q == null ? void 0 : Q.width) || ((
|
|
5553
|
+
let i = (Q == null ? void 0 : Q.width) || ((U = I.geometry) == null ? void 0 : U.width) || I.width || 0, o = (Q == null ? void 0 : Q.height) || ((c = I.geometry) == null ? void 0 : c.height) || I.height || 0;
|
|
5554
5554
|
if ((i === 0 || o === 0) && (Q != null && Q.points) && Array.isArray(Q.points) && Q.points.length > 0) {
|
|
5555
|
-
let J = 1 / 0,
|
|
5555
|
+
let J = 1 / 0, R = -1 / 0, e = 1 / 0, Y = -1 / 0;
|
|
5556
5556
|
Q.points.forEach((r) => {
|
|
5557
|
-
J = Math.min(J, r.x),
|
|
5558
|
-
}), i === 0 && (i =
|
|
5557
|
+
J = Math.min(J, r.x), R = Math.max(R, r.x), e = Math.min(e, r.y), Y = Math.max(Y, r.y);
|
|
5558
|
+
}), i === 0 && (i = R - J), o === 0 && (o = Y - e);
|
|
5559
5559
|
}
|
|
5560
|
-
const
|
|
5561
|
-
if (
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
if (delete h.cornerRadius, h.corner_radius = G, g.visible === !1)
|
|
5560
|
+
const h = (J) => {
|
|
5561
|
+
if (J)
|
|
5562
|
+
return J.corner_radius ?? J.cornerRadius;
|
|
5563
|
+
}, s = h(g) ?? h(B) ?? h(Q) ?? h(I.style) ?? h(I.geometry) ?? 0, G = { ...Q, width: i, height: o };
|
|
5564
|
+
if (delete G.cornerRadius, G.corner_radius = s, g.visible === !1)
|
|
5566
5565
|
return;
|
|
5567
|
-
const
|
|
5566
|
+
const w = g.x, a = g.y;
|
|
5568
5567
|
A.save();
|
|
5569
|
-
const N = A.globalAlpha, S = g.opacity !== void 0 ? g.opacity :
|
|
5568
|
+
const N = A.globalAlpha, S = this.normalizeOpacity(g.opacity !== void 0 ? g.opacity : 100);
|
|
5570
5569
|
A.globalAlpha = N * S;
|
|
5571
|
-
const
|
|
5572
|
-
if (
|
|
5573
|
-
const J =
|
|
5570
|
+
const k = g.compositeOperation || g.blendMode;
|
|
5571
|
+
if (k && k !== "Normal") {
|
|
5572
|
+
const J = k.toLowerCase();
|
|
5574
5573
|
[
|
|
5575
5574
|
"multiply",
|
|
5576
5575
|
"screen",
|
|
@@ -5602,23 +5601,23 @@ class xC {
|
|
|
5602
5601
|
"screen"
|
|
5603
5602
|
].includes(J) && (A.globalCompositeOperation = J);
|
|
5604
5603
|
}
|
|
5605
|
-
if (A.translate(
|
|
5604
|
+
if (A.translate(w, a), A.rotate(g.rotation * Math.PI / 180), A.scale(g.scale_x, g.scale_y), Q.type === "Text") {
|
|
5606
5605
|
let J = Q.text || "";
|
|
5607
5606
|
if (Q.textInputId) {
|
|
5608
5607
|
const p = this.inputs.get(Q.textInputId);
|
|
5609
5608
|
p !== void 0 && (J = String(p), g.geometry && g.geometry.type === "Text" && (g.geometry.text = J));
|
|
5610
5609
|
}
|
|
5611
|
-
let
|
|
5612
|
-
Q.segments && Array.isArray(Q.segments) && (
|
|
5613
|
-
const
|
|
5614
|
-
|
|
5615
|
-
let
|
|
5616
|
-
|
|
5617
|
-
const L = this.mapFontWeight(
|
|
5610
|
+
let R = J || "";
|
|
5611
|
+
Q.segments && Array.isArray(Q.segments) && (R = Q.segments.map((p) => p && p.text ? p.text : "").join(""));
|
|
5612
|
+
const e = Q.textCase || "none";
|
|
5613
|
+
e === "uppercase" ? R = R.toUpperCase() : e === "lowercase" ? R = R.toLowerCase() : e === "capitalize" && (R = R.replace(/\b\w/g, (p) => p.toUpperCase()));
|
|
5614
|
+
let Y = ((t = Q.fontWeight) == null ? void 0 : t.toString()) || "400", r = "normal";
|
|
5615
|
+
Y.toLowerCase().includes("italic") && (r = "italic", Y = Y.replace(/italic/gi, "").trim() || "400");
|
|
5616
|
+
const L = this.mapFontWeight(Y), b = Math.max(1, Q.fontSize || 16);
|
|
5618
5617
|
A.font = `${r} ${L} ${b}px "${Q.fontFamily || "Inter"}", sans-serif`;
|
|
5619
|
-
const
|
|
5618
|
+
const P = Q.textVerticalAlign || "top";
|
|
5620
5619
|
let IA = -o / 2;
|
|
5621
|
-
|
|
5620
|
+
P === "middle" || P === "center" ? (A.textBaseline = "middle", IA = 0) : P === "bottom" ? (A.textBaseline = "bottom", IA = o / 2) : (A.textBaseline = "top", IA = -o / 2);
|
|
5622
5621
|
const m = Q.textAlign || "left";
|
|
5623
5622
|
A.textAlign = m;
|
|
5624
5623
|
let QA = -i / 2;
|
|
@@ -5629,7 +5628,7 @@ class xC {
|
|
|
5629
5628
|
for (let d = 0; d < p.length; d++)
|
|
5630
5629
|
iA += A.measureText(p[d]).width + _;
|
|
5631
5630
|
return iA - _;
|
|
5632
|
-
},
|
|
5631
|
+
}, q = [], W = String(R || "").split(`
|
|
5633
5632
|
`);
|
|
5634
5633
|
W.forEach((p, iA) => {
|
|
5635
5634
|
const d = String(p || "").split(" ");
|
|
@@ -5651,30 +5650,30 @@ class xC {
|
|
|
5651
5650
|
}
|
|
5652
5651
|
if (sA !== -1) {
|
|
5653
5652
|
const oA = x.substring(0, sA + 1), NA = x.substring(sA + 1);
|
|
5654
|
-
|
|
5653
|
+
q.push({ text: l + oA, isParaEnd: !1 }), l = "", d[Z] = NA, Z--;
|
|
5655
5654
|
continue;
|
|
5656
5655
|
} else {
|
|
5657
|
-
|
|
5656
|
+
q.push({ text: l.trim(), isParaEnd: !1 }), l = "", Z--;
|
|
5658
5657
|
continue;
|
|
5659
5658
|
}
|
|
5660
5659
|
}
|
|
5661
5660
|
let hA = "";
|
|
5662
5661
|
for (let sA = 0; sA < x.length; sA++) {
|
|
5663
5662
|
const oA = hA + x[sA];
|
|
5664
|
-
O(oA) > gA && hA !== "" ? (
|
|
5663
|
+
O(oA) > gA && hA !== "" ? (q.push({ text: hA, isParaEnd: !1 }), hA = x[sA]) : hA = oA;
|
|
5665
5664
|
}
|
|
5666
5665
|
l = hA + " ";
|
|
5667
5666
|
}
|
|
5668
5667
|
}
|
|
5669
|
-
|
|
5668
|
+
q.push({ text: l.trim(), isParaEnd: iA < W.length - 1 });
|
|
5670
5669
|
});
|
|
5671
|
-
let f = IA, T =
|
|
5670
|
+
let f = IA, T = q.length * X;
|
|
5672
5671
|
if (BA > 0) {
|
|
5673
|
-
const p =
|
|
5672
|
+
const p = q.filter((iA, d) => iA.isParaEnd && d < q.length - 1).length;
|
|
5674
5673
|
T += p * BA;
|
|
5675
5674
|
}
|
|
5676
|
-
|
|
5677
|
-
const
|
|
5675
|
+
P === "middle" || P === "center" ? f -= T / 2 - b / 2 : P === "bottom" && (f -= T - b);
|
|
5676
|
+
const V = (p, iA, d, l, Z) => {
|
|
5678
5677
|
var x, aA;
|
|
5679
5678
|
if (_ === 0 && (Q.enableSegments !== !0 || !Q.segments || Q.segments.length === 0))
|
|
5680
5679
|
l ? A.strokeText(p, iA, d) : A.fillText(p, iA, d);
|
|
@@ -5710,124 +5709,131 @@ class xC {
|
|
|
5710
5709
|
};
|
|
5711
5710
|
if (B.fill) {
|
|
5712
5711
|
const p = A.globalAlpha, iA = this.createCanvasFill(A, B.fill, i, o);
|
|
5713
|
-
A.fillStyle = iA || B.fill.color || "#000000", A.globalAlpha = p * (B.fill.opacity ??
|
|
5712
|
+
A.fillStyle = iA || B.fill.color || "#000000", A.globalAlpha = p * this.normalizeOpacity(B.fill.opacity ?? 100);
|
|
5714
5713
|
let d = 0, l = f;
|
|
5715
|
-
|
|
5716
|
-
const x =
|
|
5717
|
-
x !== -1 && (
|
|
5714
|
+
q.forEach((Z) => {
|
|
5715
|
+
const x = R.indexOf(Z.text, d);
|
|
5716
|
+
x !== -1 && (V(Z.text, QA, l, !1, x), d = x + Z.text.length, l += X + (Z.isParaEnd ? BA : 0));
|
|
5718
5717
|
}), A.globalAlpha = p;
|
|
5719
5718
|
}
|
|
5720
5719
|
if (B.stroke && B.stroke.width > 0) {
|
|
5721
5720
|
const p = A.globalAlpha;
|
|
5722
|
-
A.strokeStyle = B.stroke.color, A.lineWidth = B.stroke.width, A.globalAlpha = p * (B.stroke.opacity ??
|
|
5721
|
+
A.strokeStyle = B.stroke.color, A.lineWidth = B.stroke.width, A.globalAlpha = p * this.normalizeOpacity(B.stroke.opacity ?? 100);
|
|
5723
5722
|
let iA = 0, d = f;
|
|
5724
|
-
|
|
5725
|
-
const Z =
|
|
5726
|
-
Z !== -1 && (
|
|
5723
|
+
q.forEach((l) => {
|
|
5724
|
+
const Z = R.indexOf(l.text, iA);
|
|
5725
|
+
Z !== -1 && (V(l.text, QA, d, !0, Z), iA = Z + l.text.length, d += X + (l.isParaEnd ? BA : 0));
|
|
5727
5726
|
}), A.globalAlpha = p;
|
|
5728
5727
|
}
|
|
5729
5728
|
} else if (Q.type === "Image") {
|
|
5730
5729
|
const J = Q.src;
|
|
5731
5730
|
if (J) {
|
|
5732
|
-
let
|
|
5733
|
-
|
|
5734
|
-
},
|
|
5731
|
+
let R = this.imageCache.get(J);
|
|
5732
|
+
R || (R = new Image(), R.onload = () => {
|
|
5733
|
+
}, R.onerror = () => {
|
|
5735
5734
|
console.error(`[ExodeUI] Image load failed: ${J.substring(0, 100)}${J.length > 100 ? "..." : ""}`);
|
|
5736
|
-
},
|
|
5735
|
+
}, R.src = J, this.imageCache.set(J, R)), R.complete && R.naturalWidth > 0 && (s !== 0 ? (A.save(), this.drawRoundRect(A, -i / 2, -o / 2, i, o, s), A.clip(), A.drawImage(R, -i / 2, -o / 2, i, o), A.restore()) : A.drawImage(R, -i / 2, -o / 2, i, o));
|
|
5737
5736
|
}
|
|
5738
5737
|
} else if (Q.type === "SVG") {
|
|
5739
5738
|
const J = Q.svgContent;
|
|
5740
5739
|
if (J) {
|
|
5741
|
-
const
|
|
5742
|
-
let
|
|
5743
|
-
if (!
|
|
5744
|
-
|
|
5740
|
+
const R = B.palette || [], e = I.id + "_" + R.join("_");
|
|
5741
|
+
let Y = this.imageCache.get(e);
|
|
5742
|
+
if (!Y) {
|
|
5743
|
+
Y = new Image();
|
|
5745
5744
|
let r = J;
|
|
5746
|
-
Q.colors && Q.colors.length > 0 &&
|
|
5747
|
-
if (
|
|
5748
|
-
const m =
|
|
5749
|
-
r = r.replace(QA,
|
|
5745
|
+
Q.colors && Q.colors.length > 0 && R.length > 0 && Q.colors.forEach((P, IA) => {
|
|
5746
|
+
if (R[IA]) {
|
|
5747
|
+
const m = P.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), QA = new RegExp(m, "gi");
|
|
5748
|
+
r = r.replace(QA, R[IA]);
|
|
5750
5749
|
}
|
|
5751
5750
|
});
|
|
5752
5751
|
const L = new Blob([r], { type: "image/svg+xml" }), b = URL.createObjectURL(L);
|
|
5753
|
-
|
|
5752
|
+
Y.onload = () => {
|
|
5754
5753
|
this.artboard && this.reset();
|
|
5755
|
-
},
|
|
5754
|
+
}, Y.src = b, this.imageCache.set(e, Y);
|
|
5756
5755
|
}
|
|
5757
|
-
|
|
5756
|
+
Y.complete && Y.naturalWidth > 0 && (s !== 0 ? (A.save(), this.drawRoundRect(A, -i / 2, -o / 2, i, o, s), A.clip(), A.drawImage(Y, -i / 2, -o / 2, i, o), A.restore()) : A.drawImage(Y, -i / 2, -o / 2, i, o));
|
|
5758
5757
|
}
|
|
5759
|
-
} else if (
|
|
5760
|
-
this.renderLineGraph(A,
|
|
5758
|
+
} else if (G.type === "LineGraph")
|
|
5759
|
+
this.renderLineGraph(A, G, i, o);
|
|
5761
5760
|
else if (I.type === "Shape") {
|
|
5762
|
-
if (this.applyPath(A,
|
|
5763
|
-
const J = B.shadow.color || "#000000",
|
|
5764
|
-
let
|
|
5761
|
+
if (this.applyPath(A, G, i, o, s), A.save(), B.shadow && B.shadow.opacity > 0) {
|
|
5762
|
+
const J = B.shadow.color || "#000000", R = B.shadow.opacity ?? 1;
|
|
5763
|
+
let e = J;
|
|
5765
5764
|
if (J.startsWith("#")) {
|
|
5766
|
-
const
|
|
5767
|
-
|
|
5768
|
-
} else J.startsWith("rgba") && (
|
|
5769
|
-
A.shadowColor =
|
|
5765
|
+
const Y = parseInt(J.slice(1, 3), 16), r = parseInt(J.slice(3, 5), 16), L = parseInt(J.slice(5, 7), 16);
|
|
5766
|
+
e = `rgba(${Y}, ${r}, ${L}, ${R})`;
|
|
5767
|
+
} else J.startsWith("rgba") && (e = J.replace(/[\d.]+\)$/g, `${R})`));
|
|
5768
|
+
A.shadowColor = e, A.shadowBlur = B.shadow.blur, A.shadowOffsetX = B.shadow.offsetX, A.shadowOffsetY = B.shadow.offsetY;
|
|
5770
5769
|
}
|
|
5771
5770
|
if (B.blur && B.blur.amount > 0 && (A.filter = `blur(${B.blur.amount}px)`), B.fill) {
|
|
5772
|
-
const J = A.globalAlpha,
|
|
5773
|
-
|
|
5771
|
+
const J = A.globalAlpha, R = this.createCanvasFill(A, B.fill, i, o);
|
|
5772
|
+
R ? A.fillStyle = R : A.fillStyle = B.fill.color || "transparent", A.globalAlpha = J * this.normalizeOpacity(B.fill.opacity ?? 100), A.fill(), A.globalAlpha = J;
|
|
5774
5773
|
}
|
|
5775
|
-
A.restore(), B.stroke && B.stroke.width > 0 && this.applyStrokeAlignment(A, B,
|
|
5774
|
+
A.restore(), B.stroke && B.stroke.width > 0 && this.applyStrokeAlignment(A, B, G, i, o);
|
|
5776
5775
|
} else if (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) {
|
|
5777
|
-
const J = g.width ?? Q.width ?? I.width ?? i,
|
|
5776
|
+
const J = g.width ?? Q.width ?? I.width ?? i, R = g.height ?? Q.height ?? I.height ?? o, e = s;
|
|
5778
5777
|
if (A.save(), B.shadow && B.shadow.opacity > 0) {
|
|
5779
5778
|
const r = B.shadow.color || "#000000", L = B.shadow.opacity ?? 1;
|
|
5780
5779
|
let b = r;
|
|
5781
5780
|
if (r.startsWith("#")) {
|
|
5782
|
-
const
|
|
5783
|
-
b = `rgba(${
|
|
5781
|
+
const P = parseInt(r.slice(1, 3), 16), IA = parseInt(r.slice(3, 5), 16), m = parseInt(r.slice(5, 7), 16);
|
|
5782
|
+
b = `rgba(${P}, ${IA}, ${m}, ${L})`;
|
|
5784
5783
|
}
|
|
5785
5784
|
A.shadowColor = b, A.shadowBlur = B.shadow.blur, A.shadowOffsetX = B.shadow.offsetX, A.shadowOffsetY = B.shadow.offsetY;
|
|
5786
5785
|
}
|
|
5787
|
-
if (A.beginPath(), this.drawRoundRect(A, -J / 2, -
|
|
5788
|
-
const r = A.globalAlpha, L = this.createCanvasFill(A, B.fill, J,
|
|
5789
|
-
A.fillStyle = L || B.fill.color || "transparent", A.globalAlpha = r * (B.fill.opacity ??
|
|
5786
|
+
if (A.beginPath(), this.drawRoundRect(A, -J / 2, -R / 2, J, R, e), B.fill && B.fill.type !== "None") {
|
|
5787
|
+
const r = A.globalAlpha, L = this.createCanvasFill(A, B.fill, J, R);
|
|
5788
|
+
A.fillStyle = L || B.fill.color || "transparent", A.globalAlpha = r * this.normalizeOpacity(B.fill.opacity ?? 100), A.fill(), A.globalAlpha = r;
|
|
5790
5789
|
}
|
|
5791
5790
|
if (A.restore(), B.stroke && B.stroke.width > 0 && B.stroke.isEnabled !== !1) {
|
|
5792
|
-
const r = { type: "Rectangle"
|
|
5793
|
-
this.applyStrokeAlignment(A, B, r, J,
|
|
5791
|
+
const r = { type: "Rectangle" };
|
|
5792
|
+
this.applyStrokeAlignment(A, B, r, J, R, e);
|
|
5794
5793
|
}
|
|
5795
|
-
(I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), this.drawRoundRect(A, -J / 2, -
|
|
5794
|
+
(I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), this.drawRoundRect(A, -J / 2, -R / 2, J, R, e), A.clip());
|
|
5796
5795
|
} 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 === "Toggle" || I.type === "Component" && I.variant === "toggle" ? this.renderToggle(A, I) : I.type === "Slider" || I.type === "Component" && I.variant === "slider" ? this.renderSlider(A, I) : I.type === "Dropdown" || I.type === "Component" && I.variant === "dropdown" ? this.renderDropdown(A, I) : (I.type === "ListView" || I.type === "Component" && I.variant === "listview") && this.renderListView(A, I);
|
|
5797
|
-
const
|
|
5796
|
+
const y = (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) && (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0;
|
|
5798
5797
|
if (I.children && I.children.length > 0) {
|
|
5799
5798
|
let J = 0;
|
|
5800
|
-
for (I.children.forEach((
|
|
5801
|
-
const
|
|
5802
|
-
if (!
|
|
5803
|
-
const
|
|
5804
|
-
if (r && r.isMask && (
|
|
5799
|
+
for (I.children.forEach((R) => {
|
|
5800
|
+
const e = C.get(R);
|
|
5801
|
+
if (!e) return;
|
|
5802
|
+
const Y = this.objectStates.get(R), r = (Y == null ? void 0 : Y.geometry) || e.geometry;
|
|
5803
|
+
if (r && r.isMask && (Y == null ? void 0 : Y.visible) !== !1) {
|
|
5805
5804
|
const L = r.width || 0, b = r.height || 0;
|
|
5806
|
-
this.applyObjectTransform(A,
|
|
5805
|
+
this.applyObjectTransform(A, R);
|
|
5806
|
+
const P = (Y == null ? void 0 : Y.corner_radius) ?? (r == null ? void 0 : r.corner_radius) ?? 0;
|
|
5807
|
+
this.applyPath(A, r, L, b, P), A.clip(), J++;
|
|
5807
5808
|
} else
|
|
5808
|
-
this.renderObject(A,
|
|
5809
|
+
this.renderObject(A, e, C);
|
|
5809
5810
|
}); J > 0; )
|
|
5810
5811
|
A.restore(), J--;
|
|
5811
5812
|
}
|
|
5812
|
-
|
|
5813
|
+
y && A.restore(), A.restore();
|
|
5813
5814
|
}
|
|
5814
|
-
applyStrokeAlignment(A, I, C, g, Q) {
|
|
5815
|
+
applyStrokeAlignment(A, I, C, g, Q, B) {
|
|
5815
5816
|
if (!I.stroke || I.stroke.width <= 0 || I.stroke.isEnabled === !1) return;
|
|
5816
|
-
const
|
|
5817
|
-
A.save(),
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5817
|
+
const i = A.globalAlpha, o = I.stroke.width, h = I.stroke.alignment || "center", s = I.stroke;
|
|
5818
|
+
if (A.save(), s.fill) {
|
|
5819
|
+
const k = this.createCanvasFill(A, s.fill, g, Q);
|
|
5820
|
+
k ? A.strokeStyle = k : A.strokeStyle = s.color || "#000000";
|
|
5821
|
+
} else
|
|
5822
|
+
A.strokeStyle = s.color || "#000000";
|
|
5823
|
+
A.globalAlpha = i * this.normalizeOpacity(s.opacity ?? 100), A.lineCap = s.lineCap || "round", A.lineJoin = s.lineJoin || "round", s.miterLimit !== void 0 && (A.miterLimit = s.miterLimit);
|
|
5824
|
+
const G = s.trimStart ?? 0, w = s.trimEnd ?? 1, a = s.trimOffset ?? 0, N = s.dashOffset ?? 0, S = s.dashArray || [];
|
|
5825
|
+
if (G !== 0 || w !== 1 || a !== 0) {
|
|
5826
|
+
const k = this.getPerimeter(C, g, Q);
|
|
5827
|
+
if (k > 0) {
|
|
5828
|
+
const y = Math.max(0, Math.min(1, G)), U = Math.max(0, Math.min(1, w));
|
|
5829
|
+
if (y < U) {
|
|
5830
|
+
const c = k * (U - y), t = k - c, J = -(k * (y + a % 1 + N % 1));
|
|
5831
|
+
A.setLineDash([c, t]), A.lineDashOffset = J;
|
|
5826
5832
|
} else
|
|
5827
|
-
A.setLineDash([0,
|
|
5833
|
+
A.setLineDash([0, k]);
|
|
5828
5834
|
}
|
|
5829
|
-
} else
|
|
5830
|
-
|
|
5835
|
+
} else S.length > 0 && (A.setLineDash(S), A.lineDashOffset = N);
|
|
5836
|
+
h === "inside" ? (A.lineWidth = o * 2, this.applyPath(A, C, g, Q, B), A.clip(), A.stroke()) : h === "outside" ? (A.lineWidth = o * 2, this.applyPath(A, C, g, Q, B), A.stroke(), A.save(), A.globalCompositeOperation = "destination-out", this.applyPath(A, C, g, Q, B), A.fill(), A.restore()) : (A.lineWidth = o, this.applyPath(A, C, g, Q, B), A.stroke()), A.restore(), A.globalAlpha = i;
|
|
5831
5837
|
}
|
|
5832
5838
|
getPerimeter(A, I, C) {
|
|
5833
5839
|
switch (A.type) {
|
|
@@ -5869,70 +5875,73 @@ class xC {
|
|
|
5869
5875
|
}
|
|
5870
5876
|
applyObjectTransform(A, I) {
|
|
5871
5877
|
const C = this.objectStates.get(I);
|
|
5872
|
-
|
|
5878
|
+
if (!C) return;
|
|
5879
|
+
A.translate(C.x, C.y), A.rotate(C.rotation * Math.PI / 180);
|
|
5880
|
+
const g = (C.scale_x ?? 1) * (C.flip_x === !0 ? -1 : 1), Q = (C.scale_y ?? 1) * (C.flip_y === !0 ? -1 : 1);
|
|
5881
|
+
A.scale(g, Q);
|
|
5882
|
+
}
|
|
5883
|
+
applyPath(A, I, C, g, Q) {
|
|
5884
|
+
A.beginPath(), this._tracePath(A, I, C, g, Q);
|
|
5873
5885
|
}
|
|
5874
|
-
_tracePath(A, I, C, g) {
|
|
5886
|
+
_tracePath(A, I, C, g, Q) {
|
|
5875
5887
|
if (I.type === "Rectangle") {
|
|
5876
|
-
const
|
|
5877
|
-
this.drawRoundRect(A, -C / 2, -g / 2, C, g,
|
|
5888
|
+
const B = Q !== void 0 ? Q : I.corner_radius ?? 0;
|
|
5889
|
+
this.drawRoundRect(A, -C / 2, -g / 2, C, g, B);
|
|
5878
5890
|
} else if (I.type === "Ellipse")
|
|
5879
5891
|
A.ellipse(0, 0, C / 2, g / 2, 0, 0, Math.PI * 2);
|
|
5880
5892
|
else if (I.type === "Triangle")
|
|
5881
5893
|
A.moveTo(0, -g / 2), A.lineTo(C / 2, g / 2), A.lineTo(-C / 2, g / 2), A.closePath();
|
|
5882
5894
|
else if (I.type === "Star") {
|
|
5883
|
-
const
|
|
5884
|
-
for (let
|
|
5885
|
-
const
|
|
5886
|
-
|
|
5895
|
+
const B = I.inner_radius || 20, i = I.outer_radius || 50, o = I.points || 5;
|
|
5896
|
+
for (let h = 0; h < o * 2; h++) {
|
|
5897
|
+
const s = h * Math.PI / o - Math.PI / 2, G = h % 2 === 0 ? i : B, w = G * Math.cos(s), a = G * Math.sin(s);
|
|
5898
|
+
h === 0 ? A.moveTo(w, a) : A.lineTo(w, a);
|
|
5887
5899
|
}
|
|
5888
5900
|
A.closePath();
|
|
5889
5901
|
} else if ((I.type === "Path" || I.type === "Subtract" || I.type === "Union" || I.type === "Intersect" || I.type === "Exclude" || I.type === "BooleanOperation") && I.points) {
|
|
5890
|
-
let
|
|
5891
|
-
I.points.forEach((
|
|
5892
|
-
|
|
5902
|
+
let B = 1 / 0, i = -1 / 0, o = 1 / 0, h = -1 / 0;
|
|
5903
|
+
I.points.forEach((w) => {
|
|
5904
|
+
B = Math.min(B, w.x), i = Math.max(i, w.x), o = Math.min(o, w.y), h = Math.max(h, w.y);
|
|
5893
5905
|
});
|
|
5894
|
-
const
|
|
5895
|
-
I.points.forEach((
|
|
5896
|
-
if (
|
|
5897
|
-
A.moveTo(
|
|
5906
|
+
const s = (B + i) / 2, G = (o + h) / 2;
|
|
5907
|
+
I.points.forEach((w, a) => {
|
|
5908
|
+
if (a === 0)
|
|
5909
|
+
A.moveTo(w.x - s, w.y - G);
|
|
5898
5910
|
else {
|
|
5899
|
-
const
|
|
5900
|
-
A.bezierCurveTo(
|
|
5911
|
+
const N = I.points[a - 1], S = (N.out_x ?? N.x) - s, k = (N.out_y ?? N.y) - G, y = (w.in_x ?? w.x) - s, U = (w.in_y ?? w.y) - G;
|
|
5912
|
+
A.bezierCurveTo(S, k, y, U, w.x - s, w.y - G);
|
|
5901
5913
|
}
|
|
5902
5914
|
}), I.is_closed && A.closePath();
|
|
5903
5915
|
} else if (I.points && Array.isArray(I.points)) {
|
|
5904
|
-
let
|
|
5905
|
-
I.points.forEach((
|
|
5906
|
-
|
|
5916
|
+
let B = 1 / 0, i = -1 / 0, o = 1 / 0, h = -1 / 0;
|
|
5917
|
+
I.points.forEach((w) => {
|
|
5918
|
+
B = Math.min(B, w.x), i = Math.max(i, w.x), o = Math.min(o, w.y), h = Math.max(h, w.y);
|
|
5907
5919
|
});
|
|
5908
|
-
const
|
|
5909
|
-
I.points.forEach((
|
|
5910
|
-
if (
|
|
5920
|
+
const s = (B + i) / 2, G = (o + h) / 2;
|
|
5921
|
+
I.points.forEach((w, a) => {
|
|
5922
|
+
if (a === 0) A.moveTo(w.x - s, w.y - G);
|
|
5911
5923
|
else {
|
|
5912
|
-
const
|
|
5913
|
-
|
|
5914
|
-
(
|
|
5915
|
-
(
|
|
5916
|
-
(
|
|
5917
|
-
(
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
) : A.lineTo(
|
|
5924
|
+
const N = I.points[a - 1];
|
|
5925
|
+
N.out_x !== void 0 || w.in_x !== void 0 ? A.bezierCurveTo(
|
|
5926
|
+
(N.out_x ?? N.x) - s,
|
|
5927
|
+
(N.out_y ?? N.y) - G,
|
|
5928
|
+
(w.in_x ?? w.x) - s,
|
|
5929
|
+
(w.in_y ?? w.y) - G,
|
|
5930
|
+
w.x - s,
|
|
5931
|
+
w.y - G
|
|
5932
|
+
) : A.lineTo(w.x - s, w.y - G);
|
|
5921
5933
|
}
|
|
5922
5934
|
}), I.is_closed && A.closePath();
|
|
5923
5935
|
}
|
|
5924
5936
|
}
|
|
5925
|
-
applyPath(A, I, C, g) {
|
|
5926
|
-
A.beginPath(), this._tracePath(A, I, C, g);
|
|
5927
|
-
}
|
|
5928
5937
|
renderInputBox(A, I) {
|
|
5929
5938
|
var p, iA;
|
|
5930
|
-
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((p = I.geometry) == null ? void 0 : p.width) || 250, B = ((iA = I.geometry) == null ? void 0 : iA.height) || 45, i = this.focusedId === I.id, o = this.lastHoveredObjectId === I.id,
|
|
5931
|
-
let
|
|
5932
|
-
const r = `${
|
|
5933
|
-
if (L ? (L.backgroundColor !== void 0 && (
|
|
5939
|
+
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((p = I.geometry) == null ? void 0 : p.width) || 250, B = ((iA = I.geometry) == null ? void 0 : iA.height) || 45, i = this.focusedId === I.id, o = this.lastHoveredObjectId === I.id, h = g.previewState || "default", s = h !== "default" ? h : i ? "focused" : o ? "hovered" : "default", G = g.label || { visible: !0, text: "Label" }, w = g.helperText || { visible: !1, text: "Helper text" }, a = g.leftIcon || { visible: !1 }, N = g.rightIcon || { visible: !1 }, S = g.multiline === !0, k = g.corner_radius ?? 8, y = g.corners || { tl: k, tr: k, bl: k, br: k }, U = [y.tl, y.tr, y.br, y.bl];
|
|
5940
|
+
let c = g.backgroundColor || "rgba(31, 41, 55, 1)", t = g.borderColor || "rgba(55, 65, 81, 1)", J = g.borderWidth ?? 1.5, R = g.color || "#ffffff", e = g.placeholderColor || "rgba(156, 163, 175, 1)", Y = g.fontSize || 14;
|
|
5941
|
+
const r = `${s}Style`, L = g[r];
|
|
5942
|
+
if (L ? (L.backgroundColor !== void 0 && (c = L.backgroundColor), L.borderColor !== void 0 && (t = L.borderColor), L.borderWidth !== void 0 && (J = L.borderWidth), L.color !== void 0 && (R = L.color), L.placeholderColor !== void 0 && (e = L.placeholderColor), L.fontSize !== void 0 && (Y = L.fontSize)) : s === "focused" ? (t = g.focusBorderColor || "rgba(59, 130, 246, 1)", J = Math.max(J, 2)) : s === "hovered" || s === "hover" ? (t = g.hoverBorderColor || t, c = g.hoverBackgroundColor || c) : s === "disabled" ? (c = g.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", t = g.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : s === "error" && (t = "rgba(239, 68, 68, 1)", J = Math.max(J, 2)), A.beginPath(), this.drawRoundRect(A, -Q / 2, -B / 2, Q, B, U), A.fillStyle = c, A.fill(), J > 0 && (A.strokeStyle = t, A.lineWidth = J, A.stroke(), s === "focused" || s === "focus")) {
|
|
5934
5943
|
A.save(), A.beginPath();
|
|
5935
|
-
const d =
|
|
5944
|
+
const d = U.map((l) => l + 2);
|
|
5936
5945
|
this.drawRoundRect(A, -Q / 2 - 2, -B / 2 - 2, Q + 4, B + 4, d), A.strokeStyle = "rgba(59, 130, 246, 0.3)", A.lineWidth = 2, A.stroke(), A.restore();
|
|
5937
5946
|
}
|
|
5938
5947
|
const b = (d, l) => {
|
|
@@ -5945,11 +5954,11 @@ class xC {
|
|
|
5945
5954
|
A.restore();
|
|
5946
5955
|
};
|
|
5947
5956
|
b(a, !0), b(N, !1);
|
|
5948
|
-
const
|
|
5957
|
+
const P = g.text || "", IA = g.placeholder || "Enter text...", m = !P, QA = P || IA, _ = m ? e : R, BA = Y, X = g.fontFamily || "Inter", gA = g.fontWeight || 400;
|
|
5949
5958
|
A.font = `${gA} ${BA}px "${X}", sans-serif`, A.fillStyle = _, A.textAlign = "left", A.textBaseline = S ? "top" : "middle";
|
|
5950
|
-
const O = g.inputPadding ?? 16,
|
|
5959
|
+
const O = g.inputPadding ?? 16, q = a.visible ? (a.offset ?? 16) + (a.size || 14) / 2 + 8 : O, W = N.visible ? (N.offset ?? 16) + (N.size || 14) / 2 + 8 : O, f = -(Q / 2) + q, T = Q - q - W, V = g.inputType === "password" ? "•".repeat(QA.length) : QA;
|
|
5951
5960
|
if (A.save(), A.beginPath(), A.rect(f - 2, -B / 2 + 4, T + 4, B - 8), A.clip(), S) {
|
|
5952
|
-
const d =
|
|
5961
|
+
const d = V.split(`
|
|
5953
5962
|
`);
|
|
5954
5963
|
let l = -B / 2 + O;
|
|
5955
5964
|
const Z = BA * 1.2;
|
|
@@ -5964,33 +5973,33 @@ class xC {
|
|
|
5964
5973
|
A.fillText(oA, f, l), x = A.measureText(oA).width, hA < d.length - 1 && (l += Z, x = 0);
|
|
5965
5974
|
}), i && !m && Math.floor(performance.now() / 500) % 2 === 0 && A.fillRect(f + x, l, 1.5, BA);
|
|
5966
5975
|
} else {
|
|
5967
|
-
const l = A.measureText(
|
|
5976
|
+
const l = A.measureText(V).width;
|
|
5968
5977
|
let Z = 0;
|
|
5969
|
-
if (l > T && (Z = l - T), A.fillText(
|
|
5978
|
+
if (l > T && (Z = l - T), A.fillText(V, f - Z, 0), i && !m && Math.floor(performance.now() / 500) % 2 === 0) {
|
|
5970
5979
|
const aA = f + l - Z;
|
|
5971
5980
|
A.fillRect(aA, -(BA / 2), 1.5, BA);
|
|
5972
5981
|
}
|
|
5973
5982
|
}
|
|
5974
|
-
if (A.restore(),
|
|
5975
|
-
const d =
|
|
5983
|
+
if (A.restore(), G.visible !== !1) {
|
|
5984
|
+
const d = G.text || "Label", l = G.fontSize || 12, Z = G.color || "rgba(156, 163, 175, 1)", x = G.offset ?? 8;
|
|
5976
5985
|
A.font = `600 ${l}px "${X}", sans-serif`, A.fillStyle = Z, A.textAlign = "left", A.textBaseline = "bottom";
|
|
5977
5986
|
const aA = -(Q / 2), hA = -(B / 2) - x;
|
|
5978
5987
|
A.fillText(d, aA, hA);
|
|
5979
5988
|
}
|
|
5980
|
-
if (
|
|
5981
|
-
const d =
|
|
5989
|
+
if (w.visible === !0) {
|
|
5990
|
+
const d = w.text || "Helper text", l = w.fontSize || 11, Z = s === "error" ? "rgba(239, 68, 68, 1)" : w.color || "rgba(156, 163, 175, 1)", x = w.offset ?? 6;
|
|
5982
5991
|
A.font = `400 ${l}px "${X}", sans-serif`, A.fillStyle = Z, A.textAlign = "left", A.textBaseline = "top";
|
|
5983
5992
|
const aA = -(Q / 2), hA = B / 2 + x;
|
|
5984
5993
|
A.fillText(d, aA, hA);
|
|
5985
5994
|
}
|
|
5986
5995
|
}
|
|
5987
5996
|
renderSlider(A, I) {
|
|
5988
|
-
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.geometry) || I.geometry, Q = (C == null ? void 0 : C.options) || I.options || {}, B = g.width || 200, i = Q.value ?? 50, o = Q.min ?? 0,
|
|
5989
|
-
if ((
|
|
5997
|
+
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.geometry) || I.geometry, Q = (C == null ? void 0 : C.options) || I.options || {}, B = g.width || 200, i = Q.value ?? 50, o = Q.min ?? 0, s = (Q.max ?? 100) - o, G = s === 0 ? 0 : (i - o) / s, w = Q.trackHeight || 4, a = Q.trackRoundedness ?? 2, N = Q.trackShape ?? "Rectangle", S = Q.trackPath || "", k = Q.activeColor || "#3b82f6", y = Q.inactiveColor || "#374151", U = Q.thumbShape || "Ellipse", c = Q.thumbWidth ?? 16, t = Q.thumbHeight ?? 16, J = Q.thumbRoundedness ?? 0, R = Q.thumbColor || "#ffffff", e = Q.thumbPath || "", Y = Q.thumbIcon || "", r = Q.showValueTooltip ?? !1, L = Q.tooltipBgColor || "#333333", b = Q.tooltipColor || "#ffffff", P = Q.tooltipOffsetX ?? 0, IA = Q.tooltipOffsetY ?? -25, m = (q, W, f, T, V, p, iA) => {
|
|
5998
|
+
if ((q === "Custom" || q === "Icon") && iA)
|
|
5990
5999
|
try {
|
|
5991
6000
|
const d = new Path2D(iA);
|
|
5992
|
-
if (A.save(), A.translate(W, f),
|
|
5993
|
-
const l = Math.min(T,
|
|
6001
|
+
if (A.save(), A.translate(W, f), q === "Icon") {
|
|
6002
|
+
const l = Math.min(T, V) / 24;
|
|
5994
6003
|
A.scale(l, l), A.translate(-12, -12);
|
|
5995
6004
|
}
|
|
5996
6005
|
A.fill(d), A.restore();
|
|
@@ -5998,67 +6007,67 @@ class xC {
|
|
|
5998
6007
|
} catch (d) {
|
|
5999
6008
|
console.error("Error drawing slider shape in engine:", d);
|
|
6000
6009
|
}
|
|
6001
|
-
if (A.beginPath(),
|
|
6002
|
-
A.ellipse(W, f, T / 2,
|
|
6003
|
-
else if (
|
|
6004
|
-
this.drawRoundRect(A, W - T / 2, f -
|
|
6005
|
-
else if (
|
|
6006
|
-
A.moveTo(W, f -
|
|
6007
|
-
else if (
|
|
6008
|
-
A.moveTo(W, f -
|
|
6009
|
-
else if (
|
|
6010
|
-
const l = Math.min(T,
|
|
6010
|
+
if (A.beginPath(), q === "Ellipse")
|
|
6011
|
+
A.ellipse(W, f, T / 2, V / 2, 0, 0, Math.PI * 2);
|
|
6012
|
+
else if (q === "Rectangle")
|
|
6013
|
+
this.drawRoundRect(A, W - T / 2, f - V / 2, T, V, p);
|
|
6014
|
+
else if (q === "Triangle")
|
|
6015
|
+
A.moveTo(W, f - V / 2), A.lineTo(W + T / 2, f + V / 2), A.lineTo(W - T / 2, f + V / 2), A.closePath();
|
|
6016
|
+
else if (q === "Diamond")
|
|
6017
|
+
A.moveTo(W, f - V / 2), A.lineTo(W + T / 2, f), A.lineTo(W, f + V / 2), A.lineTo(W - T / 2, f), A.closePath();
|
|
6018
|
+
else if (q === "Star") {
|
|
6019
|
+
const l = Math.min(T, V) / 2, Z = l / 2;
|
|
6011
6020
|
for (let x = 0; x < 5 * 2; x++) {
|
|
6012
6021
|
const aA = x % 2 === 0 ? l : Z, hA = x * Math.PI / 5 - Math.PI / 2;
|
|
6013
6022
|
A.lineTo(W + aA * Math.cos(hA), f + aA * Math.sin(hA));
|
|
6014
6023
|
}
|
|
6015
6024
|
A.closePath();
|
|
6016
|
-
} else
|
|
6025
|
+
} else q === "Line" && (A.moveTo(W - T / 2, f), A.lineTo(W + T / 2, f));
|
|
6017
6026
|
A.fill();
|
|
6018
6027
|
};
|
|
6019
|
-
A.fillStyle =
|
|
6020
|
-
const QA = B -
|
|
6021
|
-
if (BA > 0 && (A.fillStyle =
|
|
6022
|
-
A.save(), A.translate(_ +
|
|
6023
|
-
const
|
|
6028
|
+
A.fillStyle = y, N === "Line" ? (A.strokeStyle = y, A.lineWidth = w, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(B / 2, 0), A.stroke()) : m(N, 0, 0, B, w, a, S);
|
|
6029
|
+
const QA = B - c, _ = -B / 2 + c / 2 + G * QA, BA = _ - -B / 2;
|
|
6030
|
+
if (BA > 0 && (A.fillStyle = k, N === "Line" ? (A.strokeStyle = k, A.lineWidth = w, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(_, 0), A.stroke()) : N === "Rectangle" && (A.beginPath(), this.drawRoundRect(A, -B / 2, -w / 2, BA, w, a), A.fill())), A.save(), A.translate(_, 0), A.shadowColor = "rgba(0,0,0,0.2)", A.shadowBlur = 4, A.shadowOffsetY = 1, A.fillStyle = R, m(U, 0, 0, c, t, J, U === "Icon" ? Y : e), A.restore(), r) {
|
|
6031
|
+
A.save(), A.translate(_ + P, IA);
|
|
6032
|
+
const q = Math.round(i).toString();
|
|
6024
6033
|
A.font = "10px Inter, sans-serif";
|
|
6025
|
-
const W = A.measureText(
|
|
6026
|
-
A.beginPath(), this.drawRoundRect(A, -
|
|
6034
|
+
const W = A.measureText(q), f = 6, T = 4, V = W.width + f * 2, p = 14 + T;
|
|
6035
|
+
A.beginPath(), this.drawRoundRect(A, -V / 2, -p / 2, V, p, 4), A.fillStyle = L, A.fill(), A.fillStyle = b, A.textAlign = "center", A.textBaseline = "middle", A.fillText(q, 0, 0), A.restore();
|
|
6027
6036
|
}
|
|
6028
6037
|
const X = Q.label || {}, gA = Q.helperText || {}, O = Q.fontFamily || "Inter";
|
|
6029
6038
|
if (X.visible !== !1) {
|
|
6030
|
-
const
|
|
6039
|
+
const q = X.text || "Label", W = X.fontSize || 12, f = X.color || "rgba(156, 163, 175, 1)", T = X.offset ?? 8;
|
|
6031
6040
|
A.font = `600 ${W}px "${O}", sans-serif`, A.fillStyle = f, A.textAlign = "left", A.textBaseline = "bottom";
|
|
6032
|
-
const
|
|
6033
|
-
A.fillText(
|
|
6041
|
+
const V = -(B / 2), p = -(w / 2) - T;
|
|
6042
|
+
A.fillText(q, V, p);
|
|
6034
6043
|
}
|
|
6035
6044
|
if (gA.visible === !0) {
|
|
6036
|
-
const
|
|
6045
|
+
const q = gA.text || "Helper text", W = gA.fontSize || 11, f = gA.color || "rgba(156, 163, 175, 1)", T = gA.offset ?? 6;
|
|
6037
6046
|
A.font = `400 ${W}px "${O}", sans-serif`, A.fillStyle = f, A.textAlign = "left", A.textBaseline = "top";
|
|
6038
|
-
const
|
|
6039
|
-
A.fillText(
|
|
6047
|
+
const V = -(B / 2), p = w / 2 + T;
|
|
6048
|
+
A.fillText(q, V, p);
|
|
6040
6049
|
}
|
|
6041
6050
|
}
|
|
6042
6051
|
renderDropdown(A, I) {
|
|
6043
6052
|
var IA;
|
|
6044
6053
|
const C = this.objectStates.get(I.id);
|
|
6045
6054
|
if (!C) return;
|
|
6046
|
-
const g = C.options || I.options || {}, Q = I.geometry.width || 160, B = I.geometry.height || 40, i = -Q / 2, o = -B / 2,
|
|
6055
|
+
const g = C.options || I.options || {}, Q = I.geometry.width || 160, B = I.geometry.height || 40, i = -Q / 2, o = -B / 2, h = g.corner_radius ?? 6, s = g.disabled || g.previewState === "disabled", G = this.lastHoveredObjectId === I.id || g.previewState === "hover", w = (g.isOpen || g.previewState === "active") && !s;
|
|
6047
6056
|
let a = g.backgroundColor, N = g.borderColor, S = g.color || "#333333";
|
|
6048
|
-
|
|
6049
|
-
const
|
|
6050
|
-
A.globalAlpha =
|
|
6051
|
-
const
|
|
6052
|
-
|
|
6053
|
-
const
|
|
6054
|
-
if (
|
|
6055
|
-
const m = i + Q -
|
|
6057
|
+
s ? (a = g.disabledBackgroundColor || "#f3f4f6", N = g.disabledBorderColor || "#e5e7eb", S = g.disabledColor || "#9ca3af") : w ? (a = g.activeBackgroundColor || a, N = g.activeBorderColor || N, S = g.activeColor || S) : G && (a = g.hoverBackgroundColor || a, N = g.hoverBorderColor || N, S = g.hoverColor || S), a || (a = "#ffffff"), N || (N = "#e5e7eb");
|
|
6058
|
+
const k = A.globalAlpha;
|
|
6059
|
+
A.globalAlpha = k * (g.opacity ?? 1), this.drawRoundRect(A, i, o, Q, B, h), A.fillStyle = this.createCanvasFill(A, typeof a == "string" ? { type: "Solid", color: a } : a, Q, B) || "#ffffff", A.fill();
|
|
6060
|
+
const y = g.borderWidth ?? 1;
|
|
6061
|
+
y > 0 && (A.strokeStyle = this.createCanvasFill(A, typeof N == "string" ? { type: "Solid", color: N } : N, Q, B) || "#e5e7eb", A.lineWidth = y, A.stroke());
|
|
6062
|
+
const U = 12, c = g.chevronType || "chevron", t = g.chevronSize || 16, J = (w ? g.openIconColor : g.closedIconColor) || g.chevronColor || "#6b7280";
|
|
6063
|
+
if (c !== "none") {
|
|
6064
|
+
const m = i + Q - U - t / 2;
|
|
6056
6065
|
A.save(), A.translate(m, 0);
|
|
6057
|
-
const QA =
|
|
6058
|
-
if (A.rotate(QA * Math.PI / 180), A.strokeStyle = J, A.fillStyle = J, A.lineWidth = 1.5, A.lineCap = "round", A.lineJoin = "round",
|
|
6066
|
+
const QA = w ? g.openIconAngle ?? 180 : g.closedIconAngle ?? 0;
|
|
6067
|
+
if (A.rotate(QA * Math.PI / 180), A.strokeStyle = J, A.fillStyle = J, A.lineWidth = 1.5, A.lineCap = "round", A.lineJoin = "round", c === "chevron")
|
|
6059
6068
|
A.beginPath(), A.moveTo(-t / 2, -t * 0.2), A.lineTo(0, t * 0.2), A.lineTo(t / 2, -t * 0.2), A.stroke();
|
|
6060
|
-
else if (
|
|
6061
|
-
const _ =
|
|
6069
|
+
else if (c === "custom" || c === "path") {
|
|
6070
|
+
const _ = w && g.openIconPath || g.closedIconPath;
|
|
6062
6071
|
if (_) {
|
|
6063
6072
|
const BA = new Path2D(_);
|
|
6064
6073
|
A.save();
|
|
@@ -6068,65 +6077,65 @@ class xC {
|
|
|
6068
6077
|
}
|
|
6069
6078
|
A.restore();
|
|
6070
6079
|
}
|
|
6071
|
-
const
|
|
6072
|
-
A.font = `${
|
|
6073
|
-
const L =
|
|
6080
|
+
const R = g.selectedOption || g.placeholder || "Select...", e = g.fontSize || 14, Y = g.fontWeight || 400, r = g.fontFamily || "Inter, sans-serif";
|
|
6081
|
+
A.font = `${Y} ${e}px ${r}`;
|
|
6082
|
+
const L = s ? g.disabledColor || "#9ca3af" : !g.selectedOption && g.placeholder ? "#9ca3af" : S;
|
|
6074
6083
|
A.fillStyle = this.createCanvasFill(A, typeof L == "string" ? { type: "Solid", color: L } : L, Q, B) || "#333333", A.textAlign = "left", A.textBaseline = "middle";
|
|
6075
|
-
const b =
|
|
6076
|
-
if (A.save(), A.beginPath(), A.rect(i +
|
|
6077
|
-
const m = o + B + 4, QA = g.optionsList || [], _ = g.itemHeight || 32, BA = g.listPadding ?? 4, X = QA.length * _ + BA * 2, gA = g.listCornerRadius ??
|
|
6084
|
+
const b = c === "none" ? 0 : t + 8, P = Q - U * 2 - b;
|
|
6085
|
+
if (A.save(), A.beginPath(), A.rect(i + U, o, P, B), A.clip(), A.fillText(R, i + U, 0), A.restore(), w && !s) {
|
|
6086
|
+
const m = o + B + 4, QA = g.optionsList || [], _ = g.itemHeight || 32, BA = g.listPadding ?? 4, X = QA.length * _ + BA * 2, gA = g.listCornerRadius ?? h;
|
|
6078
6087
|
A.save();
|
|
6079
6088
|
const O = g.listShadow || {};
|
|
6080
6089
|
A.shadowColor = typeof O.color == "string" ? O.color : ((IA = O.color) == null ? void 0 : IA.color) || "rgba(0,0,0,0.15)", A.shadowBlur = O.blur ?? 12, A.shadowOffsetY = O.offsetY ?? 6, A.beginPath(), this.drawRoundRect(A, i, m, Q, X, gA), A.fillStyle = this.createCanvasFill(A, typeof g.listBackgroundColor == "string" ? { type: "Solid", color: g.listBackgroundColor } : g.listBackgroundColor || { type: "Solid", color: "#ffffff" }, Q, X) || "#ffffff", A.fill();
|
|
6081
|
-
const
|
|
6082
|
-
|
|
6083
|
-
const W = g.itemFontSize ||
|
|
6084
|
-
A.font = `${
|
|
6085
|
-
const p = m + BA +
|
|
6090
|
+
const q = g.listBorderWidth ?? 1;
|
|
6091
|
+
q > 0 && (A.shadowColor = "transparent", A.strokeStyle = this.createCanvasFill(A, typeof g.listBorderColor == "string" ? { type: "Solid", color: g.listBorderColor } : g.listBorderColor || { type: "Solid", color: N }, Q, X) || "#e5e7eb", A.lineWidth = q, A.stroke()), A.restore();
|
|
6092
|
+
const W = g.itemFontSize || e, f = g.itemFontFamily || r;
|
|
6093
|
+
A.font = `${Y} ${W}px ${f}`, QA.forEach((T, V) => {
|
|
6094
|
+
const p = m + BA + V * _;
|
|
6086
6095
|
if (T === g.selectedOption)
|
|
6087
|
-
A.fillStyle = this.createCanvasFill(A, typeof g.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: g.itemSelectedBackgroundColor } : g.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, Q, _) || "#f3f4f6", A.fillRect(i +
|
|
6096
|
+
A.fillStyle = this.createCanvasFill(A, typeof g.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: g.itemSelectedBackgroundColor } : g.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, Q, _) || "#f3f4f6", A.fillRect(i + q, p, Q - q * 2, _), A.fillStyle = g.itemSelectedColor || g.activeColor || S || "#374151";
|
|
6088
6097
|
else if (A.fillStyle = g.listTextColor || S || "#333333", this.activeDropdownId === I.id && this._lastPointerPos) {
|
|
6089
6098
|
const d = this._lastPointerPos.y - (m + BA), l = Math.floor(d / _);
|
|
6090
|
-
|
|
6099
|
+
V === l && (A.fillStyle = this.createCanvasFill(A, typeof g.itemHoverBackgroundColor == "string" ? { type: "Solid", color: g.itemHoverBackgroundColor } : g.itemHoverBackgroundColor || { type: "Solid", color: "#f9fafb" }, Q, _) || "#f9fafb", A.fillRect(i + q, p, Q - q * 2, _), A.fillStyle = g.itemHoverColor || S);
|
|
6091
6100
|
}
|
|
6092
|
-
A.fillText(T, i +
|
|
6101
|
+
A.fillText(T, i + U, p + _ / 2);
|
|
6093
6102
|
});
|
|
6094
6103
|
}
|
|
6095
|
-
A.globalAlpha =
|
|
6104
|
+
A.globalAlpha = k;
|
|
6096
6105
|
}
|
|
6097
6106
|
renderButton(A, I) {
|
|
6098
|
-
var
|
|
6099
|
-
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((
|
|
6100
|
-
A.save(), A.beginPath(),
|
|
6101
|
-
const
|
|
6102
|
-
A.font = `${a.fontWeight || 400} ${
|
|
6103
|
-
let
|
|
6107
|
+
var c, t, J, R;
|
|
6108
|
+
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((c = I.geometry) == null ? void 0 : c.width) || 120, B = ((t = I.geometry) == null ? void 0 : t.height) || 40, i = -Q / 2, o = -B / 2, h = this.lastHoveredObjectId === I.id, s = g.corner_radius ?? 8, G = g.bgShape || "Rectangle", w = h ? ((J = g.hoverStyle) == null ? void 0 : J.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6", a = g.label || {}, N = h ? ((R = g.hoverStyle) == null ? void 0 : R.textColor) || a.color || "#ffffff" : a.color || "#ffffff", S = g.icon || { enabled: !1 };
|
|
6109
|
+
A.save(), A.beginPath(), G === "Rectangle" ? this.drawRoundRect(A, i, o, Q, B, s) : G === "Ellipse" || G === "Circle" ? A.ellipse(0, 0, Q / 2, B / 2, 0, 0, Math.PI * 2) : G === "Pill" && this.drawRoundRect(A, i, o, Q, B, B / 2), A.fillStyle = w, A.fill();
|
|
6110
|
+
const k = a.fontSize || 14, y = a.fontFamily || "Inter";
|
|
6111
|
+
A.font = `${a.fontWeight || 400} ${k}px "${y}", sans-serif`, A.fillStyle = N, A.textAlign = "center", A.textBaseline = "middle";
|
|
6112
|
+
let U = 0;
|
|
6104
6113
|
if (S.enabled && S.svgPath) {
|
|
6105
|
-
const
|
|
6114
|
+
const e = S.size || 16, Y = S.gap || 8, r = S.position === "left" ? -(A.measureText(a.text || "").width / 2 + e / 2 + Y / 2) : A.measureText(a.text || "").width / 2 + e / 2 + Y / 2;
|
|
6106
6115
|
A.save(), A.translate(r, 0);
|
|
6107
|
-
const L = new Path2D(S.svgPath), b =
|
|
6108
|
-
A.scale(b, b), A.translate(-12, -12), A.fillStyle = S.color || N, A.fill(L), A.restore(),
|
|
6116
|
+
const L = new Path2D(S.svgPath), b = e / 24;
|
|
6117
|
+
A.scale(b, b), A.translate(-12, -12), A.fillStyle = S.color || N, A.fill(L), A.restore(), U = S.position === "left" ? e / 2 + Y / 2 : -(e / 2 + Y / 2);
|
|
6109
6118
|
}
|
|
6110
|
-
A.fillText(a.text || "Button",
|
|
6119
|
+
A.fillText(a.text || "Button", U, 0), A.restore();
|
|
6111
6120
|
}
|
|
6112
6121
|
renderToggleButton(A, I) {
|
|
6113
|
-
var
|
|
6114
|
-
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = g.checked ?? !1, B = ((
|
|
6115
|
-
A.save(), A.beginPath(), this.drawRoundRect(A, o,
|
|
6116
|
-
const N =
|
|
6117
|
-
A.font = `${
|
|
6122
|
+
var k, y;
|
|
6123
|
+
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = g.checked ?? !1, B = ((k = I.geometry) == null ? void 0 : k.width) || 120, i = ((y = I.geometry) == null ? void 0 : y.height) || 40, o = -B / 2, h = -i / 2, s = g.corner_radius ?? 8, G = g.label || {}, w = Q ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151", a = Q ? g.activeTextColor || "#ffffff" : g.inactiveTextColor || "#9ca3af";
|
|
6124
|
+
A.save(), A.beginPath(), this.drawRoundRect(A, o, h, B, i, s), A.fillStyle = w, A.fill();
|
|
6125
|
+
const N = G.fontSize || 14, S = G.fontFamily || "Inter";
|
|
6126
|
+
A.font = `${G.fontWeight || 600} ${N}px "${S}", sans-serif`, A.fillStyle = a, A.textAlign = "center", A.textBaseline = "middle", A.fillText(G.text || "Toggle", 0, 0), A.restore();
|
|
6118
6127
|
}
|
|
6119
6128
|
renderToggle(A, I) {
|
|
6120
|
-
var
|
|
6121
|
-
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((
|
|
6122
|
-
A.beginPath(), this.drawRoundRect(A, i, o, Q, B,
|
|
6123
|
-
const
|
|
6124
|
-
if (A.beginPath(), A.arc(
|
|
6125
|
-
const t = g.label, J = t.fontSize || 14,
|
|
6126
|
-
A.font = `${
|
|
6127
|
-
const
|
|
6129
|
+
var U, c;
|
|
6130
|
+
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((U = I.geometry) == null ? void 0 : U.width) || 52, B = ((c = I.geometry) == null ? void 0 : c.height) || 30, i = -Q / 2, o = -B / 2, h = g.checked ?? !1, s = g.corner_radius ?? B / 2;
|
|
6131
|
+
A.beginPath(), this.drawRoundRect(A, i, o, Q, B, s), A.fillStyle = h ? g.activeColor || "#10b981" : g.inactiveColor || "#374151", g.disabled && (A.globalAlpha *= 0.5), A.fill();
|
|
6132
|
+
const G = 3, w = B - G * 2, a = w / 2, N = i + G, S = i + Q - G - w, k = h ? S : N, y = o + G;
|
|
6133
|
+
if (A.beginPath(), A.arc(k + a, y + a, a, 0, Math.PI * 2), A.fillStyle = g.knobColor || "#ffffff", A.fill(), g.disabled && (A.globalAlpha *= 2), g.label && g.label.text) {
|
|
6134
|
+
const t = g.label, J = t.fontSize || 14, R = t.fontWeight || 400, e = t.fontFamily || "Inter";
|
|
6135
|
+
A.font = `${R} ${J}px "${e}", sans-serif`, A.fillStyle = t.color || "#f3f4f6", A.textBaseline = "middle";
|
|
6136
|
+
const Y = t.gap || 10;
|
|
6128
6137
|
let r = 0, L = 0;
|
|
6129
|
-
t.position === "left" ? (A.textAlign = "right", r = i -
|
|
6138
|
+
t.position === "left" ? (A.textAlign = "right", r = i - Y, L = 0) : t.position === "right" ? (A.textAlign = "left", r = i + Q + Y, L = 0) : t.position === "top" ? (A.textAlign = "center", r = 0, L = o - Y, A.textBaseline = "bottom") : t.position === "bottom" ? (A.textAlign = "center", r = 0, L = o + B + Y, A.textBaseline = "top") : (A.textAlign = "left", r = i + Q + Y, L = 0), A.fillText(t.text, r, L);
|
|
6130
6139
|
}
|
|
6131
6140
|
}
|
|
6132
6141
|
renderLineGraph(A, I, C, g) {
|
|
@@ -6151,122 +6160,157 @@ class xC {
|
|
|
6151
6160
|
}
|
|
6152
6161
|
let B = 1 / 0, i = -1 / 0, o = 0;
|
|
6153
6162
|
if (Q.forEach((S) => {
|
|
6154
|
-
let
|
|
6163
|
+
let k = S.data;
|
|
6155
6164
|
if (S.isVarEnabled && S.inputId) {
|
|
6156
|
-
let
|
|
6157
|
-
if (
|
|
6158
|
-
const
|
|
6159
|
-
|
|
6165
|
+
let y = this.inputs.get(S.inputId);
|
|
6166
|
+
if (y === void 0) {
|
|
6167
|
+
const U = this.inputNameMap.get(S.inputId);
|
|
6168
|
+
U && U.length > 0 && (y = this.inputs.get(U[0]));
|
|
6160
6169
|
}
|
|
6161
|
-
|
|
6170
|
+
y && Array.isArray(y) && (k = y);
|
|
6162
6171
|
}
|
|
6163
|
-
if (
|
|
6164
|
-
const
|
|
6165
|
-
|
|
6172
|
+
if (k && k.length > 0) {
|
|
6173
|
+
const y = k.filter((U) => typeof U == "number" && !isNaN(U));
|
|
6174
|
+
y.length > 0 && (B = Math.min(B, ...y), i = Math.max(i, ...y), o = Math.max(o, k.length));
|
|
6166
6175
|
}
|
|
6167
|
-
S._resolvedData =
|
|
6176
|
+
S._resolvedData = k;
|
|
6168
6177
|
}), o < 2) return;
|
|
6169
|
-
const
|
|
6170
|
-
const
|
|
6171
|
-
return g / 2 -
|
|
6172
|
-
},
|
|
6178
|
+
const h = i - B, s = C / (o - 1), G = (S) => {
|
|
6179
|
+
const k = h === 0 ? 0.5 : (S - B) / h;
|
|
6180
|
+
return g / 2 - k * g;
|
|
6181
|
+
}, w = (S) => S * s - C / 2, a = I.axisColor || "#333333";
|
|
6173
6182
|
if (I.showXAxis && (A.beginPath(), A.strokeStyle = I.xAxisColor || a, A.lineWidth = 1, A.moveTo(-C / 2, g / 2), A.lineTo(C / 2, g / 2), A.stroke()), I.showYAxis && (A.beginPath(), A.strokeStyle = I.yAxisColor || a, A.lineWidth = 1, A.moveTo(-C / 2, -g / 2), A.lineTo(-C / 2, g / 2), A.stroke()), A.fillStyle = I.axisLabelColor || "#333333", A.font = `${I.axisLabelFontSize || 10}px Inter, sans-serif`, I.showXLabels) {
|
|
6174
6183
|
A.textAlign = "center", A.textBaseline = "top";
|
|
6175
6184
|
for (let S = 0; S < o; S++) {
|
|
6176
|
-
const
|
|
6177
|
-
A.fillText(`${S + 1}`,
|
|
6185
|
+
const k = w(S);
|
|
6186
|
+
A.fillText(`${S + 1}`, k, g / 2 + 5);
|
|
6178
6187
|
}
|
|
6179
6188
|
}
|
|
6180
6189
|
if (I.showYLabels) {
|
|
6181
6190
|
A.textAlign = "right", A.textBaseline = "middle";
|
|
6182
|
-
const S = -C / 2 - 5,
|
|
6183
|
-
A.fillText(i.toFixed(1), S,
|
|
6191
|
+
const S = -C / 2 - 5, k = (i + B) / 2;
|
|
6192
|
+
A.fillText(i.toFixed(1), S, G(i)), A.fillText(k.toFixed(1), S, G(k)), A.fillText(B.toFixed(1), S, G(B));
|
|
6184
6193
|
}
|
|
6185
6194
|
const N = 10;
|
|
6186
6195
|
if (Q.forEach((S) => {
|
|
6187
|
-
const
|
|
6188
|
-
if (!(!
|
|
6196
|
+
const k = S._resolvedData;
|
|
6197
|
+
if (!(!k || k.length < 2)) {
|
|
6189
6198
|
if (S.showArea) {
|
|
6190
|
-
if (A.beginPath(), A.moveTo(
|
|
6191
|
-
for (let
|
|
6192
|
-
const
|
|
6193
|
-
for (let
|
|
6194
|
-
const
|
|
6195
|
-
A.lineTo(
|
|
6199
|
+
if (A.beginPath(), A.moveTo(w(0), g / 2), A.lineTo(w(0), G(k[0])), S.smoothing && k.length > 2)
|
|
6200
|
+
for (let U = 0; U < k.length - 1; U++) {
|
|
6201
|
+
const c = k[U === 0 ? U : U - 1], t = k[U], J = k[U + 1], R = k[U + 1 === k.length - 1 ? U + 1 : U + 2];
|
|
6202
|
+
for (let e = 1; e <= N; e++) {
|
|
6203
|
+
const Y = e / N, r = this._catmullRom(c, t, J, R, Y);
|
|
6204
|
+
A.lineTo(w(U + Y), G(r));
|
|
6196
6205
|
}
|
|
6197
6206
|
}
|
|
6198
6207
|
else
|
|
6199
|
-
for (let
|
|
6200
|
-
A.lineTo(
|
|
6201
|
-
A.lineTo(
|
|
6202
|
-
const
|
|
6203
|
-
A.globalAlpha =
|
|
6208
|
+
for (let U = 1; U < k.length; U++)
|
|
6209
|
+
A.lineTo(w(U), G(k[U]));
|
|
6210
|
+
A.lineTo(w(k.length - 1), g / 2), A.closePath();
|
|
6211
|
+
const y = A.globalAlpha;
|
|
6212
|
+
A.globalAlpha = y * (I.areaOpacity ?? 0.3), A.fillStyle = S.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = y;
|
|
6204
6213
|
}
|
|
6205
|
-
if (A.beginPath(), A.strokeStyle = S.lineColor || "#3b82f6", A.lineWidth = S.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(
|
|
6206
|
-
for (let
|
|
6207
|
-
const
|
|
6208
|
-
for (let
|
|
6209
|
-
const
|
|
6210
|
-
A.lineTo(
|
|
6214
|
+
if (A.beginPath(), A.strokeStyle = S.lineColor || "#3b82f6", A.lineWidth = S.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(w(0), G(k[0])), S.smoothing && k.length > 2)
|
|
6215
|
+
for (let y = 0; y < k.length - 1; y++) {
|
|
6216
|
+
const U = k[y === 0 ? y : y - 1], c = k[y], t = k[y + 1], J = k[y + 1 === k.length - 1 ? y + 1 : y + 2];
|
|
6217
|
+
for (let R = 1; R <= N; R++) {
|
|
6218
|
+
const e = R / N, Y = this._catmullRom(U, c, t, J, e);
|
|
6219
|
+
A.lineTo(w(y + e), G(Y));
|
|
6211
6220
|
}
|
|
6212
6221
|
}
|
|
6213
6222
|
else
|
|
6214
|
-
for (let
|
|
6215
|
-
A.lineTo(
|
|
6216
|
-
A.stroke(), S.showPoints &&
|
|
6217
|
-
const
|
|
6218
|
-
A.beginPath(), A.arc(
|
|
6223
|
+
for (let y = 1; y < k.length; y++)
|
|
6224
|
+
A.lineTo(w(y), G(k[y]));
|
|
6225
|
+
A.stroke(), S.showPoints && k.forEach((y, U) => {
|
|
6226
|
+
const c = w(U), t = G(y);
|
|
6227
|
+
A.beginPath(), A.arc(c, t, (S.pointSize || 6) / 2, 0, Math.PI * 2), A.fillStyle = S.pointFill || "#ffffff", A.fill(), A.strokeStyle = S.pointStrokeColor || S.lineColor || "#3b82f6", A.lineWidth = S.pointStrokeWidth || 1, A.stroke();
|
|
6219
6228
|
});
|
|
6220
6229
|
}
|
|
6221
6230
|
}), I.showLegend && Q.length > 0) {
|
|
6222
6231
|
const S = C / 2 - 10;
|
|
6223
|
-
let
|
|
6224
|
-
const
|
|
6225
|
-
A.font = `${
|
|
6226
|
-
const J =
|
|
6227
|
-
A.beginPath(), A.rect(S -
|
|
6232
|
+
let k = -g / 2 + 15;
|
|
6233
|
+
const y = I.legendFontSize || 10, U = y + 5;
|
|
6234
|
+
A.font = `${y}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", Q.forEach((c) => {
|
|
6235
|
+
const J = c.label || "Series", R = A.measureText(J).width;
|
|
6236
|
+
A.beginPath(), A.rect(S - R - 8 - 5, k - (8 / 2 + 2), 8, 8), A.fillStyle = c.lineColor || "#3b82f6", A.fill(), A.fillStyle = I.legendColor || "#333333", A.fillText(J, S, k), k += U;
|
|
6228
6237
|
});
|
|
6229
6238
|
}
|
|
6230
6239
|
}
|
|
6231
6240
|
_catmullRom(A, I, C, g, Q) {
|
|
6232
|
-
const B = (C - A) * 0.5, i = (g - I) * 0.5, o = Q * Q,
|
|
6233
|
-
return (2 * I - 2 * C + B + i) *
|
|
6241
|
+
const B = (C - A) * 0.5, i = (g - I) * 0.5, o = Q * Q, h = Q * o;
|
|
6242
|
+
return (2 * I - 2 * C + B + i) * h + (-3 * I + 3 * C - 2 * B - i) * o + B * Q + I;
|
|
6243
|
+
}
|
|
6244
|
+
normalizeOpacity(A) {
|
|
6245
|
+
const I = typeof A == "number" ? A : parseFloat(String(A)) || 100;
|
|
6246
|
+
return I > 1 ? I / 100 : I;
|
|
6234
6247
|
}
|
|
6235
6248
|
createCanvasFill(A, I, C, g) {
|
|
6249
|
+
var Q;
|
|
6236
6250
|
if (!I || I.type === "None") return null;
|
|
6237
6251
|
if (I.type === "Solid")
|
|
6238
6252
|
return I.color;
|
|
6239
|
-
if ((I.type === "LinearGradient" || I.type === "RadialGradient") && I.stops) {
|
|
6240
|
-
const
|
|
6241
|
-
var
|
|
6242
|
-
const
|
|
6243
|
-
if (
|
|
6244
|
-
const
|
|
6245
|
-
return `rgba(${
|
|
6253
|
+
if ((I.type === "LinearGradient" || I.type === "RadialGradient" || I.type === "AngularGradient" || I.type === "DiamondGradient") && I.stops) {
|
|
6254
|
+
const B = (i, o = 100) => {
|
|
6255
|
+
var k, y;
|
|
6256
|
+
const s = (((y = (k = this.artboard) == null ? void 0 : k.tokens) == null ? void 0 : y.colors) || {})[i] || i, G = this.normalizeOpacity(o);
|
|
6257
|
+
if (G >= 1 && s.startsWith("#")) return s;
|
|
6258
|
+
const w = s.startsWith("#") ? s.replace("#", "") : "ffffff", a = parseInt(w.substring(0, 2), 16), N = parseInt(w.substring(2, 4), 16), S = parseInt(w.substring(4, 6), 16);
|
|
6259
|
+
return `rgba(${a}, ${N}, ${S}, ${G})`;
|
|
6246
6260
|
};
|
|
6247
6261
|
if (I.type === "LinearGradient") {
|
|
6248
|
-
const
|
|
6249
|
-
|
|
6250
|
-
const
|
|
6251
|
-
|
|
6252
|
-
}),
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6262
|
+
const i = (a, N, S) => Array.isArray(a) ? a[N] ?? (N === 0 ? 0 : 1) : a && typeof a == "object" ? a[S] ?? (N === 0 ? 0 : 1) : N === 0 ? 0 : 1, o = i(I.start, 0, "x") * C - C / 2, h = i(I.start, 1, "y") * g - g / 2, s = i(I.end, 0, "x") * C - C / 2, G = i(I.end, 1, "y") * g - g / 2, w = A.createLinearGradient(o, h, s, G);
|
|
6263
|
+
if (I.stops.forEach((a) => {
|
|
6264
|
+
const N = a.offset !== void 0 ? a.offset : a.pos !== void 0 ? a.pos : a.position !== void 0 ? a.position : 0, S = B(a.color || "#000000", a.opacity ?? 100);
|
|
6265
|
+
w.addColorStop(Math.max(0, Math.min(1, N)), S);
|
|
6266
|
+
}), I.gradientTransform && w.setTransform) {
|
|
6267
|
+
const [a, N, S, k, y, U] = I.gradientTransform;
|
|
6268
|
+
w.setTransform({ a, b: N, c: S, d: k, e: y, f: U });
|
|
6269
|
+
}
|
|
6270
|
+
return w;
|
|
6271
|
+
} else if (I.type === "RadialGradient") {
|
|
6272
|
+
const i = (w, a, N) => Array.isArray(w) ? w[a] ?? 0.5 : w && typeof w == "object" ? w[N] ?? 0.5 : 0.5, o = i(I.center, 0, "x") * C - C / 2, h = i(I.center, 1, "y") * g - g / 2, s = (I.radius ?? 0.5) * Math.max(C, g), G = A.createRadialGradient(o, h, 0, o, h, s);
|
|
6273
|
+
if (I.stops.forEach((w) => {
|
|
6274
|
+
const a = w.offset !== void 0 ? w.offset : w.pos !== void 0 ? w.pos : w.position !== void 0 ? w.position : 0, N = B(w.color || "#000000", w.opacity ?? 100);
|
|
6275
|
+
G.addColorStop(Math.max(0, Math.min(1, a)), N);
|
|
6276
|
+
}), I.gradientTransform && G.setTransform) {
|
|
6277
|
+
const [w, a, N, S, k, y] = I.gradientTransform;
|
|
6278
|
+
G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: y });
|
|
6279
|
+
}
|
|
6280
|
+
return G;
|
|
6281
|
+
} else if (I.type === "AngularGradient") {
|
|
6282
|
+
const i = (w, a, N) => Array.isArray(w) ? w[a] ?? 0.5 : w && typeof w == "object" ? w[N] ?? 0.5 : 0.5, o = i(I.center || [0.5, 0.5], 0, "x") * C - C / 2, h = i(I.center || [0.5, 0.5], 1, "y") * g - g / 2, s = (I.degree || I.angle || 0) * (Math.PI / 180), G = (Q = A.createConicGradient) == null ? void 0 : Q.call(A, s, o, h);
|
|
6283
|
+
if (G) {
|
|
6284
|
+
if (I.stops.forEach((w) => {
|
|
6285
|
+
const a = w.offset !== void 0 ? w.offset : w.pos !== void 0 ? w.pos : w.position !== void 0 ? w.position : 0, N = B(w.color || "#000000", w.opacity ?? 100);
|
|
6286
|
+
G.addColorStop(Math.max(0, Math.min(1, a)), N);
|
|
6287
|
+
}), I.gradientTransform && G.setTransform) {
|
|
6288
|
+
const [w, a, N, S, k, y] = I.gradientTransform;
|
|
6289
|
+
G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: y });
|
|
6290
|
+
}
|
|
6291
|
+
return G;
|
|
6292
|
+
}
|
|
6293
|
+
} else if (I.type === "DiamondGradient") {
|
|
6294
|
+
const i = (w, a, N) => Array.isArray(w) ? w[a] ?? 0.5 : w && typeof w == "object" ? w[N] ?? 0.5 : 0.5, o = i(I.center || [0.5, 0.5], 0, "x") * C - C / 2, h = i(I.center || [0.5, 0.5], 1, "y") * g - g / 2, s = (I.radius ?? 0.5) * Math.max(C, g), G = A.createRadialGradient(o, h, 0, o, h, s);
|
|
6295
|
+
if (I.stops.forEach((w) => {
|
|
6296
|
+
const a = w.offset !== void 0 ? w.offset : w.pos !== void 0 ? w.pos : w.position !== void 0 ? w.position : 0, N = B(w.color || "#000000", w.opacity ?? 100);
|
|
6297
|
+
G.addColorStop(Math.max(0, Math.min(1, a)), N);
|
|
6298
|
+
}), I.gradientTransform && G.setTransform) {
|
|
6299
|
+
const [w, a, N, S, k, y] = I.gradientTransform;
|
|
6300
|
+
G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: y });
|
|
6301
|
+
}
|
|
6302
|
+
return G;
|
|
6259
6303
|
}
|
|
6260
6304
|
}
|
|
6261
6305
|
if (I.type === "Pattern" && I.url) {
|
|
6262
|
-
let
|
|
6263
|
-
if (
|
|
6264
|
-
const
|
|
6265
|
-
if (
|
|
6266
|
-
const
|
|
6267
|
-
|
|
6306
|
+
let B = this.imageCache.get(I.url);
|
|
6307
|
+
if (B || (B = new Image(), B.src = I.url, this.imageCache.set(I.url, B)), B.complete && B.naturalWidth > 0) {
|
|
6308
|
+
const i = A.createPattern(B, "repeat");
|
|
6309
|
+
if (i && (I.scaleX !== void 0 || I.offsetX !== void 0)) {
|
|
6310
|
+
const o = new DOMMatrix(), h = I.scaleX ?? 1, s = I.scaleY ?? 1, G = I.offsetX ?? 0, w = I.offsetY ?? 0, a = I.rotation ?? 0;
|
|
6311
|
+
o.translateSelf(G, w), o.rotateSelf(a), o.scaleSelf(h, s), i.setTransform(o);
|
|
6268
6312
|
}
|
|
6269
|
-
return
|
|
6313
|
+
return i;
|
|
6270
6314
|
}
|
|
6271
6315
|
}
|
|
6272
6316
|
return I.color || null;
|
|
@@ -6283,64 +6327,68 @@ class xC {
|
|
|
6283
6327
|
} catch {
|
|
6284
6328
|
i = parseFloat(i) || 0;
|
|
6285
6329
|
}
|
|
6286
|
-
let o = 0,
|
|
6287
|
-
typeof i == "number" ? o =
|
|
6288
|
-
const
|
|
6289
|
-
o = Math.min(Math.max(0, o),
|
|
6330
|
+
let o = 0, h = 0, s = 0, G = 0;
|
|
6331
|
+
typeof i == "number" ? o = h = s = G = i : Array.isArray(i) ? i.length === 1 ? o = h = s = G = i[0] : i.length === 2 ? (o = s = i[0], h = G = i[1]) : i.length === 3 ? (o = i[0], h = G = i[1], s = i[2]) : i.length >= 4 && (o = i[0], h = i[1], s = i[2], G = i[3]) : i && typeof i == "object" && (o = i.tl ?? i.corner_radius ?? i.cornerRadius ?? 0, h = i.tr ?? i.corner_radius ?? i.cornerRadius ?? 0, s = i.br ?? i.corner_radius ?? i.cornerRadius ?? 0, G = i.bl ?? i.corner_radius ?? i.cornerRadius ?? 0);
|
|
6332
|
+
const w = Math.min(Math.abs(g) / 2, Math.abs(Q) / 2);
|
|
6333
|
+
if (o = Math.min(Math.max(0, o), w), h = Math.min(Math.max(0, h), w), s = Math.min(Math.max(0, s), w), G = Math.min(Math.max(0, G), w), A.roundRect) {
|
|
6334
|
+
A.roundRect(I, C, g, Q, [o, h, s, G]);
|
|
6335
|
+
return;
|
|
6336
|
+
}
|
|
6337
|
+
A.moveTo(I + o, C), A.lineTo(I + g - h, C), A.arcTo(I + g, C, I + g, C + h, h), A.lineTo(I + g, C + Q - s), A.arcTo(I + g, C + Q, I + g - s, C + Q, s), A.lineTo(I + G, C + Q), A.arcTo(I, C + Q, I, C + Q - G, G), A.lineTo(I, C + o), A.arcTo(I, C, I + o, C, o), A.closePath();
|
|
6290
6338
|
}
|
|
6291
6339
|
renderListView(A, I) {
|
|
6292
6340
|
var m, QA, _, BA;
|
|
6293
|
-
const C = this.objectStates.get(I.id) || {}, g = C.options || I.options || {}, Q = C.width !== void 0 ? C.width : ((m = I.geometry) == null ? void 0 : m.width) || 200, B = C.height !== void 0 ? C.height : ((QA = I.geometry) == null ? void 0 : QA.height) || 300, i = -Q / 2, o = -B / 2,
|
|
6294
|
-
if (A.save(), A.globalAlpha *= L,
|
|
6341
|
+
const C = this.objectStates.get(I.id) || {}, g = C.options || I.options || {}, Q = C.width !== void 0 ? C.width : ((m = I.geometry) == null ? void 0 : m.width) || 200, B = C.height !== void 0 ? C.height : ((QA = I.geometry) == null ? void 0 : QA.height) || 300, i = -Q / 2, o = -B / 2, h = C.corner_radius !== void 0 ? C.corner_radius : g.corner_radius ?? 0, s = g.orientation || "vertical", G = g.items || [], w = g.itemGap ?? 10, a = g.itemHeight ?? 50, N = g.itemWidth ?? 200, S = g.scrollOffset ?? 0, k = g.padding ?? 0, y = g.glassEffect !== !1, U = g.accentColor || "#3b82f6", c = g.itemTextColor || "#333333", t = g.itemBackgroundColor || "#ffffff", J = g.hoveredIndex ?? null, R = g.activeItemIndex ?? null, e = g.glowIntensity ?? 0, Y = g.glowColor || "#3b82f6", r = typeof Y == "string" ? Y : Y.color || ((BA = (_ = Y.stops) == null ? void 0 : _[0]) == null ? void 0 : BA.color) || "#3b82f6", L = g.opacity !== void 0 ? g.opacity : I.opacity !== void 0 ? I.opacity : 1;
|
|
6342
|
+
if (A.save(), A.globalAlpha *= L, e > 0 && (A.shadowColor = r, A.shadowBlur = e * 2, A.shadowOffsetX = 0, A.shadowOffsetY = 0), y) {
|
|
6295
6343
|
const X = g.listBackgroundColor || "rgba(31, 41, 55, 0.4)", gA = this.createCanvasFill(A, X, Q, B);
|
|
6296
|
-
A.fillStyle = gA || "rgba(31, 41, 55, 0.4)", this.drawListViewRect(A, i, o, Q, B,
|
|
6344
|
+
A.fillStyle = gA || "rgba(31, 41, 55, 0.4)", this.drawListViewRect(A, i, o, Q, B, h), A.fill();
|
|
6297
6345
|
const O = A.createLinearGradient(i, o, i + Q, o + B);
|
|
6298
|
-
O.addColorStop(0, "rgba(255, 255, 255, 0.15)"), O.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), O.addColorStop(1, "rgba(255, 255, 255, 0.03)"), A.fillStyle = O, this.drawListViewRect(A, i, o, Q, B,
|
|
6346
|
+
O.addColorStop(0, "rgba(255, 255, 255, 0.15)"), O.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), O.addColorStop(1, "rgba(255, 255, 255, 0.03)"), A.fillStyle = O, this.drawListViewRect(A, i, o, Q, B, h), A.fill(), A.strokeStyle = "rgba(255, 255, 255, 0.25)", A.lineWidth = 1, this.drawListViewRect(A, i, o, Q, B, h), A.stroke();
|
|
6299
6347
|
} else {
|
|
6300
6348
|
const X = g.listBackgroundColor || "transparent", gA = this.createCanvasFill(A, X, Q, B);
|
|
6301
|
-
gA && (A.fillStyle = gA, this.drawListViewRect(A, i, o, Q, B,
|
|
6349
|
+
gA && (A.fillStyle = gA, this.drawListViewRect(A, i, o, Q, B, h), A.fill());
|
|
6302
6350
|
const O = g.borderWidth ?? 0;
|
|
6303
|
-
O > 0 && (A.strokeStyle = g.borderColor || "#cccccc", A.lineWidth = O, this.drawListViewRect(A, i, o, Q, B,
|
|
6351
|
+
O > 0 && (A.strokeStyle = g.borderColor || "#cccccc", A.lineWidth = O, this.drawListViewRect(A, i, o, Q, B, h), A.stroke());
|
|
6304
6352
|
}
|
|
6305
|
-
A.shadowBlur = 0, A.save(), this.drawListViewRect(A, i, o, Q, B,
|
|
6306
|
-
const b = typeof
|
|
6307
|
-
let
|
|
6308
|
-
if (A.textBaseline = "middle",
|
|
6309
|
-
const O =
|
|
6310
|
-
if (
|
|
6311
|
-
const Z = this.createCanvasFill(A,
|
|
6312
|
-
A.fillStyle = Z ||
|
|
6353
|
+
A.shadowBlur = 0, A.save(), this.drawListViewRect(A, i, o, Q, B, h), A.clip();
|
|
6354
|
+
const b = typeof k == "number" ? k : s === "vertical" ? k[0] : k[3];
|
|
6355
|
+
let P = (s === "vertical" ? o : i) + S + b;
|
|
6356
|
+
if (A.textBaseline = "middle", G.forEach((X, gA) => {
|
|
6357
|
+
const O = s === "vertical" ? Q : N, q = s === "vertical" ? a : B, W = s === "vertical" ? i : P, f = s === "vertical" ? P : o, T = J === gA, V = R === gA;
|
|
6358
|
+
if (V) {
|
|
6359
|
+
const Z = this.createCanvasFill(A, U, O, q);
|
|
6360
|
+
A.fillStyle = Z || U;
|
|
6313
6361
|
const x = A.globalAlpha;
|
|
6314
|
-
A.globalAlpha = x * 0.8, A.fillRect(W, f, O,
|
|
6362
|
+
A.globalAlpha = x * 0.8, A.fillRect(W, f, O, q), A.globalAlpha = x;
|
|
6315
6363
|
} else if (T)
|
|
6316
|
-
A.fillStyle =
|
|
6364
|
+
A.fillStyle = y ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", A.fillRect(W, f, O, q);
|
|
6317
6365
|
else if (t !== "transparent") {
|
|
6318
|
-
const Z = this.createCanvasFill(A, t, O,
|
|
6319
|
-
A.fillStyle = Z || t, A.fillRect(W, f, O,
|
|
6366
|
+
const Z = this.createCanvasFill(A, t, O, q);
|
|
6367
|
+
A.fillStyle = Z || t, A.fillRect(W, f, O, q);
|
|
6320
6368
|
}
|
|
6321
|
-
if (
|
|
6322
|
-
const Z = this.createCanvasFill(A,
|
|
6323
|
-
A.fillStyle = Z ||
|
|
6369
|
+
if (V || T) {
|
|
6370
|
+
const Z = this.createCanvasFill(A, U, s === "vertical" ? 3 : O, s === "vertical" ? q : 3);
|
|
6371
|
+
A.fillStyle = Z || U, s === "vertical" ? A.fillRect(W, f, 3, q) : A.fillRect(W, f + q - 3, O, 3);
|
|
6324
6372
|
}
|
|
6325
|
-
const p =
|
|
6326
|
-
A.fillStyle = p, A.font =
|
|
6327
|
-
const iA = typeof X == "string" ? X : (X == null ? void 0 : X.label) || `Item ${gA + 1}`, d = W + (
|
|
6328
|
-
|
|
6373
|
+
const p = V ? "#ffffff" : y ? "rgba(255, 255, 255, 0.9)" : c;
|
|
6374
|
+
A.fillStyle = p, A.font = V || T ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
|
|
6375
|
+
const iA = typeof X == "string" ? X : (X == null ? void 0 : X.label) || `Item ${gA + 1}`, d = W + (s === "vertical" ? 16 : O / 2), l = f + q / 2;
|
|
6376
|
+
s === "horizontal" ? A.textAlign = "center" : A.textAlign = "left", A.fillText(iA, d, l), P += (s === "vertical" ? a : N) + w;
|
|
6329
6377
|
}), A.restore(), g.showScrollbar !== !1) {
|
|
6330
|
-
const X = (
|
|
6378
|
+
const X = (G.length || 0) * (s === "vertical" ? a : N) + ((G.length || 0) - 1) * w, gA = s === "vertical" ? B : Q;
|
|
6331
6379
|
if (X > gA) {
|
|
6332
|
-
const O = gA / X,
|
|
6333
|
-
A.fillStyle = f,
|
|
6380
|
+
const O = gA / X, q = gA * O, W = -S / X * gA, f = g.scrollbarColor || "rgba(255,255,255,0.3)", T = g.scrollbarWidth || 4;
|
|
6381
|
+
A.fillStyle = f, s === "vertical" ? A.fillRect(i + Q - T - 2, o + W, T, q) : A.fillRect(i + W, o + B - T - 2, q, T);
|
|
6334
6382
|
}
|
|
6335
6383
|
}
|
|
6336
6384
|
A.restore();
|
|
6337
6385
|
}
|
|
6338
6386
|
updateListViewScrollFromPointer(A) {
|
|
6339
|
-
var
|
|
6387
|
+
var k, y;
|
|
6340
6388
|
if (!this._lastPointerPos || !this._prevPointerPos) return;
|
|
6341
6389
|
const I = A.options || {}, C = I.orientation || "vertical", g = this._lastPointerPos.x - this._prevPointerPos.x, Q = this._lastPointerPos.y - this._prevPointerPos.y;
|
|
6342
6390
|
C === "vertical" ? I.scrollOffset = (I.scrollOffset || 0) + Q : I.scrollOffset = (I.scrollOffset || 0) + g;
|
|
6343
|
-
const B = this.objectStates.get(A.id) || {}, i = I.items || [], o = I.itemGap ?? 10,
|
|
6391
|
+
const B = this.objectStates.get(A.id) || {}, i = I.items || [], o = I.itemGap ?? 10, h = I.itemHeight ?? 50, s = I.itemWidth ?? 200, G = B.width !== void 0 ? B.width : ((k = A.geometry) == null ? void 0 : k.width) || 200, w = B.height !== void 0 ? B.height : ((y = A.geometry) == null ? void 0 : y.height) || 300, a = (i.length || 0) * (C === "vertical" ? h : s) + ((i.length || 0) - 1) * o, S = Math.max(0, a - (C === "vertical" ? w : G) + (I.padding * 2 || 0));
|
|
6344
6392
|
I.scrollOffset > 0 && (I.scrollOffset = 0), I.scrollOffset < -S && (I.scrollOffset = -S);
|
|
6345
6393
|
}
|
|
6346
6394
|
updateListViewHoverFromPointer(A, I, C) {
|
|
@@ -6348,16 +6396,16 @@ class xC {
|
|
|
6348
6396
|
Q.hoveredIndex !== g && (Q.hoveredIndex = g);
|
|
6349
6397
|
}
|
|
6350
6398
|
getListViewItemIndexAtPointer(A, I, C) {
|
|
6351
|
-
var b,
|
|
6399
|
+
var b, P;
|
|
6352
6400
|
const g = A.options || {}, Q = this.objectStates.get(A.id) || {}, B = g.items || [];
|
|
6353
6401
|
if (B.length === 0) return null;
|
|
6354
|
-
const i = Q.width !== void 0 ? Q.width : ((b = A.geometry) == null ? void 0 : b.width) || 200, o = Q.height !== void 0 ? Q.height : ((
|
|
6355
|
-
let L = (
|
|
6402
|
+
const i = Q.width !== void 0 ? Q.width : ((b = A.geometry) == null ? void 0 : b.width) || 200, o = Q.height !== void 0 ? Q.height : ((P = A.geometry) == null ? void 0 : P.height) || 300, h = g.orientation || "vertical", s = g.itemGap ?? 10, G = g.itemHeight ?? 50, w = g.itemWidth ?? 200, a = g.scrollOffset ?? 0, N = g.padding ?? 0, S = this.getWorldTransform(A.id), k = I - S.x, y = C - S.y, U = -S.rotation * (Math.PI / 180), c = Math.cos(U), t = Math.sin(U), J = k * c - y * t, R = k * t + y * c, e = -i / 2, Y = -o / 2, r = typeof N == "number" ? N : h === "vertical" ? N[0] : N[3];
|
|
6403
|
+
let L = (h === "vertical" ? Y : e) + a + r;
|
|
6356
6404
|
for (let IA = 0; IA < B.length; IA++) {
|
|
6357
|
-
const m =
|
|
6358
|
-
if (J >= _ && J <= _ + m &&
|
|
6405
|
+
const m = h === "vertical" ? i : w, QA = h === "vertical" ? G : o, _ = h === "vertical" ? e : L, BA = h === "vertical" ? L : Y;
|
|
6406
|
+
if (J >= _ && J <= _ + m && R >= BA && R <= BA + QA)
|
|
6359
6407
|
return IA;
|
|
6360
|
-
L += (
|
|
6408
|
+
L += (h === "vertical" ? G : w) + s;
|
|
6361
6409
|
}
|
|
6362
6410
|
return null;
|
|
6363
6411
|
}
|
|
@@ -6376,104 +6424,104 @@ const PC = RC(
|
|
|
6376
6424
|
alignment: B = "Center",
|
|
6377
6425
|
onReady: i,
|
|
6378
6426
|
onTrigger: o,
|
|
6379
|
-
onInputUpdate:
|
|
6380
|
-
onComponentChange:
|
|
6381
|
-
onToggle:
|
|
6382
|
-
onInputChange:
|
|
6427
|
+
onInputUpdate: h,
|
|
6428
|
+
onComponentChange: s,
|
|
6429
|
+
onToggle: G,
|
|
6430
|
+
onInputChange: w,
|
|
6383
6431
|
onInputFocus: a,
|
|
6384
6432
|
onInputBlur: N
|
|
6385
6433
|
}, S) => {
|
|
6386
|
-
const
|
|
6387
|
-
tC(S, () =>
|
|
6388
|
-
console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"),
|
|
6434
|
+
const k = wI(null), y = wI(new xC()), U = wI(), c = wI(0);
|
|
6435
|
+
tC(S, () => k.current), eA(() => {
|
|
6436
|
+
console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"), y.current.setLayout(Q, B);
|
|
6389
6437
|
}, [Q, B]), eA(() => {
|
|
6390
|
-
o &&
|
|
6438
|
+
o && y.current.setTriggerCallback(o);
|
|
6391
6439
|
}, [o]), eA(() => {
|
|
6392
|
-
|
|
6393
|
-
}, [w]), eA(() => {
|
|
6394
|
-
G && M.current.setComponentChangeCallback(G);
|
|
6395
|
-
}, [G]), eA(() => {
|
|
6396
|
-
h && M.current.setToggleCallback(h);
|
|
6440
|
+
h && y.current.setInputUpdateCallback(h);
|
|
6397
6441
|
}, [h]), eA(() => {
|
|
6398
|
-
s &&
|
|
6442
|
+
s && y.current.setComponentChangeCallback(s);
|
|
6399
6443
|
}, [s]), eA(() => {
|
|
6400
|
-
|
|
6444
|
+
G && y.current.setToggleCallback(G);
|
|
6445
|
+
}, [G]), eA(() => {
|
|
6446
|
+
w && y.current.setInputChangeCallback(w);
|
|
6447
|
+
}, [w]), eA(() => {
|
|
6448
|
+
a && y.current.setInputFocusCallback(a);
|
|
6401
6449
|
}, [a]), eA(() => {
|
|
6402
|
-
N &&
|
|
6450
|
+
N && y.current.setInputBlurCallback(N);
|
|
6403
6451
|
}, [N]), eA(() => {
|
|
6404
6452
|
(async () => {
|
|
6405
|
-
const
|
|
6406
|
-
let
|
|
6407
|
-
if (!
|
|
6453
|
+
const R = y.current;
|
|
6454
|
+
let e = D;
|
|
6455
|
+
if (!e && A)
|
|
6408
6456
|
try {
|
|
6409
|
-
|
|
6410
|
-
} catch (
|
|
6411
|
-
console.error("Failed to load ExodeUI animation:",
|
|
6457
|
+
e = await (await fetch(A)).json();
|
|
6458
|
+
} catch (Y) {
|
|
6459
|
+
console.error("Failed to load ExodeUI animation:", Y);
|
|
6412
6460
|
return;
|
|
6413
6461
|
}
|
|
6414
|
-
|
|
6462
|
+
e && (R.load(e), i && i(R));
|
|
6415
6463
|
})();
|
|
6416
6464
|
}, [D, A]), eA(() => {
|
|
6417
|
-
const J =
|
|
6418
|
-
if (!
|
|
6419
|
-
const
|
|
6420
|
-
if (!
|
|
6421
|
-
const
|
|
6422
|
-
|
|
6423
|
-
const L = (r -
|
|
6424
|
-
|
|
6425
|
-
const b = window.devicePixelRatio || 1,
|
|
6426
|
-
(
|
|
6465
|
+
const J = y.current, R = k.current;
|
|
6466
|
+
if (!R) return;
|
|
6467
|
+
const e = R.getContext("2d");
|
|
6468
|
+
if (!e) return;
|
|
6469
|
+
const Y = (r) => {
|
|
6470
|
+
c.current || (c.current = r);
|
|
6471
|
+
const L = (r - c.current) / 1e3;
|
|
6472
|
+
c.current = r, g && J.advance(L);
|
|
6473
|
+
const b = window.devicePixelRatio || 1, P = R.getBoundingClientRect(), IA = Math.floor(P.width * b), m = Math.floor(P.height * b);
|
|
6474
|
+
(R.width !== IA || R.height !== m) && (R.width = IA, R.height = m), J.render(e, IA, m), U.current = requestAnimationFrame(Y);
|
|
6427
6475
|
};
|
|
6428
|
-
return
|
|
6429
|
-
|
|
6476
|
+
return U.current = requestAnimationFrame(Y), () => {
|
|
6477
|
+
U.current && cancelAnimationFrame(U.current);
|
|
6430
6478
|
};
|
|
6431
6479
|
}, [g]);
|
|
6432
|
-
const t = (J,
|
|
6433
|
-
const
|
|
6434
|
-
|
|
6480
|
+
const t = (J, R) => {
|
|
6481
|
+
const e = J.currentTarget.getBoundingClientRect(), Y = J.clientX - e.left, r = J.clientY - e.top, L = e.width, b = e.height;
|
|
6482
|
+
y.current.handlePointerInput(R, Y, r, L, b);
|
|
6435
6483
|
};
|
|
6436
6484
|
return /* @__PURE__ */ UC(
|
|
6437
6485
|
"canvas",
|
|
6438
6486
|
{
|
|
6439
|
-
ref:
|
|
6487
|
+
ref: k,
|
|
6440
6488
|
style: { width: "100%", height: "100%", outline: "none", ...C },
|
|
6441
6489
|
className: I,
|
|
6442
6490
|
tabIndex: 0,
|
|
6443
6491
|
onPointerDown: (J) => {
|
|
6444
|
-
var
|
|
6445
|
-
t(J, "down"), (
|
|
6492
|
+
var R;
|
|
6493
|
+
t(J, "down"), (R = k.current) == null || R.focus();
|
|
6446
6494
|
},
|
|
6447
6495
|
onPointerUp: (J) => t(J, "up"),
|
|
6448
6496
|
onPointerMove: (J) => t(J, "move"),
|
|
6449
6497
|
onPointerLeave: (J) => t(J, "blur"),
|
|
6450
6498
|
onClick: (J) => t(J, "click"),
|
|
6451
6499
|
onKeyDown: (J) => {
|
|
6452
|
-
J.key === "Backspace" || J.key === "Enter" || J.key,
|
|
6500
|
+
J.key === "Backspace" || J.key === "Enter" || J.key, y.current.handleKeyDown(J.nativeEvent);
|
|
6453
6501
|
}
|
|
6454
6502
|
}
|
|
6455
6503
|
);
|
|
6456
6504
|
}
|
|
6457
6505
|
);
|
|
6458
6506
|
function VC() {
|
|
6459
|
-
const [D, A] = cC(null), I =
|
|
6460
|
-
D == null || D.setInputBool(
|
|
6461
|
-
}, [D]), C =
|
|
6462
|
-
D == null || D.setInputNumber(
|
|
6463
|
-
}, [D]), g =
|
|
6464
|
-
D == null || D.fireTrigger(
|
|
6465
|
-
}, [D]), Q =
|
|
6466
|
-
D == null || D.setInputText(
|
|
6467
|
-
}, [D]), B =
|
|
6468
|
-
D == null || D.setInputNumberArray(
|
|
6469
|
-
}, [D]), i =
|
|
6470
|
-
D == null || D.setInputStringArray(
|
|
6471
|
-
}, [D]), o =
|
|
6472
|
-
D == null || D.updateObjectOptions(
|
|
6473
|
-
}, [D]),
|
|
6474
|
-
D == null || D.updateConstraint(
|
|
6475
|
-
}, [D]),
|
|
6476
|
-
D == null || D.updateGraphData(
|
|
6507
|
+
const [D, A] = cC(null), I = nA((G, w) => {
|
|
6508
|
+
D == null || D.setInputBool(G, w);
|
|
6509
|
+
}, [D]), C = nA((G, w) => {
|
|
6510
|
+
D == null || D.setInputNumber(G, w);
|
|
6511
|
+
}, [D]), g = nA((G) => {
|
|
6512
|
+
D == null || D.fireTrigger(G);
|
|
6513
|
+
}, [D]), Q = nA((G, w) => {
|
|
6514
|
+
D == null || D.setInputText(G, w);
|
|
6515
|
+
}, [D]), B = nA((G, w) => {
|
|
6516
|
+
D == null || D.setInputNumberArray(G, w);
|
|
6517
|
+
}, [D]), i = nA((G, w) => {
|
|
6518
|
+
D == null || D.setInputStringArray(G, w);
|
|
6519
|
+
}, [D]), o = nA((G, w) => {
|
|
6520
|
+
D == null || D.updateObjectOptions(G, w);
|
|
6521
|
+
}, [D]), h = nA((G, w, a) => {
|
|
6522
|
+
D == null || D.updateConstraint(G, w, a);
|
|
6523
|
+
}, [D]), s = nA((G, w) => {
|
|
6524
|
+
D == null || D.updateGraphData(G, w);
|
|
6477
6525
|
}, [D]);
|
|
6478
6526
|
return {
|
|
6479
6527
|
setEngine: A,
|
|
@@ -6485,8 +6533,8 @@ function VC() {
|
|
|
6485
6533
|
setInputText: Q,
|
|
6486
6534
|
setInputNumberArray: B,
|
|
6487
6535
|
setInputStringArray: i,
|
|
6488
|
-
updateConstraint:
|
|
6489
|
-
updateGraphData:
|
|
6536
|
+
updateConstraint: h,
|
|
6537
|
+
updateGraphData: s,
|
|
6490
6538
|
updateObjectOptions: o
|
|
6491
6539
|
};
|
|
6492
6540
|
}
|