exodeui 2.6.21 → 2.6.23
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 -0
- package/dist/index.js +4 -4
- package/dist/index.mjs +1231 -1182
- package/dist/types.d.ts +1 -0
- package/dist/useExodeUI.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
var NC = Object.defineProperty;
|
|
2
2
|
var kC = (i, A, I) => A in i ? NC(i, A, { enumerable: !0, configurable: !0, writable: !0, value: I }) : i[A] = I;
|
|
3
|
-
var
|
|
3
|
+
var $ = (i, A, I) => kC(i, typeof A != "symbol" ? A + "" : A, I);
|
|
4
4
|
import { jsx as yC } from "react/jsx-runtime";
|
|
5
|
-
import { forwardRef as FC, useRef as DI, useImperativeHandle as MC, useEffect as
|
|
5
|
+
import { forwardRef as FC, useRef as DI, useImperativeHandle as MC, useEffect as jA, useState as JC, useCallback as HA } from "react";
|
|
6
6
|
var UC = /* @__PURE__ */ ((i) => (i.Equal = "Equal", i.NotEqual = "NotEqual", i.GreaterThan = "GreaterThan", i.LessThan = "LessThan", i.GreaterEqual = "GreaterEqual", i.LessEqual = "LessEqual", i.IsTrue = "IsTrue", i.IsFalse = "IsFalse", i))(UC || {}), uA = /* @__PURE__ */ ((i) => (i.AND = "AND", i.OR = "OR", i.NOT = "NOT", i.XOR = "XOR", i))(uA || {});
|
|
7
7
|
let E;
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
return
|
|
8
|
+
const j = new Array(128).fill(void 0);
|
|
9
|
+
function W(i) {
|
|
10
|
+
return j[i];
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
let $A =
|
|
14
|
-
function
|
|
15
|
-
$A ===
|
|
12
|
+
j.push(void 0, null, !0, !1);
|
|
13
|
+
let $A = j.length;
|
|
14
|
+
function P(i) {
|
|
15
|
+
$A === j.length && j.push(j.length + 1);
|
|
16
16
|
const A = $A;
|
|
17
|
-
return $A =
|
|
17
|
+
return $A = j[A], j[A] = i, A;
|
|
18
18
|
}
|
|
19
19
|
function oI(i, A) {
|
|
20
20
|
try {
|
|
21
21
|
return i.apply(this, A);
|
|
22
22
|
} catch (I) {
|
|
23
|
-
E.__wbindgen_export_0(
|
|
23
|
+
E.__wbindgen_export_0(P(I));
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
const Tg = typeof TextDecoder < "u" ? new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }) : { decode: () => {
|
|
@@ -31,26 +31,26 @@ let VA = null;
|
|
|
31
31
|
function fI(i, A) {
|
|
32
32
|
return i >>>= 0, Tg.decode((VA !== null && VA.byteLength !== 0 || (VA = new Uint8Array(E.memory.buffer)), VA).subarray(i, i + A));
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function L(i) {
|
|
35
35
|
return i == null;
|
|
36
36
|
}
|
|
37
|
-
let
|
|
38
|
-
function
|
|
39
|
-
return (
|
|
37
|
+
let bA = null;
|
|
38
|
+
function GA() {
|
|
39
|
+
return (bA === null || bA.buffer.detached === !0 || bA.buffer.detached === void 0 && bA.buffer !== E.memory.buffer) && (bA = new DataView(E.memory.buffer)), bA;
|
|
40
40
|
}
|
|
41
41
|
function wI(i) {
|
|
42
|
-
const A =
|
|
42
|
+
const A = W(i);
|
|
43
43
|
return function(I) {
|
|
44
|
-
I < 132 || (
|
|
44
|
+
I < 132 || (j[I] = $A, $A = I);
|
|
45
45
|
}(i), A;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function K(i, A) {
|
|
48
48
|
if (!(i instanceof A)) throw new Error(`expected instance of ${A.name}`);
|
|
49
49
|
}
|
|
50
|
-
let
|
|
50
|
+
let AA = 128;
|
|
51
51
|
function CA(i) {
|
|
52
|
-
if (
|
|
53
|
-
return
|
|
52
|
+
if (AA == 1) throw new Error("out of js stack");
|
|
53
|
+
return j[--AA] = i, AA;
|
|
54
54
|
}
|
|
55
55
|
let PA = null;
|
|
56
56
|
function RC(i, A) {
|
|
@@ -64,25 +64,25 @@ function Kg(i, A) {
|
|
|
64
64
|
return i >>>= 0, Zg().subarray(i / 4, i / 4 + A);
|
|
65
65
|
}
|
|
66
66
|
let _A = null;
|
|
67
|
-
function
|
|
67
|
+
function Og() {
|
|
68
68
|
return _A !== null && _A.byteLength !== 0 || (_A = new Uint32Array(E.memory.buffer)), _A;
|
|
69
69
|
}
|
|
70
70
|
let FA = 0;
|
|
71
71
|
function tI(i, A) {
|
|
72
72
|
const I = A(4 * i.length, 4) >>> 0;
|
|
73
|
-
return
|
|
73
|
+
return Og().set(i, I / 4), FA = i.length, I;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function pA(i, A) {
|
|
76
76
|
const I = A(4 * i.length, 4) >>> 0;
|
|
77
77
|
return Zg().set(i, I / 4), FA = i.length, I;
|
|
78
78
|
}
|
|
79
|
-
const NI = Object.freeze({ LinX: 0, 0: "LinX", LinY: 1, 1: "LinY", AngX: 2, 2: "AngX" }),
|
|
79
|
+
const NI = Object.freeze({ LinX: 0, 0: "LinX", LinY: 1, 1: "LinY", AngX: 2, 2: "AngX" }), dA = 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" }), NA = 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" }), YI = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
80
80
|
}, unregister: () => {
|
|
81
81
|
} } : new FinalizationRegistry((i) => E.__wbg_rawbroadphase_free(i >>> 0, 1));
|
|
82
|
-
class
|
|
82
|
+
class fA {
|
|
83
83
|
static __wrap(A) {
|
|
84
84
|
A >>>= 0;
|
|
85
|
-
const I = Object.create(
|
|
85
|
+
const I = Object.create(fA.prototype);
|
|
86
86
|
return I.__wbg_ptr = A, YI.register(I, I.__wbg_ptr, I), I;
|
|
87
87
|
}
|
|
88
88
|
__destroy_into_raw() {
|
|
@@ -97,87 +97,87 @@ class dA {
|
|
|
97
97
|
const A = E.rawbroadphase_new();
|
|
98
98
|
return this.__wbg_ptr = A >>> 0, YI.register(this, this.__wbg_ptr, this), this;
|
|
99
99
|
}
|
|
100
|
-
castRay(A, I, C, g, Q, B, D,
|
|
100
|
+
castRay(A, I, C, g, Q, B, D, w, o, h, G, s) {
|
|
101
101
|
try {
|
|
102
|
-
|
|
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, D,
|
|
102
|
+
K(A, oA), K(I, IA), K(C, EA), K(g, k), K(Q, k);
|
|
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, D, w, L(o) ? 4294967297 : o >>> 0, !L(h), L(h) ? 0 : h, !L(G), L(G) ? 0 : G, CA(s));
|
|
104
104
|
return a === 0 ? void 0 : _I.__wrap(a);
|
|
105
105
|
} finally {
|
|
106
|
-
|
|
106
|
+
j[AA++] = void 0;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
castRayAndGetNormal(A, I, C, g, Q, B, D,
|
|
109
|
+
castRayAndGetNormal(A, I, C, g, Q, B, D, w, o, h, G, s) {
|
|
110
110
|
try {
|
|
111
|
-
|
|
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, D,
|
|
111
|
+
K(A, oA), K(I, IA), K(C, EA), K(g, k), K(Q, k);
|
|
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, D, w, L(o) ? 4294967297 : o >>> 0, !L(h), L(h) ? 0 : h, !L(G), L(G) ? 0 : G, CA(s));
|
|
113
113
|
return a === 0 ? void 0 : FI.__wrap(a);
|
|
114
114
|
} finally {
|
|
115
|
-
|
|
115
|
+
j[AA++] = void 0;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
intersectionsWithRay(A, I, C, g, Q, B, D,
|
|
118
|
+
intersectionsWithRay(A, I, C, g, Q, B, D, w, o, h, G, s, a) {
|
|
119
119
|
try {
|
|
120
|
-
|
|
120
|
+
K(A, oA), K(I, IA), K(C, EA), K(g, k), K(Q, k), E.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, D, CA(w), o, L(h) ? 4294967297 : h >>> 0, !L(G), L(G) ? 0 : G, !L(s), L(s) ? 0 : s, CA(a));
|
|
121
121
|
} finally {
|
|
122
|
-
|
|
122
|
+
j[AA++] = void 0, j[AA++] = void 0;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
intersectionWithShape(A, I, C, g, Q, B, D,
|
|
125
|
+
intersectionWithShape(A, I, C, g, Q, B, D, w, o, h, G) {
|
|
126
126
|
try {
|
|
127
127
|
const M = E.__wbindgen_add_to_stack_pointer(-16);
|
|
128
|
-
|
|
129
|
-
var
|
|
130
|
-
return
|
|
128
|
+
K(A, oA), K(I, IA), K(C, EA), K(g, k), K(Q, m), K(B, d), E.rawbroadphase_intersectionWithShape(M, this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D, L(w) ? 4294967297 : w >>> 0, !L(o), L(o) ? 0 : o, !L(h), L(h) ? 0 : h, CA(G));
|
|
129
|
+
var s = GA().getInt32(M + 0, !0), a = GA().getFloat64(M + 8, !0);
|
|
130
|
+
return s === 0 ? void 0 : a;
|
|
131
131
|
} finally {
|
|
132
|
-
E.__wbindgen_add_to_stack_pointer(16),
|
|
132
|
+
E.__wbindgen_add_to_stack_pointer(16), j[AA++] = void 0;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
projectPoint(A, I, C, g, Q, B, D,
|
|
135
|
+
projectPoint(A, I, C, g, Q, B, D, w, o, h) {
|
|
136
136
|
try {
|
|
137
|
-
|
|
138
|
-
const G = E.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B,
|
|
139
|
-
return G === 0 ? void 0 :
|
|
137
|
+
K(A, oA), K(I, IA), K(C, EA), K(g, k);
|
|
138
|
+
const G = E.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, L(D) ? 4294967297 : D >>> 0, !L(w), L(w) ? 0 : w, !L(o), L(o) ? 0 : o, CA(h));
|
|
139
|
+
return G === 0 ? void 0 : hI.__wrap(G);
|
|
140
140
|
} finally {
|
|
141
|
-
|
|
141
|
+
j[AA++] = void 0;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
projectPointAndGetFeature(A, I, C, g, Q, B, D,
|
|
144
|
+
projectPointAndGetFeature(A, I, C, g, Q, B, D, w, o) {
|
|
145
145
|
try {
|
|
146
|
-
|
|
147
|
-
const h = E.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q,
|
|
148
|
-
return h === 0 ? void 0 :
|
|
146
|
+
K(A, oA), K(I, IA), K(C, EA), K(g, k);
|
|
147
|
+
const h = E.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, L(B) ? 4294967297 : B >>> 0, !L(D), L(D) ? 0 : D, !L(w), L(w) ? 0 : w, CA(o));
|
|
148
|
+
return h === 0 ? void 0 : hI.__wrap(h);
|
|
149
149
|
} finally {
|
|
150
|
-
|
|
150
|
+
j[AA++] = void 0;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
intersectionsWithPoint(A, I, C, g, Q, B, D,
|
|
153
|
+
intersectionsWithPoint(A, I, C, g, Q, B, D, w, o, h) {
|
|
154
154
|
try {
|
|
155
|
-
|
|
155
|
+
K(A, oA), K(I, IA), K(C, EA), K(g, k), E.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, CA(Q), B, L(D) ? 4294967297 : D >>> 0, !L(w), L(w) ? 0 : w, !L(o), L(o) ? 0 : o, CA(h));
|
|
156
156
|
} finally {
|
|
157
|
-
|
|
157
|
+
j[AA++] = void 0, j[AA++] = void 0;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
castShape(A, I, C, g, Q, B, D,
|
|
160
|
+
castShape(A, I, C, g, Q, B, D, w, o, h, G, s, a, M, y) {
|
|
161
161
|
try {
|
|
162
|
-
|
|
163
|
-
const J = E.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr,
|
|
162
|
+
K(A, oA), K(I, IA), K(C, EA), K(g, k), K(Q, m), K(B, k), K(D, d);
|
|
163
|
+
const J = E.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr, w, o, h, G, L(s) ? 4294967297 : s >>> 0, !L(a), L(a) ? 0 : a, !L(M), L(M) ? 0 : M, CA(y));
|
|
164
164
|
return J === 0 ? void 0 : kI.__wrap(J);
|
|
165
165
|
} finally {
|
|
166
|
-
|
|
166
|
+
j[AA++] = void 0;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
intersectionsWithShape(A, I, C, g, Q, B, D,
|
|
169
|
+
intersectionsWithShape(A, I, C, g, Q, B, D, w, o, h, G, s) {
|
|
170
170
|
try {
|
|
171
|
-
|
|
171
|
+
K(A, oA), K(I, IA), K(C, EA), K(g, k), K(Q, m), K(B, d), E.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, CA(D), w, L(o) ? 4294967297 : o >>> 0, !L(h), L(h) ? 0 : h, !L(G), L(G) ? 0 : G, CA(s));
|
|
172
172
|
} finally {
|
|
173
|
-
|
|
173
|
+
j[AA++] = void 0, j[AA++] = void 0;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
collidersWithAabbIntersectingAabb(A, I, C, g, Q, B) {
|
|
177
177
|
try {
|
|
178
|
-
|
|
178
|
+
K(A, oA), K(I, IA), K(C, EA), K(g, k), K(Q, k), E.rawbroadphase_collidersWithAabbIntersectingAabb(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, CA(B));
|
|
179
179
|
} finally {
|
|
180
|
-
|
|
180
|
+
j[AA++] = void 0;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
}
|
|
@@ -201,7 +201,7 @@ class bI {
|
|
|
201
201
|
const Sg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
202
202
|
}, unregister: () => {
|
|
203
203
|
} } : new FinalizationRegistry((i) => E.__wbg_rawcharactercollision_free(i >>> 0, 1));
|
|
204
|
-
class
|
|
204
|
+
class Wg {
|
|
205
205
|
__destroy_into_raw() {
|
|
206
206
|
const A = this.__wbg_ptr;
|
|
207
207
|
return this.__wbg_ptr = 0, Sg.unregister(this), A;
|
|
@@ -219,39 +219,39 @@ class Og {
|
|
|
219
219
|
}
|
|
220
220
|
translationDeltaApplied() {
|
|
221
221
|
const A = E.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
|
|
222
|
-
return
|
|
222
|
+
return k.__wrap(A);
|
|
223
223
|
}
|
|
224
224
|
translationDeltaRemaining() {
|
|
225
225
|
const A = E.rawcharactercollision_translationDeltaRemaining(this.__wbg_ptr);
|
|
226
|
-
return
|
|
226
|
+
return k.__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 k.__wrap(A);
|
|
234
234
|
}
|
|
235
235
|
worldWitness2() {
|
|
236
236
|
const A = E.rawcharactercollision_worldWitness2(this.__wbg_ptr);
|
|
237
|
-
return
|
|
237
|
+
return k.__wrap(A);
|
|
238
238
|
}
|
|
239
239
|
worldNormal1() {
|
|
240
240
|
const A = E.rawcharactercollision_worldNormal1(this.__wbg_ptr);
|
|
241
|
-
return
|
|
241
|
+
return k.__wrap(A);
|
|
242
242
|
}
|
|
243
243
|
worldNormal2() {
|
|
244
244
|
const A = E.rawcharactercollision_worldNormal2(this.__wbg_ptr);
|
|
245
|
-
return
|
|
245
|
+
return k.__wrap(A);
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
const eI = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
249
249
|
}, unregister: () => {
|
|
250
250
|
} } : new FinalizationRegistry((i) => E.__wbg_rawcolliderset_free(i >>> 0, 1));
|
|
251
|
-
class
|
|
251
|
+
class EA {
|
|
252
252
|
static __wrap(A) {
|
|
253
253
|
A >>>= 0;
|
|
254
|
-
const I = Object.create(
|
|
254
|
+
const I = Object.create(EA.prototype);
|
|
255
255
|
return I.__wbg_ptr = A, eI.register(I, I.__wbg_ptr, I), I;
|
|
256
256
|
}
|
|
257
257
|
__destroy_into_raw() {
|
|
@@ -264,19 +264,19 @@ class QA {
|
|
|
264
264
|
}
|
|
265
265
|
coTranslation(A) {
|
|
266
266
|
const I = E.rawcolliderset_coTranslation(this.__wbg_ptr, A);
|
|
267
|
-
return
|
|
267
|
+
return k.__wrap(I);
|
|
268
268
|
}
|
|
269
269
|
coRotation(A) {
|
|
270
270
|
const I = E.rawcolliderset_coRotation(this.__wbg_ptr, A);
|
|
271
|
-
return
|
|
271
|
+
return m.__wrap(I);
|
|
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 : k.__wrap(I);
|
|
276
276
|
}
|
|
277
277
|
coRotationWrtParent(A) {
|
|
278
278
|
const I = E.rawcolliderset_coRotationWrtParent(this.__wbg_ptr, A);
|
|
279
|
-
return I === 0 ? void 0 :
|
|
279
|
+
return I === 0 ? void 0 : m.__wrap(I);
|
|
280
280
|
}
|
|
281
281
|
coSetTranslation(A, I, C) {
|
|
282
282
|
E.rawcolliderset_coSetTranslation(this.__wbg_ptr, A, I, C);
|
|
@@ -298,14 +298,14 @@ class QA {
|
|
|
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 : k.__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 : k.__wrap(I);
|
|
306
306
|
}
|
|
307
307
|
coSetHalfExtents(A, I) {
|
|
308
|
-
|
|
308
|
+
K(I, k), 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);
|
|
@@ -332,7 +332,7 @@ class QA {
|
|
|
332
332
|
try {
|
|
333
333
|
const g = E.__wbindgen_add_to_stack_pointer(-16);
|
|
334
334
|
E.rawcolliderset_coVoxelData(g, this.__wbg_ptr, A);
|
|
335
|
-
var I =
|
|
335
|
+
var I = GA().getInt32(g + 0, !0), C = GA().getInt32(g + 4, !0);
|
|
336
336
|
let Q;
|
|
337
337
|
return I !== 0 && (Q = RC(I, C).slice(), E.__wbindgen_export_1(I, 4 * C, 4)), Q;
|
|
338
338
|
} finally {
|
|
@@ -341,7 +341,7 @@ class QA {
|
|
|
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 : k.__wrap(I);
|
|
345
345
|
}
|
|
346
346
|
coSetVoxel(A, I, C, g) {
|
|
347
347
|
E.rawcolliderset_coSetVoxel(this.__wbg_ptr, A, I, C, g);
|
|
@@ -356,7 +356,7 @@ class QA {
|
|
|
356
356
|
try {
|
|
357
357
|
const g = E.__wbindgen_add_to_stack_pointer(-16);
|
|
358
358
|
E.rawcolliderset_coVertices(g, this.__wbg_ptr, A);
|
|
359
|
-
var I =
|
|
359
|
+
var I = GA().getInt32(g + 0, !0), C = GA().getInt32(g + 4, !0);
|
|
360
360
|
let Q;
|
|
361
361
|
return I !== 0 && (Q = Kg(I, C).slice(), E.__wbindgen_export_1(I, 4 * C, 4)), Q;
|
|
362
362
|
} finally {
|
|
@@ -367,10 +367,10 @@ class QA {
|
|
|
367
367
|
try {
|
|
368
368
|
const g = E.__wbindgen_add_to_stack_pointer(-16);
|
|
369
369
|
E.rawcolliderset_coIndices(g, this.__wbg_ptr, A);
|
|
370
|
-
var I =
|
|
370
|
+
var I = GA().getInt32(g + 0, !0), C = GA().getInt32(g + 4, !0);
|
|
371
371
|
let Q;
|
|
372
372
|
return I !== 0 && (Q = function(B, D) {
|
|
373
|
-
return B >>>= 0,
|
|
373
|
+
return B >>>= 0, Og().subarray(B / 4, B / 4 + D);
|
|
374
374
|
}(I, C).slice(), E.__wbindgen_export_1(I, 4 * C, 4)), Q;
|
|
375
375
|
} finally {
|
|
376
376
|
E.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -384,7 +384,7 @@ class QA {
|
|
|
384
384
|
try {
|
|
385
385
|
const g = E.__wbindgen_add_to_stack_pointer(-16);
|
|
386
386
|
E.rawcolliderset_coHeightfieldHeights(g, this.__wbg_ptr, A);
|
|
387
|
-
var I =
|
|
387
|
+
var I = GA().getInt32(g + 0, !0), C = GA().getInt32(g + 4, !0);
|
|
388
388
|
let Q;
|
|
389
389
|
return I !== 0 && (Q = Kg(I, C).slice(), E.__wbindgen_export_1(I, 4 * C, 4)), Q;
|
|
390
390
|
} finally {
|
|
@@ -393,13 +393,13 @@ class QA {
|
|
|
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 : k.__wrap(I);
|
|
397
397
|
}
|
|
398
398
|
coParent(A) {
|
|
399
399
|
try {
|
|
400
400
|
const g = E.__wbindgen_add_to_stack_pointer(-16);
|
|
401
401
|
E.rawcolliderset_coParent(g, this.__wbg_ptr, A);
|
|
402
|
-
var I =
|
|
402
|
+
var I = GA().getInt32(g + 0, !0), C = GA().getFloat64(g + 8, !0);
|
|
403
403
|
return I === 0 ? void 0 : C;
|
|
404
404
|
} finally {
|
|
405
405
|
E.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -451,23 +451,23 @@ class QA {
|
|
|
451
451
|
return E.rawcolliderset_coContactForceEventThreshold(this.__wbg_ptr, A);
|
|
452
452
|
}
|
|
453
453
|
coContainsPoint(A, I) {
|
|
454
|
-
return
|
|
454
|
+
return K(I, k), E.rawcolliderset_coContainsPoint(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
|
|
455
455
|
}
|
|
456
|
-
coCastShape(A, I, C, g, Q, B, D,
|
|
457
|
-
|
|
458
|
-
const h = E.rawcolliderset_coCastShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D,
|
|
456
|
+
coCastShape(A, I, C, g, Q, B, D, w, o) {
|
|
457
|
+
K(I, k), K(C, d), K(g, k), K(Q, m), K(B, k);
|
|
458
|
+
const h = E.rawcolliderset_coCastShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D, w, o);
|
|
459
459
|
return h === 0 ? void 0 : JI.__wrap(h);
|
|
460
460
|
}
|
|
461
461
|
coCastCollider(A, I, C, g, Q, B, D) {
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
return
|
|
462
|
+
K(I, k), K(g, k);
|
|
463
|
+
const w = E.rawcolliderset_coCastCollider(this.__wbg_ptr, A, I.__wbg_ptr, C, g.__wbg_ptr, Q, B, D);
|
|
464
|
+
return w === 0 ? void 0 : kI.__wrap(w);
|
|
465
465
|
}
|
|
466
466
|
coIntersectsShape(A, I, C, g) {
|
|
467
|
-
return
|
|
467
|
+
return K(I, d), K(C, k), K(g, m), 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
|
-
|
|
470
|
+
K(I, d), K(C, k), K(g, m);
|
|
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 : AI.__wrap(B);
|
|
473
473
|
}
|
|
@@ -476,18 +476,18 @@ class QA {
|
|
|
476
476
|
return g === 0 ? void 0 : AI.__wrap(g);
|
|
477
477
|
}
|
|
478
478
|
coProjectPoint(A, I, C) {
|
|
479
|
-
|
|
479
|
+
K(I, k);
|
|
480
480
|
const g = E.rawcolliderset_coProjectPoint(this.__wbg_ptr, A, I.__wbg_ptr, C);
|
|
481
481
|
return yI.__wrap(g);
|
|
482
482
|
}
|
|
483
483
|
coIntersectsRay(A, I, C, g) {
|
|
484
|
-
return
|
|
484
|
+
return K(I, k), K(C, k), 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
|
|
487
|
+
return K(I, k), K(C, k), 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
|
-
|
|
490
|
+
K(I, k), K(C, k);
|
|
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 : MI.__wrap(B);
|
|
493
493
|
}
|
|
@@ -528,7 +528,7 @@ class QA {
|
|
|
528
528
|
E.rawcolliderset_coSetActiveCollisionTypes(this.__wbg_ptr, A, I);
|
|
529
529
|
}
|
|
530
530
|
coSetShape(A, I) {
|
|
531
|
-
|
|
531
|
+
K(I, d), E.rawcolliderset_coSetShape(this.__wbg_ptr, A, I.__wbg_ptr);
|
|
532
532
|
}
|
|
533
533
|
coSetContactForceEventThreshold(A, I) {
|
|
534
534
|
E.rawcolliderset_coSetContactForceEventThreshold(this.__wbg_ptr, A, I);
|
|
@@ -540,7 +540,7 @@ class QA {
|
|
|
540
540
|
E.rawcolliderset_coSetMass(this.__wbg_ptr, A, I);
|
|
541
541
|
}
|
|
542
542
|
coSetMassProperties(A, I, C, g) {
|
|
543
|
-
|
|
543
|
+
K(C, k), 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,18 +552,18 @@ class QA {
|
|
|
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, D,
|
|
555
|
+
createCollider(A, I, C, g, Q, B, D, w, o, h, G, s, a, M, y, J, S, F, U, R, c, r, n, p) {
|
|
556
556
|
try {
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
var Z =
|
|
560
|
-
return Z === 0 ? void 0 :
|
|
557
|
+
const X = E.__wbindgen_add_to_stack_pointer(-16);
|
|
558
|
+
K(I, d), K(C, k), K(g, m), K(D, k), K(p, IA), E.rawcolliderset_createCollider(X, this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, D.__wbg_ptr, w, o, h, G, s, a, M, y, J, S, F, U, R, c, r, n, p.__wbg_ptr);
|
|
559
|
+
var Z = GA().getInt32(X + 0, !0), H = GA().getFloat64(X + 8, !0);
|
|
560
|
+
return Z === 0 ? void 0 : H;
|
|
561
561
|
} finally {
|
|
562
562
|
E.__wbindgen_add_to_stack_pointer(16);
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
remove(A, I, C, g) {
|
|
566
|
-
|
|
566
|
+
K(I, qA), K(C, IA), 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;
|
|
@@ -572,7 +572,7 @@ class QA {
|
|
|
572
572
|
try {
|
|
573
573
|
E.rawcolliderset_forEachColliderHandle(this.__wbg_ptr, CA(A));
|
|
574
574
|
} finally {
|
|
575
|
-
|
|
575
|
+
j[AA++] = void 0;
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
578
|
}
|
|
@@ -601,19 +601,19 @@ class kI {
|
|
|
601
601
|
}
|
|
602
602
|
witness1() {
|
|
603
603
|
const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
|
|
604
|
-
return
|
|
604
|
+
return k.__wrap(A);
|
|
605
605
|
}
|
|
606
606
|
witness2() {
|
|
607
607
|
const A = E.rawcollidershapecasthit_witness2(this.__wbg_ptr);
|
|
608
|
-
return
|
|
608
|
+
return k.__wrap(A);
|
|
609
609
|
}
|
|
610
610
|
normal1() {
|
|
611
611
|
const A = E.rawcollidershapecasthit_normal1(this.__wbg_ptr);
|
|
612
|
-
return
|
|
612
|
+
return k.__wrap(A);
|
|
613
613
|
}
|
|
614
614
|
normal2() {
|
|
615
615
|
const A = E.rawcollidershapecasthit_normal2(this.__wbg_ptr);
|
|
616
|
-
return
|
|
616
|
+
return k.__wrap(A);
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
const kg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -641,14 +641,14 @@ class uI {
|
|
|
641
641
|
}
|
|
642
642
|
total_force() {
|
|
643
643
|
const A = E.rawcontactforceevent_total_force(this.__wbg_ptr);
|
|
644
|
-
return
|
|
644
|
+
return k.__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 k.__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 VI {
|
|
|
673
673
|
}
|
|
674
674
|
normal() {
|
|
675
675
|
const A = E.rawcontactmanifold_normal(this.__wbg_ptr);
|
|
676
|
-
return
|
|
676
|
+
return k.__wrap(A);
|
|
677
677
|
}
|
|
678
678
|
local_n1() {
|
|
679
679
|
const A = E.rawcontactmanifold_local_n1(this.__wbg_ptr);
|
|
680
|
-
return
|
|
680
|
+
return k.__wrap(A);
|
|
681
681
|
}
|
|
682
682
|
local_n2() {
|
|
683
683
|
const A = E.rawcontactmanifold_local_n2(this.__wbg_ptr);
|
|
684
|
-
return
|
|
684
|
+
return k.__wrap(A);
|
|
685
685
|
}
|
|
686
686
|
subshape1() {
|
|
687
687
|
return E.rawcontactmanifold_subshape1(this.__wbg_ptr) >>> 0;
|
|
@@ -694,11 +694,11 @@ class VI {
|
|
|
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 : k.__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 : k.__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 VI {
|
|
|
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 : k.__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 VI {
|
|
|
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 k.__wrap(I);
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
739
|
const Fg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -791,9 +791,9 @@ class cC {
|
|
|
791
791
|
}
|
|
792
792
|
render(A, I, C, g, Q, B, D) {
|
|
793
793
|
try {
|
|
794
|
-
|
|
794
|
+
K(A, IA), K(I, EA), K(C, rA), K(g, lA), K(Q, oA), E.rawdebugrenderpipeline_render(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, CA(D));
|
|
795
795
|
} finally {
|
|
796
|
-
|
|
796
|
+
j[AA++] = void 0;
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
799
|
}
|
|
@@ -816,11 +816,11 @@ class zI {
|
|
|
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 : k.__wrap(A);
|
|
820
820
|
}
|
|
821
821
|
takeIntegrationParameters() {
|
|
822
822
|
const A = E.rawdeserializedworld_takeIntegrationParameters(this.__wbg_ptr);
|
|
823
|
-
return A === 0 ? void 0 :
|
|
823
|
+
return A === 0 ? void 0 : OA.__wrap(A);
|
|
824
824
|
}
|
|
825
825
|
takeIslandManager() {
|
|
826
826
|
const A = E.rawdeserializedworld_takeIslandManager(this.__wbg_ptr);
|
|
@@ -828,11 +828,11 @@ class zI {
|
|
|
828
828
|
}
|
|
829
829
|
takeBroadPhase() {
|
|
830
830
|
const A = E.rawdeserializedworld_takeBroadPhase(this.__wbg_ptr);
|
|
831
|
-
return A === 0 ? void 0 :
|
|
831
|
+
return A === 0 ? void 0 : fA.__wrap(A);
|
|
832
832
|
}
|
|
833
833
|
takeNarrowPhase() {
|
|
834
834
|
const A = E.rawdeserializedworld_takeNarrowPhase(this.__wbg_ptr);
|
|
835
|
-
return A === 0 ? void 0 :
|
|
835
|
+
return A === 0 ? void 0 : oA.__wrap(A);
|
|
836
836
|
}
|
|
837
837
|
takeBodies() {
|
|
838
838
|
const A = E.rawdeserializedworld_takeBodies(this.__wbg_ptr);
|
|
@@ -840,7 +840,7 @@ class zI {
|
|
|
840
840
|
}
|
|
841
841
|
takeColliders() {
|
|
842
842
|
const A = E.rawdeserializedworld_takeColliders(this.__wbg_ptr);
|
|
843
|
-
return A === 0 ? void 0 :
|
|
843
|
+
return A === 0 ? void 0 : EA.__wrap(A);
|
|
844
844
|
}
|
|
845
845
|
takeImpulseJoints() {
|
|
846
846
|
const A = E.rawdeserializedworld_takeImpulseJoints(this.__wbg_ptr);
|
|
@@ -871,14 +871,14 @@ class jg {
|
|
|
871
871
|
try {
|
|
872
872
|
E.raweventqueue_drainCollisionEvents(this.__wbg_ptr, CA(A));
|
|
873
873
|
} finally {
|
|
874
|
-
|
|
874
|
+
j[AA++] = void 0;
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
877
|
drainContactForceEvents(A) {
|
|
878
878
|
try {
|
|
879
879
|
E.raweventqueue_drainContactForceEvents(this.__wbg_ptr, CA(A));
|
|
880
880
|
} finally {
|
|
881
|
-
|
|
881
|
+
j[AA++] = void 0;
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
884
|
clear() {
|
|
@@ -903,27 +903,27 @@ class kA {
|
|
|
903
903
|
E.__wbg_rawgenericjoint_free(A, 0);
|
|
904
904
|
}
|
|
905
905
|
static spring(A, I, C, g, Q) {
|
|
906
|
-
|
|
906
|
+
K(g, k), K(Q, k);
|
|
907
907
|
const B = E.rawgenericjoint_spring(A, I, C, g.__wbg_ptr, Q.__wbg_ptr);
|
|
908
908
|
return kA.__wrap(B);
|
|
909
909
|
}
|
|
910
910
|
static rope(A, I, C) {
|
|
911
|
-
|
|
911
|
+
K(I, k), K(C, k);
|
|
912
912
|
const g = E.rawgenericjoint_rope(A, I.__wbg_ptr, C.__wbg_ptr);
|
|
913
913
|
return kA.__wrap(g);
|
|
914
914
|
}
|
|
915
915
|
static prismatic(A, I, C, g, Q, B) {
|
|
916
|
-
|
|
916
|
+
K(A, k), K(I, k), K(C, k);
|
|
917
917
|
const D = E.rawgenericjoint_prismatic(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g, Q, B);
|
|
918
918
|
return D === 0 ? void 0 : kA.__wrap(D);
|
|
919
919
|
}
|
|
920
920
|
static fixed(A, I, C, g) {
|
|
921
|
-
|
|
921
|
+
K(A, k), K(I, m), K(C, k), K(g, m);
|
|
922
922
|
const Q = E.rawgenericjoint_fixed(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr);
|
|
923
923
|
return kA.__wrap(Q);
|
|
924
924
|
}
|
|
925
925
|
static revolute(A, I) {
|
|
926
|
-
|
|
926
|
+
K(A, k), K(I, k);
|
|
927
927
|
const C = E.rawgenericjoint_revolute(A.__wbg_ptr, I.__wbg_ptr);
|
|
928
928
|
return C === 0 ? void 0 : kA.__wrap(C);
|
|
929
929
|
}
|
|
@@ -956,25 +956,25 @@ class rA {
|
|
|
956
956
|
}
|
|
957
957
|
jointFrameX1(A) {
|
|
958
958
|
const I = E.rawimpulsejointset_jointFrameX1(this.__wbg_ptr, A);
|
|
959
|
-
return
|
|
959
|
+
return m.__wrap(I);
|
|
960
960
|
}
|
|
961
961
|
jointFrameX2(A) {
|
|
962
962
|
const I = E.rawimpulsejointset_jointFrameX2(this.__wbg_ptr, A);
|
|
963
|
-
return
|
|
963
|
+
return m.__wrap(I);
|
|
964
964
|
}
|
|
965
965
|
jointAnchor1(A) {
|
|
966
966
|
const I = E.rawimpulsejointset_jointAnchor1(this.__wbg_ptr, A);
|
|
967
|
-
return
|
|
967
|
+
return k.__wrap(I);
|
|
968
968
|
}
|
|
969
969
|
jointAnchor2(A) {
|
|
970
970
|
const I = E.rawimpulsejointset_jointAnchor2(this.__wbg_ptr, A);
|
|
971
|
-
return
|
|
971
|
+
return k.__wrap(I);
|
|
972
972
|
}
|
|
973
973
|
jointSetAnchor1(A, I) {
|
|
974
|
-
|
|
974
|
+
K(I, k), E.rawimpulsejointset_jointSetAnchor1(this.__wbg_ptr, A, I.__wbg_ptr);
|
|
975
975
|
}
|
|
976
976
|
jointSetAnchor2(A, I) {
|
|
977
|
-
|
|
977
|
+
K(I, k), 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;
|
|
@@ -1011,7 +1011,7 @@ class rA {
|
|
|
1011
1011
|
return this.__wbg_ptr = A >>> 0, LI.register(this, this.__wbg_ptr, this), this;
|
|
1012
1012
|
}
|
|
1013
1013
|
createJoint(A, I, C, g) {
|
|
1014
|
-
return
|
|
1014
|
+
return K(A, kA), E.rawimpulsejointset_createJoint(this.__wbg_ptr, A.__wbg_ptr, I, C, g);
|
|
1015
1015
|
}
|
|
1016
1016
|
remove(A, I) {
|
|
1017
1017
|
E.rawimpulsejointset_remove(this.__wbg_ptr, A, I);
|
|
@@ -1026,24 +1026,24 @@ class rA {
|
|
|
1026
1026
|
try {
|
|
1027
1027
|
E.rawimpulsejointset_forEachJointHandle(this.__wbg_ptr, CA(A));
|
|
1028
1028
|
} finally {
|
|
1029
|
-
|
|
1029
|
+
j[AA++] = void 0;
|
|
1030
1030
|
}
|
|
1031
1031
|
}
|
|
1032
1032
|
forEachJointAttachedToRigidBody(A, I) {
|
|
1033
1033
|
try {
|
|
1034
1034
|
E.rawimpulsejointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, A, CA(I));
|
|
1035
1035
|
} finally {
|
|
1036
|
-
|
|
1036
|
+
j[AA++] = void 0;
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|
|
1040
1040
|
const rI = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1041
1041
|
}, unregister: () => {
|
|
1042
1042
|
} } : new FinalizationRegistry((i) => E.__wbg_rawintegrationparameters_free(i >>> 0, 1));
|
|
1043
|
-
class
|
|
1043
|
+
class OA {
|
|
1044
1044
|
static __wrap(A) {
|
|
1045
1045
|
A >>>= 0;
|
|
1046
|
-
const I = Object.create(
|
|
1046
|
+
const I = Object.create(OA.prototype);
|
|
1047
1047
|
return I.__wbg_ptr = A, rI.register(I, I.__wbg_ptr, I), I;
|
|
1048
1048
|
}
|
|
1049
1049
|
__destroy_into_raw() {
|
|
@@ -1138,7 +1138,7 @@ class qA {
|
|
|
1138
1138
|
try {
|
|
1139
1139
|
E.rawislandmanager_forEachActiveRigidBodyHandle(this.__wbg_ptr, CA(A));
|
|
1140
1140
|
} finally {
|
|
1141
|
-
|
|
1141
|
+
j[AA++] = void 0;
|
|
1142
1142
|
}
|
|
1143
1143
|
}
|
|
1144
1144
|
}
|
|
@@ -1160,10 +1160,10 @@ class tC {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
up() {
|
|
1162
1162
|
const A = E.rawcollidershapecasthit_normal2(this.__wbg_ptr);
|
|
1163
|
-
return
|
|
1163
|
+
return k.__wrap(A);
|
|
1164
1164
|
}
|
|
1165
1165
|
setUp(A) {
|
|
1166
|
-
|
|
1166
|
+
K(A, k), 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 tC {
|
|
|
1229
1229
|
snapToGroundEnabled() {
|
|
1230
1230
|
return E.rawkinematiccharactercontroller_snapToGroundEnabled(this.__wbg_ptr) !== 0;
|
|
1231
1231
|
}
|
|
1232
|
-
computeColliderMovement(A, I, C, g, Q, B, D,
|
|
1232
|
+
computeColliderMovement(A, I, C, g, Q, B, D, w, o, h, G, s) {
|
|
1233
1233
|
try {
|
|
1234
|
-
|
|
1234
|
+
K(I, fA), K(C, oA), K(g, IA), K(Q, EA), K(D, k), E.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, D.__wbg_ptr, w, L(o) ? 4294967297 : Math.fround(o), h, L(G) ? 4294967297 : G >>> 0, CA(s));
|
|
1235
1235
|
} finally {
|
|
1236
|
-
|
|
1236
|
+
j[AA++] = void 0;
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
1239
1239
|
computedMovement() {
|
|
1240
1240
|
const A = E.rawkinematiccharactercontroller_computedMovement(this.__wbg_ptr);
|
|
1241
|
-
return
|
|
1241
|
+
return k.__wrap(A);
|
|
1242
1242
|
}
|
|
1243
1243
|
computedGrounded() {
|
|
1244
1244
|
return E.rawkinematiccharactercontroller_computedGrounded(this.__wbg_ptr) !== 0;
|
|
@@ -1247,7 +1247,7 @@ class tC {
|
|
|
1247
1247
|
return E.rawkinematiccharactercontroller_numComputedCollisions(this.__wbg_ptr) >>> 0;
|
|
1248
1248
|
}
|
|
1249
1249
|
computedCollision(A, I) {
|
|
1250
|
-
return
|
|
1250
|
+
return K(I, Wg), E.rawkinematiccharactercontroller_computedCollision(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
1253
|
const lI = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -1272,19 +1272,19 @@ class lA {
|
|
|
1272
1272
|
}
|
|
1273
1273
|
jointFrameX1(A) {
|
|
1274
1274
|
const I = E.rawmultibodyjointset_jointFrameX1(this.__wbg_ptr, A);
|
|
1275
|
-
return
|
|
1275
|
+
return m.__wrap(I);
|
|
1276
1276
|
}
|
|
1277
1277
|
jointFrameX2(A) {
|
|
1278
1278
|
const I = E.rawmultibodyjointset_jointFrameX2(this.__wbg_ptr, A);
|
|
1279
|
-
return
|
|
1279
|
+
return m.__wrap(I);
|
|
1280
1280
|
}
|
|
1281
1281
|
jointAnchor1(A) {
|
|
1282
1282
|
const I = E.rawmultibodyjointset_jointAnchor1(this.__wbg_ptr, A);
|
|
1283
|
-
return
|
|
1283
|
+
return k.__wrap(I);
|
|
1284
1284
|
}
|
|
1285
1285
|
jointAnchor2(A) {
|
|
1286
1286
|
const I = E.rawmultibodyjointset_jointAnchor2(this.__wbg_ptr, A);
|
|
1287
|
-
return
|
|
1287
|
+
return k.__wrap(I);
|
|
1288
1288
|
}
|
|
1289
1289
|
jointContactsEnabled(A) {
|
|
1290
1290
|
return E.rawmultibodyjointset_jointContactsEnabled(this.__wbg_ptr, A) !== 0;
|
|
@@ -1306,7 +1306,7 @@ class lA {
|
|
|
1306
1306
|
return this.__wbg_ptr = A >>> 0, lI.register(this, this.__wbg_ptr, this), this;
|
|
1307
1307
|
}
|
|
1308
1308
|
createJoint(A, I, C, g) {
|
|
1309
|
-
return
|
|
1309
|
+
return K(A, kA), E.rawmultibodyjointset_createJoint(this.__wbg_ptr, A.__wbg_ptr, I, C, g);
|
|
1310
1310
|
}
|
|
1311
1311
|
remove(A, I) {
|
|
1312
1312
|
E.rawmultibodyjointset_remove(this.__wbg_ptr, A, I);
|
|
@@ -1318,24 +1318,24 @@ class lA {
|
|
|
1318
1318
|
try {
|
|
1319
1319
|
E.rawmultibodyjointset_forEachJointHandle(this.__wbg_ptr, CA(A));
|
|
1320
1320
|
} finally {
|
|
1321
|
-
|
|
1321
|
+
j[AA++] = void 0;
|
|
1322
1322
|
}
|
|
1323
1323
|
}
|
|
1324
1324
|
forEachJointAttachedToRigidBody(A, I) {
|
|
1325
1325
|
try {
|
|
1326
1326
|
E.rawmultibodyjointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, A, CA(I));
|
|
1327
1327
|
} finally {
|
|
1328
|
-
|
|
1328
|
+
j[AA++] = void 0;
|
|
1329
1329
|
}
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
1332
1332
|
const nI = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1333
1333
|
}, unregister: () => {
|
|
1334
1334
|
} } : new FinalizationRegistry((i) => E.__wbg_rawnarrowphase_free(i >>> 0, 1));
|
|
1335
|
-
class
|
|
1335
|
+
class oA {
|
|
1336
1336
|
static __wrap(A) {
|
|
1337
1337
|
A >>>= 0;
|
|
1338
|
-
const I = Object.create(
|
|
1338
|
+
const I = Object.create(oA.prototype);
|
|
1339
1339
|
return I.__wbg_ptr = A, nI.register(I, I.__wbg_ptr, I), I;
|
|
1340
1340
|
}
|
|
1341
1341
|
__destroy_into_raw() {
|
|
@@ -1351,14 +1351,14 @@ class wA {
|
|
|
1351
1351
|
return this.__wbg_ptr = A >>> 0, nI.register(this, this.__wbg_ptr, this), this;
|
|
1352
1352
|
}
|
|
1353
1353
|
contact_pairs_with(A, I) {
|
|
1354
|
-
E.rawnarrowphase_contact_pairs_with(this.__wbg_ptr, A,
|
|
1354
|
+
E.rawnarrowphase_contact_pairs_with(this.__wbg_ptr, A, P(I));
|
|
1355
1355
|
}
|
|
1356
1356
|
contact_pair(A, I) {
|
|
1357
1357
|
const C = E.rawnarrowphase_contact_pair(this.__wbg_ptr, A, I);
|
|
1358
1358
|
return C === 0 ? void 0 : PI.__wrap(C);
|
|
1359
1359
|
}
|
|
1360
1360
|
intersection_pairs_with(A, I) {
|
|
1361
|
-
E.rawnarrowphase_intersection_pairs_with(this.__wbg_ptr, A,
|
|
1361
|
+
E.rawnarrowphase_intersection_pairs_with(this.__wbg_ptr, A, P(I));
|
|
1362
1362
|
}
|
|
1363
1363
|
intersection_pair(A, I) {
|
|
1364
1364
|
return E.rawnarrowphase_intersection_pair(this.__wbg_ptr, A, I) !== 0;
|
|
@@ -1434,11 +1434,11 @@ class YC {
|
|
|
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, D,
|
|
1438
|
-
|
|
1437
|
+
step(A, I, C, g, Q, B, D, w, o, h) {
|
|
1438
|
+
K(A, k), K(I, OA), K(C, qA), K(g, fA), K(Q, oA), K(B, IA), K(D, EA), K(w, rA), K(o, lA), K(h, bI), E.rawphysicspipeline_step(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr, w.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr);
|
|
1439
1439
|
}
|
|
1440
|
-
stepWithEvents(A, I, C, g, Q, B, D,
|
|
1441
|
-
|
|
1440
|
+
stepWithEvents(A, I, C, g, Q, B, D, w, o, h, G, s, a, M) {
|
|
1441
|
+
K(A, k), K(I, OA), K(C, qA), K(g, fA), K(Q, oA), K(B, IA), K(D, EA), K(w, rA), K(o, lA), K(h, bI), K(G, jg), E.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr, w.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr, G.__wbg_ptr, P(s), P(a), P(M));
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
1444
|
const Yg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -1473,27 +1473,27 @@ class eC {
|
|
|
1473
1473
|
E.rawpidcontroller_reset_integrals(this.__wbg_ptr);
|
|
1474
1474
|
}
|
|
1475
1475
|
apply_linear_correction(A, I, C, g, Q) {
|
|
1476
|
-
|
|
1476
|
+
K(I, IA), K(g, k), K(Q, k), 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, IA), 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
|
-
|
|
1482
|
+
K(I, IA), K(g, k), K(Q, k);
|
|
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 k.__wrap(B);
|
|
1485
1485
|
}
|
|
1486
1486
|
angular_correction(A, I, C, g, Q) {
|
|
1487
|
-
return
|
|
1487
|
+
return K(I, IA), E.rawpidcontroller_angular_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g, Q);
|
|
1488
1488
|
}
|
|
1489
1489
|
}
|
|
1490
1490
|
const eg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1491
1491
|
}, unregister: () => {
|
|
1492
1492
|
} } : new FinalizationRegistry((i) => E.__wbg_rawpointcolliderprojection_free(i >>> 0, 1));
|
|
1493
|
-
class
|
|
1493
|
+
class hI {
|
|
1494
1494
|
static __wrap(A) {
|
|
1495
1495
|
A >>>= 0;
|
|
1496
|
-
const I = Object.create(
|
|
1496
|
+
const I = Object.create(hI.prototype);
|
|
1497
1497
|
return I.__wbg_ptr = A, eg.register(I, I.__wbg_ptr, I), I;
|
|
1498
1498
|
}
|
|
1499
1499
|
__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 k.__wrap(A);
|
|
1513
1513
|
}
|
|
1514
1514
|
isInside() {
|
|
1515
1515
|
return E.rawpointcolliderprojection_isInside(this.__wbg_ptr) !== 0;
|
|
@@ -1541,7 +1541,7 @@ class yI {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
point() {
|
|
1543
1543
|
const A = E.rawpointprojection_point(this.__wbg_ptr);
|
|
1544
|
-
return
|
|
1544
|
+
return k.__wrap(A);
|
|
1545
1545
|
}
|
|
1546
1546
|
isInside() {
|
|
1547
1547
|
return E.rawpointprojection_isInside(this.__wbg_ptr) !== 0;
|
|
@@ -1593,7 +1593,7 @@ class FI {
|
|
|
1593
1593
|
}
|
|
1594
1594
|
normal() {
|
|
1595
1595
|
const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
|
|
1596
|
-
return
|
|
1596
|
+
return k.__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 MI {
|
|
|
1625
1625
|
}
|
|
1626
1626
|
normal() {
|
|
1627
1627
|
const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
|
|
1628
|
-
return
|
|
1628
|
+
return k.__wrap(A);
|
|
1629
1629
|
}
|
|
1630
1630
|
time_of_impact() {
|
|
1631
1631
|
return E.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
|
|
@@ -1657,11 +1657,11 @@ class IA {
|
|
|
1657
1657
|
}
|
|
1658
1658
|
rbTranslation(A) {
|
|
1659
1659
|
const I = E.rawrigidbodyset_rbTranslation(this.__wbg_ptr, A);
|
|
1660
|
-
return
|
|
1660
|
+
return k.__wrap(I);
|
|
1661
1661
|
}
|
|
1662
1662
|
rbRotation(A) {
|
|
1663
1663
|
const I = E.rawrigidbodyset_rbRotation(this.__wbg_ptr, A);
|
|
1664
|
-
return
|
|
1664
|
+
return m.__wrap(I);
|
|
1665
1665
|
}
|
|
1666
1666
|
rbSleep(A) {
|
|
1667
1667
|
E.rawrigidbodyset_rbSleep(this.__wbg_ptr, A);
|
|
@@ -1674,11 +1674,11 @@ class IA {
|
|
|
1674
1674
|
}
|
|
1675
1675
|
rbNextTranslation(A) {
|
|
1676
1676
|
const I = E.rawrigidbodyset_rbNextTranslation(this.__wbg_ptr, A);
|
|
1677
|
-
return
|
|
1677
|
+
return k.__wrap(I);
|
|
1678
1678
|
}
|
|
1679
1679
|
rbNextRotation(A) {
|
|
1680
1680
|
const I = E.rawrigidbodyset_rbNextRotation(this.__wbg_ptr, A);
|
|
1681
|
-
return
|
|
1681
|
+
return m.__wrap(I);
|
|
1682
1682
|
}
|
|
1683
1683
|
rbSetTranslation(A, I, C, g) {
|
|
1684
1684
|
E.rawrigidbodyset_rbSetTranslation(this.__wbg_ptr, A, I, C, g);
|
|
@@ -1687,7 +1687,7 @@ class IA {
|
|
|
1687
1687
|
E.rawrigidbodyset_rbSetRotation(this.__wbg_ptr, A, I, C);
|
|
1688
1688
|
}
|
|
1689
1689
|
rbSetLinvel(A, I, C) {
|
|
1690
|
-
|
|
1690
|
+
K(I, k), 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);
|
|
@@ -1699,25 +1699,25 @@ class IA {
|
|
|
1699
1699
|
E.rawrigidbodyset_rbSetNextKinematicRotation(this.__wbg_ptr, A, I);
|
|
1700
1700
|
}
|
|
1701
1701
|
rbRecomputeMassPropertiesFromColliders(A, I) {
|
|
1702
|
-
|
|
1702
|
+
K(I, EA), E.rawrigidbodyset_rbRecomputeMassPropertiesFromColliders(this.__wbg_ptr, A, I.__wbg_ptr);
|
|
1703
1703
|
}
|
|
1704
1704
|
rbSetAdditionalMass(A, I, C) {
|
|
1705
1705
|
E.rawrigidbodyset_rbSetAdditionalMass(this.__wbg_ptr, A, I, C);
|
|
1706
1706
|
}
|
|
1707
1707
|
rbSetAdditionalMassProperties(A, I, C, g, Q) {
|
|
1708
|
-
|
|
1708
|
+
K(C, k), 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 k.__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
|
-
|
|
1718
|
+
K(I, k);
|
|
1719
1719
|
const C = E.rawrigidbodyset_rbVelocityAtPoint(this.__wbg_ptr, A, I.__wbg_ptr);
|
|
1720
|
-
return
|
|
1720
|
+
return k.__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 IA {
|
|
|
1748
1748
|
}
|
|
1749
1749
|
rbEffectiveInvMass(A) {
|
|
1750
1750
|
const I = E.rawrigidbodyset_rbEffectiveInvMass(this.__wbg_ptr, A);
|
|
1751
|
-
return
|
|
1751
|
+
return k.__wrap(I);
|
|
1752
1752
|
}
|
|
1753
1753
|
rbLocalCom(A) {
|
|
1754
1754
|
const I = E.rawrigidbodyset_rbLocalCom(this.__wbg_ptr, A);
|
|
1755
|
-
return
|
|
1755
|
+
return k.__wrap(I);
|
|
1756
1756
|
}
|
|
1757
1757
|
rbWorldCom(A) {
|
|
1758
1758
|
const I = E.rawrigidbodyset_rbWorldCom(this.__wbg_ptr, A);
|
|
1759
|
-
return
|
|
1759
|
+
return k.__wrap(I);
|
|
1760
1760
|
}
|
|
1761
1761
|
rbInvPrincipalInertia(A) {
|
|
1762
1762
|
return E.rawrigidbodyset_rbInvPrincipalInertia(this.__wbg_ptr, A);
|
|
@@ -1831,10 +1831,10 @@ class IA {
|
|
|
1831
1831
|
E.rawrigidbodyset_rbResetTorques(this.__wbg_ptr, A, I);
|
|
1832
1832
|
}
|
|
1833
1833
|
rbAddForce(A, I, C) {
|
|
1834
|
-
|
|
1834
|
+
K(I, k), E.rawrigidbodyset_rbAddForce(this.__wbg_ptr, A, I.__wbg_ptr, C);
|
|
1835
1835
|
}
|
|
1836
1836
|
rbApplyImpulse(A, I, C) {
|
|
1837
|
-
|
|
1837
|
+
K(I, k), 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 IA {
|
|
|
1843
1843
|
E.rawrigidbodyset_rbApplyTorqueImpulse(this.__wbg_ptr, A, I, C);
|
|
1844
1844
|
}
|
|
1845
1845
|
rbAddForceAtPoint(A, I, C, g) {
|
|
1846
|
-
|
|
1846
|
+
K(I, k), K(C, k), E.rawrigidbodyset_rbAddForceAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
|
|
1847
1847
|
}
|
|
1848
1848
|
rbApplyImpulseAtPoint(A, I, C, g) {
|
|
1849
|
-
|
|
1849
|
+
K(I, k), K(C, k), 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 IA {
|
|
|
1862
1862
|
}
|
|
1863
1863
|
rbUserForce(A) {
|
|
1864
1864
|
const I = E.rawrigidbodyset_rbUserForce(this.__wbg_ptr, A);
|
|
1865
|
-
return
|
|
1865
|
+
return k.__wrap(I);
|
|
1866
1866
|
}
|
|
1867
1867
|
rbUserTorque(A) {
|
|
1868
1868
|
return E.rawrigidbodyset_rbUserTorque(this.__wbg_ptr, A);
|
|
@@ -1871,11 +1871,11 @@ class IA {
|
|
|
1871
1871
|
const A = E.rawrigidbodyset_new();
|
|
1872
1872
|
return this.__wbg_ptr = A >>> 0, HI.register(this, this.__wbg_ptr, this), this;
|
|
1873
1873
|
}
|
|
1874
|
-
createRigidBody(A, I, C, g, Q, B, D,
|
|
1875
|
-
return
|
|
1874
|
+
createRigidBody(A, I, C, g, Q, B, D, w, o, h, G, s, a, M, y, J, S, F, U, R, c, r) {
|
|
1875
|
+
return K(I, k), K(C, m), K(D, k), K(w, k), E.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q, B, D.__wbg_ptr, w.__wbg_ptr, o, h, G, s, a, M, y, J, S, F, U, R, c, r);
|
|
1876
1876
|
}
|
|
1877
1877
|
remove(A, I, C, g, Q) {
|
|
1878
|
-
|
|
1878
|
+
K(I, qA), K(C, EA), K(g, rA), K(Q, lA), 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;
|
|
@@ -1887,20 +1887,20 @@ class IA {
|
|
|
1887
1887
|
try {
|
|
1888
1888
|
E.rawrigidbodyset_forEachRigidBodyHandle(this.__wbg_ptr, CA(A));
|
|
1889
1889
|
} finally {
|
|
1890
|
-
|
|
1890
|
+
j[AA++] = void 0;
|
|
1891
1891
|
}
|
|
1892
1892
|
}
|
|
1893
1893
|
propagateModifiedBodyPositionsToColliders(A) {
|
|
1894
|
-
|
|
1894
|
+
K(A, EA), E.rawrigidbodyset_propagateModifiedBodyPositionsToColliders(this.__wbg_ptr, A.__wbg_ptr);
|
|
1895
1895
|
}
|
|
1896
1896
|
}
|
|
1897
1897
|
const ng = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1898
1898
|
}, unregister: () => {
|
|
1899
1899
|
} } : new FinalizationRegistry((i) => E.__wbg_rawrotation_free(i >>> 0, 1));
|
|
1900
|
-
class
|
|
1900
|
+
class m {
|
|
1901
1901
|
static __wrap(A) {
|
|
1902
1902
|
A >>>= 0;
|
|
1903
|
-
const I = Object.create(
|
|
1903
|
+
const I = Object.create(m.prototype);
|
|
1904
1904
|
return I.__wbg_ptr = A, ng.register(I, I.__wbg_ptr, I), I;
|
|
1905
1905
|
}
|
|
1906
1906
|
__destroy_into_raw() {
|
|
@@ -1913,11 +1913,11 @@ class x {
|
|
|
1913
1913
|
}
|
|
1914
1914
|
static identity() {
|
|
1915
1915
|
const A = E.rawrotation_identity();
|
|
1916
|
-
return
|
|
1916
|
+
return m.__wrap(A);
|
|
1917
1917
|
}
|
|
1918
1918
|
static fromAngle(A) {
|
|
1919
1919
|
const I = E.rawrotation_fromAngle(A);
|
|
1920
|
-
return
|
|
1920
|
+
return m.__wrap(I);
|
|
1921
1921
|
}
|
|
1922
1922
|
get im() {
|
|
1923
1923
|
return E.rawkinematiccharactercontroller_offset(this.__wbg_ptr);
|
|
@@ -1945,21 +1945,21 @@ class LC {
|
|
|
1945
1945
|
const A = E.rawccdsolver_new();
|
|
1946
1946
|
return this.__wbg_ptr = A >>> 0, Hg.register(this, this.__wbg_ptr, this), this;
|
|
1947
1947
|
}
|
|
1948
|
-
serializeAll(A, I, C, g, Q, B, D,
|
|
1949
|
-
return
|
|
1948
|
+
serializeAll(A, I, C, g, Q, B, D, w, o) {
|
|
1949
|
+
return K(A, k), K(I, OA), K(C, qA), K(g, fA), K(Q, oA), K(B, IA), K(D, EA), K(w, rA), K(o, lA), wI(E.rawserializationpipeline_serializeAll(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr, w.__wbg_ptr, o.__wbg_ptr));
|
|
1950
1950
|
}
|
|
1951
1951
|
deserializeAll(A) {
|
|
1952
|
-
const I = E.rawserializationpipeline_deserializeAll(this.__wbg_ptr,
|
|
1952
|
+
const I = E.rawserializationpipeline_deserializeAll(this.__wbg_ptr, P(A));
|
|
1953
1953
|
return I === 0 ? void 0 : zI.__wrap(I);
|
|
1954
1954
|
}
|
|
1955
1955
|
}
|
|
1956
1956
|
const pg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1957
1957
|
}, unregister: () => {
|
|
1958
1958
|
} } : new FinalizationRegistry((i) => E.__wbg_rawshape_free(i >>> 0, 1));
|
|
1959
|
-
class
|
|
1959
|
+
class d {
|
|
1960
1960
|
static __wrap(A) {
|
|
1961
1961
|
A >>>= 0;
|
|
1962
|
-
const I = Object.create(
|
|
1962
|
+
const I = Object.create(d.prototype);
|
|
1963
1963
|
return I.__wbg_ptr = A, pg.register(I, I.__wbg_ptr, I), I;
|
|
1964
1964
|
}
|
|
1965
1965
|
__destroy_into_raw() {
|
|
@@ -1972,109 +1972,109 @@ class n {
|
|
|
1972
1972
|
}
|
|
1973
1973
|
static cuboid(A, I) {
|
|
1974
1974
|
const C = E.rawshape_cuboid(A, I);
|
|
1975
|
-
return
|
|
1975
|
+
return d.__wrap(C);
|
|
1976
1976
|
}
|
|
1977
1977
|
static roundCuboid(A, I, C) {
|
|
1978
1978
|
const g = E.rawshape_roundCuboid(A, I, C);
|
|
1979
|
-
return
|
|
1979
|
+
return d.__wrap(g);
|
|
1980
1980
|
}
|
|
1981
1981
|
static ball(A) {
|
|
1982
1982
|
const I = E.rawshape_ball(A);
|
|
1983
|
-
return
|
|
1983
|
+
return d.__wrap(I);
|
|
1984
1984
|
}
|
|
1985
1985
|
static halfspace(A) {
|
|
1986
|
-
|
|
1986
|
+
K(A, k);
|
|
1987
1987
|
const I = E.rawshape_halfspace(A.__wbg_ptr);
|
|
1988
|
-
return
|
|
1988
|
+
return d.__wrap(I);
|
|
1989
1989
|
}
|
|
1990
1990
|
static capsule(A, I) {
|
|
1991
1991
|
const C = E.rawshape_capsule(A, I);
|
|
1992
|
-
return
|
|
1992
|
+
return d.__wrap(C);
|
|
1993
1993
|
}
|
|
1994
1994
|
static voxels(A, I) {
|
|
1995
|
-
|
|
1995
|
+
K(A, k);
|
|
1996
1996
|
const C = tI(I, E.__wbindgen_export_2), g = FA, Q = E.rawshape_voxels(A.__wbg_ptr, C, g);
|
|
1997
|
-
return
|
|
1997
|
+
return d.__wrap(Q);
|
|
1998
1998
|
}
|
|
1999
1999
|
static voxelsFromPoints(A, I) {
|
|
2000
|
-
|
|
2001
|
-
const C =
|
|
2002
|
-
return
|
|
2000
|
+
K(A, k);
|
|
2001
|
+
const C = pA(I, E.__wbindgen_export_2), g = FA, Q = E.rawshape_voxelsFromPoints(A.__wbg_ptr, C, g);
|
|
2002
|
+
return d.__wrap(Q);
|
|
2003
2003
|
}
|
|
2004
2004
|
static polyline(A, I) {
|
|
2005
|
-
const C =
|
|
2006
|
-
return
|
|
2005
|
+
const C = pA(A, E.__wbindgen_export_2), g = FA, Q = tI(I, E.__wbindgen_export_2), B = FA, D = E.rawshape_polyline(C, g, Q, B);
|
|
2006
|
+
return d.__wrap(D);
|
|
2007
2007
|
}
|
|
2008
2008
|
static trimesh(A, I, C) {
|
|
2009
|
-
const g =
|
|
2010
|
-
return
|
|
2009
|
+
const g = pA(A, E.__wbindgen_export_2), Q = FA, B = tI(I, E.__wbindgen_export_2), D = FA, w = E.rawshape_trimesh(g, Q, B, D, C);
|
|
2010
|
+
return w === 0 ? void 0 : d.__wrap(w);
|
|
2011
2011
|
}
|
|
2012
2012
|
static heightfield(A, I) {
|
|
2013
|
-
const C =
|
|
2014
|
-
|
|
2013
|
+
const C = pA(A, E.__wbindgen_export_2), g = FA;
|
|
2014
|
+
K(I, k);
|
|
2015
2015
|
const Q = E.rawshape_heightfield(C, g, I.__wbg_ptr);
|
|
2016
|
-
return
|
|
2016
|
+
return d.__wrap(Q);
|
|
2017
2017
|
}
|
|
2018
2018
|
static segment(A, I) {
|
|
2019
|
-
|
|
2019
|
+
K(A, k), K(I, k);
|
|
2020
2020
|
const C = E.rawshape_segment(A.__wbg_ptr, I.__wbg_ptr);
|
|
2021
|
-
return
|
|
2021
|
+
return d.__wrap(C);
|
|
2022
2022
|
}
|
|
2023
2023
|
static triangle(A, I, C) {
|
|
2024
|
-
|
|
2024
|
+
K(A, k), K(I, k), K(C, k);
|
|
2025
2025
|
const g = E.rawshape_triangle(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr);
|
|
2026
|
-
return
|
|
2026
|
+
return d.__wrap(g);
|
|
2027
2027
|
}
|
|
2028
2028
|
static roundTriangle(A, I, C, g) {
|
|
2029
|
-
|
|
2029
|
+
K(A, k), K(I, k), K(C, k);
|
|
2030
2030
|
const Q = E.rawshape_roundTriangle(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g);
|
|
2031
|
-
return
|
|
2031
|
+
return d.__wrap(Q);
|
|
2032
2032
|
}
|
|
2033
2033
|
static convexHull(A) {
|
|
2034
|
-
const I =
|
|
2035
|
-
return g === 0 ? void 0 :
|
|
2034
|
+
const I = pA(A, E.__wbindgen_export_2), C = FA, g = E.rawshape_convexHull(I, C);
|
|
2035
|
+
return g === 0 ? void 0 : d.__wrap(g);
|
|
2036
2036
|
}
|
|
2037
2037
|
static roundConvexHull(A, I) {
|
|
2038
|
-
const C =
|
|
2039
|
-
return Q === 0 ? void 0 :
|
|
2038
|
+
const C = pA(A, E.__wbindgen_export_2), g = FA, Q = E.rawshape_roundConvexHull(C, g, I);
|
|
2039
|
+
return Q === 0 ? void 0 : d.__wrap(Q);
|
|
2040
2040
|
}
|
|
2041
2041
|
static convexPolyline(A) {
|
|
2042
|
-
const I =
|
|
2043
|
-
return g === 0 ? void 0 :
|
|
2042
|
+
const I = pA(A, E.__wbindgen_export_2), C = FA, g = E.rawshape_convexPolyline(I, C);
|
|
2043
|
+
return g === 0 ? void 0 : d.__wrap(g);
|
|
2044
2044
|
}
|
|
2045
2045
|
static roundConvexPolyline(A, I) {
|
|
2046
|
-
const C =
|
|
2047
|
-
return Q === 0 ? void 0 :
|
|
2046
|
+
const C = pA(A, E.__wbindgen_export_2), g = FA, Q = E.rawshape_roundConvexPolyline(C, g, I);
|
|
2047
|
+
return Q === 0 ? void 0 : d.__wrap(Q);
|
|
2048
2048
|
}
|
|
2049
|
-
castShape(A, I, C, g, Q, B, D,
|
|
2050
|
-
|
|
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, D.__wbg_ptr,
|
|
2049
|
+
castShape(A, I, C, g, Q, B, D, w, o, h) {
|
|
2050
|
+
K(A, k), K(I, m), K(C, k), K(g, d), K(Q, k), K(B, m), K(D, k);
|
|
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, D.__wbg_ptr, w, o, h);
|
|
2052
2052
|
return G === 0 ? void 0 : JI.__wrap(G);
|
|
2053
2053
|
}
|
|
2054
2054
|
intersectsShape(A, I, C, g, Q) {
|
|
2055
|
-
return
|
|
2055
|
+
return K(A, k), K(I, m), K(C, d), K(g, k), K(Q, m), 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
|
-
|
|
2058
|
+
K(A, k), K(I, m), K(C, d), K(g, k), K(Q, m);
|
|
2059
2059
|
const D = 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 D === 0 ? void 0 : AI.__wrap(D);
|
|
2061
2061
|
}
|
|
2062
2062
|
containsPoint(A, I, C) {
|
|
2063
|
-
return
|
|
2063
|
+
return K(A, k), K(I, m), K(C, k), 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
|
-
|
|
2066
|
+
K(A, k), K(I, m), K(C, k);
|
|
2067
2067
|
const Q = E.rawshape_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g);
|
|
2068
2068
|
return yI.__wrap(Q);
|
|
2069
2069
|
}
|
|
2070
2070
|
intersectsRay(A, I, C, g, Q) {
|
|
2071
|
-
return
|
|
2071
|
+
return K(A, k), K(I, m), K(C, k), K(g, k), 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
|
|
2074
|
+
return K(A, k), K(I, m), K(C, k), K(g, k), 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
|
-
|
|
2077
|
+
K(A, k), K(I, m), K(C, k), K(g, k);
|
|
2078
2078
|
const D = E.rawshape_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B);
|
|
2079
2079
|
return D === 0 ? void 0 : MI.__wrap(D);
|
|
2080
2080
|
}
|
|
@@ -2101,19 +2101,19 @@ class JI {
|
|
|
2101
2101
|
}
|
|
2102
2102
|
witness1() {
|
|
2103
2103
|
const A = E.rawshapecasthit_witness1(this.__wbg_ptr);
|
|
2104
|
-
return
|
|
2104
|
+
return k.__wrap(A);
|
|
2105
2105
|
}
|
|
2106
2106
|
witness2() {
|
|
2107
2107
|
const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
|
|
2108
|
-
return
|
|
2108
|
+
return k.__wrap(A);
|
|
2109
2109
|
}
|
|
2110
2110
|
normal1() {
|
|
2111
2111
|
const A = E.rawcollidershapecasthit_witness2(this.__wbg_ptr);
|
|
2112
|
-
return
|
|
2112
|
+
return k.__wrap(A);
|
|
2113
2113
|
}
|
|
2114
2114
|
normal2() {
|
|
2115
2115
|
const A = E.rawcollidershapecasthit_normal1(this.__wbg_ptr);
|
|
2116
|
-
return
|
|
2116
|
+
return k.__wrap(A);
|
|
2117
2117
|
}
|
|
2118
2118
|
}
|
|
2119
2119
|
const fg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -2138,28 +2138,28 @@ class AI {
|
|
|
2138
2138
|
}
|
|
2139
2139
|
point1() {
|
|
2140
2140
|
const A = E.rawpointprojection_point(this.__wbg_ptr);
|
|
2141
|
-
return
|
|
2141
|
+
return k.__wrap(A);
|
|
2142
2142
|
}
|
|
2143
2143
|
point2() {
|
|
2144
2144
|
const A = E.rawpointcolliderprojection_point(this.__wbg_ptr);
|
|
2145
|
-
return
|
|
2145
|
+
return k.__wrap(A);
|
|
2146
2146
|
}
|
|
2147
2147
|
normal1() {
|
|
2148
2148
|
const A = E.rawcontactforceevent_total_force(this.__wbg_ptr);
|
|
2149
|
-
return
|
|
2149
|
+
return k.__wrap(A);
|
|
2150
2150
|
}
|
|
2151
2151
|
normal2() {
|
|
2152
2152
|
const A = E.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
|
|
2153
|
-
return
|
|
2153
|
+
return k.__wrap(A);
|
|
2154
2154
|
}
|
|
2155
2155
|
}
|
|
2156
2156
|
const pI = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
2157
2157
|
}, unregister: () => {
|
|
2158
2158
|
} } : new FinalizationRegistry((i) => E.__wbg_rawvector_free(i >>> 0, 1));
|
|
2159
|
-
class
|
|
2159
|
+
class k {
|
|
2160
2160
|
static __wrap(A) {
|
|
2161
2161
|
A >>>= 0;
|
|
2162
|
-
const I = Object.create(
|
|
2162
|
+
const I = Object.create(k.prototype);
|
|
2163
2163
|
return I.__wbg_ptr = A, pI.register(I, I.__wbg_ptr, I), I;
|
|
2164
2164
|
}
|
|
2165
2165
|
__destroy_into_raw() {
|
|
@@ -2172,7 +2172,7 @@ class N {
|
|
|
2172
2172
|
}
|
|
2173
2173
|
static zero() {
|
|
2174
2174
|
const A = E.rawvector_zero();
|
|
2175
|
-
return
|
|
2175
|
+
return k.__wrap(A);
|
|
2176
2176
|
}
|
|
2177
2177
|
constructor(A, I) {
|
|
2178
2178
|
const C = E.rawvector_new(A, I);
|
|
@@ -2192,11 +2192,11 @@ class N {
|
|
|
2192
2192
|
}
|
|
2193
2193
|
xy() {
|
|
2194
2194
|
const A = E.rawvector_xy(this.__wbg_ptr);
|
|
2195
|
-
return
|
|
2195
|
+
return k.__wrap(A);
|
|
2196
2196
|
}
|
|
2197
2197
|
yx() {
|
|
2198
2198
|
const A = E.rawvector_yx(this.__wbg_ptr);
|
|
2199
|
-
return
|
|
2199
|
+
return k.__wrap(A);
|
|
2200
2200
|
}
|
|
2201
2201
|
}
|
|
2202
2202
|
async function mg(i) {
|
|
@@ -2204,80 +2204,80 @@ async function mg(i) {
|
|
|
2204
2204
|
i !== void 0 && (Object.getPrototypeOf(i) === Object.prototype ? { module_or_path: i } = i : console.warn("using deprecated parameters for the initialization function; pass a single object instead")), i === void 0 && (i = new URL("rapier_wasm2d_bg.wasm", "<deleted>"));
|
|
2205
2205
|
const A = function() {
|
|
2206
2206
|
const g = { wbg: {} };
|
|
2207
|
-
return g.wbg.__wbg_bind_c8359b1cba058168 = function(Q, B, D,
|
|
2208
|
-
return
|
|
2207
|
+
return g.wbg.__wbg_bind_c8359b1cba058168 = function(Q, B, D, w) {
|
|
2208
|
+
return P(W(Q).bind(W(B), W(D), W(w)));
|
|
2209
2209
|
}, g.wbg.__wbg_buffer_609cc3eee51ed158 = function(Q) {
|
|
2210
|
-
return
|
|
2210
|
+
return P(W(Q).buffer);
|
|
2211
2211
|
}, g.wbg.__wbg_call_672a4d21634d4a24 = function() {
|
|
2212
2212
|
return oI(function(Q, B) {
|
|
2213
|
-
return
|
|
2213
|
+
return P(W(Q).call(W(B)));
|
|
2214
2214
|
}, arguments);
|
|
2215
2215
|
}, g.wbg.__wbg_call_7cccdd69e0791ae2 = function() {
|
|
2216
2216
|
return oI(function(Q, B, D) {
|
|
2217
|
-
return
|
|
2217
|
+
return P(W(Q).call(W(B), W(D)));
|
|
2218
2218
|
}, arguments);
|
|
2219
2219
|
}, g.wbg.__wbg_call_833bed5770ea2041 = function() {
|
|
2220
|
-
return oI(function(Q, B, D,
|
|
2221
|
-
return
|
|
2220
|
+
return oI(function(Q, B, D, w) {
|
|
2221
|
+
return P(W(Q).call(W(B), W(D), W(w)));
|
|
2222
2222
|
}, arguments);
|
|
2223
2223
|
}, g.wbg.__wbg_call_b8adc8b1d0a0d8eb = function() {
|
|
2224
|
-
return oI(function(Q, B, D,
|
|
2225
|
-
return
|
|
2224
|
+
return oI(function(Q, B, D, w, o) {
|
|
2225
|
+
return P(W(Q).call(W(B), W(D), W(w), W(o)));
|
|
2226
2226
|
}, arguments);
|
|
2227
2227
|
}, g.wbg.__wbg_length_3b4f022188ae8db6 = function(Q) {
|
|
2228
|
-
return
|
|
2228
|
+
return W(Q).length;
|
|
2229
2229
|
}, g.wbg.__wbg_length_a446193dc22c12f8 = function(Q) {
|
|
2230
|
-
return
|
|
2230
|
+
return W(Q).length;
|
|
2231
2231
|
}, g.wbg.__wbg_new_a12002a7f91c75be = function(Q) {
|
|
2232
|
-
return
|
|
2232
|
+
return P(new Uint8Array(W(Q)));
|
|
2233
2233
|
}, g.wbg.__wbg_newnoargs_105ed471475aaf50 = function(Q, B) {
|
|
2234
|
-
return
|
|
2234
|
+
return P(new Function(fI(Q, B)));
|
|
2235
2235
|
}, g.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(Q, B, D) {
|
|
2236
|
-
return
|
|
2236
|
+
return P(new Uint8Array(W(Q), B >>> 0, D >>> 0));
|
|
2237
2237
|
}, g.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(Q, B, D) {
|
|
2238
|
-
return
|
|
2238
|
+
return P(new Float32Array(W(Q), B >>> 0, D >>> 0));
|
|
2239
2239
|
}, g.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(Q) {
|
|
2240
|
-
return
|
|
2240
|
+
return P(new Float32Array(Q >>> 0));
|
|
2241
2241
|
}, g.wbg.__wbg_now_2c95c9de01293173 = function(Q) {
|
|
2242
|
-
return
|
|
2242
|
+
return W(Q).now();
|
|
2243
2243
|
}, g.wbg.__wbg_performance_7a3ffd0b17f663ad = function(Q) {
|
|
2244
|
-
return
|
|
2244
|
+
return P(W(Q).performance);
|
|
2245
2245
|
}, g.wbg.__wbg_rawcontactforceevent_new = function(Q) {
|
|
2246
|
-
return
|
|
2246
|
+
return P(uI.__wrap(Q));
|
|
2247
2247
|
}, g.wbg.__wbg_rawraycolliderintersection_new = function(Q) {
|
|
2248
|
-
return
|
|
2248
|
+
return P(FI.__wrap(Q));
|
|
2249
2249
|
}, g.wbg.__wbg_set_10bad9bee0e9c58b = function(Q, B, D) {
|
|
2250
|
-
|
|
2250
|
+
W(Q).set(W(B), D >>> 0);
|
|
2251
2251
|
}, g.wbg.__wbg_set_65595bdd868b3009 = function(Q, B, D) {
|
|
2252
|
-
|
|
2252
|
+
W(Q).set(W(B), D >>> 0);
|
|
2253
2253
|
}, g.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
|
2254
2254
|
const Q = typeof global > "u" ? null : global;
|
|
2255
|
-
return
|
|
2255
|
+
return L(Q) ? 0 : P(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 L(Q) ? 0 : P(Q);
|
|
2259
2259
|
}, g.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
|
2260
2260
|
const Q = typeof self > "u" ? null : self;
|
|
2261
|
-
return
|
|
2261
|
+
return L(Q) ? 0 : P(Q);
|
|
2262
2262
|
}, g.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
|
2263
2263
|
const Q = typeof window > "u" ? null : window;
|
|
2264
|
-
return
|
|
2264
|
+
return L(Q) ? 0 : P(Q);
|
|
2265
2265
|
}, g.wbg.__wbindgen_boolean_get = function(Q) {
|
|
2266
|
-
const B =
|
|
2266
|
+
const B = W(Q);
|
|
2267
2267
|
return typeof B == "boolean" ? B ? 1 : 0 : 2;
|
|
2268
2268
|
}, g.wbg.__wbindgen_is_function = function(Q) {
|
|
2269
|
-
return typeof
|
|
2269
|
+
return typeof W(Q) == "function";
|
|
2270
2270
|
}, g.wbg.__wbindgen_is_undefined = function(Q) {
|
|
2271
|
-
return
|
|
2271
|
+
return W(Q) === void 0;
|
|
2272
2272
|
}, g.wbg.__wbindgen_memory = function() {
|
|
2273
|
-
return
|
|
2273
|
+
return P(E.memory);
|
|
2274
2274
|
}, g.wbg.__wbindgen_number_get = function(Q, B) {
|
|
2275
|
-
const D =
|
|
2276
|
-
|
|
2275
|
+
const D = W(B), w = typeof D == "number" ? D : void 0;
|
|
2276
|
+
GA().setFloat64(Q + 8, L(w) ? 0 : w, !0), GA().setInt32(Q + 0, !L(w), !0);
|
|
2277
2277
|
}, g.wbg.__wbindgen_number_new = function(Q) {
|
|
2278
|
-
return
|
|
2278
|
+
return P(Q);
|
|
2279
2279
|
}, g.wbg.__wbindgen_object_clone_ref = function(Q) {
|
|
2280
|
-
return
|
|
2280
|
+
return P(W(Q));
|
|
2281
2281
|
}, g.wbg.__wbindgen_object_drop_ref = function(Q) {
|
|
2282
2282
|
wI(Q);
|
|
2283
2283
|
}, g.wbg.__wbindgen_throw = function(Q, B) {
|
|
@@ -2302,7 +2302,7 @@ async function mg(i) {
|
|
|
2302
2302
|
}
|
|
2303
2303
|
}(await i, A);
|
|
2304
2304
|
return function(g, Q) {
|
|
2305
|
-
return E = g.exports, mg.__wbindgen_wasm_module = Q,
|
|
2305
|
+
return E = g.exports, mg.__wbindgen_wasm_module = Q, bA = null, zA = null, PA = null, _A = null, VA = null, E;
|
|
2306
2306
|
}(I, C);
|
|
2307
2307
|
}
|
|
2308
2308
|
class xg {
|
|
@@ -2310,26 +2310,26 @@ class xg {
|
|
|
2310
2310
|
this.x = A, this.y = I;
|
|
2311
2311
|
}
|
|
2312
2312
|
}
|
|
2313
|
-
class
|
|
2313
|
+
class N {
|
|
2314
2314
|
static new(A, I) {
|
|
2315
2315
|
return new xg(A, I);
|
|
2316
2316
|
}
|
|
2317
2317
|
static zeros() {
|
|
2318
|
-
return
|
|
2318
|
+
return N.new(0, 0);
|
|
2319
2319
|
}
|
|
2320
2320
|
static fromRaw(A) {
|
|
2321
2321
|
if (!A) return null;
|
|
2322
|
-
let I =
|
|
2322
|
+
let I = N.new(A.x, A.y);
|
|
2323
2323
|
return A.free(), I;
|
|
2324
2324
|
}
|
|
2325
2325
|
static intoRaw(A) {
|
|
2326
|
-
return new
|
|
2326
|
+
return new k(A.x, A.y);
|
|
2327
2327
|
}
|
|
2328
2328
|
static copy(A, I) {
|
|
2329
2329
|
A.x = I.x, A.y = I.y;
|
|
2330
2330
|
}
|
|
2331
2331
|
}
|
|
2332
|
-
class
|
|
2332
|
+
class z {
|
|
2333
2333
|
static identity() {
|
|
2334
2334
|
return 0;
|
|
2335
2335
|
}
|
|
@@ -2339,10 +2339,10 @@ class P {
|
|
|
2339
2339
|
return A.free(), I;
|
|
2340
2340
|
}
|
|
2341
2341
|
static intoRaw(A) {
|
|
2342
|
-
return
|
|
2342
|
+
return m.fromAngle(A);
|
|
2343
2343
|
}
|
|
2344
2344
|
}
|
|
2345
|
-
var cA, MA, TI, ZI, II, xA,
|
|
2345
|
+
var cA, MA, TI, ZI, II, xA, KA, OI, WI, GI, sI, jI, mI, KI, ZA;
|
|
2346
2346
|
(function(i) {
|
|
2347
2347
|
i[i.Dynamic = 0] = "Dynamic", i[i.Fixed = 1] = "Fixed", i[i.KinematicPositionBased = 2] = "KinematicPositionBased", i[i.KinematicVelocityBased = 3] = "KinematicVelocityBased";
|
|
2348
2348
|
})(cA || (cA = {}));
|
|
@@ -2391,25 +2391,25 @@ class xI {
|
|
|
2391
2391
|
}
|
|
2392
2392
|
translation() {
|
|
2393
2393
|
let A = this.rawSet.rbTranslation(this.handle);
|
|
2394
|
-
return
|
|
2394
|
+
return N.fromRaw(A);
|
|
2395
2395
|
}
|
|
2396
2396
|
rotation() {
|
|
2397
2397
|
let A = this.rawSet.rbRotation(this.handle);
|
|
2398
|
-
return
|
|
2398
|
+
return z.fromRaw(A);
|
|
2399
2399
|
}
|
|
2400
2400
|
nextTranslation() {
|
|
2401
2401
|
let A = this.rawSet.rbNextTranslation(this.handle);
|
|
2402
|
-
return
|
|
2402
|
+
return N.fromRaw(A);
|
|
2403
2403
|
}
|
|
2404
2404
|
nextRotation() {
|
|
2405
2405
|
let A = this.rawSet.rbNextRotation(this.handle);
|
|
2406
|
-
return
|
|
2406
|
+
return z.fromRaw(A);
|
|
2407
2407
|
}
|
|
2408
2408
|
setTranslation(A, I) {
|
|
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 = N.intoRaw(A);
|
|
2413
2413
|
this.rawSet.rbSetLinvel(this.handle, C, I), C.free();
|
|
2414
2414
|
}
|
|
2415
2415
|
gravityScale() {
|
|
@@ -2431,11 +2431,11 @@ class xI {
|
|
|
2431
2431
|
this.rawSet.rbSetNextKinematicRotation(this.handle, A);
|
|
2432
2432
|
}
|
|
2433
2433
|
linvel() {
|
|
2434
|
-
return
|
|
2434
|
+
return N.fromRaw(this.rawSet.rbLinvel(this.handle));
|
|
2435
2435
|
}
|
|
2436
2436
|
velocityAtPoint(A) {
|
|
2437
|
-
const I =
|
|
2438
|
-
let C =
|
|
2437
|
+
const I = N.intoRaw(A);
|
|
2438
|
+
let C = N.fromRaw(this.rawSet.rbVelocityAtPoint(this.handle, I));
|
|
2439
2439
|
return I.free(), C;
|
|
2440
2440
|
}
|
|
2441
2441
|
angvel() {
|
|
@@ -2445,16 +2445,16 @@ class xI {
|
|
|
2445
2445
|
return this.rawSet.rbMass(this.handle);
|
|
2446
2446
|
}
|
|
2447
2447
|
effectiveInvMass() {
|
|
2448
|
-
return
|
|
2448
|
+
return N.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 N.fromRaw(this.rawSet.rbLocalCom(this.handle));
|
|
2455
2455
|
}
|
|
2456
2456
|
worldCom() {
|
|
2457
|
-
return
|
|
2457
|
+
return N.fromRaw(this.rawSet.rbWorldCom(this.handle));
|
|
2458
2458
|
}
|
|
2459
2459
|
invPrincipalInertia() {
|
|
2460
2460
|
return this.rawSet.rbInvPrincipalInertia(this.handle);
|
|
@@ -2526,7 +2526,7 @@ class xI {
|
|
|
2526
2526
|
this.rawSet.rbSetAdditionalMass(this.handle, A, I);
|
|
2527
2527
|
}
|
|
2528
2528
|
setAdditionalMassProperties(A, I, C, g) {
|
|
2529
|
-
let Q =
|
|
2529
|
+
let Q = N.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 xI {
|
|
|
2539
2539
|
this.rawSet.rbResetTorques(this.handle, A);
|
|
2540
2540
|
}
|
|
2541
2541
|
addForce(A, I) {
|
|
2542
|
-
const C =
|
|
2542
|
+
const C = N.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 = N.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 xI {
|
|
|
2553
2553
|
this.rawSet.rbApplyTorqueImpulse(this.handle, A, I);
|
|
2554
2554
|
}
|
|
2555
2555
|
addForceAtPoint(A, I, C) {
|
|
2556
|
-
const g =
|
|
2556
|
+
const g = N.intoRaw(A), Q = N.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 = N.intoRaw(A), Q = N.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 N.fromRaw(this.rawSet.rbUserForce(this.handle));
|
|
2565
2565
|
}
|
|
2566
2566
|
userTorque() {
|
|
2567
2567
|
return this.rawSet.rbUserTorque(this.handle);
|
|
@@ -2569,7 +2569,7 @@ class xI {
|
|
|
2569
2569
|
}
|
|
2570
2570
|
class YA {
|
|
2571
2571
|
constructor(A) {
|
|
2572
|
-
this.enabled = !0, this.status = A, this.translation =
|
|
2572
|
+
this.enabled = !0, this.status = A, this.translation = N.zeros(), this.rotation = z.identity(), this.gravityScale = 1, this.linvel = N.zeros(), this.mass = 0, this.massOnly = !1, this.centerOfMass = N.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 YA(cA.Dynamic);
|
|
@@ -2625,7 +2625,7 @@ class YA {
|
|
|
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, N.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,10 +2707,10 @@ class Xg {
|
|
|
2707
2707
|
this.map.forEach((I) => I.finalizeDeserialization(A));
|
|
2708
2708
|
}
|
|
2709
2709
|
createRigidBody(A, I) {
|
|
2710
|
-
let C =
|
|
2710
|
+
let C = N.intoRaw(I.translation), g = z.intoRaw(I.rotation), Q = N.intoRaw(I.linvel), B = N.intoRaw(I.centerOfMass), D = 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
|
-
const
|
|
2713
|
-
return
|
|
2712
|
+
const w = new xI(this.raw, A, D);
|
|
2713
|
+
return w.userData = I.userData, this.map.set(D, w), w;
|
|
2714
2714
|
}
|
|
2715
2715
|
remove(A, I, C, g, Q) {
|
|
2716
2716
|
for (let B = 0; B < this.raw.rbNumColliders(A); B += 1) C.unmap(this.raw.rbCollider(A, B));
|
|
@@ -2739,7 +2739,7 @@ class Xg {
|
|
|
2739
2739
|
}
|
|
2740
2740
|
class vg {
|
|
2741
2741
|
constructor(A) {
|
|
2742
|
-
this.raw = A || new
|
|
2742
|
+
this.raw = A || new OA();
|
|
2743
2743
|
}
|
|
2744
2744
|
free() {
|
|
2745
2745
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
@@ -2812,15 +2812,15 @@ class nA {
|
|
|
2812
2812
|
}
|
|
2813
2813
|
static newTyped(A, I, C) {
|
|
2814
2814
|
switch (A.jointType(C)) {
|
|
2815
|
-
case
|
|
2815
|
+
case dA.Revolute:
|
|
2816
2816
|
return new _g(A, I, C);
|
|
2817
|
-
case
|
|
2817
|
+
case dA.Prismatic:
|
|
2818
2818
|
return new zg(A, I, C);
|
|
2819
|
-
case
|
|
2819
|
+
case dA.Fixed:
|
|
2820
2820
|
return new ug(A, I, C);
|
|
2821
|
-
case
|
|
2821
|
+
case dA.Spring:
|
|
2822
2822
|
return new Pg(A, I, C);
|
|
2823
|
-
case
|
|
2823
|
+
case dA.Rope:
|
|
2824
2824
|
return new Vg(A, I, C);
|
|
2825
2825
|
default:
|
|
2826
2826
|
return new nA(A, I, C);
|
|
@@ -2842,17 +2842,17 @@ class nA {
|
|
|
2842
2842
|
return this.rawSet.jointType(this.handle);
|
|
2843
2843
|
}
|
|
2844
2844
|
anchor1() {
|
|
2845
|
-
return
|
|
2845
|
+
return N.fromRaw(this.rawSet.jointAnchor1(this.handle));
|
|
2846
2846
|
}
|
|
2847
2847
|
anchor2() {
|
|
2848
|
-
return
|
|
2848
|
+
return N.fromRaw(this.rawSet.jointAnchor2(this.handle));
|
|
2849
2849
|
}
|
|
2850
2850
|
setAnchor1(A) {
|
|
2851
|
-
const I =
|
|
2851
|
+
const I = N.intoRaw(A);
|
|
2852
2852
|
this.rawSet.jointSetAnchor1(this.handle, I), I.free();
|
|
2853
2853
|
}
|
|
2854
2854
|
setAnchor2(A) {
|
|
2855
|
-
const I =
|
|
2855
|
+
const I = N.intoRaw(A);
|
|
2856
2856
|
this.rawSet.jointSetAnchor2(this.handle, I), I.free();
|
|
2857
2857
|
}
|
|
2858
2858
|
setContactsEnabled(A) {
|
|
@@ -2904,35 +2904,35 @@ class _g extends $I {
|
|
|
2904
2904
|
return NI.AngX;
|
|
2905
2905
|
}
|
|
2906
2906
|
}
|
|
2907
|
-
class
|
|
2907
|
+
class TA {
|
|
2908
2908
|
constructor() {
|
|
2909
2909
|
}
|
|
2910
2910
|
static fixed(A, I, C, g) {
|
|
2911
|
-
let Q = new
|
|
2911
|
+
let Q = new TA();
|
|
2912
2912
|
return Q.anchor1 = A, Q.anchor2 = C, Q.frame1 = I, Q.frame2 = g, Q.jointType = MA.Fixed, Q;
|
|
2913
2913
|
}
|
|
2914
2914
|
static spring(A, I, C, g, Q) {
|
|
2915
|
-
let B = new
|
|
2915
|
+
let B = new TA();
|
|
2916
2916
|
return B.anchor1 = g, B.anchor2 = Q, B.length = A, B.stiffness = I, B.damping = C, B.jointType = MA.Spring, B;
|
|
2917
2917
|
}
|
|
2918
2918
|
static rope(A, I, C) {
|
|
2919
|
-
let g = new
|
|
2919
|
+
let g = new TA();
|
|
2920
2920
|
return g.anchor1 = I, g.anchor2 = C, g.length = A, g.jointType = MA.Rope, g;
|
|
2921
2921
|
}
|
|
2922
2922
|
static revolute(A, I) {
|
|
2923
|
-
let C = new
|
|
2923
|
+
let C = new TA();
|
|
2924
2924
|
return C.anchor1 = A, C.anchor2 = I, C.jointType = MA.Revolute, C;
|
|
2925
2925
|
}
|
|
2926
2926
|
static prismatic(A, I, C) {
|
|
2927
|
-
let g = new
|
|
2927
|
+
let g = new TA();
|
|
2928
2928
|
return g.anchor1 = A, g.anchor2 = I, g.axis = C, g.jointType = MA.Prismatic, g;
|
|
2929
2929
|
}
|
|
2930
2930
|
intoRaw() {
|
|
2931
|
-
let A, I, C =
|
|
2931
|
+
let A, I, C = N.intoRaw(this.anchor1), g = N.intoRaw(this.anchor2), Q = !1, B = 0, D = 0;
|
|
2932
2932
|
switch (this.jointType) {
|
|
2933
2933
|
case MA.Fixed:
|
|
2934
|
-
let
|
|
2935
|
-
I = kA.fixed(C,
|
|
2934
|
+
let w = z.intoRaw(this.frame1), o = z.intoRaw(this.frame2);
|
|
2935
|
+
I = kA.fixed(C, w, g, o), w.free(), o.free();
|
|
2936
2936
|
break;
|
|
2937
2937
|
case MA.Spring:
|
|
2938
2938
|
I = kA.spring(this.length, this.stiffness, this.damping, C, g);
|
|
@@ -2941,7 +2941,7 @@ class bA {
|
|
|
2941
2941
|
I = kA.rope(this.length, C, g);
|
|
2942
2942
|
break;
|
|
2943
2943
|
case MA.Prismatic:
|
|
2944
|
-
A =
|
|
2944
|
+
A = N.intoRaw(this.axis), this.limitsEnabled && (Q = !0, B = this.limits[0], D = this.limits[1]), I = kA.prismatic(C, g, A, Q, B, D), A.free();
|
|
2945
2945
|
break;
|
|
2946
2946
|
case MA.Revolute:
|
|
2947
2947
|
I = kA.revolute(C, g);
|
|
@@ -2964,8 +2964,8 @@ class $g {
|
|
|
2964
2964
|
createJoint(A, I, C, g, Q) {
|
|
2965
2965
|
const B = I.intoRaw(), D = this.raw.createJoint(B, C, g, Q);
|
|
2966
2966
|
B.free();
|
|
2967
|
-
let
|
|
2968
|
-
return this.map.set(D,
|
|
2967
|
+
let w = nA.newTyped(this.raw, A, D);
|
|
2968
|
+
return this.map.set(D, w), w;
|
|
2969
2969
|
}
|
|
2970
2970
|
remove(A, I) {
|
|
2971
2971
|
this.raw.remove(A, I), this.unmap(A);
|
|
@@ -2998,11 +2998,11 @@ class WA {
|
|
|
2998
2998
|
}
|
|
2999
2999
|
static newTyped(A, I) {
|
|
3000
3000
|
switch (A.jointType(I)) {
|
|
3001
|
-
case
|
|
3001
|
+
case dA.Revolute:
|
|
3002
3002
|
return new gC(A, I);
|
|
3003
|
-
case
|
|
3003
|
+
case dA.Prismatic:
|
|
3004
3004
|
return new IC(A, I);
|
|
3005
|
-
case
|
|
3005
|
+
case dA.Fixed:
|
|
3006
3006
|
return new AC(A, I);
|
|
3007
3007
|
default:
|
|
3008
3008
|
return new WA(A, I);
|
|
@@ -3111,7 +3111,7 @@ class QI {
|
|
|
3111
3111
|
}
|
|
3112
3112
|
static fromRaw(A) {
|
|
3113
3113
|
if (!A) return null;
|
|
3114
|
-
const I = new QI(A.time_of_impact(),
|
|
3114
|
+
const I = new QI(A.time_of_impact(), N.fromRaw(A.normal()), A.featureType(), A.featureId());
|
|
3115
3115
|
return A.free(), I;
|
|
3116
3116
|
}
|
|
3117
3117
|
}
|
|
@@ -3121,7 +3121,7 @@ class gI {
|
|
|
3121
3121
|
}
|
|
3122
3122
|
static fromRaw(A, I) {
|
|
3123
3123
|
if (!I) return null;
|
|
3124
|
-
const C = new gI(A.get(I.colliderHandle()), I.time_of_impact(),
|
|
3124
|
+
const C = new gI(A.get(I.colliderHandle()), I.time_of_impact(), N.fromRaw(I.normal()), I.featureType(), I.featureId());
|
|
3125
3125
|
return I.free(), C;
|
|
3126
3126
|
}
|
|
3127
3127
|
}
|
|
@@ -3141,7 +3141,7 @@ class BI {
|
|
|
3141
3141
|
}
|
|
3142
3142
|
static fromRaw(A) {
|
|
3143
3143
|
if (!A) return null;
|
|
3144
|
-
const I = new BI(
|
|
3144
|
+
const I = new BI(N.fromRaw(A.point()), A.isInside());
|
|
3145
3145
|
return A.free(), I;
|
|
3146
3146
|
}
|
|
3147
3147
|
}
|
|
@@ -3151,7 +3151,7 @@ class CI {
|
|
|
3151
3151
|
}
|
|
3152
3152
|
static fromRaw(A, I) {
|
|
3153
3153
|
if (!I) return null;
|
|
3154
|
-
const C = new CI(A.get(I.colliderHandle()),
|
|
3154
|
+
const C = new CI(A.get(I.colliderHandle()), N.fromRaw(I.point()), I.isInside(), I.featureType(), I.featureId());
|
|
3155
3155
|
return I.free(), C;
|
|
3156
3156
|
}
|
|
3157
3157
|
}
|
|
@@ -3161,7 +3161,7 @@ class vA {
|
|
|
3161
3161
|
}
|
|
3162
3162
|
static fromRaw(A, I) {
|
|
3163
3163
|
if (!I) return null;
|
|
3164
|
-
const C = new vA(I.time_of_impact(),
|
|
3164
|
+
const C = new vA(I.time_of_impact(), N.fromRaw(I.witness1()), N.fromRaw(I.witness2()), N.fromRaw(I.normal1()), N.fromRaw(I.normal2()));
|
|
3165
3165
|
return I.free(), C;
|
|
3166
3166
|
}
|
|
3167
3167
|
}
|
|
@@ -3171,61 +3171,61 @@ class EI extends vA {
|
|
|
3171
3171
|
}
|
|
3172
3172
|
static fromRaw(A, I) {
|
|
3173
3173
|
if (!I) return null;
|
|
3174
|
-
const C = new EI(A.get(I.colliderHandle()), I.time_of_impact(),
|
|
3174
|
+
const C = new EI(A.get(I.colliderHandle()), I.time_of_impact(), N.fromRaw(I.witness1()), N.fromRaw(I.witness2()), N.fromRaw(I.normal1()), N.fromRaw(I.normal2()));
|
|
3175
3175
|
return I.free(), C;
|
|
3176
3176
|
}
|
|
3177
3177
|
}
|
|
3178
3178
|
class EC {
|
|
3179
3179
|
constructor(A) {
|
|
3180
|
-
this.raw = A || new
|
|
3180
|
+
this.raw = A || new fA();
|
|
3181
3181
|
}
|
|
3182
3182
|
free() {
|
|
3183
3183
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3184
3184
|
}
|
|
3185
|
-
castRay(A, I, C, g, Q, B, D,
|
|
3186
|
-
let
|
|
3187
|
-
return
|
|
3185
|
+
castRay(A, I, C, g, Q, B, D, w, o, h, G) {
|
|
3186
|
+
let s = N.intoRaw(g.origin), a = N.intoRaw(g.dir), M = RI.fromRaw(C, this.raw.castRay(A.raw, I.raw, C.raw, s, a, Q, B, D, w, o, h, G));
|
|
3187
|
+
return s.free(), a.free(), M;
|
|
3188
3188
|
}
|
|
3189
|
-
castRayAndGetNormal(A, I, C, g, Q, B, D,
|
|
3190
|
-
let
|
|
3191
|
-
return
|
|
3189
|
+
castRayAndGetNormal(A, I, C, g, Q, B, D, w, o, h, G) {
|
|
3190
|
+
let s = N.intoRaw(g.origin), a = N.intoRaw(g.dir), M = gI.fromRaw(C, this.raw.castRayAndGetNormal(A.raw, I.raw, C.raw, s, a, Q, B, D, w, o, h, G));
|
|
3191
|
+
return s.free(), a.free(), M;
|
|
3192
3192
|
}
|
|
3193
|
-
intersectionsWithRay(A, I, C, g, Q, B, D,
|
|
3194
|
-
let a =
|
|
3195
|
-
this.raw.intersectionsWithRay(A.raw, I.raw, C.raw, a, M, Q, B, (y) => D(gI.fromRaw(C, y)),
|
|
3193
|
+
intersectionsWithRay(A, I, C, g, Q, B, D, w, o, h, G, s) {
|
|
3194
|
+
let a = N.intoRaw(g.origin), M = N.intoRaw(g.dir);
|
|
3195
|
+
this.raw.intersectionsWithRay(A.raw, I.raw, C.raw, a, M, Q, B, (y) => D(gI.fromRaw(C, y)), w, o, h, G, s), a.free(), M.free();
|
|
3196
3196
|
}
|
|
3197
|
-
intersectionWithShape(A, I, C, g, Q, B, D,
|
|
3198
|
-
let
|
|
3199
|
-
return
|
|
3197
|
+
intersectionWithShape(A, I, C, g, Q, B, D, w, o, h, G) {
|
|
3198
|
+
let s = N.intoRaw(g), a = z.intoRaw(Q), M = B.intoRaw(), y = this.raw.intersectionWithShape(A.raw, I.raw, C.raw, s, a, M, D, w, o, h, G);
|
|
3199
|
+
return s.free(), a.free(), M.free(), y;
|
|
3200
3200
|
}
|
|
3201
|
-
projectPoint(A, I, C, g, Q, B, D,
|
|
3202
|
-
let G =
|
|
3203
|
-
return G.free(),
|
|
3201
|
+
projectPoint(A, I, C, g, Q, B, D, w, o, h) {
|
|
3202
|
+
let G = N.intoRaw(g), s = CI.fromRaw(C, this.raw.projectPoint(A.raw, I.raw, C.raw, G, Q, B, D, w, o, h));
|
|
3203
|
+
return G.free(), s;
|
|
3204
3204
|
}
|
|
3205
|
-
projectPointAndGetFeature(A, I, C, g, Q, B, D,
|
|
3206
|
-
let h =
|
|
3205
|
+
projectPointAndGetFeature(A, I, C, g, Q, B, D, w, o) {
|
|
3206
|
+
let h = N.intoRaw(g), G = CI.fromRaw(C, this.raw.projectPointAndGetFeature(A.raw, I.raw, C.raw, h, Q, B, D, w, o));
|
|
3207
3207
|
return h.free(), G;
|
|
3208
3208
|
}
|
|
3209
|
-
intersectionsWithPoint(A, I, C, g, Q, B, D,
|
|
3210
|
-
let G =
|
|
3211
|
-
this.raw.intersectionsWithPoint(A.raw, I.raw, C.raw, G, Q, B, D,
|
|
3209
|
+
intersectionsWithPoint(A, I, C, g, Q, B, D, w, o, h) {
|
|
3210
|
+
let G = N.intoRaw(g);
|
|
3211
|
+
this.raw.intersectionsWithPoint(A.raw, I.raw, C.raw, G, Q, B, D, w, o, h), G.free();
|
|
3212
3212
|
}
|
|
3213
|
-
castShape(A, I, C, g, Q, B, D,
|
|
3214
|
-
let J =
|
|
3215
|
-
return J.free(),
|
|
3213
|
+
castShape(A, I, C, g, Q, B, D, w, o, h, G, s, a, M, y) {
|
|
3214
|
+
let J = N.intoRaw(g), S = z.intoRaw(Q), F = N.intoRaw(B), U = D.intoRaw(), R = EI.fromRaw(C, this.raw.castShape(A.raw, I.raw, C.raw, J, S, F, U, w, o, h, G, s, a, M, y));
|
|
3215
|
+
return J.free(), S.free(), F.free(), U.free(), R;
|
|
3216
3216
|
}
|
|
3217
|
-
intersectionsWithShape(A, I, C, g, Q, B, D,
|
|
3218
|
-
let a =
|
|
3219
|
-
this.raw.intersectionsWithShape(A.raw, I.raw, C.raw, a, M, y, D,
|
|
3217
|
+
intersectionsWithShape(A, I, C, g, Q, B, D, w, o, h, G, s) {
|
|
3218
|
+
let a = N.intoRaw(g), M = z.intoRaw(Q), y = B.intoRaw();
|
|
3219
|
+
this.raw.intersectionsWithShape(A.raw, I.raw, C.raw, a, M, y, D, w, o, h, G, s), a.free(), M.free(), y.free();
|
|
3220
3220
|
}
|
|
3221
3221
|
collidersWithAabbIntersectingAabb(A, I, C, g, Q, B) {
|
|
3222
|
-
let D =
|
|
3223
|
-
this.raw.collidersWithAabbIntersectingAabb(A.raw, I.raw, C.raw, D,
|
|
3222
|
+
let D = N.intoRaw(g), w = N.intoRaw(Q);
|
|
3223
|
+
this.raw.collidersWithAabbIntersectingAabb(A.raw, I.raw, C.raw, D, w, B), D.free(), w.free();
|
|
3224
3224
|
}
|
|
3225
3225
|
}
|
|
3226
3226
|
class iC {
|
|
3227
3227
|
constructor(A) {
|
|
3228
|
-
this.raw = A || new
|
|
3228
|
+
this.raw = A || new oA(), this.tempManifold = new DC(null);
|
|
3229
3229
|
}
|
|
3230
3230
|
free() {
|
|
3231
3231
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
@@ -3257,13 +3257,13 @@ class DC {
|
|
|
3257
3257
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3258
3258
|
}
|
|
3259
3259
|
normal() {
|
|
3260
|
-
return
|
|
3260
|
+
return N.fromRaw(this.raw.normal());
|
|
3261
3261
|
}
|
|
3262
3262
|
localNormal1() {
|
|
3263
|
-
return
|
|
3263
|
+
return N.fromRaw(this.raw.local_n1());
|
|
3264
3264
|
}
|
|
3265
3265
|
localNormal2() {
|
|
3266
|
-
return
|
|
3266
|
+
return N.fromRaw(this.raw.local_n2());
|
|
3267
3267
|
}
|
|
3268
3268
|
subshape1() {
|
|
3269
3269
|
return this.raw.subshape1();
|
|
@@ -3275,10 +3275,10 @@ class DC {
|
|
|
3275
3275
|
return this.raw.num_contacts();
|
|
3276
3276
|
}
|
|
3277
3277
|
localContactPoint1(A) {
|
|
3278
|
-
return
|
|
3278
|
+
return N.fromRaw(this.raw.contact_local_p1(A));
|
|
3279
3279
|
}
|
|
3280
3280
|
localContactPoint2(A) {
|
|
3281
|
-
return
|
|
3281
|
+
return N.fromRaw(this.raw.contact_local_p2(A));
|
|
3282
3282
|
}
|
|
3283
3283
|
contactDist(A) {
|
|
3284
3284
|
return this.raw.contact_dist(A);
|
|
@@ -3299,7 +3299,7 @@ class DC {
|
|
|
3299
3299
|
return this.raw.num_solver_contacts();
|
|
3300
3300
|
}
|
|
3301
3301
|
solverContactPoint(A) {
|
|
3302
|
-
return
|
|
3302
|
+
return N.fromRaw(this.raw.solver_contact_point(A));
|
|
3303
3303
|
}
|
|
3304
3304
|
solverContactDist(A) {
|
|
3305
3305
|
return this.raw.solver_contact_dist(A);
|
|
@@ -3311,7 +3311,7 @@ class DC {
|
|
|
3311
3311
|
return this.raw.solver_contact_restitution(A);
|
|
3312
3312
|
}
|
|
3313
3313
|
solverContactTangentVelocity(A) {
|
|
3314
|
-
return
|
|
3314
|
+
return N.fromRaw(this.raw.solver_contact_tangent_velocity(A));
|
|
3315
3315
|
}
|
|
3316
3316
|
}
|
|
3317
3317
|
class XA {
|
|
@@ -3320,14 +3320,14 @@ class XA {
|
|
|
3320
3320
|
}
|
|
3321
3321
|
static fromRaw(A) {
|
|
3322
3322
|
if (!A) return null;
|
|
3323
|
-
const I = new XA(A.distance(),
|
|
3323
|
+
const I = new XA(A.distance(), N.fromRaw(A.point1()), N.fromRaw(A.point2()), N.fromRaw(A.normal1()), N.fromRaw(A.normal2()));
|
|
3324
3324
|
return A.free(), I;
|
|
3325
3325
|
}
|
|
3326
3326
|
}
|
|
3327
|
-
class
|
|
3327
|
+
class aA {
|
|
3328
3328
|
static fromRaw(A, I) {
|
|
3329
3329
|
const C = A.coShapeType(I);
|
|
3330
|
-
let g, Q, B, D,
|
|
3330
|
+
let g, Q, B, D, w, o, h;
|
|
3331
3331
|
switch (C) {
|
|
3332
3332
|
case NA.Ball:
|
|
3333
3333
|
return new Ig(A.coRadius(I));
|
|
@@ -3336,27 +3336,27 @@ class SA {
|
|
|
3336
3336
|
case NA.RoundCuboid:
|
|
3337
3337
|
return g = A.coHalfExtents(I), Q = A.coRoundRadius(I), new Qg(g.x, g.y, Q);
|
|
3338
3338
|
case NA.Capsule:
|
|
3339
|
-
return
|
|
3339
|
+
return w = A.coHalfHeight(I), o = A.coRadius(I), new Bg(w, o);
|
|
3340
3340
|
case NA.Segment:
|
|
3341
|
-
return B = A.coVertices(I), new Eg(
|
|
3341
|
+
return B = A.coVertices(I), new Eg(N.new(B[0], B[1]), N.new(B[2], B[3]));
|
|
3342
3342
|
case NA.Polyline:
|
|
3343
3343
|
return B = A.coVertices(I), D = A.coIndices(I), new og(B, D);
|
|
3344
3344
|
case NA.Triangle:
|
|
3345
|
-
return B = A.coVertices(I), new ig(
|
|
3345
|
+
return B = A.coVertices(I), new ig(N.new(B[0], B[1]), N.new(B[2], B[3]), N.new(B[4], B[5]));
|
|
3346
3346
|
case NA.RoundTriangle:
|
|
3347
|
-
return B = A.coVertices(I), Q = A.coRoundRadius(I), new Dg(
|
|
3347
|
+
return B = A.coVertices(I), Q = A.coRoundRadius(I), new Dg(N.new(B[0], B[1]), N.new(B[2], B[3]), N.new(B[4], B[5]), Q);
|
|
3348
3348
|
case NA.HalfSpace:
|
|
3349
|
-
return h =
|
|
3349
|
+
return h = N.fromRaw(A.coHalfspaceNormal(I)), new gg(h);
|
|
3350
3350
|
case NA.Voxels:
|
|
3351
|
-
const G = A.coVoxelData(I),
|
|
3352
|
-
return new wg(G,
|
|
3351
|
+
const G = A.coVoxelData(I), s = A.coVoxelSize(I);
|
|
3352
|
+
return new wg(G, s);
|
|
3353
3353
|
case NA.TriMesh:
|
|
3354
3354
|
B = A.coVertices(I), D = A.coIndices(I);
|
|
3355
3355
|
const a = A.coTriMeshFlags(I);
|
|
3356
|
-
return new
|
|
3356
|
+
return new hg(B, D, a);
|
|
3357
3357
|
case NA.HeightField:
|
|
3358
3358
|
const M = A.coHeightfieldScale(I), y = A.coHeightfieldHeights(I);
|
|
3359
|
-
return new
|
|
3359
|
+
return new Gg(y, M);
|
|
3360
3360
|
case NA.ConvexPolygon:
|
|
3361
3361
|
return B = A.coVertices(I), new aI(B, !1);
|
|
3362
3362
|
case NA.RoundConvexPolygon:
|
|
@@ -3365,159 +3365,159 @@ class SA {
|
|
|
3365
3365
|
throw new Error("unknown shape type: " + C);
|
|
3366
3366
|
}
|
|
3367
3367
|
}
|
|
3368
|
-
castShape(A, I, C, g, Q, B, D,
|
|
3369
|
-
let G =
|
|
3370
|
-
return G.free(),
|
|
3368
|
+
castShape(A, I, C, g, Q, B, D, w, o, h) {
|
|
3369
|
+
let G = N.intoRaw(A), s = z.intoRaw(I), a = N.intoRaw(C), M = N.intoRaw(Q), y = z.intoRaw(B), J = N.intoRaw(D), S = this.intoRaw(), F = g.intoRaw(), U = vA.fromRaw(null, S.castShape(G, s, a, F, M, y, J, w, o, h));
|
|
3370
|
+
return G.free(), s.free(), a.free(), M.free(), y.free(), J.free(), S.free(), F.free(), U;
|
|
3371
3371
|
}
|
|
3372
3372
|
intersectsShape(A, I, C, g, Q) {
|
|
3373
|
-
let B =
|
|
3374
|
-
return B.free(), D.free(),
|
|
3373
|
+
let B = N.intoRaw(A), D = z.intoRaw(I), w = N.intoRaw(g), o = z.intoRaw(Q), h = this.intoRaw(), G = C.intoRaw(), s = h.intersectsShape(B, D, G, w, o);
|
|
3374
|
+
return B.free(), D.free(), w.free(), o.free(), h.free(), G.free(), s;
|
|
3375
3375
|
}
|
|
3376
3376
|
contactShape(A, I, C, g, Q, B) {
|
|
3377
|
-
let D =
|
|
3378
|
-
return D.free(),
|
|
3377
|
+
let D = N.intoRaw(A), w = z.intoRaw(I), o = N.intoRaw(g), h = z.intoRaw(Q), G = this.intoRaw(), s = C.intoRaw(), a = XA.fromRaw(G.contactShape(D, w, s, o, h, B));
|
|
3378
|
+
return D.free(), w.free(), o.free(), h.free(), G.free(), s.free(), a;
|
|
3379
3379
|
}
|
|
3380
3380
|
containsPoint(A, I, C) {
|
|
3381
|
-
let g =
|
|
3382
|
-
return g.free(), Q.free(), B.free(), D.free(),
|
|
3381
|
+
let g = N.intoRaw(A), Q = z.intoRaw(I), B = N.intoRaw(C), D = this.intoRaw(), w = D.containsPoint(g, Q, B);
|
|
3382
|
+
return g.free(), Q.free(), B.free(), D.free(), w;
|
|
3383
3383
|
}
|
|
3384
3384
|
projectPoint(A, I, C, g) {
|
|
3385
|
-
let Q =
|
|
3386
|
-
return Q.free(), B.free(), D.free(),
|
|
3385
|
+
let Q = N.intoRaw(A), B = z.intoRaw(I), D = N.intoRaw(C), w = this.intoRaw(), o = BI.fromRaw(w.projectPoint(Q, B, D, g));
|
|
3386
|
+
return Q.free(), B.free(), D.free(), w.free(), o;
|
|
3387
3387
|
}
|
|
3388
3388
|
intersectsRay(A, I, C, g) {
|
|
3389
|
-
let Q =
|
|
3390
|
-
return Q.free(), B.free(), D.free(),
|
|
3389
|
+
let Q = N.intoRaw(I), B = z.intoRaw(C), D = N.intoRaw(A.origin), w = N.intoRaw(A.dir), o = this.intoRaw(), h = o.intersectsRay(Q, B, D, w, g);
|
|
3390
|
+
return Q.free(), B.free(), D.free(), w.free(), o.free(), h;
|
|
3391
3391
|
}
|
|
3392
3392
|
castRay(A, I, C, g, Q) {
|
|
3393
|
-
let B =
|
|
3394
|
-
return B.free(), D.free(),
|
|
3393
|
+
let B = N.intoRaw(I), D = z.intoRaw(C), w = N.intoRaw(A.origin), o = N.intoRaw(A.dir), h = this.intoRaw(), G = h.castRay(B, D, w, o, g, Q);
|
|
3394
|
+
return B.free(), D.free(), w.free(), o.free(), h.free(), G;
|
|
3395
3395
|
}
|
|
3396
3396
|
castRayAndGetNormal(A, I, C, g, Q) {
|
|
3397
|
-
let B =
|
|
3398
|
-
return B.free(), D.free(),
|
|
3397
|
+
let B = N.intoRaw(I), D = z.intoRaw(C), w = N.intoRaw(A.origin), o = N.intoRaw(A.dir), h = this.intoRaw(), G = QI.fromRaw(h.castRayAndGetNormal(B, D, w, o, g, Q));
|
|
3398
|
+
return B.free(), D.free(), w.free(), o.free(), h.free(), G;
|
|
3399
3399
|
}
|
|
3400
3400
|
}
|
|
3401
3401
|
(function(i) {
|
|
3402
3402
|
i[i.Ball = 0] = "Ball", i[i.Cuboid = 1] = "Cuboid", i[i.Capsule = 2] = "Capsule", i[i.Segment = 3] = "Segment", i[i.Polyline = 4] = "Polyline", i[i.Triangle = 5] = "Triangle", i[i.TriMesh = 6] = "TriMesh", i[i.HeightField = 7] = "HeightField", i[i.ConvexPolygon = 9] = "ConvexPolygon", i[i.RoundCuboid = 10] = "RoundCuboid", i[i.RoundTriangle = 11] = "RoundTriangle", i[i.RoundConvexPolygon = 12] = "RoundConvexPolygon", i[i.HalfSpace = 13] = "HalfSpace", i[i.Voxels = 14] = "Voxels";
|
|
3403
|
-
})(
|
|
3403
|
+
})(KA || (KA = {})), function(i) {
|
|
3404
3404
|
i[i.DELETE_BAD_TOPOLOGY_TRIANGLES = 4] = "DELETE_BAD_TOPOLOGY_TRIANGLES", i[i.ORIENTED = 8] = "ORIENTED", i[i.MERGE_DUPLICATE_VERTICES = 16] = "MERGE_DUPLICATE_VERTICES", i[i.DELETE_DEGENERATE_TRIANGLES = 32] = "DELETE_DEGENERATE_TRIANGLES", i[i.DELETE_DUPLICATE_TRIANGLES = 64] = "DELETE_DUPLICATE_TRIANGLES", i[i.FIX_INTERNAL_EDGES = 144] = "FIX_INTERNAL_EDGES";
|
|
3405
|
-
}(
|
|
3406
|
-
class Ig extends
|
|
3405
|
+
}(OI || (OI = {}));
|
|
3406
|
+
class Ig extends aA {
|
|
3407
3407
|
constructor(A) {
|
|
3408
|
-
super(), this.type =
|
|
3408
|
+
super(), this.type = KA.Ball, this.radius = A;
|
|
3409
3409
|
}
|
|
3410
3410
|
intoRaw() {
|
|
3411
|
-
return
|
|
3411
|
+
return d.ball(this.radius);
|
|
3412
3412
|
}
|
|
3413
3413
|
}
|
|
3414
|
-
class gg extends
|
|
3414
|
+
class gg extends aA {
|
|
3415
3415
|
constructor(A) {
|
|
3416
|
-
super(), this.type =
|
|
3416
|
+
super(), this.type = KA.HalfSpace, this.normal = A;
|
|
3417
3417
|
}
|
|
3418
3418
|
intoRaw() {
|
|
3419
|
-
let A =
|
|
3419
|
+
let A = N.intoRaw(this.normal), I = d.halfspace(A);
|
|
3420
3420
|
return A.free(), I;
|
|
3421
3421
|
}
|
|
3422
3422
|
}
|
|
3423
|
-
class Cg extends
|
|
3423
|
+
class Cg extends aA {
|
|
3424
3424
|
constructor(A, I) {
|
|
3425
|
-
super(), this.type =
|
|
3425
|
+
super(), this.type = KA.Cuboid, this.halfExtents = N.new(A, I);
|
|
3426
3426
|
}
|
|
3427
3427
|
intoRaw() {
|
|
3428
|
-
return
|
|
3428
|
+
return d.cuboid(this.halfExtents.x, this.halfExtents.y);
|
|
3429
3429
|
}
|
|
3430
3430
|
}
|
|
3431
|
-
class Qg extends
|
|
3431
|
+
class Qg extends aA {
|
|
3432
3432
|
constructor(A, I, C) {
|
|
3433
|
-
super(), this.type =
|
|
3433
|
+
super(), this.type = KA.RoundCuboid, this.halfExtents = N.new(A, I), this.borderRadius = C;
|
|
3434
3434
|
}
|
|
3435
3435
|
intoRaw() {
|
|
3436
|
-
return
|
|
3436
|
+
return d.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius);
|
|
3437
3437
|
}
|
|
3438
3438
|
}
|
|
3439
|
-
class Bg extends
|
|
3439
|
+
class Bg extends aA {
|
|
3440
3440
|
constructor(A, I) {
|
|
3441
|
-
super(), this.type =
|
|
3441
|
+
super(), this.type = KA.Capsule, this.halfHeight = A, this.radius = I;
|
|
3442
3442
|
}
|
|
3443
3443
|
intoRaw() {
|
|
3444
|
-
return
|
|
3444
|
+
return d.capsule(this.halfHeight, this.radius);
|
|
3445
3445
|
}
|
|
3446
3446
|
}
|
|
3447
|
-
class Eg extends
|
|
3447
|
+
class Eg extends aA {
|
|
3448
3448
|
constructor(A, I) {
|
|
3449
|
-
super(), this.type =
|
|
3449
|
+
super(), this.type = KA.Segment, this.a = A, this.b = I;
|
|
3450
3450
|
}
|
|
3451
3451
|
intoRaw() {
|
|
3452
|
-
let A =
|
|
3452
|
+
let A = N.intoRaw(this.a), I = N.intoRaw(this.b), C = d.segment(A, I);
|
|
3453
3453
|
return A.free(), I.free(), C;
|
|
3454
3454
|
}
|
|
3455
3455
|
}
|
|
3456
|
-
class ig extends
|
|
3456
|
+
class ig extends aA {
|
|
3457
3457
|
constructor(A, I, C) {
|
|
3458
|
-
super(), this.type =
|
|
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 = N.intoRaw(this.a), I = N.intoRaw(this.b), C = N.intoRaw(this.c), g = d.triangle(A, I, C);
|
|
3462
3462
|
return A.free(), I.free(), C.free(), g;
|
|
3463
3463
|
}
|
|
3464
3464
|
}
|
|
3465
|
-
class Dg extends
|
|
3465
|
+
class Dg extends aA {
|
|
3466
3466
|
constructor(A, I, C, g) {
|
|
3467
|
-
super(), this.type =
|
|
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 = N.intoRaw(this.a), I = N.intoRaw(this.b), C = N.intoRaw(this.c), g = d.roundTriangle(A, I, C, this.borderRadius);
|
|
3471
3471
|
return A.free(), I.free(), C.free(), g;
|
|
3472
3472
|
}
|
|
3473
3473
|
}
|
|
3474
|
-
class og extends
|
|
3474
|
+
class og extends aA {
|
|
3475
3475
|
constructor(A, I) {
|
|
3476
|
-
super(), this.type =
|
|
3476
|
+
super(), this.type = KA.Polyline, this.vertices = A, this.indices = I ?? new Uint32Array(0);
|
|
3477
3477
|
}
|
|
3478
3478
|
intoRaw() {
|
|
3479
|
-
return
|
|
3479
|
+
return d.polyline(this.vertices, this.indices);
|
|
3480
3480
|
}
|
|
3481
3481
|
}
|
|
3482
|
-
class wg extends
|
|
3482
|
+
class wg extends aA {
|
|
3483
3483
|
constructor(A, I) {
|
|
3484
|
-
super(), this.type =
|
|
3484
|
+
super(), this.type = KA.Voxels, this.data = A, this.voxelSize = I;
|
|
3485
3485
|
}
|
|
3486
3486
|
intoRaw() {
|
|
3487
|
-
let A, I =
|
|
3488
|
-
return A = this.data instanceof Int32Array ?
|
|
3487
|
+
let A, I = N.intoRaw(this.voxelSize);
|
|
3488
|
+
return A = this.data instanceof Int32Array ? d.voxels(I, this.data) : d.voxelsFromPoints(I, this.data), I.free(), A;
|
|
3489
3489
|
}
|
|
3490
3490
|
}
|
|
3491
|
-
class
|
|
3491
|
+
class hg extends aA {
|
|
3492
3492
|
constructor(A, I, C) {
|
|
3493
|
-
super(), this.type =
|
|
3493
|
+
super(), this.type = KA.TriMesh, this.vertices = A, this.indices = I, this.flags = C;
|
|
3494
3494
|
}
|
|
3495
3495
|
intoRaw() {
|
|
3496
|
-
return
|
|
3496
|
+
return d.trimesh(this.vertices, this.indices, this.flags);
|
|
3497
3497
|
}
|
|
3498
3498
|
}
|
|
3499
|
-
class aI extends
|
|
3499
|
+
class aI extends aA {
|
|
3500
3500
|
constructor(A, I) {
|
|
3501
|
-
super(), this.type =
|
|
3501
|
+
super(), this.type = KA.ConvexPolygon, this.vertices = A, this.skipConvexHullComputation = !!I;
|
|
3502
3502
|
}
|
|
3503
3503
|
intoRaw() {
|
|
3504
|
-
return this.skipConvexHullComputation ?
|
|
3504
|
+
return this.skipConvexHullComputation ? d.convexPolyline(this.vertices) : d.convexHull(this.vertices);
|
|
3505
3505
|
}
|
|
3506
3506
|
}
|
|
3507
|
-
class SI extends
|
|
3507
|
+
class SI extends aA {
|
|
3508
3508
|
constructor(A, I, C) {
|
|
3509
|
-
super(), this.type =
|
|
3509
|
+
super(), this.type = KA.RoundConvexPolygon, this.vertices = A, this.borderRadius = I, this.skipConvexHullComputation = !!C;
|
|
3510
3510
|
}
|
|
3511
3511
|
intoRaw() {
|
|
3512
|
-
return this.skipConvexHullComputation ?
|
|
3512
|
+
return this.skipConvexHullComputation ? d.roundConvexPolyline(this.vertices, this.borderRadius) : d.roundConvexHull(this.vertices, this.borderRadius);
|
|
3513
3513
|
}
|
|
3514
3514
|
}
|
|
3515
|
-
class
|
|
3515
|
+
class Gg extends aA {
|
|
3516
3516
|
constructor(A, I) {
|
|
3517
|
-
super(), this.type =
|
|
3517
|
+
super(), this.type = KA.HeightField, this.heights = A, this.scale = I;
|
|
3518
3518
|
}
|
|
3519
3519
|
intoRaw() {
|
|
3520
|
-
let A =
|
|
3520
|
+
let A = N.intoRaw(this.scale), I = d.heightfield(this.heights, A);
|
|
3521
3521
|
return A.free(), I;
|
|
3522
3522
|
}
|
|
3523
3523
|
}
|
|
@@ -3528,9 +3528,9 @@ class oC {
|
|
|
3528
3528
|
free() {
|
|
3529
3529
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3530
3530
|
}
|
|
3531
|
-
step(A, I, C, g, Q, B, D,
|
|
3532
|
-
let a =
|
|
3533
|
-
G ? this.raw.stepWithEvents(a, I.raw, C.raw, g.raw, Q.raw, B.raw, D.raw,
|
|
3531
|
+
step(A, I, C, g, Q, B, D, w, o, h, G, s) {
|
|
3532
|
+
let a = N.intoRaw(A);
|
|
3533
|
+
G ? this.raw.stepWithEvents(a, I.raw, C.raw, g.raw, Q.raw, B.raw, D.raw, w.raw, o.raw, h.raw, G.raw, s, s ? s.filterContactPair : null, s ? s.filterIntersectionPair : null) : this.raw.step(a, I.raw, C.raw, g.raw, Q.raw, B.raw, D.raw, w.raw, o.raw, h.raw), a.free();
|
|
3534
3534
|
}
|
|
3535
3535
|
}
|
|
3536
3536
|
class XI {
|
|
@@ -3540,9 +3540,9 @@ class XI {
|
|
|
3540
3540
|
free() {
|
|
3541
3541
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3542
3542
|
}
|
|
3543
|
-
serializeAll(A, I, C, g, Q, B, D,
|
|
3544
|
-
let h =
|
|
3545
|
-
const G = this.raw.serializeAll(h, I.raw, C.raw, g.raw, Q.raw, B.raw, D.raw,
|
|
3543
|
+
serializeAll(A, I, C, g, Q, B, D, w, o) {
|
|
3544
|
+
let h = N.intoRaw(A);
|
|
3545
|
+
const G = this.raw.serializeAll(h, I.raw, C.raw, g.raw, Q.raw, B.raw, D.raw, w.raw, o.raw);
|
|
3546
3546
|
return h.free(), G;
|
|
3547
3547
|
}
|
|
3548
3548
|
deserializeAll(A) {
|
|
@@ -3554,7 +3554,7 @@ class wC {
|
|
|
3554
3554
|
this.vertices = A, this.colors = I;
|
|
3555
3555
|
}
|
|
3556
3556
|
}
|
|
3557
|
-
class
|
|
3557
|
+
class hC {
|
|
3558
3558
|
constructor(A) {
|
|
3559
3559
|
this.raw = A || new cC();
|
|
3560
3560
|
}
|
|
@@ -3565,11 +3565,11 @@ class GC {
|
|
|
3565
3565
|
this.raw.render(A.raw, I.raw, C.raw, g.raw, Q.raw, B, I.castClosure(D)), this.vertices = this.raw.vertices(), this.colors = this.raw.colors();
|
|
3566
3566
|
}
|
|
3567
3567
|
}
|
|
3568
|
-
class
|
|
3568
|
+
class GC {
|
|
3569
3569
|
}
|
|
3570
3570
|
class sC {
|
|
3571
3571
|
constructor(A, I, C, g, Q, B) {
|
|
3572
|
-
this.params = I, this.bodies = Q, this.colliders = B, this.broadPhase = C, this.narrowPhase = g, this.raw = new tC(A), this.rawCharacterCollision = new
|
|
3572
|
+
this.params = I, this.bodies = Q, this.colliders = B, this.broadPhase = C, this.narrowPhase = g, this.raw = new tC(A), this.rawCharacterCollision = new Wg(), this._applyImpulsesToDynamicBodies = !1, this._characterMass = null;
|
|
3573
3573
|
}
|
|
3574
3574
|
free() {
|
|
3575
3575
|
this.raw && (this.raw.free(), this.rawCharacterCollision.free()), this.raw = void 0, this.rawCharacterCollision = void 0;
|
|
@@ -3578,7 +3578,7 @@ class sC {
|
|
|
3578
3578
|
return this.raw.up();
|
|
3579
3579
|
}
|
|
3580
3580
|
setUp(A) {
|
|
3581
|
-
let I =
|
|
3581
|
+
let I = N.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 = N.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 N.fromRaw(this.raw.computedMovement());
|
|
3662
3662
|
}
|
|
3663
3663
|
computedGrounded() {
|
|
3664
3664
|
return this.raw.computedGrounded();
|
|
@@ -3669,14 +3669,14 @@ 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
|
|
3672
|
+
return (I = I ?? new GC()).translationDeltaApplied = N.fromRaw(C.translationDeltaApplied()), I.translationDeltaRemaining = N.fromRaw(C.translationDeltaRemaining()), I.toi = C.toi(), I.witness1 = N.fromRaw(C.worldWitness1()), I.witness2 = N.fromRaw(C.worldWitness2()), I.normal1 = N.fromRaw(C.worldNormal1()), I.normal2 = N.fromRaw(C.worldNormal2()), I.collider = this.colliders.get(C.handle()), I;
|
|
3673
3673
|
}
|
|
3674
3674
|
return null;
|
|
3675
3675
|
}
|
|
3676
3676
|
}
|
|
3677
3677
|
(function(i) {
|
|
3678
3678
|
i[i.None = 0] = "None", i[i.LinX = 1] = "LinX", i[i.LinY = 2] = "LinY", i[i.LinZ = 4] = "LinZ", i[i.AngZ = 32] = "AngZ", i[i.AllLin = 3] = "AllLin", i[i.AllAng = 32] = "AllAng", i[i.All = 35] = "All";
|
|
3679
|
-
})(
|
|
3679
|
+
})(WI || (WI = {}));
|
|
3680
3680
|
class KC {
|
|
3681
3681
|
constructor(A, I, C, g, Q, B) {
|
|
3682
3682
|
this.params = A, this.bodies = I, this.raw = new eC(C, g, Q, B);
|
|
@@ -3700,29 +3700,29 @@ class KC {
|
|
|
3700
3700
|
this.raw.reset_integrals();
|
|
3701
3701
|
}
|
|
3702
3702
|
applyLinearCorrection(A, I, C) {
|
|
3703
|
-
let g =
|
|
3703
|
+
let g = N.intoRaw(I), Q = N.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 = N.intoRaw(I), Q = N.intoRaw(C), B = this.raw.linear_correction(this.params.dt, this.bodies.raw, A.handle, g, Q);
|
|
3711
|
+
return g.free(), Q.free(), N.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 cI {
|
|
3718
|
-
constructor(A, I, C, g, Q, B, D,
|
|
3719
|
-
this.gravity = A, this.integrationParameters = new vg(I), this.islands = new BC(C), this.broadPhase = new EC(g), this.narrowPhase = new iC(Q), this.bodies = new Xg(B), this.colliders = new SC(D), this.impulseJoints = new $g(
|
|
3718
|
+
constructor(A, I, C, g, Q, B, D, w, o, h, G, s, a) {
|
|
3719
|
+
this.gravity = A, this.integrationParameters = new vg(I), this.islands = new BC(C), this.broadPhase = new EC(g), this.narrowPhase = new iC(Q), this.bodies = new Xg(B), this.colliders = new SC(D), this.impulseJoints = new $g(w), this.multibodyJoints = new CC(o), this.ccdSolver = new QC(h), this.physicsPipeline = new oC(G), this.serializationPipeline = new XI(s), this.debugRenderPipeline = new hC(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 cI(
|
|
3725
|
+
return A ? new cI(N.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);
|
|
@@ -3829,18 +3829,18 @@ class cI {
|
|
|
3829
3829
|
forEachActiveRigidBody(A) {
|
|
3830
3830
|
this.bodies.forEachActiveRigidBody(this.islands, A);
|
|
3831
3831
|
}
|
|
3832
|
-
castRay(A, I, C, g, Q, B, D,
|
|
3833
|
-
return this.broadPhase.castRay(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, D ? D.handle : null, this.colliders.castClosure(
|
|
3832
|
+
castRay(A, I, C, g, Q, B, D, w) {
|
|
3833
|
+
return this.broadPhase.castRay(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, D ? D.handle : null, this.colliders.castClosure(w));
|
|
3834
3834
|
}
|
|
3835
|
-
castRayAndGetNormal(A, I, C, g, Q, B, D,
|
|
3836
|
-
return this.broadPhase.castRayAndGetNormal(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, D ? D.handle : null, this.colliders.castClosure(
|
|
3835
|
+
castRayAndGetNormal(A, I, C, g, Q, B, D, w) {
|
|
3836
|
+
return this.broadPhase.castRayAndGetNormal(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, D ? D.handle : null, this.colliders.castClosure(w));
|
|
3837
3837
|
}
|
|
3838
|
-
intersectionsWithRay(A, I, C, g, Q, B, D,
|
|
3839
|
-
this.broadPhase.intersectionsWithRay(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, D ? D.handle : null,
|
|
3838
|
+
intersectionsWithRay(A, I, C, g, Q, B, D, w, o) {
|
|
3839
|
+
this.broadPhase.intersectionsWithRay(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, D ? D.handle : null, w ? w.handle : null, this.colliders.castClosure(o));
|
|
3840
3840
|
}
|
|
3841
|
-
intersectionWithShape(A, I, C, g, Q, B, D,
|
|
3842
|
-
let
|
|
3843
|
-
return
|
|
3841
|
+
intersectionWithShape(A, I, C, g, Q, B, D, w) {
|
|
3842
|
+
let o = this.broadPhase.intersectionWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, D ? D.handle : null, this.colliders.castClosure(w));
|
|
3843
|
+
return o != null ? this.colliders.get(o) : null;
|
|
3844
3844
|
}
|
|
3845
3845
|
projectPoint(A, I, C, g, Q, B, D) {
|
|
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(D));
|
|
@@ -3851,11 +3851,11 @@ class cI {
|
|
|
3851
3851
|
intersectionsWithPoint(A, I, C, g, Q, B, D) {
|
|
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(D));
|
|
3853
3853
|
}
|
|
3854
|
-
castShape(A, I, C, g, Q, B, D,
|
|
3855
|
-
return this.broadPhase.castShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, D,
|
|
3854
|
+
castShape(A, I, C, g, Q, B, D, w, o, h, G, s) {
|
|
3855
|
+
return this.broadPhase.castShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, D, w, o, h ? h.handle : null, G ? G.handle : null, this.colliders.castClosure(s));
|
|
3856
3856
|
}
|
|
3857
|
-
intersectionsWithShape(A, I, C, g, Q, B, D,
|
|
3858
|
-
this.broadPhase.intersectionsWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, this.colliders.castClosure(g), Q, B, D ? D.handle : null,
|
|
3857
|
+
intersectionsWithShape(A, I, C, g, Q, B, D, w, o) {
|
|
3858
|
+
this.broadPhase.intersectionsWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, this.colliders.castClosure(g), Q, B, D ? D.handle : null, w ? w.handle : null, this.colliders.castClosure(o));
|
|
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));
|
|
@@ -3929,7 +3929,7 @@ class cI {
|
|
|
3929
3929
|
}
|
|
3930
3930
|
(function(i) {
|
|
3931
3931
|
i[i.NONE = 0] = "NONE", i[i.COLLISION_EVENTS = 1] = "COLLISION_EVENTS", i[i.CONTACT_FORCE_EVENTS = 2] = "CONTACT_FORCE_EVENTS";
|
|
3932
|
-
})(
|
|
3932
|
+
})(GI || (GI = {}));
|
|
3933
3933
|
class aC {
|
|
3934
3934
|
free() {
|
|
3935
3935
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
@@ -3941,13 +3941,13 @@ class aC {
|
|
|
3941
3941
|
return this.raw.collider2();
|
|
3942
3942
|
}
|
|
3943
3943
|
totalForce() {
|
|
3944
|
-
return
|
|
3944
|
+
return N.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 N.fromRaw(this.raw.max_force_direction());
|
|
3951
3951
|
}
|
|
3952
3952
|
maxForceMagnitude() {
|
|
3953
3953
|
return this.raw.max_force_magnitude();
|
|
@@ -3990,7 +3990,7 @@ class vI {
|
|
|
3990
3990
|
this.handle != null && (this._parent = A.get(this.colliderSet.raw.coParent(this.handle)));
|
|
3991
3991
|
}
|
|
3992
3992
|
ensureShapeIsCached() {
|
|
3993
|
-
this._shape || (this._shape =
|
|
3993
|
+
this._shape || (this._shape = aA.fromRaw(this.colliderSet.raw, this.handle));
|
|
3994
3994
|
}
|
|
3995
3995
|
get shape() {
|
|
3996
3996
|
return this.ensureShapeIsCached(), this._shape;
|
|
@@ -4002,16 +4002,16 @@ class vI {
|
|
|
4002
4002
|
return this.colliderSet.raw.contains(this.handle);
|
|
4003
4003
|
}
|
|
4004
4004
|
translation() {
|
|
4005
|
-
return
|
|
4005
|
+
return N.fromRaw(this.colliderSet.raw.coTranslation(this.handle));
|
|
4006
4006
|
}
|
|
4007
4007
|
translationWrtParent() {
|
|
4008
|
-
return
|
|
4008
|
+
return N.fromRaw(this.colliderSet.raw.coTranslationWrtParent(this.handle));
|
|
4009
4009
|
}
|
|
4010
4010
|
rotation() {
|
|
4011
|
-
return
|
|
4011
|
+
return z.fromRaw(this.colliderSet.raw.coRotation(this.handle));
|
|
4012
4012
|
}
|
|
4013
4013
|
rotationWrtParent() {
|
|
4014
|
-
return
|
|
4014
|
+
return z.fromRaw(this.colliderSet.raw.coRotationWrtParent(this.handle));
|
|
4015
4015
|
}
|
|
4016
4016
|
isSensor() {
|
|
4017
4017
|
return this.colliderSet.raw.coIsSensor(this.handle);
|
|
@@ -4090,7 +4090,7 @@ class vI {
|
|
|
4090
4090
|
this.colliderSet.raw.coSetMass(this.handle, A);
|
|
4091
4091
|
}
|
|
4092
4092
|
setMassProperties(A, I, C) {
|
|
4093
|
-
let g =
|
|
4093
|
+
let g = N.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 vI {
|
|
|
4109
4109
|
return this.colliderSet.raw.coShapeType(this.handle);
|
|
4110
4110
|
}
|
|
4111
4111
|
halfExtents() {
|
|
4112
|
-
return
|
|
4112
|
+
return N.fromRaw(this.colliderSet.raw.coHalfExtents(this.handle));
|
|
4113
4113
|
}
|
|
4114
4114
|
setHalfExtents(A) {
|
|
4115
|
-
const I =
|
|
4115
|
+
const I = N.intoRaw(A);
|
|
4116
4116
|
this.colliderSet.raw.coSetHalfExtents(this.handle, I);
|
|
4117
4117
|
}
|
|
4118
4118
|
radius() {
|
|
@@ -4153,7 +4153,7 @@ class vI {
|
|
|
4153
4153
|
}
|
|
4154
4154
|
heightfieldScale() {
|
|
4155
4155
|
let A = this.colliderSet.raw.coHeightfieldScale(this.handle);
|
|
4156
|
-
return
|
|
4156
|
+
return N.fromRaw(A);
|
|
4157
4157
|
}
|
|
4158
4158
|
parent() {
|
|
4159
4159
|
return this._parent;
|
|
@@ -4180,51 +4180,51 @@ class vI {
|
|
|
4180
4180
|
return this.colliderSet.raw.coSolverGroups(this.handle);
|
|
4181
4181
|
}
|
|
4182
4182
|
containsPoint(A) {
|
|
4183
|
-
let I =
|
|
4183
|
+
let I = N.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 = N.intoRaw(A), g = BI.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 = N.intoRaw(A.origin), g = N.intoRaw(A.dir), Q = this.colliderSet.raw.coIntersectsRay(this.handle, C, g, I);
|
|
4192
4192
|
return C.free(), g.free(), Q;
|
|
4193
4193
|
}
|
|
4194
|
-
castShape(A, I, C, g, Q, B, D,
|
|
4195
|
-
let
|
|
4196
|
-
return
|
|
4194
|
+
castShape(A, I, C, g, Q, B, D, w) {
|
|
4195
|
+
let o = N.intoRaw(A), h = N.intoRaw(C), G = z.intoRaw(g), s = N.intoRaw(Q), a = I.intoRaw(), M = vA.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, o, a, h, G, s, B, D, w));
|
|
4196
|
+
return o.free(), h.free(), G.free(), s.free(), a.free(), M;
|
|
4197
4197
|
}
|
|
4198
4198
|
castCollider(A, I, C, g, Q, B) {
|
|
4199
|
-
let D =
|
|
4200
|
-
return D.free(),
|
|
4199
|
+
let D = N.intoRaw(A), w = N.intoRaw(C), o = EI.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, D, I.handle, w, g, Q, B));
|
|
4200
|
+
return D.free(), w.free(), o;
|
|
4201
4201
|
}
|
|
4202
4202
|
intersectsShape(A, I, C) {
|
|
4203
|
-
let g =
|
|
4203
|
+
let g = N.intoRaw(I), Q = z.intoRaw(C), B = A.intoRaw(), D = this.colliderSet.raw.coIntersectsShape(this.handle, B, g, Q);
|
|
4204
4204
|
return g.free(), Q.free(), B.free(), D;
|
|
4205
4205
|
}
|
|
4206
4206
|
contactShape(A, I, C, g) {
|
|
4207
|
-
let Q =
|
|
4208
|
-
return Q.free(), B.free(), D.free(),
|
|
4207
|
+
let Q = N.intoRaw(I), B = z.intoRaw(C), D = A.intoRaw(), w = XA.fromRaw(this.colliderSet.raw.coContactShape(this.handle, D, Q, B, g));
|
|
4208
|
+
return Q.free(), B.free(), D.free(), w;
|
|
4209
4209
|
}
|
|
4210
4210
|
contactCollider(A, I) {
|
|
4211
4211
|
return XA.fromRaw(this.colliderSet.raw.coContactCollider(this.handle, A.handle, I));
|
|
4212
4212
|
}
|
|
4213
4213
|
castRay(A, I, C) {
|
|
4214
|
-
let g =
|
|
4214
|
+
let g = N.intoRaw(A.origin), Q = N.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 = N.intoRaw(A.origin), Q = N.intoRaw(A.dir), B = QI.fromRaw(this.colliderSet.raw.coCastRayAndGetNormal(this.handle, g, Q, I, C));
|
|
4219
4219
|
return g.free(), Q.free(), B;
|
|
4220
4220
|
}
|
|
4221
4221
|
}
|
|
4222
4222
|
(function(i) {
|
|
4223
4223
|
i[i.Density = 0] = "Density", i[i.Mass = 1] = "Mass", i[i.MassProps = 2] = "MassProps";
|
|
4224
|
-
})(
|
|
4224
|
+
})(ZA || (ZA = {}));
|
|
4225
4225
|
class hA {
|
|
4226
4226
|
constructor(A) {
|
|
4227
|
-
this.enabled = !0, this.shape = A, this.massPropsMode =
|
|
4227
|
+
this.enabled = !0, this.shape = A, this.massPropsMode = ZA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation = z.identity(), this.translation = N.zeros(), this.isSensor = !1, this.collisionGroups = 4294967295, this.solverGroups = 4294967295, this.frictionCombineRule = II.Average, this.restitutionCombineRule = II.Average, this.activeCollisionTypes = KI.DEFAULT, this.activeEvents = GI.NONE, this.activeHooks = sI.NONE, this.mass = 0, this.centerOfMass = N.zeros(), this.contactForceEventThreshold = 0, this.contactSkin = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0;
|
|
4228
4228
|
}
|
|
4229
4229
|
static ball(A) {
|
|
4230
4230
|
const I = new Ig(A);
|
|
@@ -4255,7 +4255,7 @@ class hA {
|
|
|
4255
4255
|
return new hA(C);
|
|
4256
4256
|
}
|
|
4257
4257
|
static trimesh(A, I, C) {
|
|
4258
|
-
const g = new
|
|
4258
|
+
const g = new hg(A, I, C);
|
|
4259
4259
|
return new hA(g);
|
|
4260
4260
|
}
|
|
4261
4261
|
static cuboid(A, I) {
|
|
@@ -4271,7 +4271,7 @@ class hA {
|
|
|
4271
4271
|
return new hA(I);
|
|
4272
4272
|
}
|
|
4273
4273
|
static heightfield(A, I) {
|
|
4274
|
-
const C = new
|
|
4274
|
+
const C = new Gg(A, I);
|
|
4275
4275
|
return new hA(C);
|
|
4276
4276
|
}
|
|
4277
4277
|
static convexHull(A) {
|
|
@@ -4307,13 +4307,13 @@ class hA {
|
|
|
4307
4307
|
return this.contactSkin = A, this;
|
|
4308
4308
|
}
|
|
4309
4309
|
setDensity(A) {
|
|
4310
|
-
return this.massPropsMode =
|
|
4310
|
+
return this.massPropsMode = ZA.Density, this.density = A, this;
|
|
4311
4311
|
}
|
|
4312
4312
|
setMass(A) {
|
|
4313
|
-
return this.massPropsMode =
|
|
4313
|
+
return this.massPropsMode = ZA.Mass, this.mass = A, this;
|
|
4314
4314
|
}
|
|
4315
4315
|
setMassProperties(A, I, C) {
|
|
4316
|
-
return this.massPropsMode =
|
|
4316
|
+
return this.massPropsMode = ZA.MassProps, this.mass = A, N.copy(this.centerOfMass, I), this.principalAngularInertia = C, this;
|
|
4317
4317
|
}
|
|
4318
4318
|
setRestitution(A) {
|
|
4319
4319
|
return this.restitution = A, this;
|
|
@@ -4348,7 +4348,7 @@ class hA {
|
|
|
4348
4348
|
}
|
|
4349
4349
|
class SC {
|
|
4350
4350
|
constructor(A) {
|
|
4351
|
-
this.raw = A || new
|
|
4351
|
+
this.raw = A || new EA(), this.map = new UI(), A && A.forEachColliderHandle((I) => {
|
|
4352
4352
|
this.map.set(I, new vI(this, I, null));
|
|
4353
4353
|
});
|
|
4354
4354
|
}
|
|
@@ -4364,10 +4364,10 @@ class SC {
|
|
|
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 =
|
|
4368
|
-
Q.free(), B.free(), D.free(),
|
|
4369
|
-
let h = g ? A.get(C) : null, G = new vI(this,
|
|
4370
|
-
return this.map.set(
|
|
4367
|
+
let Q = I.shape.intoRaw(), B = N.intoRaw(I.translation), D = z.intoRaw(I.rotation), w = N.intoRaw(I.centerOfMass), o = this.raw.createCollider(I.enabled, Q, B, D, I.massPropsMode, I.mass, w, 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
|
+
Q.free(), B.free(), D.free(), w.free();
|
|
4369
|
+
let h = g ? A.get(C) : null, G = new vI(this, o, h, I.shape);
|
|
4370
|
+
return this.map.set(o, 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,37 +4393,37 @@ class SC {
|
|
|
4393
4393
|
}
|
|
4394
4394
|
function lC(i, A, I, C) {
|
|
4395
4395
|
return new (I || (I = Promise))(function(g, Q) {
|
|
4396
|
-
function B(
|
|
4396
|
+
function B(o) {
|
|
4397
4397
|
try {
|
|
4398
|
-
|
|
4398
|
+
w(C.next(o));
|
|
4399
4399
|
} catch (h) {
|
|
4400
4400
|
Q(h);
|
|
4401
4401
|
}
|
|
4402
4402
|
}
|
|
4403
|
-
function D(
|
|
4403
|
+
function D(o) {
|
|
4404
4404
|
try {
|
|
4405
|
-
|
|
4405
|
+
w(C.throw(o));
|
|
4406
4406
|
} catch (h) {
|
|
4407
4407
|
Q(h);
|
|
4408
4408
|
}
|
|
4409
4409
|
}
|
|
4410
|
-
function o
|
|
4410
|
+
function w(o) {
|
|
4411
4411
|
var h;
|
|
4412
|
-
|
|
4412
|
+
o.done ? g(o.value) : (h = o.value, h instanceof I ? h : new I(function(G) {
|
|
4413
4413
|
G(h);
|
|
4414
4414
|
})).then(B, D);
|
|
4415
4415
|
}
|
|
4416
|
-
|
|
4416
|
+
w((C = C.apply(i, [])).next());
|
|
4417
4417
|
});
|
|
4418
4418
|
}
|
|
4419
4419
|
for (var nC = { byteLength: function(i) {
|
|
4420
4420
|
var A = bg(i), I = A[0], C = A[1];
|
|
4421
4421
|
return 3 * (I + C) / 4 - C;
|
|
4422
4422
|
}, toByteArray: function(i) {
|
|
4423
|
-
var A, I, C = bg(i), g = C[0], Q = C[1], B = new HC(function(
|
|
4423
|
+
var A, I, C = bg(i), g = C[0], Q = C[1], B = new HC(function(o, h, G) {
|
|
4424
4424
|
return 3 * (h + G) / 4 - G;
|
|
4425
|
-
}(0, g, Q)), D = 0,
|
|
4426
|
-
for (I = 0; I <
|
|
4425
|
+
}(0, g, Q)), D = 0, w = Q > 0 ? g - 4 : g;
|
|
4426
|
+
for (I = 0; I < w; I += 4) A = UA[i.charCodeAt(I)] << 18 | UA[i.charCodeAt(I + 1)] << 12 | UA[i.charCodeAt(I + 2)] << 6 | UA[i.charCodeAt(I + 3)], B[D++] = A >> 16 & 255, B[D++] = A >> 8 & 255, B[D++] = 255 & A;
|
|
4427
4427
|
return Q === 2 && (A = UA[i.charCodeAt(I)] << 2 | UA[i.charCodeAt(I + 1)] >> 4, B[D++] = 255 & A), Q === 1 && (A = UA[i.charCodeAt(I)] << 10 | UA[i.charCodeAt(I + 1)] << 4 | UA[i.charCodeAt(I + 2)] >> 2, B[D++] = A >> 8 & 255, B[D++] = 255 & A), B;
|
|
4428
4428
|
}, fromByteArray: function(i) {
|
|
4429
4429
|
for (var A, I = i.length, C = I % 3, g = [], Q = 16383, B = 0, D = I - C; B < D; B += Q) g.push(dC(i, B, B + Q > D ? D : B + Q));
|
|
@@ -4450,7 +4450,7 @@ function bC() {
|
|
|
4450
4450
|
try {
|
|
4451
4451
|
const g = E.__wbindgen_add_to_stack_pointer(-16);
|
|
4452
4452
|
E.version(g);
|
|
4453
|
-
var I =
|
|
4453
|
+
var I = GA().getInt32(g + 0, !0), C = GA().getInt32(g + 4, !0);
|
|
4454
4454
|
return i = I, A = C, fI(I, C);
|
|
4455
4455
|
} finally {
|
|
4456
4456
|
E.__wbindgen_add_to_stack_pointer(16), E.__wbindgen_export_1(i, A, 1);
|
|
@@ -4462,7 +4462,7 @@ function TC(i) {
|
|
|
4462
4462
|
A = i, E.reserve_memory(A);
|
|
4463
4463
|
}
|
|
4464
4464
|
UA[45] = 62, UA[95] = 63;
|
|
4465
|
-
var yA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector2: xg, VectorOps:
|
|
4465
|
+
var yA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector2: xg, VectorOps: N, RotationOps: z, get RigidBodyType() {
|
|
4466
4466
|
return cA;
|
|
4467
4467
|
}, RigidBody: xI, RigidBodyDesc: YA, RigidBodySet: Xg, IntegrationParameters: vg, get JointType() {
|
|
4468
4468
|
return MA;
|
|
@@ -4470,35 +4470,35 @@ var yA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector
|
|
|
4470
4470
|
return TI;
|
|
4471
4471
|
}, get JointAxesMask() {
|
|
4472
4472
|
return ZI;
|
|
4473
|
-
}, ImpulseJoint: nA, UnitImpulseJoint: $I, FixedImpulseJoint: ug, RopeImpulseJoint: Vg, SpringImpulseJoint: Pg, PrismaticImpulseJoint: zg, RevoluteImpulseJoint: _g, JointData:
|
|
4473
|
+
}, ImpulseJoint: nA, UnitImpulseJoint: $I, FixedImpulseJoint: ug, RopeImpulseJoint: Vg, SpringImpulseJoint: Pg, PrismaticImpulseJoint: zg, RevoluteImpulseJoint: _g, JointData: TA, ImpulseJointSet: $g, MultibodyJoint: WA, UnitMultibodyJoint: Ag, FixedMultibodyJoint: AC, PrismaticMultibodyJoint: IC, RevoluteMultibodyJoint: gC, MultibodyJointSet: CC, get CoefficientCombineRule() {
|
|
4474
4474
|
return II;
|
|
4475
|
-
}, CCDSolver: QC, IslandManager: BC, BroadPhase: EC, NarrowPhase: iC, TempContactManifold: DC, Shape:
|
|
4476
|
-
return
|
|
4475
|
+
}, CCDSolver: QC, IslandManager: BC, BroadPhase: EC, NarrowPhase: iC, TempContactManifold: DC, Shape: aA, get ShapeType() {
|
|
4476
|
+
return KA;
|
|
4477
4477
|
}, get TriMeshFlags() {
|
|
4478
|
-
return
|
|
4479
|
-
}, Ball: Ig, HalfSpace: gg, Cuboid: Cg, RoundCuboid: Qg, Capsule: Bg, Segment: Eg, Triangle: ig, RoundTriangle: Dg, Polyline: og, Voxels: wg, TriMesh:
|
|
4478
|
+
return OI;
|
|
4479
|
+
}, Ball: Ig, HalfSpace: gg, Cuboid: Cg, RoundCuboid: Qg, Capsule: Bg, Segment: Eg, Triangle: ig, RoundTriangle: Dg, Polyline: og, Voxels: wg, TriMesh: hg, ConvexPolygon: aI, RoundConvexPolygon: SI, Heightfield: Gg, get ActiveCollisionTypes() {
|
|
4480
4480
|
return KI;
|
|
4481
4481
|
}, Collider: vI, get MassPropsMode() {
|
|
4482
|
-
return
|
|
4482
|
+
return ZA;
|
|
4483
4483
|
}, ColliderDesc: hA, ColliderSet: SC, get FeatureType() {
|
|
4484
4484
|
return xA;
|
|
4485
4485
|
}, Ray: rC, RayIntersection: QI, RayColliderIntersection: gI, RayColliderHit: RI, PointProjection: BI, PointColliderProjection: CI, ShapeCastHit: vA, ColliderShapeCastHit: EI, ShapeContact: XA, World: cI, PhysicsPipeline: oC, SerializationPipeline: XI, get ActiveEvents() {
|
|
4486
|
-
return
|
|
4486
|
+
return GI;
|
|
4487
4487
|
}, TempContactForceEvent: aC, EventQueue: qC, get ActiveHooks() {
|
|
4488
4488
|
return sI;
|
|
4489
4489
|
}, get SolverFlags() {
|
|
4490
4490
|
return jI;
|
|
4491
|
-
}, DebugRenderBuffers: wC, DebugRenderPipeline:
|
|
4491
|
+
}, DebugRenderBuffers: wC, DebugRenderPipeline: hC, get QueryFilterFlags() {
|
|
4492
4492
|
return mI;
|
|
4493
|
-
}, init: fC, CharacterCollision:
|
|
4494
|
-
return
|
|
4493
|
+
}, init: fC, CharacterCollision: GC, KinematicCharacterController: sC, get PidAxesMask() {
|
|
4494
|
+
return WI;
|
|
4495
4495
|
}, PidController: KC });
|
|
4496
4496
|
class ZC {
|
|
4497
4497
|
constructor() {
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4498
|
+
$(this, "world", null);
|
|
4499
|
+
$(this, "bodies", /* @__PURE__ */ new Map());
|
|
4500
|
+
$(this, "colliders", /* @__PURE__ */ new Map());
|
|
4501
|
+
$(this, "initialized", !1);
|
|
4502
4502
|
}
|
|
4503
4503
|
async init(A) {
|
|
4504
4504
|
this.initialized || (await yA.init(), this.world = new yA.World(new yA.Vector2(A.x, A.y)), this.initialized = !0);
|
|
@@ -4596,39 +4596,39 @@ class ZC {
|
|
|
4596
4596
|
g && g.applyImpulse(new yA.Vector2(I, C), !0);
|
|
4597
4597
|
}
|
|
4598
4598
|
}
|
|
4599
|
-
class
|
|
4599
|
+
class OC {
|
|
4600
4600
|
constructor() {
|
|
4601
|
-
|
|
4602
|
-
|
|
4601
|
+
$(this, "artboard", null);
|
|
4602
|
+
$(this, "objectStates", /* @__PURE__ */ new Map());
|
|
4603
4603
|
// Physics State
|
|
4604
|
-
|
|
4604
|
+
$(this, "physicsEngine", null);
|
|
4605
4605
|
// State Machine State
|
|
4606
|
-
|
|
4607
|
-
|
|
4606
|
+
$(this, "activeStateMachine", null);
|
|
4607
|
+
$(this, "inputs", /* @__PURE__ */ new Map());
|
|
4608
4608
|
// id -> value
|
|
4609
|
-
|
|
4609
|
+
$(this, "inputNameMap", /* @__PURE__ */ new Map());
|
|
4610
4610
|
// name -> id[] mapping
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4611
|
+
$(this, "layerStates", /* @__PURE__ */ new Map());
|
|
4612
|
+
$(this, "imageCache", /* @__PURE__ */ new Map());
|
|
4613
|
+
$(this, "layout", { fit: "Contain", alignment: "Center" });
|
|
4614
|
+
$(this, "onTrigger");
|
|
4615
|
+
$(this, "onInputUpdate");
|
|
4616
|
+
$(this, "onComponentChange");
|
|
4617
4617
|
// Track triggers that were just fired in the current frame
|
|
4618
|
-
|
|
4618
|
+
$(this, "justFiredTriggers", /* @__PURE__ */ new Set());
|
|
4619
4619
|
// Track currently hovered object for Enter/Leave events
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4620
|
+
$(this, "lastHoveredObjectId", null);
|
|
4621
|
+
$(this, "_lastPointerPos", null);
|
|
4622
|
+
$(this, "_prevPointerPos", null);
|
|
4623
4623
|
// Interaction State
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4624
|
+
$(this, "focusedId", null);
|
|
4625
|
+
$(this, "draggingSliderId", null);
|
|
4626
|
+
$(this, "activeDropdownId", null);
|
|
4627
|
+
$(this, "draggingListViewId", null);
|
|
4628
4628
|
// Physics/Animation State
|
|
4629
|
-
|
|
4629
|
+
$(this, "objectVelocities", /* @__PURE__ */ new Map());
|
|
4630
4630
|
// Trigger Management
|
|
4631
|
-
|
|
4631
|
+
$(this, "activeTriggers", /* @__PURE__ */ new Map());
|
|
4632
4632
|
}
|
|
4633
4633
|
setTriggerCallback(A) {
|
|
4634
4634
|
this.onTrigger = A;
|
|
@@ -4659,6 +4659,10 @@ class WC {
|
|
|
4659
4659
|
getObjectState(A) {
|
|
4660
4660
|
return this.objectStates.get(A);
|
|
4661
4661
|
}
|
|
4662
|
+
updateObjectOptions(A, I) {
|
|
4663
|
+
const C = this.objectStates.get(A);
|
|
4664
|
+
C && (C.options = { ...C.options, ...I });
|
|
4665
|
+
}
|
|
4662
4666
|
load(A) {
|
|
4663
4667
|
this.artboard = A, this.loadFonts(), this.reset(), this.advance(0);
|
|
4664
4668
|
}
|
|
@@ -4693,14 +4697,14 @@ class WC {
|
|
|
4693
4697
|
if ((Q = g.physics) != null && Q.enabled && g.type === "Shape") {
|
|
4694
4698
|
const B = this.objectStates.get(g.id);
|
|
4695
4699
|
if (!B) return;
|
|
4696
|
-
const D = g.geometry.width || 100,
|
|
4700
|
+
const D = g.geometry.width || 100, w = g.geometry.height || 100;
|
|
4697
4701
|
this.physicsEngine.createBody({
|
|
4698
4702
|
id: g.id,
|
|
4699
4703
|
type: g.geometry.type,
|
|
4700
4704
|
x: B.x,
|
|
4701
4705
|
y: B.y,
|
|
4702
4706
|
width: D,
|
|
4703
|
-
height:
|
|
4707
|
+
height: w,
|
|
4704
4708
|
rotation: B.rotation * (Math.PI / 180),
|
|
4705
4709
|
// Convert deg to rad
|
|
4706
4710
|
isStatic: g.physics.bodyType === "Static",
|
|
@@ -4770,10 +4774,10 @@ class WC {
|
|
|
4770
4774
|
const B = this.activeStateMachine.layers.find((D) => D.name === A);
|
|
4771
4775
|
if (B)
|
|
4772
4776
|
for (const D of I) {
|
|
4773
|
-
const
|
|
4774
|
-
if (
|
|
4775
|
-
let
|
|
4776
|
-
|
|
4777
|
+
const w = B.states.find((o) => o.id === D);
|
|
4778
|
+
if (w) {
|
|
4779
|
+
let o = null;
|
|
4780
|
+
w.animationId && (o = this.artboard.animations.find((h) => h.id === w.animationId) || null), o || (o = this.artboard.animations.find((h) => h.name === w.name || h.id === w.name || w.name === "Entry" && h.name === "Rotate") || null), o && (g.push({ animation: o, state: w }), Q = Math.max(Q, o.duration));
|
|
4777
4781
|
}
|
|
4778
4782
|
}
|
|
4779
4783
|
}
|
|
@@ -4800,23 +4804,31 @@ class WC {
|
|
|
4800
4804
|
setInputNumberArray(A, I) {
|
|
4801
4805
|
this.updateInput(A, I);
|
|
4802
4806
|
}
|
|
4807
|
+
setInputStringArray(A, I) {
|
|
4808
|
+
this.updateInput(A, I);
|
|
4809
|
+
}
|
|
4803
4810
|
updateInput(A, I) {
|
|
4804
|
-
var B, D;
|
|
4811
|
+
var B, D, w;
|
|
4805
4812
|
let C;
|
|
4806
4813
|
if (this.inputs.has(A)) {
|
|
4807
|
-
const o = (B = this.activeStateMachine) == null ? void 0 : B.inputs.find((
|
|
4814
|
+
const o = (B = this.activeStateMachine) == null ? void 0 : B.inputs.find((h) => h.id === A);
|
|
4808
4815
|
o && typeof o.value == "object" && (C = o.value.type);
|
|
4809
4816
|
} else {
|
|
4810
4817
|
const o = this.inputNameMap.get(A);
|
|
4811
4818
|
if (o && o.length > 0) {
|
|
4812
|
-
const
|
|
4813
|
-
|
|
4819
|
+
const h = (D = this.activeStateMachine) == null ? void 0 : D.inputs.find((G) => G.id === o[0]);
|
|
4820
|
+
h && typeof h.value == "object" && (C = h.value.type);
|
|
4814
4821
|
}
|
|
4815
4822
|
}
|
|
4816
4823
|
let g = I;
|
|
4817
4824
|
C === "Trigger" && (I === 1 ? g = !0 : I === 0 && (g = !1)), this.inputs.has(A) && this.setInternalInput(A, g);
|
|
4818
4825
|
const Q = this.inputNameMap.get(A);
|
|
4819
|
-
Q && Q.forEach((o) => this.setInternalInput(o, g)), C === "Trigger" && g === !0 && (this.justFiredTriggers.add(A), Q && Q.forEach((o) => this.justFiredTriggers.add(o))), this.
|
|
4826
|
+
Q && Q.forEach((o) => this.setInternalInput(o, g)), C === "Trigger" && g === !0 && (this.justFiredTriggers.add(A), Q && Q.forEach((o) => this.justFiredTriggers.add(o))), Array.isArray(g) && ((w = this.artboard) == null || w.objects.forEach((o) => {
|
|
4827
|
+
if (o.inputId === A || o.name === A) {
|
|
4828
|
+
const h = this.objectStates.get(o.id);
|
|
4829
|
+
h && h.options && (o.type === "ListView" || o.variant === "listview" ? h.options.items = g : (o.type === "Dropdown" || o.variant === "dropdown") && (h.options.optionsList = g));
|
|
4830
|
+
}
|
|
4831
|
+
})), this.evaluateTransitions();
|
|
4820
4832
|
}
|
|
4821
4833
|
evaluateTransitions() {
|
|
4822
4834
|
this.activeStateMachine && (this.activeStateMachine.layers.forEach((A) => {
|
|
@@ -4825,16 +4837,16 @@ class WC {
|
|
|
4825
4837
|
const C = [];
|
|
4826
4838
|
let g = !1;
|
|
4827
4839
|
for (const Q of I.currentStateIds) {
|
|
4828
|
-
const B = A.states.find((
|
|
4840
|
+
const B = A.states.find((w) => w.id === Q);
|
|
4829
4841
|
if (!B) continue;
|
|
4830
4842
|
let D = !1;
|
|
4831
|
-
for (const
|
|
4832
|
-
this.checkConditions(
|
|
4843
|
+
for (const w of B.transitions)
|
|
4844
|
+
this.checkConditions(w.conditions) && (C.push(w.targetStateId), D = !0, g = !0, w.conditions && w.conditions.forEach((o) => {
|
|
4833
4845
|
var G;
|
|
4834
|
-
const h = (G = this.activeStateMachine) == null ? void 0 : G.inputs.find((
|
|
4835
|
-
if (h && typeof h.value == "object" && h.value.type === "Number" && (this.setInternalInput(
|
|
4836
|
-
const
|
|
4837
|
-
|
|
4846
|
+
const h = (G = this.activeStateMachine) == null ? void 0 : G.inputs.find((s) => s.id === o.inputId);
|
|
4847
|
+
if (h && typeof h.value == "object" && h.value.type === "Number" && (this.setInternalInput(o.inputId, 0), this.inputNameMap.has(h.name))) {
|
|
4848
|
+
const s = this.inputNameMap.get(h.name);
|
|
4849
|
+
s == null || s.forEach((a) => this.setInternalInput(a, 0));
|
|
4838
4850
|
}
|
|
4839
4851
|
}));
|
|
4840
4852
|
D || C.push(Q);
|
|
@@ -4842,11 +4854,11 @@ class WC {
|
|
|
4842
4854
|
if (!g) {
|
|
4843
4855
|
const Q = this.findGlobalTransition(A, I.currentStateIds);
|
|
4844
4856
|
Q && (C.length = 0, C.push(Q.targetStateId), g = !0, Q.conditions && Q.conditions.forEach((B) => {
|
|
4845
|
-
var
|
|
4846
|
-
const D = (
|
|
4857
|
+
var w;
|
|
4858
|
+
const D = (w = this.activeStateMachine) == null ? void 0 : w.inputs.find((o) => o.id === B.inputId);
|
|
4847
4859
|
if (D && typeof D.value == "object" && D.value.type === "Number" && (this.setInternalInput(B.inputId, 0), this.inputNameMap.has(D.name))) {
|
|
4848
|
-
const
|
|
4849
|
-
|
|
4860
|
+
const o = this.inputNameMap.get(D.name);
|
|
4861
|
+
o == null || o.forEach((h) => this.setInternalInput(h, 0));
|
|
4850
4862
|
}
|
|
4851
4863
|
}));
|
|
4852
4864
|
}
|
|
@@ -4917,33 +4929,33 @@ class WC {
|
|
|
4917
4929
|
});
|
|
4918
4930
|
}
|
|
4919
4931
|
evaluateLogicTree(A, I, C = /* @__PURE__ */ new Set()) {
|
|
4920
|
-
var B, D,
|
|
4932
|
+
var B, D, w;
|
|
4921
4933
|
if (C.has(A)) return !1;
|
|
4922
4934
|
C.add(A);
|
|
4923
|
-
const g = (D = (B = this.activeStateMachine) == null ? void 0 : B.logicNodes) == null ? void 0 : D.find((
|
|
4935
|
+
const g = (D = (B = this.activeStateMachine) == null ? void 0 : B.logicNodes) == null ? void 0 : D.find((o) => o.id === A);
|
|
4924
4936
|
if (g) {
|
|
4925
|
-
const
|
|
4926
|
-
const
|
|
4927
|
-
return
|
|
4937
|
+
const o = (h, G) => {
|
|
4938
|
+
const s = g.inputs.find((a) => a.id === h);
|
|
4939
|
+
return s ? s.sourceId ? this.evaluateLogicTree(s.sourceId, s.sourceHandleId, C) : s.value !== void 0 ? s.value : G : G;
|
|
4928
4940
|
};
|
|
4929
4941
|
switch (g.op) {
|
|
4930
4942
|
case uA.AND:
|
|
4931
|
-
return
|
|
4943
|
+
return o("a", !1) && o("b", !1);
|
|
4932
4944
|
case uA.OR:
|
|
4933
|
-
return
|
|
4945
|
+
return o("a", !1) || o("b", !1);
|
|
4934
4946
|
case uA.NOT:
|
|
4935
|
-
return !
|
|
4947
|
+
return !o("in", !1);
|
|
4936
4948
|
case uA.XOR:
|
|
4937
|
-
return !!
|
|
4949
|
+
return !!o("a", !1) != !!o("b", !1);
|
|
4938
4950
|
default:
|
|
4939
4951
|
return 0;
|
|
4940
4952
|
}
|
|
4941
4953
|
}
|
|
4942
4954
|
let Q = this.inputs.get(A);
|
|
4943
4955
|
if (this.justFiredTriggers.has(A) && (Q = !0), I && Q !== void 0) {
|
|
4944
|
-
const
|
|
4945
|
-
if (
|
|
4946
|
-
const h =
|
|
4956
|
+
const o = (w = this.activeStateMachine) == null ? void 0 : w.inputs.find((h) => h.id === A);
|
|
4957
|
+
if (o && o.value.type === "Number" && typeof Q == "number") {
|
|
4958
|
+
const h = o.value.defaultValue ?? o.value.value;
|
|
4947
4959
|
if (I === "source-greater") return Q > h;
|
|
4948
4960
|
if (I === "source-less") return Q < h;
|
|
4949
4961
|
if (I === "source-equal") return Q === h;
|
|
@@ -4970,12 +4982,12 @@ class WC {
|
|
|
4970
4982
|
this.applyAnimation(C.animation, I.time);
|
|
4971
4983
|
}));
|
|
4972
4984
|
})), this.solveConstraints(A), this.activeTriggers.forEach((I, C) => {
|
|
4973
|
-
var g, Q, B, D,
|
|
4985
|
+
var g, Q, B, D, w, o, h;
|
|
4974
4986
|
if (I.phase === "entry")
|
|
4975
4987
|
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);
|
|
4976
4988
|
else if (I.phase === "hold") {
|
|
4977
|
-
const G = (
|
|
4978
|
-
if (I.elapsedHold += A * 1e3, I.elapsedHold >=
|
|
4989
|
+
const G = (o = (w = (D = this.artboard) == null ? void 0 : D.objects.find((a) => a.id === C)) == null ? void 0 : w.triggers) == null ? void 0 : o.find((a) => a.id === I.triggerId), s = (G == null ? void 0 : G.duration) || 0;
|
|
4990
|
+
if (I.elapsedHold += A * 1e3, I.elapsedHold >= s)
|
|
4979
4991
|
if (G != null && G.exitAnimationId) {
|
|
4980
4992
|
const a = (h = this.artboard) == null ? void 0 : h.animations.find((M) => M.id === G.exitAnimationId);
|
|
4981
4993
|
a ? (I.phase = "exit", I.animation = a, I.time = 0) : this.activeTriggers.delete(C);
|
|
@@ -4989,58 +5001,58 @@ class WC {
|
|
|
4989
5001
|
if (!I.constraints || I.constraints.length === 0) return;
|
|
4990
5002
|
const C = this.objectStates.get(I.id);
|
|
4991
5003
|
C && I.constraints.forEach((g) => {
|
|
4992
|
-
var B, D,
|
|
5004
|
+
var B, D, w, o, h, G;
|
|
4993
5005
|
const Q = g.strength ?? 1;
|
|
4994
5006
|
if (g.type === "Translation") {
|
|
4995
|
-
const
|
|
4996
|
-
if (
|
|
5007
|
+
const s = this.objectStates.get(g.targetId);
|
|
5008
|
+
if (s) {
|
|
4997
5009
|
const a = g.useSpring, M = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 };
|
|
4998
5010
|
if (a) {
|
|
4999
|
-
const { x: y, y: J, vx:
|
|
5000
|
-
g.copyX && (C.x = y), g.copyY && (C.y = J), this.objectVelocities.set(I.id, { vx:
|
|
5011
|
+
const { x: y, y: J, vx: S, vy: F } = this.computeSpring(C.x, C.y, M.vx, M.vy, s.x, s.y, g, A);
|
|
5012
|
+
g.copyX && (C.x = y), g.copyY && (C.y = J), this.objectVelocities.set(I.id, { vx: S, vy: F });
|
|
5001
5013
|
} else
|
|
5002
|
-
g.copyX && (C.x = C.x + (
|
|
5014
|
+
g.copyX && (C.x = C.x + (s.x - C.x) * Q), g.copyY && (C.y = C.y + (s.y - C.y) * Q);
|
|
5003
5015
|
(B = g.limitX) != null && B.enabled && (C.x = Math.max(g.limitX.min, Math.min(g.limitX.max, C.x))), (D = g.limitY) != null && D.enabled && (C.y = Math.max(g.limitY.min, Math.min(g.limitY.max, C.y)));
|
|
5004
5016
|
}
|
|
5005
5017
|
} else if (g.type === "FollowPointer") {
|
|
5006
|
-
const
|
|
5018
|
+
const s = ((w = this._lastPointerPos) == null ? void 0 : w.x) ?? C.x, a = ((o = this._lastPointerPos) == null ? void 0 : o.y) ?? C.y;
|
|
5007
5019
|
if (g.useSpring) {
|
|
5008
|
-
const y = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 }, { x: J, y:
|
|
5009
|
-
C.x = J, C.y =
|
|
5020
|
+
const y = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 }, { x: J, y: S, vx: F, vy: U } = this.computeSpring(C.x, C.y, y.vx, y.vy, s, a, g, A);
|
|
5021
|
+
C.x = J, C.y = S, this.objectVelocities.set(I.id, { vx: F, vy: U });
|
|
5010
5022
|
} else
|
|
5011
|
-
C.x = C.x + (
|
|
5023
|
+
C.x = C.x + (s - C.x) * Q, C.y = C.y + (a - C.y) * Q;
|
|
5012
5024
|
(h = g.limitX) != null && h.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)));
|
|
5013
5025
|
} else if (g.type === "Distance") {
|
|
5014
|
-
const
|
|
5015
|
-
if (
|
|
5016
|
-
const a = C.x -
|
|
5017
|
-
let
|
|
5026
|
+
const s = this.objectStates.get(g.targetId);
|
|
5027
|
+
if (s) {
|
|
5028
|
+
const a = C.x - s.x, M = C.y - s.y, y = Math.sqrt(a * a + M * M), J = g.distance || 0;
|
|
5029
|
+
let S = y;
|
|
5018
5030
|
switch (g.mode) {
|
|
5019
5031
|
case "exact":
|
|
5020
|
-
|
|
5032
|
+
S = J;
|
|
5021
5033
|
break;
|
|
5022
5034
|
case "minimum":
|
|
5023
|
-
|
|
5035
|
+
S = Math.max(J, y);
|
|
5024
5036
|
break;
|
|
5025
5037
|
case "maximum":
|
|
5026
|
-
|
|
5038
|
+
S = Math.min(J, y);
|
|
5027
5039
|
break;
|
|
5028
5040
|
case "clamped":
|
|
5029
|
-
|
|
5041
|
+
S = Math.max(0, Math.min(J, y));
|
|
5030
5042
|
break;
|
|
5031
5043
|
}
|
|
5032
5044
|
if (y > 0) {
|
|
5033
|
-
const F =
|
|
5034
|
-
C.x =
|
|
5035
|
-
} else y === 0 &&
|
|
5045
|
+
const F = S / y;
|
|
5046
|
+
C.x = s.x + a * F, C.y = s.y + M * F;
|
|
5047
|
+
} else y === 0 && S > 0 && (C.x = s.x + S);
|
|
5036
5048
|
}
|
|
5037
5049
|
}
|
|
5038
5050
|
});
|
|
5039
5051
|
});
|
|
5040
5052
|
}
|
|
5041
|
-
computeSpring(A, I, C, g, Q, B, D,
|
|
5042
|
-
const
|
|
5043
|
-
return { x:
|
|
5053
|
+
computeSpring(A, I, C, g, Q, B, D, w) {
|
|
5054
|
+
const o = D.stiffness ?? 100, h = D.damping ?? 10, G = D.mass ?? 1, s = -o * (A - Q), a = -o * (I - B), M = -h * C, y = -h * g, J = (s + M) / G, S = (a + y) / G, F = C + J * w, U = g + S * w, R = A + F * w, c = I + U * w;
|
|
5055
|
+
return { x: R, y: c, vx: F, vy: U };
|
|
5044
5056
|
}
|
|
5045
5057
|
handlePointerInput(A, I, C, g, Q) {
|
|
5046
5058
|
if (!this.artboard) return;
|
|
@@ -5051,24 +5063,27 @@ class WC {
|
|
|
5051
5063
|
this.artboard.height,
|
|
5052
5064
|
this.layout.fit,
|
|
5053
5065
|
this.layout.alignment
|
|
5054
|
-
), D = (I - B.tx) / B.scaleX - this.artboard.width / 2,
|
|
5055
|
-
this._prevPointerPos = this._lastPointerPos, this._lastPointerPos = { x: D, y:
|
|
5066
|
+
), D = (I - B.tx) / B.scaleX - this.artboard.width / 2, w = (C - B.ty) / B.scaleY - this.artboard.height / 2;
|
|
5067
|
+
this._prevPointerPos = this._lastPointerPos, this._lastPointerPos = { x: D, y: w }, this.updateInput("mouseX", D), this.updateInput("mouseY", w), this.handlePointerEvent(A, D, w);
|
|
5056
5068
|
}
|
|
5057
5069
|
handlePointerEvent(A, I, C) {
|
|
5058
|
-
var
|
|
5070
|
+
var w;
|
|
5059
5071
|
if (!this.artboard) return;
|
|
5060
5072
|
let g = null;
|
|
5061
|
-
const Q = (
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5073
|
+
const Q = (o, h) => {
|
|
5074
|
+
var J;
|
|
5075
|
+
let G = h;
|
|
5076
|
+
h === "click" ? G = "onClick" : h === "down" ? G = "onPointerDown" : h === "up" ? G = "onPointerUp" : h === "blur" && (G = "onPointerLeave");
|
|
5077
|
+
const s = /* @__PURE__ */ new Set([G]);
|
|
5078
|
+
h === "move" && s.add("onPointerEnter").add("hover").add("onPointerLeave").add("blur"), G === "onClick" && s.add("click"), G === "onPointerDown" && s.add("pointerDown"), G === "onPointerUp" && s.add("pointerUp");
|
|
5079
|
+
const a = ["button", "toggle", "toggle_button", "dropdown", "listview", "inputbox", "slider"];
|
|
5080
|
+
return !!(o.type === "Component" && a.includes(o.variant) || a.includes((J = o.type) == null ? void 0 : J.toLowerCase()) || (o.interactions || []).some((S) => s.has(S.event)) || (o.triggers || []).some((S) => s.has(S.eventType)));
|
|
5066
5081
|
};
|
|
5067
5082
|
let B = null;
|
|
5068
|
-
for (let
|
|
5069
|
-
const
|
|
5070
|
-
if (this.hitTest(
|
|
5071
|
-
g =
|
|
5083
|
+
for (let o = this.artboard.objects.length - 1; o >= 0; o--) {
|
|
5084
|
+
const h = this.artboard.objects[o], G = this.objectStates.get(h.id);
|
|
5085
|
+
if (G && G.visible !== !1 && G.opacity > 0 && this.hitTest(h, I, C) && (B || (B = h), Q(h, A))) {
|
|
5086
|
+
g = h;
|
|
5072
5087
|
break;
|
|
5073
5088
|
}
|
|
5074
5089
|
}
|
|
@@ -5076,64 +5091,76 @@ class WC {
|
|
|
5076
5091
|
const D = (g == null ? void 0 : g.id) || null;
|
|
5077
5092
|
if (A === "move") {
|
|
5078
5093
|
if (this.draggingSliderId) {
|
|
5079
|
-
const
|
|
5080
|
-
|
|
5094
|
+
const o = this.artboard.objects.find((h) => h.id === this.draggingSliderId);
|
|
5095
|
+
o && this.updateSliderValueFromPointer(o, I, C);
|
|
5081
5096
|
return;
|
|
5082
5097
|
}
|
|
5083
5098
|
if (this.draggingListViewId) {
|
|
5084
|
-
const
|
|
5085
|
-
|
|
5099
|
+
const o = this.artboard.objects.find((h) => h.id === this.draggingListViewId);
|
|
5100
|
+
o && this.updateListViewScrollFromPointer(o);
|
|
5086
5101
|
return;
|
|
5087
5102
|
}
|
|
5088
5103
|
g && g.type === "Component" && g.variant === "listview" && this.updateListViewHoverFromPointer(g, I, C), D !== this.lastHoveredObjectId && (console.log(`[Engine] HOVER CHANGE: ${this.lastHoveredObjectId} -> ${D}`), this.lastHoveredObjectId && this.fireEventForObject(this.lastHoveredObjectId, "onPointerLeave"), D && this.fireEventForObject(D, "onPointerEnter"), this.lastHoveredObjectId = D);
|
|
5089
5104
|
return;
|
|
5090
5105
|
}
|
|
5091
|
-
if ((A === "up" || A === "blur") && (this.draggingSliderId = null, this.draggingListViewId = null),
|
|
5092
|
-
|
|
5093
|
-
if (
|
|
5094
|
-
const G =
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5106
|
+
if ((A === "up" || A === "blur") && (this.draggingSliderId = null, this.draggingListViewId = null), this.activeDropdownId && A === "down") {
|
|
5107
|
+
const o = this.artboard.objects.find((h) => h.id === this.activeDropdownId);
|
|
5108
|
+
if (o && (o.type === "Dropdown" || o.variant === "dropdown")) {
|
|
5109
|
+
const h = this.objectStates.get(o.id), G = (h == null ? void 0 : h.options) || o.options || {}, s = o.geometry || {}, a = s.width ?? o.width ?? 200, M = s.height ?? o.height ?? 40, y = G.optionsList || [], J = G.itemHeight || 32, S = G.listPadding ?? 4, F = y.length * J + S * 2, U = this.getWorldTransform(o.id), R = a * Math.abs(U.scaleX), c = M * Math.abs(U.scaleY), r = U.y + c / 2 + 4, n = Math.abs(I - U.x) <= R / 2, p = C >= r && C <= r + F * Math.abs(U.scaleY);
|
|
5110
|
+
if (n && p) {
|
|
5111
|
+
const Z = Math.abs(U.scaleY), H = C - (r + S * Z), X = Math.floor(H / (J * Z));
|
|
5112
|
+
if (X >= 0 && X < y.length) {
|
|
5113
|
+
const QA = y[X];
|
|
5114
|
+
G.selectedOption = QA, G.isOpen = !1, this.activeDropdownId = null, o.inputId && this.setInternalInput(o.inputId, QA), this.onComponentChange && this.onComponentChange({
|
|
5115
|
+
objectId: o.id,
|
|
5116
|
+
componentName: o.name,
|
|
5117
|
+
variant: "dropdown",
|
|
5118
|
+
property: "selectedOption",
|
|
5119
|
+
value: QA
|
|
5120
|
+
});
|
|
5121
|
+
}
|
|
5122
|
+
return;
|
|
5123
|
+
} else D !== this.activeDropdownId && (G.isOpen = !1, this.activeDropdownId = null);
|
|
5124
|
+
}
|
|
5125
|
+
}
|
|
5126
|
+
if (g) {
|
|
5127
|
+
let o = g, h = g;
|
|
5128
|
+
for (; h && h.parentId; ) {
|
|
5129
|
+
const s = this.artboard.objects.find((a) => a.id === h.parentId);
|
|
5130
|
+
if (s && s.type === "Component") {
|
|
5131
|
+
o = s;
|
|
5132
|
+
break;
|
|
5133
|
+
}
|
|
5134
|
+
h = s;
|
|
5135
|
+
}
|
|
5136
|
+
let G = A;
|
|
5137
|
+
if (A === "click" ? G = "onClick" : A === "down" ? G = "onPointerDown" : A === "up" ? G = "onPointerUp" : A === "blur" && (G = "onPointerLeave"), this.fireEventForObject(g.id, G), o !== g && this.fireEventForObject(o.id, G), o.type === "Component" && o.variant === "toggle_button" && A === "down") {
|
|
5138
|
+
const s = this.objectStates.get(o.id), a = (s == null ? void 0 : s.options) || o.options || {};
|
|
5139
|
+
a.checked = !a.checked, o.inputId && this.setInternalInput(o.inputId, a.checked), this.onComponentChange && this.onComponentChange({
|
|
5140
|
+
objectId: o.id,
|
|
5141
|
+
componentName: o.name,
|
|
5098
5142
|
variant: "toggle_button",
|
|
5099
5143
|
property: "checked",
|
|
5100
|
-
value:
|
|
5144
|
+
value: a.checked
|
|
5101
5145
|
});
|
|
5102
5146
|
}
|
|
5103
|
-
if (
|
|
5104
|
-
const
|
|
5105
|
-
|
|
5106
|
-
objectId:
|
|
5107
|
-
componentName:
|
|
5147
|
+
if (o.type === "Component" && o.variant === "toggle" && A === "down") {
|
|
5148
|
+
const s = this.objectStates.get(o.id), a = (s == null ? void 0 : s.options) || o.options || {};
|
|
5149
|
+
a.checked = !a.checked, o.inputId && this.setInternalInput(o.inputId, a.checked), this.onComponentChange && this.onComponentChange({
|
|
5150
|
+
objectId: o.id,
|
|
5151
|
+
componentName: o.name,
|
|
5108
5152
|
variant: "toggle",
|
|
5109
5153
|
property: "checked",
|
|
5110
|
-
value:
|
|
5154
|
+
value: a.checked
|
|
5111
5155
|
});
|
|
5112
5156
|
}
|
|
5113
|
-
if (
|
|
5114
|
-
const
|
|
5115
|
-
if (
|
|
5116
|
-
const
|
|
5117
|
-
|
|
5118
|
-
const R = Math.floor((F - J) / y);
|
|
5119
|
-
if (R >= 0 && R < M.length) {
|
|
5120
|
-
const U = M[R];
|
|
5121
|
-
G.selectedOption = U, G.isOpen = !1, this.activeDropdownId = null, g.inputId && this.setInternalInput(g.inputId, U), this.onComponentChange && this.onComponentChange({
|
|
5122
|
-
objectId: g.id,
|
|
5123
|
-
componentName: g.name,
|
|
5124
|
-
variant: "dropdown",
|
|
5125
|
-
property: "selectedOption",
|
|
5126
|
-
value: U
|
|
5127
|
-
});
|
|
5128
|
-
return;
|
|
5129
|
-
}
|
|
5130
|
-
}
|
|
5131
|
-
}
|
|
5132
|
-
if (K && this.activeDropdownId && this.activeDropdownId !== g.id) {
|
|
5133
|
-
const a = this.artboard.objects.find((M) => M.id === this.activeDropdownId);
|
|
5134
|
-
a && a.options && (a.options.isOpen = !1);
|
|
5157
|
+
if (o.type === "Component" && o.variant === "dropdown" && A === "down") {
|
|
5158
|
+
const s = this.objectStates.get(o.id), a = (s == null ? void 0 : s.options) || o.options || {}, M = !a.isOpen;
|
|
5159
|
+
if (M && this.activeDropdownId && this.activeDropdownId !== o.id) {
|
|
5160
|
+
const y = this.artboard.objects.find((J) => J.id === this.activeDropdownId);
|
|
5161
|
+
y && y.options && (y.options.isOpen = !1);
|
|
5135
5162
|
}
|
|
5136
|
-
|
|
5163
|
+
a.isOpen = M, this.activeDropdownId = M ? o.id : null;
|
|
5137
5164
|
}
|
|
5138
5165
|
if (g.type === "Component" && g.variant === "button" && A === "down" && this.onComponentChange && this.onComponentChange({
|
|
5139
5166
|
objectId: g.id,
|
|
@@ -5143,31 +5170,31 @@ class WC {
|
|
|
5143
5170
|
value: !0
|
|
5144
5171
|
}), g.type === "Component" && g.variant === "listview" && A === "down") {
|
|
5145
5172
|
this.draggingListViewId = g.id;
|
|
5146
|
-
const
|
|
5147
|
-
if (
|
|
5148
|
-
const
|
|
5149
|
-
|
|
5150
|
-
const
|
|
5151
|
-
|
|
5152
|
-
const
|
|
5153
|
-
|
|
5173
|
+
const s = this.getListViewItemIndexAtPointer(g, I, C);
|
|
5174
|
+
if (s !== null) {
|
|
5175
|
+
const a = g.options || {};
|
|
5176
|
+
a.activeItemIndex = s;
|
|
5177
|
+
const M = this.objectStates.get(g.id);
|
|
5178
|
+
M && M.options && (M.options.activeItemIndex = s);
|
|
5179
|
+
const y = (a.items || [])[s], J = typeof y == "string" ? y : y.label || y.value || s;
|
|
5180
|
+
M && M.options && (M.options.selectedValue = J), g.inputId && this.setInternalInput(g.inputId, J), this.onComponentChange && (this.onComponentChange({
|
|
5154
5181
|
objectId: g.id,
|
|
5155
5182
|
componentName: g.name,
|
|
5156
5183
|
variant: "listview",
|
|
5157
5184
|
property: "activeItemIndex",
|
|
5158
|
-
value:
|
|
5185
|
+
value: s
|
|
5159
5186
|
}), this.onComponentChange({
|
|
5160
5187
|
objectId: g.id,
|
|
5161
5188
|
componentName: g.name,
|
|
5162
5189
|
variant: "listview",
|
|
5163
5190
|
property: "selected",
|
|
5164
|
-
value:
|
|
5191
|
+
value: J
|
|
5165
5192
|
}));
|
|
5166
5193
|
}
|
|
5167
5194
|
}
|
|
5168
5195
|
if (A === "click") {
|
|
5169
|
-
const
|
|
5170
|
-
(
|
|
5196
|
+
const s = (w = this.artboard) == null ? void 0 : w.objects.find((a) => a.id === g.id);
|
|
5197
|
+
(s == null ? void 0 : s.type) === "Component" && s.variant === "inputbox" ? (this.focusedId = g.id, console.log(`[Engine] Focus set to: ${g.id}`)) : this.focusedId = null;
|
|
5171
5198
|
}
|
|
5172
5199
|
} else A === "click" && (this.focusedId = null);
|
|
5173
5200
|
}
|
|
@@ -5203,35 +5230,35 @@ class WC {
|
|
|
5203
5230
|
}
|
|
5204
5231
|
fireEventForObject(A, I) {
|
|
5205
5232
|
if (!this.artboard) return;
|
|
5206
|
-
const C = this.artboard.objects.find((
|
|
5233
|
+
const C = this.artboard.objects.find((o) => o.id === A);
|
|
5207
5234
|
if (!C) return;
|
|
5208
5235
|
console.log(`[Engine] Firing event ${I} on ${C.name}`);
|
|
5209
5236
|
const g = /* @__PURE__ */ new Set([I]);
|
|
5210
5237
|
I === "onPointerEnter" && g.add("hover"), I === "onPointerLeave" && g.add("blur"), I === "onPointerDown" && g.add("pointerDown"), I === "onPointerUp" && g.add("pointerUp");
|
|
5211
|
-
const B = (C.interactions || []).find((
|
|
5238
|
+
const B = (C.interactions || []).find((o) => g.has(o.event));
|
|
5212
5239
|
if (B)
|
|
5213
5240
|
if (console.log(`[Engine] Interaction matched: ${I} (as ${B.event}) -> ${B.targetInputId}`), B.action === "setInput") {
|
|
5214
|
-
let
|
|
5215
|
-
|
|
5241
|
+
let o = B.value;
|
|
5242
|
+
o === "toggle" && (o = !this.inputs.get(B.targetInputId)), this.updateInput(B.targetInputId, o);
|
|
5216
5243
|
} else B.action === "fireTrigger" && this.updateInput(B.targetInputId, !0);
|
|
5217
|
-
const
|
|
5218
|
-
if (
|
|
5219
|
-
console.log(`[Engine] Trigger matched: ${I} (as ${
|
|
5220
|
-
const
|
|
5221
|
-
|
|
5222
|
-
triggerId:
|
|
5223
|
-
animation:
|
|
5244
|
+
const w = (C.triggers || []).find((o) => g.has(o.eventType));
|
|
5245
|
+
if (w && w.entryAnimationId) {
|
|
5246
|
+
console.log(`[Engine] Trigger matched: ${I} (as ${w.eventType}) -> Animation ${w.entryAnimationId}`);
|
|
5247
|
+
const o = this.artboard.animations.find((h) => h.id === w.entryAnimationId);
|
|
5248
|
+
o && (this.activeTriggers.set(C.id, {
|
|
5249
|
+
triggerId: w.id,
|
|
5250
|
+
animation: o,
|
|
5224
5251
|
time: 0,
|
|
5225
5252
|
phase: "entry",
|
|
5226
5253
|
elapsedHold: 0
|
|
5227
|
-
}), this.onTrigger && this.onTrigger(
|
|
5254
|
+
}), this.onTrigger && this.onTrigger(w.name, o.name));
|
|
5228
5255
|
}
|
|
5229
5256
|
}
|
|
5230
5257
|
getWorldTransform(A) {
|
|
5231
|
-
var
|
|
5258
|
+
var s;
|
|
5232
5259
|
const I = this.objectStates.get(A);
|
|
5233
5260
|
if (!I) return { x: 0, y: 0, scaleX: 1, scaleY: 1, rotation: 0 };
|
|
5234
|
-
const C = (
|
|
5261
|
+
const C = (s = this.artboard) == null ? void 0 : s.objects.find((a) => a.id === A);
|
|
5235
5262
|
if (!C || !C.parentId)
|
|
5236
5263
|
return {
|
|
5237
5264
|
x: I.x,
|
|
@@ -5240,7 +5267,7 @@ class WC {
|
|
|
5240
5267
|
scaleY: I.scale_y ?? 1,
|
|
5241
5268
|
rotation: I.rotation ?? 0
|
|
5242
5269
|
};
|
|
5243
|
-
const g = this.getWorldTransform(C.parentId), Q = g.rotation * (Math.PI / 180), B = Math.cos(Q), D = Math.sin(Q),
|
|
5270
|
+
const g = this.getWorldTransform(C.parentId), Q = g.rotation * (Math.PI / 180), B = Math.cos(Q), D = Math.sin(Q), w = I.x * g.scaleX, o = I.y * g.scaleY, h = g.x + (w * B - o * D), G = g.y + (w * D + o * B);
|
|
5244
5271
|
return {
|
|
5245
5272
|
x: h,
|
|
5246
5273
|
y: G,
|
|
@@ -5250,20 +5277,20 @@ class WC {
|
|
|
5250
5277
|
};
|
|
5251
5278
|
}
|
|
5252
5279
|
hitTest(A, I, C) {
|
|
5253
|
-
var
|
|
5280
|
+
var U, R;
|
|
5254
5281
|
if (!this.objectStates.get(A.id)) return !1;
|
|
5255
|
-
const Q = ((
|
|
5256
|
-
return Math.abs(a) <=
|
|
5282
|
+
const Q = ((U = A.geometry) == null ? void 0 : U.width) ?? A.width ?? 100, B = ((R = A.geometry) == null ? void 0 : R.height) ?? A.height ?? 100, D = this.getWorldTransform(A.id), w = I - D.x, o = C - D.y, h = -D.rotation * (Math.PI / 180), G = Math.cos(h), s = Math.sin(h), a = w * G - o * s, M = w * s + o * G, y = D.scaleX, J = D.scaleY, S = Q * Math.abs(y), F = B * Math.abs(J);
|
|
5283
|
+
return Math.abs(a) <= S / 2 && Math.abs(M) <= F / 2;
|
|
5257
5284
|
}
|
|
5258
5285
|
updateSliderValueFromPointer(A, I, C) {
|
|
5259
|
-
var
|
|
5286
|
+
var r;
|
|
5260
5287
|
if (!this.objectStates.get(A.id)) return;
|
|
5261
|
-
const Q = A.options || {}, B = ((
|
|
5262
|
-
let
|
|
5263
|
-
|
|
5264
|
-
const F = Q.min ?? 0,
|
|
5265
|
-
let c = F +
|
|
5266
|
-
|
|
5288
|
+
const Q = A.options || {}, B = ((r = A.geometry) == null ? void 0 : r.width) ?? A.width ?? 200, D = this.getWorldTransform(A.id), w = I - D.x, o = C - D.y, h = -D.rotation * (Math.PI / 180), G = Math.cos(h), s = Math.sin(h), a = w * G - o * s, M = Q.thumbWidth ?? 16, y = B - M;
|
|
5289
|
+
let S = (a + y / 2) / y;
|
|
5290
|
+
S = Math.max(0, Math.min(1, S));
|
|
5291
|
+
const F = Q.min ?? 0, U = Q.max ?? 100, R = Q.step || 1;
|
|
5292
|
+
let c = F + S * (U - F);
|
|
5293
|
+
R > 0 && (c = Math.round(c / R) * R), c = Math.max(F, Math.min(U, c)), Q.value !== c && (Q.value = c, A.inputId && this.setInternalInput(A.inputId, c), this.onComponentChange && this.onComponentChange({
|
|
5267
5294
|
objectId: A.id,
|
|
5268
5295
|
componentName: A.name,
|
|
5269
5296
|
variant: "slider",
|
|
@@ -5273,26 +5300,26 @@ class WC {
|
|
|
5273
5300
|
}
|
|
5274
5301
|
applyAnimation(A, I) {
|
|
5275
5302
|
A.tracks.forEach((C) => {
|
|
5276
|
-
var
|
|
5277
|
-
const g = (
|
|
5278
|
-
if (((
|
|
5303
|
+
var w, o, h;
|
|
5304
|
+
const g = (w = this.artboard) == null ? void 0 : w.objects.find((G) => G.id === C.object_id);
|
|
5305
|
+
if (((o = g == null ? void 0 : g.physics) == null ? void 0 : o.enabled) && g.physics.bodyType !== "Static" && (["x", "y", "rotation"].includes(C.property) || C.property.startsWith("transform.")))
|
|
5279
5306
|
return;
|
|
5280
5307
|
const B = this.objectStates.get(C.object_id);
|
|
5281
5308
|
if (!B) return;
|
|
5282
5309
|
const D = this.interpolate(C.keyframes, I);
|
|
5283
5310
|
if (C.property.includes(".")) {
|
|
5284
5311
|
const G = (C.property || "").split(".");
|
|
5285
|
-
let
|
|
5312
|
+
let s = B;
|
|
5286
5313
|
for (let a = 0; a < G.length - 1; a++) {
|
|
5287
|
-
if (!
|
|
5314
|
+
if (!s[G[a]]) {
|
|
5288
5315
|
let M = g;
|
|
5289
5316
|
for (let y = 0; y <= a; y++)
|
|
5290
5317
|
M = M ? M[G[y]] : null;
|
|
5291
|
-
|
|
5318
|
+
s[G[a]] = M ? JSON.parse(JSON.stringify(M)) : {};
|
|
5292
5319
|
}
|
|
5293
|
-
|
|
5320
|
+
s = s[G[a]];
|
|
5294
5321
|
}
|
|
5295
|
-
|
|
5322
|
+
s[G[G.length - 1]] = D;
|
|
5296
5323
|
} else
|
|
5297
5324
|
B[C.property] = D;
|
|
5298
5325
|
if (this.physicsEngine && ((h = g == null ? void 0 : g.physics) != null && h.enabled) && g.physics.bodyType === "Static")
|
|
@@ -5319,24 +5346,24 @@ class WC {
|
|
|
5319
5346
|
if (typeof C.value == "string") {
|
|
5320
5347
|
if (C.value.startsWith("#"))
|
|
5321
5348
|
return this.interpolateColor(C.value, g.value, B);
|
|
5322
|
-
const D = parseFloat(C.value),
|
|
5323
|
-
return !isNaN(D) && !isNaN(
|
|
5349
|
+
const D = parseFloat(C.value), w = parseFloat(g.value);
|
|
5350
|
+
return !isNaN(D) && !isNaN(w) ? Math.round(D + (w - D) * B).toString() : C.value;
|
|
5324
5351
|
}
|
|
5325
5352
|
return C.value + (g.value - C.value) * B;
|
|
5326
5353
|
}
|
|
5327
5354
|
interpolateColor(A, I, C) {
|
|
5328
5355
|
const g = (G) => {
|
|
5329
|
-
const
|
|
5356
|
+
const s = G.replace("#", "");
|
|
5330
5357
|
return {
|
|
5331
|
-
r: parseInt(
|
|
5332
|
-
g: parseInt(
|
|
5333
|
-
b: parseInt(
|
|
5358
|
+
r: parseInt(s.substring(0, 2), 16),
|
|
5359
|
+
g: parseInt(s.substring(2, 4), 16),
|
|
5360
|
+
b: parseInt(s.substring(4, 6), 16)
|
|
5334
5361
|
};
|
|
5335
|
-
}, Q = g(A), B = g(I), D = Math.round(Q.r + (B.r - Q.r) * C),
|
|
5336
|
-
const
|
|
5337
|
-
return
|
|
5362
|
+
}, Q = g(A), B = g(I), D = Math.round(Q.r + (B.r - Q.r) * C), w = Math.round(Q.g + (B.g - Q.g) * C), o = Math.round(Q.b + (B.b - Q.b) * C), h = (G) => {
|
|
5363
|
+
const s = Math.max(0, Math.min(255, G)).toString(16);
|
|
5364
|
+
return s.length === 1 ? "0" + s : s;
|
|
5338
5365
|
};
|
|
5339
|
-
return `#${h(D)}${h(
|
|
5366
|
+
return `#${h(D)}${h(w)}${h(o)}`;
|
|
5340
5367
|
}
|
|
5341
5368
|
render(A, I, C) {
|
|
5342
5369
|
if (!this.artboard)
|
|
@@ -5351,65 +5378,65 @@ class WC {
|
|
|
5351
5378
|
this.layout.alignment
|
|
5352
5379
|
);
|
|
5353
5380
|
if (A.save(), A.translate(B.tx, B.ty), A.scale(B.scaleX, B.scaleY), A.translate(g / 2, Q / 2), A.fillStyle = this.artboard.backgroundColor || "#000000", A.fillRect(-g / 2, -Q / 2, g, Q), this.artboard.backgroundImage) {
|
|
5354
|
-
const
|
|
5355
|
-
let h = this.imageCache.get(
|
|
5356
|
-
if (h || (h = new Image(), h.src =
|
|
5381
|
+
const o = this.artboard.backgroundImage;
|
|
5382
|
+
let h = this.imageCache.get(o);
|
|
5383
|
+
if (h || (h = new Image(), h.src = o, this.imageCache.set(o, h)), h.complete && h.naturalWidth > 0) {
|
|
5357
5384
|
A.save(), A.globalAlpha = this.artboard.backgroundOpacity ?? 1;
|
|
5358
|
-
const G = h.naturalWidth / h.naturalHeight,
|
|
5385
|
+
const G = h.naturalWidth / h.naturalHeight, s = g / Q;
|
|
5359
5386
|
let a, M, y, J;
|
|
5360
|
-
|
|
5387
|
+
s > G ? (a = g, M = g / G) : (M = Q, a = Q * G), y = -a / 2, J = -M / 2, A.drawImage(h, y, J, a, M), A.restore();
|
|
5361
5388
|
}
|
|
5362
5389
|
}
|
|
5363
5390
|
A.beginPath(), A.rect(-g / 2, -Q / 2, g, Q), A.clip();
|
|
5364
5391
|
const D = /* @__PURE__ */ new Map();
|
|
5365
|
-
this.artboard.objects.forEach((
|
|
5366
|
-
let
|
|
5367
|
-
for (this.artboard.objects.forEach((
|
|
5368
|
-
if (!
|
|
5369
|
-
const h = this.objectStates.get(
|
|
5392
|
+
this.artboard.objects.forEach((o) => D.set(o.id, o));
|
|
5393
|
+
let w = 0;
|
|
5394
|
+
for (this.artboard.objects.forEach((o) => {
|
|
5395
|
+
if (!o.parentId) {
|
|
5396
|
+
const h = this.objectStates.get(o.id), G = (h == null ? void 0 : h.geometry) || o.geometry;
|
|
5370
5397
|
if (G && G.isMask && (h == null ? void 0 : h.visible) !== !1) {
|
|
5371
|
-
A.save(), this.applyObjectTransform(A,
|
|
5372
|
-
const
|
|
5373
|
-
this.applyPath(A, G,
|
|
5398
|
+
A.save(), this.applyObjectTransform(A, o.id);
|
|
5399
|
+
const s = G.width || 0, a = G.height || 0;
|
|
5400
|
+
this.applyPath(A, G, s, a), A.clip(), w++;
|
|
5374
5401
|
} else
|
|
5375
|
-
this.renderObject(A,
|
|
5402
|
+
this.renderObject(A, o, D);
|
|
5376
5403
|
}
|
|
5377
|
-
});
|
|
5378
|
-
A.restore(),
|
|
5404
|
+
}); w > 0; )
|
|
5405
|
+
A.restore(), w--;
|
|
5379
5406
|
A.restore();
|
|
5380
5407
|
}
|
|
5381
5408
|
calculateTransform(A, I, C, g, Q, B) {
|
|
5382
|
-
let D = 1,
|
|
5409
|
+
let D = 1, w = 1, o = 1;
|
|
5383
5410
|
const h = C / g, G = A / I;
|
|
5384
5411
|
switch (Q) {
|
|
5385
5412
|
case "Contain":
|
|
5386
|
-
G > h ?
|
|
5413
|
+
G > h ? o = I / g : o = A / C, D = w = o;
|
|
5387
5414
|
break;
|
|
5388
5415
|
case "Cover":
|
|
5389
|
-
G > h ?
|
|
5416
|
+
G > h ? o = A / C : o = I / g, D = w = o;
|
|
5390
5417
|
break;
|
|
5391
5418
|
case "Fill":
|
|
5392
|
-
D = A / C,
|
|
5419
|
+
D = A / C, w = I / g;
|
|
5393
5420
|
break;
|
|
5394
5421
|
case "FitWidth":
|
|
5395
|
-
|
|
5422
|
+
o = A / C, D = w = o;
|
|
5396
5423
|
break;
|
|
5397
5424
|
case "FitHeight":
|
|
5398
|
-
|
|
5425
|
+
o = I / g, D = w = o;
|
|
5399
5426
|
break;
|
|
5400
5427
|
case "None":
|
|
5401
|
-
D =
|
|
5428
|
+
D = w = 1;
|
|
5402
5429
|
break;
|
|
5403
5430
|
case "ScaleDown":
|
|
5404
|
-
|
|
5431
|
+
o = Math.min(A / C, I / g), o > 1 && (o = 1), D = w = o;
|
|
5405
5432
|
break;
|
|
5406
5433
|
default:
|
|
5407
|
-
D =
|
|
5434
|
+
D = w = 1;
|
|
5408
5435
|
break;
|
|
5409
5436
|
}
|
|
5410
|
-
const
|
|
5437
|
+
const s = C * D, a = g * w;
|
|
5411
5438
|
let M = 0, y = 0;
|
|
5412
|
-
return B.includes("Left") ? M = 0 : B.includes("Right") ? M = A -
|
|
5439
|
+
return B.includes("Left") ? M = 0 : B.includes("Right") ? M = A - s : M = (A - s) / 2, B.includes("Top") ? y = 0 : B.includes("Bottom") ? y = I - a : y = (I - a) / 2, { scaleX: D, scaleY: w, tx: M, ty: y };
|
|
5413
5440
|
}
|
|
5414
5441
|
mapFontWeight(A) {
|
|
5415
5442
|
const I = A.toLowerCase();
|
|
@@ -5422,17 +5449,17 @@ class WC {
|
|
|
5422
5449
|
console.warn("No state for object:", I.id);
|
|
5423
5450
|
return;
|
|
5424
5451
|
}
|
|
5425
|
-
A.roundRect || (A.roundRect = (
|
|
5452
|
+
A.roundRect || (A.roundRect = (S, F, U, R, c) => (this.drawRoundRect(A, S, F, U, R, c), A));
|
|
5426
5453
|
const Q = g.geometry ? { ...I.geometry, ...g.geometry } : I.geometry, B = g.style ? { ...I.style, ...g.style } : I.style;
|
|
5427
5454
|
if (g.visible === !1)
|
|
5428
5455
|
return;
|
|
5429
|
-
const D = Q.width || 0,
|
|
5456
|
+
const D = Q.width || 0, w = Q.height || 0, o = g.x, h = g.y;
|
|
5430
5457
|
A.save();
|
|
5431
|
-
const G = A.globalAlpha,
|
|
5432
|
-
A.globalAlpha = G *
|
|
5458
|
+
const G = A.globalAlpha, s = g.opacity !== void 0 ? g.opacity : 1;
|
|
5459
|
+
A.globalAlpha = G * s;
|
|
5433
5460
|
const a = g.compositeOperation || g.blendMode;
|
|
5434
5461
|
if (a && a !== "Normal") {
|
|
5435
|
-
const
|
|
5462
|
+
const S = a.toLowerCase();
|
|
5436
5463
|
[
|
|
5437
5464
|
"multiply",
|
|
5438
5465
|
"screen",
|
|
@@ -5462,65 +5489,65 @@ class WC {
|
|
|
5462
5489
|
"xor",
|
|
5463
5490
|
"multiply",
|
|
5464
5491
|
"screen"
|
|
5465
|
-
].includes(
|
|
5492
|
+
].includes(S) && (A.globalCompositeOperation = S);
|
|
5466
5493
|
}
|
|
5467
|
-
if (A.translate(
|
|
5468
|
-
let
|
|
5494
|
+
if (A.translate(o, h), A.rotate(g.rotation * Math.PI / 180), A.scale(g.scale_x, g.scale_y), Q.type === "Text") {
|
|
5495
|
+
let S = Q.text || "";
|
|
5469
5496
|
if (Q.textInputId) {
|
|
5470
5497
|
const t = this.inputs.get(Q.textInputId);
|
|
5471
|
-
t !== void 0 && (
|
|
5498
|
+
t !== void 0 && (S = String(t), g.geometry && g.geometry.type === "Text" && (g.geometry.text = S));
|
|
5472
5499
|
}
|
|
5473
|
-
let F =
|
|
5500
|
+
let F = S || "";
|
|
5474
5501
|
Q.segments && Array.isArray(Q.segments) && (F = Q.segments.map((t) => t && t.text ? t.text : "").join(""));
|
|
5475
|
-
const
|
|
5476
|
-
|
|
5477
|
-
let
|
|
5478
|
-
|
|
5479
|
-
const
|
|
5480
|
-
A.font = `${c} ${
|
|
5481
|
-
const
|
|
5482
|
-
let Z = -
|
|
5483
|
-
|
|
5484
|
-
const
|
|
5485
|
-
A.textAlign =
|
|
5486
|
-
let
|
|
5487
|
-
|
|
5488
|
-
const
|
|
5489
|
-
if (
|
|
5490
|
-
let
|
|
5491
|
-
for (let
|
|
5492
|
-
|
|
5493
|
-
return
|
|
5494
|
-
},
|
|
5502
|
+
const U = Q.textCase || "none";
|
|
5503
|
+
U === "uppercase" ? F = F.toUpperCase() : U === "lowercase" ? F = F.toLowerCase() : U === "capitalize" && (F = F.replace(/\b\w/g, (t) => t.toUpperCase()));
|
|
5504
|
+
let R = ((J = Q.fontWeight) == null ? void 0 : J.toString()) || "400", c = "normal";
|
|
5505
|
+
R.toLowerCase().includes("italic") && (c = "italic", R = R.replace(/italic/gi, "").trim() || "400");
|
|
5506
|
+
const r = this.mapFontWeight(R), n = Math.max(1, Q.fontSize || 16);
|
|
5507
|
+
A.font = `${c} ${r} ${n}px "${Q.fontFamily || "Inter"}", sans-serif`;
|
|
5508
|
+
const p = Q.textVerticalAlign || "top";
|
|
5509
|
+
let Z = -w / 2;
|
|
5510
|
+
p === "middle" || p === "center" ? (A.textBaseline = "middle", Z = 0) : p === "bottom" ? (A.textBaseline = "bottom", Z = w / 2) : (A.textBaseline = "top", Z = -w / 2);
|
|
5511
|
+
const H = Q.textAlign || "left";
|
|
5512
|
+
A.textAlign = H;
|
|
5513
|
+
let X = -D / 2;
|
|
5514
|
+
H === "center" && (X = 0), H === "right" && (X = D / 2);
|
|
5515
|
+
const QA = Q.letterSpacing || 0, SA = Q.paragraphSpacing || 0, wA = (Q.lineHeight || 1.2) * n, v = (Q.width || D || 200) + 15, x = (t) => {
|
|
5516
|
+
if (QA === 0) return A.measureText(t).width;
|
|
5517
|
+
let l = 0;
|
|
5518
|
+
for (let e = 0; e < t.length; e++)
|
|
5519
|
+
l += A.measureText(t[e]).width + QA;
|
|
5520
|
+
return l - QA;
|
|
5521
|
+
}, q = [], b = String(F || "").split(`
|
|
5495
5522
|
`);
|
|
5496
|
-
|
|
5497
|
-
const
|
|
5523
|
+
b.forEach((t, l) => {
|
|
5524
|
+
const e = String(t || "").split(" ");
|
|
5498
5525
|
let O = "";
|
|
5499
|
-
for (let
|
|
5500
|
-
const
|
|
5501
|
-
|
|
5526
|
+
for (let _ = 0; _ < e.length; _++) {
|
|
5527
|
+
const BA = O + e[_] + " ";
|
|
5528
|
+
x(BA.trim()) > v && _ > 0 ? (q.push({ text: O.trim(), isParaEnd: !1 }), O = e[_] + " ") : O = BA;
|
|
5502
5529
|
}
|
|
5503
|
-
|
|
5530
|
+
q.push({ text: O.trim(), isParaEnd: l < b.length - 1 });
|
|
5504
5531
|
});
|
|
5505
|
-
let
|
|
5506
|
-
if (
|
|
5507
|
-
const t =
|
|
5508
|
-
|
|
5532
|
+
let T = Z, Y = q.length * wA;
|
|
5533
|
+
if (SA > 0) {
|
|
5534
|
+
const t = q.filter((l, e) => l.isParaEnd && e < q.length - 1).length;
|
|
5535
|
+
Y += t * SA;
|
|
5509
5536
|
}
|
|
5510
|
-
|
|
5511
|
-
const
|
|
5512
|
-
var
|
|
5513
|
-
if (
|
|
5514
|
-
O ? A.strokeText(t,
|
|
5537
|
+
p === "middle" || p === "center" ? T -= Y / 2 - n / 2 : p === "bottom" && (T -= Y - n);
|
|
5538
|
+
const f = (t, l, e, O, _) => {
|
|
5539
|
+
var BA, V;
|
|
5540
|
+
if (QA === 0 && (Q.enableSegments !== !0 || !Q.segments || Q.segments.length === 0))
|
|
5541
|
+
O ? A.strokeText(t, l, e) : A.fillText(t, l, e);
|
|
5515
5542
|
else {
|
|
5516
|
-
const
|
|
5517
|
-
let
|
|
5518
|
-
|
|
5519
|
-
let
|
|
5520
|
-
for (let
|
|
5521
|
-
const RA = t[
|
|
5543
|
+
const gA = x(t);
|
|
5544
|
+
let u = l;
|
|
5545
|
+
H === "center" ? u -= gA / 2 : H === "right" && (u -= gA);
|
|
5546
|
+
let iA = u;
|
|
5547
|
+
for (let sA = 0; sA < t.length; sA++) {
|
|
5548
|
+
const RA = t[sA];
|
|
5522
5549
|
if (Q.enableSegments === !0 && Q.segments && Q.segments.length > 0) {
|
|
5523
|
-
const LA =
|
|
5550
|
+
const LA = _ + sA;
|
|
5524
5551
|
let JA = 0;
|
|
5525
5552
|
const DA = Q.segments.find((tA) => {
|
|
5526
5553
|
if (!tA || typeof tA.text != "string") return !1;
|
|
@@ -5529,124 +5556,124 @@ class WC {
|
|
|
5529
5556
|
});
|
|
5530
5557
|
if (DA) {
|
|
5531
5558
|
if (DA.fill) {
|
|
5532
|
-
const tA = ((
|
|
5559
|
+
const tA = ((V = (BA = g == null ? void 0 : g.style) == null ? void 0 : BA.fill) == null ? void 0 : V.color) || null;
|
|
5533
5560
|
O ? A.strokeStyle = DA.fill.color || A.strokeStyle : A.fillStyle = tA || DA.fill.color || A.fillStyle;
|
|
5534
5561
|
}
|
|
5535
5562
|
if (DA.fontSize || DA.fontFamily || DA.fontWeight) {
|
|
5536
|
-
const tA = DA.fontWeight ? this.mapFontWeight(DA.fontWeight.toString()) :
|
|
5563
|
+
const tA = DA.fontWeight ? this.mapFontWeight(DA.fontWeight.toString()) : r, iI = DA.fontSize || n, sg = DA.fontFamily || Q.fontFamily || "Inter";
|
|
5537
5564
|
A.font = `${c} ${tA} ${iI}px "${sg}", sans-serif`;
|
|
5538
5565
|
}
|
|
5539
5566
|
}
|
|
5540
5567
|
}
|
|
5541
|
-
O ? A.strokeText(RA,
|
|
5568
|
+
O ? A.strokeText(RA, iA, e) : A.fillText(RA, iA, e), Q.enableSegments === !0 && Q.segments && Q.segments.length > 0 && (A.font = `${c} ${r} ${n}px "${Q.fontFamily || "Inter"}", sans-serif`), iA += A.measureText(RA).width + QA;
|
|
5542
5569
|
}
|
|
5543
5570
|
}
|
|
5544
5571
|
};
|
|
5545
5572
|
if (B.fill) {
|
|
5546
|
-
const t = A.globalAlpha,
|
|
5547
|
-
A.fillStyle =
|
|
5548
|
-
let
|
|
5549
|
-
|
|
5550
|
-
const
|
|
5551
|
-
|
|
5573
|
+
const t = A.globalAlpha, l = this.createCanvasFill(A, B.fill, D, w);
|
|
5574
|
+
A.fillStyle = l || B.fill.color || "#000000", A.globalAlpha = t * (B.fill.opacity ?? 1);
|
|
5575
|
+
let e = 0, O = T;
|
|
5576
|
+
q.forEach((_) => {
|
|
5577
|
+
const BA = F.indexOf(_.text, e);
|
|
5578
|
+
BA !== -1 && (f(_.text, X, O, !1, BA), e = BA + _.text.length, O += wA + (_.isParaEnd ? SA : 0));
|
|
5552
5579
|
}), A.globalAlpha = t;
|
|
5553
5580
|
}
|
|
5554
5581
|
if (B.stroke && B.stroke.width > 0) {
|
|
5555
5582
|
const t = A.globalAlpha;
|
|
5556
5583
|
A.strokeStyle = B.stroke.color, A.lineWidth = B.stroke.width, A.globalAlpha = t * (B.stroke.opacity ?? 1);
|
|
5557
|
-
let
|
|
5558
|
-
|
|
5559
|
-
const
|
|
5560
|
-
|
|
5584
|
+
let l = 0, e = T;
|
|
5585
|
+
q.forEach((O) => {
|
|
5586
|
+
const _ = F.indexOf(O.text, l);
|
|
5587
|
+
_ !== -1 && (f(O.text, X, e, !0, _), l = _ + O.text.length, e += wA + (O.isParaEnd ? SA : 0));
|
|
5561
5588
|
}), A.globalAlpha = t;
|
|
5562
5589
|
}
|
|
5563
5590
|
} else if (Q.type === "Image") {
|
|
5564
|
-
const
|
|
5565
|
-
if (
|
|
5566
|
-
let F = this.imageCache.get(
|
|
5591
|
+
const S = Q.src;
|
|
5592
|
+
if (S) {
|
|
5593
|
+
let F = this.imageCache.get(S);
|
|
5567
5594
|
if (F || (F = new Image(), F.onload = () => {
|
|
5568
5595
|
}, F.onerror = () => {
|
|
5569
|
-
console.error(`[ExodeUI] Image load failed: ${
|
|
5570
|
-
}, F.src =
|
|
5571
|
-
const
|
|
5572
|
-
|
|
5596
|
+
console.error(`[ExodeUI] Image load failed: ${S.substring(0, 100)}${S.length > 100 ? "..." : ""}`);
|
|
5597
|
+
}, F.src = S, this.imageCache.set(S, F)), F.complete && F.naturalWidth > 0) {
|
|
5598
|
+
const U = Q.corner_radius ?? Q.cornerRadius ?? 0;
|
|
5599
|
+
U !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: U }, D, w), A.clip(), A.drawImage(F, -D / 2, -w / 2, D, w), A.restore()) : A.drawImage(F, -D / 2, -w / 2, D, w);
|
|
5573
5600
|
}
|
|
5574
5601
|
}
|
|
5575
5602
|
} else if (Q.type === "SVG") {
|
|
5576
|
-
const
|
|
5577
|
-
if (
|
|
5578
|
-
const F = B.palette || [],
|
|
5579
|
-
let
|
|
5580
|
-
if (!
|
|
5581
|
-
|
|
5582
|
-
let c =
|
|
5583
|
-
Q.colors && Q.colors.length > 0 && F.length > 0 && Q.colors.forEach((
|
|
5603
|
+
const S = Q.svgContent;
|
|
5604
|
+
if (S) {
|
|
5605
|
+
const F = B.palette || [], U = I.id + "_" + F.join("_");
|
|
5606
|
+
let R = this.imageCache.get(U);
|
|
5607
|
+
if (!R) {
|
|
5608
|
+
R = new Image();
|
|
5609
|
+
let c = S;
|
|
5610
|
+
Q.colors && Q.colors.length > 0 && F.length > 0 && Q.colors.forEach((p, Z) => {
|
|
5584
5611
|
if (F[Z]) {
|
|
5585
|
-
const
|
|
5586
|
-
c = c.replace(
|
|
5612
|
+
const H = p.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), X = new RegExp(H, "gi");
|
|
5613
|
+
c = c.replace(X, F[Z]);
|
|
5587
5614
|
}
|
|
5588
5615
|
});
|
|
5589
|
-
const
|
|
5590
|
-
|
|
5616
|
+
const r = new Blob([c], { type: "image/svg+xml" }), n = URL.createObjectURL(r);
|
|
5617
|
+
R.src = n, this.imageCache.set(U, R);
|
|
5591
5618
|
}
|
|
5592
|
-
if (
|
|
5619
|
+
if (R.complete && R.naturalWidth > 0) {
|
|
5593
5620
|
const c = Q.corner_radius ?? Q.cornerRadius ?? 0;
|
|
5594
|
-
c !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: c }, D,
|
|
5621
|
+
c !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: c }, D, w), A.clip(), A.drawImage(R, -D / 2, -w / 2, D, w), A.restore()) : A.drawImage(R, -D / 2, -w / 2, D, w);
|
|
5595
5622
|
}
|
|
5596
5623
|
}
|
|
5597
5624
|
} else if (Q.type === "LineGraph")
|
|
5598
|
-
this.renderLineGraph(A, Q, D,
|
|
5625
|
+
this.renderLineGraph(A, Q, D, w);
|
|
5599
5626
|
else if (I.type === "Shape") {
|
|
5600
|
-
if (this.applyPath(A, Q, D,
|
|
5627
|
+
if (this.applyPath(A, Q, D, w), A.save(), B.shadow && B.shadow.opacity > 0) {
|
|
5601
5628
|
if (A.shadowColor = B.shadow.color, B.shadow.opacity < 1 && B.shadow.color.startsWith("#")) {
|
|
5602
|
-
const
|
|
5603
|
-
A.shadowColor = `rgba(${
|
|
5629
|
+
const S = parseInt(B.shadow.color.slice(1, 3), 16), F = parseInt(B.shadow.color.slice(3, 5), 16), U = parseInt(B.shadow.color.slice(5, 7), 16);
|
|
5630
|
+
A.shadowColor = `rgba(${S}, ${F}, ${U}, ${B.shadow.opacity})`;
|
|
5604
5631
|
}
|
|
5605
5632
|
A.shadowBlur = B.shadow.blur, A.shadowOffsetX = B.shadow.offsetX, A.shadowOffsetY = B.shadow.offsetY;
|
|
5606
5633
|
}
|
|
5607
5634
|
if (B.blur && B.blur.amount > 0 && (A.filter = `blur(${B.blur.amount}px)`), B.fill) {
|
|
5608
|
-
const
|
|
5609
|
-
F ? A.fillStyle = F : A.fillStyle = B.fill.color || "transparent", A.globalAlpha =
|
|
5635
|
+
const S = A.globalAlpha, F = this.createCanvasFill(A, B.fill, D, w);
|
|
5636
|
+
F ? A.fillStyle = F : A.fillStyle = B.fill.color || "transparent", A.globalAlpha = S * (B.fill.opacity ?? 1), A.fill(), A.globalAlpha = S;
|
|
5610
5637
|
}
|
|
5611
5638
|
if (B.stroke && B.stroke.width > 0) {
|
|
5612
|
-
const
|
|
5613
|
-
A.strokeStyle = B.stroke.color, A.lineWidth = B.stroke.width, A.globalAlpha =
|
|
5639
|
+
const S = A.globalAlpha;
|
|
5640
|
+
A.strokeStyle = B.stroke.color, A.lineWidth = B.stroke.width, A.globalAlpha = S * (B.stroke.opacity ?? 1), A.stroke(), A.globalAlpha = S;
|
|
5614
5641
|
}
|
|
5615
5642
|
A.restore();
|
|
5616
5643
|
} else if (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) {
|
|
5617
|
-
const
|
|
5644
|
+
const S = g.width !== void 0 ? g.width : I.width || D, F = g.height !== void 0 ? g.height : I.height || w, U = g.cornerRadius !== void 0 ? g.cornerRadius : I.cornerRadius ?? I.corner_radius ?? 0;
|
|
5618
5645
|
if (A.save(), B.shadow && B.shadow.opacity > 0) {
|
|
5619
5646
|
if (A.shadowColor = B.shadow.color, B.shadow.opacity < 1 && B.shadow.color.startsWith("#")) {
|
|
5620
|
-
const c = parseInt(B.shadow.color.slice(1, 3), 16),
|
|
5621
|
-
A.shadowColor = `rgba(${c}, ${
|
|
5647
|
+
const c = parseInt(B.shadow.color.slice(1, 3), 16), r = parseInt(B.shadow.color.slice(3, 5), 16), n = parseInt(B.shadow.color.slice(5, 7), 16);
|
|
5648
|
+
A.shadowColor = `rgba(${c}, ${r}, ${n}, ${B.shadow.opacity})`;
|
|
5622
5649
|
}
|
|
5623
5650
|
A.shadowBlur = B.shadow.blur, A.shadowOffsetX = B.shadow.offsetX, A.shadowOffsetY = B.shadow.offsetY;
|
|
5624
5651
|
}
|
|
5625
|
-
if (A.beginPath(), A.roundRect(-
|
|
5626
|
-
const c = A.globalAlpha,
|
|
5627
|
-
A.fillStyle =
|
|
5652
|
+
if (A.beginPath(), A.roundRect(-S / 2, -F / 2, S, F, U), B.fill && B.fill.type !== "None") {
|
|
5653
|
+
const c = A.globalAlpha, r = this.createCanvasFill(A, B.fill, S, F);
|
|
5654
|
+
A.fillStyle = r || B.fill.color || "transparent", A.globalAlpha = c * (B.fill.opacity ?? 1), A.fill(), A.globalAlpha = c;
|
|
5628
5655
|
}
|
|
5629
5656
|
if (B.stroke && B.stroke.width > 0 && B.stroke.isEnabled !== !1) {
|
|
5630
5657
|
const c = A.globalAlpha;
|
|
5631
5658
|
A.strokeStyle = B.stroke.color || "#000000", A.lineWidth = B.stroke.width, A.globalAlpha = c * (B.stroke.opacity ?? 1), A.stroke(), A.globalAlpha = c;
|
|
5632
5659
|
}
|
|
5633
|
-
A.restore(), (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), A.roundRect(-
|
|
5660
|
+
A.restore(), (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), A.roundRect(-S / 2, -F / 2, S, F, U), A.clip());
|
|
5634
5661
|
} 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);
|
|
5635
5662
|
const M = (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) && (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0;
|
|
5636
5663
|
if (I.children && I.children.length > 0) {
|
|
5637
|
-
let
|
|
5664
|
+
let S = 0;
|
|
5638
5665
|
for (I.children.forEach((F) => {
|
|
5639
|
-
const
|
|
5640
|
-
if (!
|
|
5641
|
-
const
|
|
5642
|
-
if (c && c.isMask && (
|
|
5666
|
+
const U = C.get(F);
|
|
5667
|
+
if (!U) return;
|
|
5668
|
+
const R = this.objectStates.get(F), c = (R == null ? void 0 : R.geometry) || U.geometry;
|
|
5669
|
+
if (c && c.isMask && (R == null ? void 0 : R.visible) !== !1) {
|
|
5643
5670
|
A.save(), this.applyObjectTransform(A, F);
|
|
5644
|
-
const
|
|
5645
|
-
this.applyPath(A, c,
|
|
5671
|
+
const r = c.width || 0, n = c.height || 0;
|
|
5672
|
+
this.applyPath(A, c, r, n), A.clip(), S++;
|
|
5646
5673
|
} else
|
|
5647
|
-
this.renderObject(A,
|
|
5648
|
-
});
|
|
5649
|
-
A.restore(),
|
|
5674
|
+
this.renderObject(A, U, C);
|
|
5675
|
+
}); S > 0; )
|
|
5676
|
+
A.restore(), S--;
|
|
5650
5677
|
}
|
|
5651
5678
|
const y = I.clipsContent !== !1 || I.clipContent === !0;
|
|
5652
5679
|
(M || y) && M && A.restore(), A.restore();
|
|
@@ -5665,9 +5692,9 @@ class WC {
|
|
|
5665
5692
|
A.moveTo(0, -g / 2), A.lineTo(C / 2, g / 2), A.lineTo(-C / 2, g / 2), A.closePath();
|
|
5666
5693
|
else if (I.type === "Star") {
|
|
5667
5694
|
const Q = I.inner_radius || 20, B = I.outer_radius || 50, D = I.points || 5;
|
|
5668
|
-
for (let
|
|
5669
|
-
const
|
|
5670
|
-
|
|
5695
|
+
for (let w = 0; w < D * 2; w++) {
|
|
5696
|
+
const o = w * Math.PI / D - Math.PI / 2, h = w % 2 === 0 ? B : Q, G = h * Math.cos(o), s = h * Math.sin(o);
|
|
5697
|
+
w === 0 ? A.moveTo(G, s) : A.lineTo(G, s);
|
|
5671
5698
|
}
|
|
5672
5699
|
A.closePath();
|
|
5673
5700
|
} else I.type === "Path" && I.points && (I.points.forEach((Q, B) => {
|
|
@@ -5675,202 +5702,207 @@ class WC {
|
|
|
5675
5702
|
}), I.is_closed && A.closePath());
|
|
5676
5703
|
}
|
|
5677
5704
|
renderInputBox(A, I) {
|
|
5678
|
-
var
|
|
5679
|
-
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((
|
|
5680
|
-
let
|
|
5681
|
-
const Z = `${h}Style`,
|
|
5682
|
-
|
|
5683
|
-
const
|
|
5684
|
-
if (!
|
|
5685
|
-
const
|
|
5705
|
+
var _, BA;
|
|
5706
|
+
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((_ = I.geometry) == null ? void 0 : _.width) || 250, B = ((BA = I.geometry) == null ? void 0 : BA.height) || 45, D = this.focusedId === I.id, w = this.lastHoveredObjectId === I.id, o = g.previewState || "default", h = o !== "default" ? o : D ? "focused" : w ? "hovered" : "default", G = g.label || { visible: !0, text: "Label" }, s = g.helperText || { visible: !1, text: "Helper text" }, a = g.leftIcon || { visible: !1 }, M = g.rightIcon || { visible: !1 }, y = g.multiline === !0, J = g.cornerRadius ?? 8, S = g.corners || { tl: J, tr: J, bl: J, br: J }, F = [S.tl, S.tr, S.br, S.bl];
|
|
5707
|
+
let U = g.backgroundColor || "rgba(31, 41, 55, 1)", R = g.borderColor || "rgba(55, 65, 81, 1)", c = g.borderWidth ?? 1.5, r = g.color || "#ffffff", n = g.placeholderColor || "rgba(156, 163, 175, 1)", p = g.fontSize || 14;
|
|
5708
|
+
const Z = `${h}Style`, H = g[Z];
|
|
5709
|
+
H ? (H.backgroundColor !== void 0 && (U = H.backgroundColor), H.borderColor !== void 0 && (R = H.borderColor), H.borderWidth !== void 0 && (c = H.borderWidth), H.color !== void 0 && (r = H.color), H.placeholderColor !== void 0 && (n = H.placeholderColor), H.fontSize !== void 0 && (p = H.fontSize)) : h === "focused" ? (R = g.focusBorderColor || "rgba(59, 130, 246, 1)", c = Math.max(c, 2)) : h === "hovered" || h === "hover" ? (R = g.hoverBorderColor || R, U = g.hoverBackgroundColor || U) : h === "disabled" ? (U = g.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", R = g.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : h === "error" && (R = "rgba(239, 68, 68, 1)", c = Math.max(c, 2)), A.beginPath(), A.roundRect(-Q / 2, -B / 2, Q, B, F), A.fillStyle = U, A.fill(), c > 0 && (A.strokeStyle = R, A.lineWidth = c, A.stroke(), (h === "focused" || h === "focus") && (A.save(), A.beginPath(), A.roundRect(-Q / 2 - 2, -B / 2 - 2, Q + 4, B + 4, F.map((V) => V + 2)), A.strokeStyle = "rgba(59, 130, 246, 0.3)", A.lineWidth = 2, A.stroke(), A.restore()));
|
|
5710
|
+
const X = (V, gA) => {
|
|
5711
|
+
if (!V.visible || !V.svgPath) return;
|
|
5712
|
+
const u = V.size || 14, iA = V.offset ?? 16, sA = V.color || "#ffffff", RA = gA ? -(Q / 2) + iA : Q / 2 - iA, LA = V.svgPath;
|
|
5686
5713
|
if (A.save(), A.translate(RA, 0), !LA.startsWith("<svg")) {
|
|
5687
|
-
const JA = new Path2D(LA), DA =
|
|
5688
|
-
A.scale(DA, DA), A.translate(-12, -12), A.fillStyle =
|
|
5714
|
+
const JA = new Path2D(LA), DA = u / 24;
|
|
5715
|
+
A.scale(DA, DA), A.translate(-12, -12), A.fillStyle = sA, A.fill(JA);
|
|
5689
5716
|
}
|
|
5690
5717
|
A.restore();
|
|
5691
5718
|
};
|
|
5692
|
-
|
|
5693
|
-
const
|
|
5694
|
-
A.font = `${
|
|
5695
|
-
const
|
|
5696
|
-
if (A.save(), A.beginPath(), A.rect(
|
|
5697
|
-
const
|
|
5719
|
+
X(a, !0), X(M, !1);
|
|
5720
|
+
const QA = g.text || "", SA = g.placeholder || "Enter text...", wA = !QA, v = QA || SA, x = wA ? n : r, q = p, b = g.fontFamily || "Inter", T = g.fontWeight || 400;
|
|
5721
|
+
A.font = `${T} ${q}px "${b}", sans-serif`, A.fillStyle = x, A.textAlign = "left", A.textBaseline = y ? "top" : "middle";
|
|
5722
|
+
const Y = g.inputPadding ?? 16, f = a.visible ? (a.offset ?? 16) + (a.size || 14) / 2 + 8 : Y, t = M.visible ? (M.offset ?? 16) + (M.size || 14) / 2 + 8 : Y, l = -(Q / 2) + f, e = Q - f - t, O = g.inputType === "password" ? "•".repeat(v.length) : v;
|
|
5723
|
+
if (A.save(), A.beginPath(), A.rect(l - 2, -B / 2 + 4, e + 4, B - 8), A.clip(), y) {
|
|
5724
|
+
const V = O.split(`
|
|
5698
5725
|
`);
|
|
5699
|
-
let
|
|
5700
|
-
const
|
|
5701
|
-
let
|
|
5702
|
-
|
|
5703
|
-
const LA =
|
|
5726
|
+
let gA = -B / 2 + Y;
|
|
5727
|
+
const u = q * 1.2;
|
|
5728
|
+
let iA = 0;
|
|
5729
|
+
V.forEach((sA, RA) => {
|
|
5730
|
+
const LA = sA.split(" ");
|
|
5704
5731
|
let JA = "";
|
|
5705
5732
|
for (let DA = 0; DA < LA.length; DA++) {
|
|
5706
5733
|
const tA = JA + LA[DA] + " ";
|
|
5707
|
-
A.measureText(tA).width >
|
|
5734
|
+
A.measureText(tA).width > e && DA > 0 ? (A.fillText(JA, l, gA), JA = LA[DA] + " ", gA += u) : JA = tA;
|
|
5708
5735
|
}
|
|
5709
|
-
A.fillText(JA,
|
|
5710
|
-
}), D && !
|
|
5736
|
+
A.fillText(JA, l, gA), iA = A.measureText(JA).width, RA < V.length - 1 && (gA += u, iA = 0);
|
|
5737
|
+
}), D && !wA && Math.floor(performance.now() / 500) % 2 === 0 && A.fillRect(l + iA, gA, 1.5, q);
|
|
5711
5738
|
} else {
|
|
5712
|
-
const
|
|
5713
|
-
let
|
|
5714
|
-
if (
|
|
5715
|
-
const
|
|
5716
|
-
A.fillRect(
|
|
5739
|
+
const gA = A.measureText(O).width;
|
|
5740
|
+
let u = 0;
|
|
5741
|
+
if (gA > e && (u = gA - e), A.fillText(O, l - u, 0), D && !wA && Math.floor(performance.now() / 500) % 2 === 0) {
|
|
5742
|
+
const sA = l + gA - u;
|
|
5743
|
+
A.fillRect(sA, -(q / 2), 1.5, q);
|
|
5717
5744
|
}
|
|
5718
5745
|
}
|
|
5719
5746
|
if (A.restore(), G.visible !== !1) {
|
|
5720
|
-
const
|
|
5721
|
-
A.font = `600 ${
|
|
5722
|
-
const
|
|
5723
|
-
A.fillText(
|
|
5747
|
+
const V = G.text || "Label", gA = G.fontSize || 12, u = G.color || "rgba(156, 163, 175, 1)", iA = G.offset ?? 8;
|
|
5748
|
+
A.font = `600 ${gA}px "${b}", sans-serif`, A.fillStyle = u, A.textAlign = "left", A.textBaseline = "bottom";
|
|
5749
|
+
const sA = -(Q / 2), RA = -(B / 2) - iA;
|
|
5750
|
+
A.fillText(V, sA, RA);
|
|
5724
5751
|
}
|
|
5725
|
-
if (
|
|
5726
|
-
const
|
|
5727
|
-
A.font = `400 ${
|
|
5728
|
-
const
|
|
5729
|
-
A.fillText(
|
|
5752
|
+
if (s.visible === !0) {
|
|
5753
|
+
const V = s.text || "Helper text", gA = s.fontSize || 11, u = h === "error" ? "rgba(239, 68, 68, 1)" : s.color || "rgba(156, 163, 175, 1)", iA = s.offset ?? 6;
|
|
5754
|
+
A.font = `400 ${gA}px "${b}", sans-serif`, A.fillStyle = u, A.textAlign = "left", A.textBaseline = "top";
|
|
5755
|
+
const sA = -(Q / 2), RA = B / 2 + iA;
|
|
5756
|
+
A.fillText(V, sA, RA);
|
|
5730
5757
|
}
|
|
5731
5758
|
}
|
|
5732
5759
|
renderSlider(A, I) {
|
|
5733
|
-
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, D = Q.value ?? 50,
|
|
5734
|
-
if ((
|
|
5760
|
+
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, D = Q.value ?? 50, w = Q.min ?? 0, h = (Q.max ?? 100) - w, G = h === 0 ? 0 : (D - w) / h, s = Q.trackHeight || 4, a = Q.trackRoundedness ?? 2, M = Q.trackShape ?? "Rectangle", y = Q.trackPath || "", J = Q.activeColor || "#3b82f6", S = Q.inactiveColor || "#374151", F = Q.thumbShape || "Ellipse", U = Q.thumbWidth ?? 16, R = Q.thumbHeight ?? 16, c = Q.thumbRoundedness ?? 0, r = Q.thumbColor || "#ffffff", n = Q.thumbPath || "", p = Q.thumbIcon || "", Z = Q.showValueTooltip ?? !1, H = Q.tooltipBgColor || "#333333", X = Q.tooltipColor || "#ffffff", QA = Q.tooltipOffsetX ?? 0, SA = Q.tooltipOffsetY ?? -25, wA = (Y, f, t, l, e, O, _) => {
|
|
5761
|
+
if ((Y === "Custom" || Y === "Icon") && _)
|
|
5735
5762
|
try {
|
|
5736
|
-
const
|
|
5737
|
-
if (A.save(), A.translate(
|
|
5738
|
-
const
|
|
5739
|
-
A.scale(
|
|
5763
|
+
const BA = new Path2D(_);
|
|
5764
|
+
if (A.save(), A.translate(f, t), Y === "Icon") {
|
|
5765
|
+
const V = Math.min(l, e) / 24;
|
|
5766
|
+
A.scale(V, V), A.translate(-12, -12);
|
|
5740
5767
|
}
|
|
5741
|
-
A.fill(
|
|
5768
|
+
A.fill(BA), A.restore();
|
|
5742
5769
|
return;
|
|
5743
|
-
} catch (
|
|
5744
|
-
console.error("Error drawing slider shape in engine:",
|
|
5770
|
+
} catch (BA) {
|
|
5771
|
+
console.error("Error drawing slider shape in engine:", BA);
|
|
5745
5772
|
}
|
|
5746
|
-
if (A.beginPath(),
|
|
5747
|
-
A.ellipse(
|
|
5748
|
-
else if (
|
|
5749
|
-
A.roundRect(
|
|
5750
|
-
else if (
|
|
5751
|
-
A.moveTo(
|
|
5752
|
-
else if (
|
|
5753
|
-
A.moveTo(
|
|
5754
|
-
else if (
|
|
5755
|
-
const
|
|
5756
|
-
for (let
|
|
5757
|
-
const
|
|
5758
|
-
A.lineTo(
|
|
5773
|
+
if (A.beginPath(), Y === "Ellipse")
|
|
5774
|
+
A.ellipse(f, t, l / 2, e / 2, 0, 0, Math.PI * 2);
|
|
5775
|
+
else if (Y === "Rectangle")
|
|
5776
|
+
A.roundRect(f - l / 2, t - e / 2, l, e, O);
|
|
5777
|
+
else if (Y === "Triangle")
|
|
5778
|
+
A.moveTo(f, t - e / 2), A.lineTo(f + l / 2, t + e / 2), A.lineTo(f - l / 2, t + e / 2), A.closePath();
|
|
5779
|
+
else if (Y === "Diamond")
|
|
5780
|
+
A.moveTo(f, t - e / 2), A.lineTo(f + l / 2, t), A.lineTo(f, t + e / 2), A.lineTo(f - l / 2, t), A.closePath();
|
|
5781
|
+
else if (Y === "Star") {
|
|
5782
|
+
const V = Math.min(l, e) / 2, gA = V / 2;
|
|
5783
|
+
for (let u = 0; u < 5 * 2; u++) {
|
|
5784
|
+
const iA = u % 2 === 0 ? V : gA, sA = u * Math.PI / 5 - Math.PI / 2;
|
|
5785
|
+
A.lineTo(f + iA * Math.cos(sA), t + iA * Math.sin(sA));
|
|
5759
5786
|
}
|
|
5760
5787
|
A.closePath();
|
|
5761
|
-
} else
|
|
5788
|
+
} else Y === "Line" && (A.moveTo(f - l / 2, t), A.lineTo(f + l / 2, t));
|
|
5762
5789
|
A.fill();
|
|
5763
5790
|
};
|
|
5764
|
-
A.fillStyle =
|
|
5765
|
-
const
|
|
5766
|
-
if (
|
|
5767
|
-
A.save(), A.translate(
|
|
5768
|
-
const
|
|
5791
|
+
A.fillStyle = S, M === "Line" ? (A.strokeStyle = S, A.lineWidth = s, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(B / 2, 0), A.stroke()) : wA(M, 0, 0, B, s, a, y);
|
|
5792
|
+
const v = B * G, x = -B / 2 + v;
|
|
5793
|
+
if (v > 0 && (A.fillStyle = J, M === "Line" ? (A.strokeStyle = J, A.lineWidth = s, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(x, 0), A.stroke()) : M === "Rectangle" && (A.beginPath(), A.roundRect(-B / 2, -s / 2, v, s, a), A.fill())), A.save(), A.translate(x, 0), A.shadowColor = "rgba(0,0,0,0.2)", A.shadowBlur = 4, A.shadowOffsetY = 1, A.fillStyle = r, wA(F, 0, 0, U, R, c, F === "Icon" ? p : n), A.restore(), Z) {
|
|
5794
|
+
A.save(), A.translate(x + QA, SA);
|
|
5795
|
+
const Y = Math.round(D).toString();
|
|
5769
5796
|
A.font = "10px Inter, sans-serif";
|
|
5770
|
-
const
|
|
5771
|
-
A.beginPath(), A.roundRect(-
|
|
5797
|
+
const f = A.measureText(Y), t = 6, l = 4, e = f.width + t * 2, O = 14 + l;
|
|
5798
|
+
A.beginPath(), A.roundRect(-e / 2, -O / 2, e, O, 4), A.fillStyle = H, A.fill(), A.fillStyle = X, A.textAlign = "center", A.textBaseline = "middle", A.fillText(Y, 0, 0), A.restore();
|
|
5772
5799
|
}
|
|
5773
|
-
const
|
|
5774
|
-
if (
|
|
5775
|
-
const
|
|
5776
|
-
A.font = `600 ${
|
|
5777
|
-
const
|
|
5778
|
-
A.fillText(
|
|
5800
|
+
const q = Q.label || {}, b = Q.helperText || {}, T = Q.fontFamily || "Inter";
|
|
5801
|
+
if (q.visible !== !1) {
|
|
5802
|
+
const Y = q.text || "Label", f = q.fontSize || 12, t = q.color || "rgba(156, 163, 175, 1)", l = q.offset ?? 8;
|
|
5803
|
+
A.font = `600 ${f}px "${T}", sans-serif`, A.fillStyle = t, A.textAlign = "left", A.textBaseline = "bottom";
|
|
5804
|
+
const e = -(B / 2), O = -(s / 2) - l;
|
|
5805
|
+
A.fillText(Y, e, O);
|
|
5779
5806
|
}
|
|
5780
|
-
if (
|
|
5781
|
-
const
|
|
5782
|
-
A.font = `400 ${
|
|
5783
|
-
const
|
|
5784
|
-
A.fillText(
|
|
5807
|
+
if (b.visible === !0) {
|
|
5808
|
+
const Y = b.text || "Helper text", f = b.fontSize || 11, t = b.color || "rgba(156, 163, 175, 1)", l = b.offset ?? 6;
|
|
5809
|
+
A.font = `400 ${f}px "${T}", sans-serif`, A.fillStyle = t, A.textAlign = "left", A.textBaseline = "top";
|
|
5810
|
+
const e = -(B / 2), O = s / 2 + l;
|
|
5811
|
+
A.fillText(Y, e, O);
|
|
5785
5812
|
}
|
|
5786
5813
|
}
|
|
5787
5814
|
renderDropdown(A, I) {
|
|
5815
|
+
var wA;
|
|
5788
5816
|
const C = this.objectStates.get(I.id);
|
|
5789
5817
|
if (!C) return;
|
|
5790
|
-
const g = C.options || I.options || {}, Q = I.geometry.width || 160, B = I.geometry.height || 40, D = -Q / 2,
|
|
5791
|
-
let a = g.backgroundColor
|
|
5792
|
-
|
|
5793
|
-
const J =
|
|
5794
|
-
|
|
5818
|
+
const g = C.options || I.options || {}, Q = I.geometry.width || 160, B = I.geometry.height || 40, D = -Q / 2, w = -B / 2, o = g.cornerRadius ?? 6, h = g.disabled || g.previewState === "disabled", G = this.lastHoveredObjectId === I.id || g.previewState === "hover", s = (g.isOpen || g.previewState === "active") && !h;
|
|
5819
|
+
let a = g.backgroundColor, M = g.borderColor, y = g.color || "#333333";
|
|
5820
|
+
h ? (a = g.disabledBackgroundColor || "#f3f4f6", M = g.disabledBorderColor || "#e5e7eb", y = g.disabledColor || "#9ca3af") : s ? (a = g.activeBackgroundColor || a, M = g.activeBorderColor || M, y = g.activeColor || y) : G && (a = g.hoverBackgroundColor || a, M = g.hoverBorderColor || M, y = g.hoverColor || y), a || (a = "#ffffff"), M || (M = "#e5e7eb");
|
|
5821
|
+
const J = A.globalAlpha;
|
|
5822
|
+
A.globalAlpha = J * (g.opacity ?? 1), A.beginPath();
|
|
5823
|
+
const S = (v, x, q, b, T, Y) => {
|
|
5824
|
+
b < 0 && (b = 0), T < 0 && (T = 0), Y = Math.min(Y, Math.min(b, T) / 2), v.moveTo(x + Y, q), v.lineTo(x + b - Y, q), v.arcTo(x + b, q, x + b, q + Y, Y), v.lineTo(x + b, q + T - Y), v.arcTo(x + b, q + T, x + b - Y, q + T, Y), v.lineTo(x + Y, q + T), v.arcTo(x, q + T, x, q + T - Y, Y), v.lineTo(x, q + Y), v.arcTo(x, q, x + Y, q, Y), v.closePath();
|
|
5795
5825
|
};
|
|
5796
|
-
|
|
5797
|
-
const
|
|
5798
|
-
|
|
5799
|
-
const
|
|
5826
|
+
S(A, D, w, Q, B, o), A.fillStyle = this.createCanvasFill(A, typeof a == "string" ? { type: "Solid", color: a } : a, Q, B) || "#ffffff", A.fill();
|
|
5827
|
+
const F = g.borderWidth ?? 1;
|
|
5828
|
+
F > 0 && (A.strokeStyle = this.createCanvasFill(A, typeof M == "string" ? { type: "Solid", color: M } : M, Q, B) || "#e5e7eb", A.lineWidth = F, A.stroke());
|
|
5829
|
+
const U = 12, R = g.chevronType || "chevron", c = g.chevronSize || 16, r = (s ? g.openIconColor : g.closedIconColor) || g.chevronColor || "#6b7280";
|
|
5800
5830
|
if (R !== "none") {
|
|
5801
|
-
const v = D + Q -
|
|
5831
|
+
const v = D + Q - U - c / 2;
|
|
5802
5832
|
A.save(), A.translate(v, 0);
|
|
5803
|
-
const
|
|
5804
|
-
if (A.rotate(
|
|
5805
|
-
A.beginPath(), A.moveTo(-
|
|
5833
|
+
const x = s ? g.openIconAngle ?? 180 : g.closedIconAngle ?? 0;
|
|
5834
|
+
if (A.rotate(x * Math.PI / 180), A.strokeStyle = r, A.fillStyle = r, A.lineWidth = 1.5, A.lineCap = "round", A.lineJoin = "round", R === "chevron")
|
|
5835
|
+
A.beginPath(), A.moveTo(-c / 2, -c * 0.2), A.lineTo(0, c * 0.2), A.lineTo(c / 2, -c * 0.2), A.stroke();
|
|
5806
5836
|
else if (R === "custom" || R === "path") {
|
|
5807
|
-
const
|
|
5808
|
-
if (
|
|
5809
|
-
const
|
|
5837
|
+
const q = s && g.openIconPath || g.closedIconPath;
|
|
5838
|
+
if (q) {
|
|
5839
|
+
const b = new Path2D(q);
|
|
5810
5840
|
A.save();
|
|
5811
|
-
const
|
|
5812
|
-
A.scale(
|
|
5841
|
+
const T = c / 24;
|
|
5842
|
+
A.scale(T, T), A.translate(-12, -12), A.fill(b), A.restore();
|
|
5813
5843
|
}
|
|
5814
5844
|
}
|
|
5815
5845
|
A.restore();
|
|
5816
5846
|
}
|
|
5817
|
-
const
|
|
5818
|
-
A.font = `${
|
|
5819
|
-
const
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
const
|
|
5824
|
-
|
|
5825
|
-
const
|
|
5826
|
-
A.
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5847
|
+
const n = g.selectedOption || g.placeholder || "Select...", p = g.fontSize || 14, Z = g.fontWeight || 400, H = g.fontFamily || "Inter, sans-serif";
|
|
5848
|
+
A.font = `${Z} ${p}px ${H}`;
|
|
5849
|
+
const X = h ? g.disabledColor || "#9ca3af" : !g.selectedOption && g.placeholder ? "#9ca3af" : y;
|
|
5850
|
+
A.fillStyle = this.createCanvasFill(A, typeof X == "string" ? { type: "Solid", color: X } : X, Q, B) || "#333333", A.textAlign = "left", A.textBaseline = "middle";
|
|
5851
|
+
const QA = R === "none" ? 0 : c + 8, SA = Q - U * 2 - QA;
|
|
5852
|
+
if (A.save(), A.beginPath(), A.rect(D + U, w, SA, B), A.clip(), A.fillText(n, D + U, 0), A.restore(), s && !h) {
|
|
5853
|
+
const v = w + B + 4, x = g.optionsList || [], q = g.itemHeight || 32, b = g.listPadding ?? 4, T = x.length * q + b * 2, Y = g.listCornerRadius ?? o;
|
|
5854
|
+
A.save();
|
|
5855
|
+
const f = g.listShadow || {};
|
|
5856
|
+
A.shadowColor = typeof f.color == "string" ? f.color : ((wA = f.color) == null ? void 0 : wA.color) || "rgba(0,0,0,0.15)", A.shadowBlur = f.blur ?? 12, A.shadowOffsetY = f.offsetY ?? 6, A.beginPath(), S(A, D, v, Q, T, Y), A.fillStyle = this.createCanvasFill(A, typeof g.listBackgroundColor == "string" ? { type: "Solid", color: g.listBackgroundColor } : g.listBackgroundColor || { type: "Solid", color: "#ffffff" }, Q, T) || "#ffffff", A.fill();
|
|
5857
|
+
const t = g.listBorderWidth ?? 1;
|
|
5858
|
+
t > 0 && (A.shadowColor = "transparent", A.strokeStyle = this.createCanvasFill(A, typeof g.listBorderColor == "string" ? { type: "Solid", color: g.listBorderColor } : g.listBorderColor || { type: "Solid", color: M }, Q, T) || "#e5e7eb", A.lineWidth = t, A.stroke()), A.restore();
|
|
5859
|
+
const l = g.itemFontSize || p, e = g.itemFontFamily || H;
|
|
5860
|
+
A.font = `${Z} ${l}px ${e}`, x.forEach((O, _) => {
|
|
5861
|
+
const BA = v + b + _ * q;
|
|
5862
|
+
if (O === g.selectedOption)
|
|
5863
|
+
A.fillStyle = this.createCanvasFill(A, typeof g.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: g.itemSelectedBackgroundColor } : g.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, Q, q) || "#f3f4f6", A.fillRect(D + t, BA, Q - t * 2, q), A.fillStyle = g.itemSelectedColor || g.activeColor || y || "#374151";
|
|
5830
5864
|
else if (A.fillStyle = g.listTextColor || y || "#333333", this.activeDropdownId === I.id && this._lastPointerPos) {
|
|
5831
|
-
const
|
|
5832
|
-
|
|
5833
|
-
const z = this._lastPointerPos.y - (O.y + B / 2 + 4 + f), oA = Math.floor(z / e);
|
|
5834
|
-
t === oA && (A.fillStyle = g.itemHoverBackgroundColor || g.listHoverColor || "#f9fafb", A.fillRect(D + u, H, Q - u * 2, e), A.fillStyle = g.itemHoverColor || y);
|
|
5835
|
-
}
|
|
5865
|
+
const gA = this._lastPointerPos.y - (v + b), u = Math.floor(gA / q);
|
|
5866
|
+
_ === u && (A.fillStyle = this.createCanvasFill(A, typeof g.itemHoverBackgroundColor == "string" ? { type: "Solid", color: g.itemHoverBackgroundColor } : g.itemHoverBackgroundColor || { type: "Solid", color: "#f9fafb" }, Q, q) || "#f9fafb", A.fillRect(D + t, BA, Q - t * 2, q), A.fillStyle = g.itemHoverColor || y);
|
|
5836
5867
|
}
|
|
5837
|
-
A.fillText(
|
|
5868
|
+
A.fillText(O, D + U, BA + q / 2);
|
|
5838
5869
|
});
|
|
5839
5870
|
}
|
|
5871
|
+
A.globalAlpha = J;
|
|
5840
5872
|
}
|
|
5841
5873
|
renderButton(A, I) {
|
|
5842
|
-
var
|
|
5843
|
-
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((
|
|
5844
|
-
A.save(), A.beginPath(), G === "Rectangle" ? A.roundRect(D,
|
|
5845
|
-
const J = a.fontSize || 14,
|
|
5846
|
-
A.font = `${a.fontWeight || 400} ${J}px "${
|
|
5874
|
+
var U, R, c, r;
|
|
5875
|
+
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) || 120, B = ((R = I.geometry) == null ? void 0 : R.height) || 40, D = -Q / 2, w = -B / 2, o = this.lastHoveredObjectId === I.id, h = g.cornerRadius ?? 8, G = g.bgShape || "Rectangle", s = o ? ((c = g.hoverStyle) == null ? void 0 : c.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6", a = g.label || {}, M = o ? ((r = g.hoverStyle) == null ? void 0 : r.textColor) || a.color || "#ffffff" : a.color || "#ffffff", y = g.icon || { enabled: !1 };
|
|
5876
|
+
A.save(), A.beginPath(), G === "Rectangle" ? A.roundRect(D, w, Q, B, h) : G === "Ellipse" || G === "Circle" ? A.ellipse(0, 0, Q / 2, B / 2, 0, 0, Math.PI * 2) : G === "Pill" && A.roundRect(D, w, Q, B, B / 2), A.fillStyle = s, A.fill();
|
|
5877
|
+
const J = a.fontSize || 14, S = a.fontFamily || "Inter";
|
|
5878
|
+
A.font = `${a.fontWeight || 400} ${J}px "${S}", sans-serif`, A.fillStyle = M, A.textAlign = "center", A.textBaseline = "middle";
|
|
5847
5879
|
let F = 0;
|
|
5848
5880
|
if (y.enabled && y.svgPath) {
|
|
5849
|
-
const
|
|
5881
|
+
const n = y.size || 16, p = y.gap || 8, Z = y.position === "left" ? -(A.measureText(a.text || "").width / 2 + n / 2 + p / 2) : A.measureText(a.text || "").width / 2 + n / 2 + p / 2;
|
|
5850
5882
|
A.save(), A.translate(Z, 0);
|
|
5851
|
-
const
|
|
5852
|
-
A.scale(
|
|
5883
|
+
const H = new Path2D(y.svgPath), X = n / 24;
|
|
5884
|
+
A.scale(X, X), A.translate(-12, -12), A.fillStyle = y.color || M, A.fill(H), A.restore(), F = y.position === "left" ? n / 2 + p / 2 : -(n / 2 + p / 2);
|
|
5853
5885
|
}
|
|
5854
5886
|
A.fillText(a.text || "Button", F, 0), A.restore();
|
|
5855
5887
|
}
|
|
5856
5888
|
renderToggleButton(A, I) {
|
|
5857
|
-
var J,
|
|
5858
|
-
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = g.checked ?? !1, B = ((J = I.geometry) == null ? void 0 : J.width) || 120, D = ((
|
|
5859
|
-
A.save(), A.beginPath(), A.roundRect(
|
|
5889
|
+
var J, S;
|
|
5890
|
+
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = g.checked ?? !1, B = ((J = I.geometry) == null ? void 0 : J.width) || 120, D = ((S = I.geometry) == null ? void 0 : S.height) || 40, w = -B / 2, o = -D / 2, h = g.cornerRadius ?? 8, G = g.label || {}, s = Q ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151", a = Q ? g.activeTextColor || "#ffffff" : g.inactiveTextColor || "#9ca3af";
|
|
5891
|
+
A.save(), A.beginPath(), A.roundRect(w, o, B, D, h), A.fillStyle = s, A.fill();
|
|
5860
5892
|
const M = G.fontSize || 14, y = G.fontFamily || "Inter";
|
|
5861
5893
|
A.font = `${G.fontWeight || 600} ${M}px "${y}", sans-serif`, A.fillStyle = a, A.textAlign = "center", A.textBaseline = "middle", A.fillText(G.text || "Toggle", 0, 0), A.restore();
|
|
5862
5894
|
}
|
|
5863
5895
|
renderToggle(A, I) {
|
|
5864
|
-
var F,
|
|
5865
|
-
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((F = I.geometry) == null ? void 0 : F.width) || 52, B = ((
|
|
5866
|
-
A.beginPath(), A.roundRect(D,
|
|
5867
|
-
const G = 3,
|
|
5868
|
-
if (A.beginPath(), A.arc(J + a,
|
|
5869
|
-
const
|
|
5870
|
-
A.font = `${
|
|
5871
|
-
const
|
|
5872
|
-
let Z = 0,
|
|
5873
|
-
|
|
5896
|
+
var F, U;
|
|
5897
|
+
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((F = I.geometry) == null ? void 0 : F.width) || 52, B = ((U = I.geometry) == null ? void 0 : U.height) || 30, D = -Q / 2, w = -B / 2, o = g.checked ?? !1, h = g.cornerRadius ?? B / 2;
|
|
5898
|
+
A.beginPath(), A.roundRect(D, w, Q, B, h), A.fillStyle = o ? g.activeColor || "#10b981" : g.inactiveColor || "#374151", g.disabled && (A.globalAlpha *= 0.5), A.fill();
|
|
5899
|
+
const G = 3, s = B - G * 2, a = s / 2, M = D + G, y = D + Q - G - s, J = o ? y : M, S = w + G;
|
|
5900
|
+
if (A.beginPath(), A.arc(J + a, S + a, a, 0, Math.PI * 2), A.fillStyle = g.knobColor || "#ffffff", A.fill(), g.disabled && (A.globalAlpha *= 2), g.label && g.label.text) {
|
|
5901
|
+
const R = g.label, c = R.fontSize || 14, r = R.fontWeight || 400, n = R.fontFamily || "Inter";
|
|
5902
|
+
A.font = `${r} ${c}px "${n}", sans-serif`, A.fillStyle = R.color || "#f3f4f6", A.textBaseline = "middle";
|
|
5903
|
+
const p = R.gap || 10;
|
|
5904
|
+
let Z = 0, H = 0;
|
|
5905
|
+
R.position === "left" ? (A.textAlign = "right", Z = D - p, H = 0) : R.position === "right" ? (A.textAlign = "left", Z = D + Q + p, H = 0) : R.position === "top" ? (A.textAlign = "center", Z = 0, H = w - p, A.textBaseline = "bottom") : R.position === "bottom" ? (A.textAlign = "center", Z = 0, H = w + B + p, A.textBaseline = "top") : (A.textAlign = "left", Z = D + Q + p, H = 0), A.fillText(R.text, Z, H);
|
|
5874
5906
|
}
|
|
5875
5907
|
}
|
|
5876
5908
|
renderLineGraph(A, I, C, g) {
|
|
@@ -5893,31 +5925,31 @@ class WC {
|
|
|
5893
5925
|
A.save(), A.fillStyle = "#6366f1", A.font = "12px Inter, system-ui, sans-serif", A.textAlign = "center", A.textBaseline = "middle", A.fillText("NO DATA", 0, 0), A.restore();
|
|
5894
5926
|
return;
|
|
5895
5927
|
}
|
|
5896
|
-
let B = 1 / 0, D = -1 / 0,
|
|
5928
|
+
let B = 1 / 0, D = -1 / 0, w = 0;
|
|
5897
5929
|
if (Q.forEach((y) => {
|
|
5898
5930
|
let J = y.data;
|
|
5899
5931
|
if (y.isVarEnabled && y.inputId) {
|
|
5900
|
-
let
|
|
5901
|
-
if (
|
|
5932
|
+
let S = this.inputs.get(y.inputId);
|
|
5933
|
+
if (S === void 0) {
|
|
5902
5934
|
const F = this.inputNameMap.get(y.inputId);
|
|
5903
|
-
F && F.length > 0 && (
|
|
5935
|
+
F && F.length > 0 && (S = this.inputs.get(F[0]));
|
|
5904
5936
|
}
|
|
5905
|
-
|
|
5937
|
+
S && Array.isArray(S) && (J = S);
|
|
5906
5938
|
}
|
|
5907
5939
|
if (J && J.length > 0) {
|
|
5908
|
-
const
|
|
5909
|
-
|
|
5940
|
+
const S = J.filter((F) => typeof F == "number" && !isNaN(F));
|
|
5941
|
+
S.length > 0 && (B = Math.min(B, ...S), D = Math.max(D, ...S), w = Math.max(w, J.length));
|
|
5910
5942
|
}
|
|
5911
5943
|
y._resolvedData = J;
|
|
5912
|
-
}),
|
|
5913
|
-
const
|
|
5914
|
-
const J =
|
|
5944
|
+
}), w < 2) return;
|
|
5945
|
+
const o = D - B, h = C / (w - 1), G = (y) => {
|
|
5946
|
+
const J = o === 0 ? 0.5 : (y - B) / o;
|
|
5915
5947
|
return g / 2 - J * g;
|
|
5916
|
-
},
|
|
5948
|
+
}, s = (y) => y * h - C / 2, a = I.axisColor || "#333333";
|
|
5917
5949
|
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) {
|
|
5918
5950
|
A.textAlign = "center", A.textBaseline = "top";
|
|
5919
|
-
for (let y = 0; y <
|
|
5920
|
-
const J =
|
|
5951
|
+
for (let y = 0; y < w; y++) {
|
|
5952
|
+
const J = s(y);
|
|
5921
5953
|
A.fillText(`${y + 1}`, J, g / 2 + 5);
|
|
5922
5954
|
}
|
|
5923
5955
|
}
|
|
@@ -5931,73 +5963,73 @@ class WC {
|
|
|
5931
5963
|
const J = y._resolvedData;
|
|
5932
5964
|
if (!(!J || J.length < 2)) {
|
|
5933
5965
|
if (y.showArea) {
|
|
5934
|
-
if (A.beginPath(), A.moveTo(
|
|
5966
|
+
if (A.beginPath(), A.moveTo(s(0), g / 2), A.lineTo(s(0), G(J[0])), y.smoothing && J.length > 2)
|
|
5935
5967
|
for (let F = 0; F < J.length - 1; F++) {
|
|
5936
|
-
const
|
|
5937
|
-
for (let
|
|
5938
|
-
const
|
|
5939
|
-
A.lineTo(
|
|
5968
|
+
const U = J[F === 0 ? F : F - 1], R = J[F], c = J[F + 1], r = J[F + 1 === J.length - 1 ? F + 1 : F + 2];
|
|
5969
|
+
for (let n = 1; n <= M; n++) {
|
|
5970
|
+
const p = n / M, Z = this._catmullRom(U, R, c, r, p);
|
|
5971
|
+
A.lineTo(s(F + p), G(Z));
|
|
5940
5972
|
}
|
|
5941
5973
|
}
|
|
5942
5974
|
else
|
|
5943
5975
|
for (let F = 1; F < J.length; F++)
|
|
5944
|
-
A.lineTo(
|
|
5945
|
-
A.lineTo(
|
|
5946
|
-
const
|
|
5947
|
-
A.globalAlpha =
|
|
5976
|
+
A.lineTo(s(F), G(J[F]));
|
|
5977
|
+
A.lineTo(s(J.length - 1), g / 2), A.closePath();
|
|
5978
|
+
const S = A.globalAlpha;
|
|
5979
|
+
A.globalAlpha = S * (I.areaOpacity ?? 0.3), A.fillStyle = y.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = S;
|
|
5948
5980
|
}
|
|
5949
|
-
if (A.beginPath(), A.strokeStyle = y.lineColor || "#3b82f6", A.lineWidth = y.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(
|
|
5950
|
-
for (let
|
|
5951
|
-
const F = J[
|
|
5952
|
-
for (let
|
|
5953
|
-
const
|
|
5954
|
-
A.lineTo(
|
|
5981
|
+
if (A.beginPath(), A.strokeStyle = y.lineColor || "#3b82f6", A.lineWidth = y.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(s(0), G(J[0])), y.smoothing && J.length > 2)
|
|
5982
|
+
for (let S = 0; S < J.length - 1; S++) {
|
|
5983
|
+
const F = J[S === 0 ? S : S - 1], U = J[S], R = J[S + 1], c = J[S + 1 === J.length - 1 ? S + 1 : S + 2];
|
|
5984
|
+
for (let r = 1; r <= M; r++) {
|
|
5985
|
+
const n = r / M, p = this._catmullRom(F, U, R, c, n);
|
|
5986
|
+
A.lineTo(s(S + n), G(p));
|
|
5955
5987
|
}
|
|
5956
5988
|
}
|
|
5957
5989
|
else
|
|
5958
|
-
for (let
|
|
5959
|
-
A.lineTo(
|
|
5960
|
-
A.stroke(), y.showPoints && J.forEach((
|
|
5961
|
-
const
|
|
5962
|
-
A.beginPath(), A.arc(
|
|
5990
|
+
for (let S = 1; S < J.length; S++)
|
|
5991
|
+
A.lineTo(s(S), G(J[S]));
|
|
5992
|
+
A.stroke(), y.showPoints && J.forEach((S, F) => {
|
|
5993
|
+
const U = s(F), R = G(S);
|
|
5994
|
+
A.beginPath(), A.arc(U, R, (y.pointSize || 6) / 2, 0, Math.PI * 2), A.fillStyle = y.pointFill || "#ffffff", A.fill(), A.strokeStyle = y.pointStrokeColor || y.lineColor || "#3b82f6", A.lineWidth = y.pointStrokeWidth || 1, A.stroke();
|
|
5963
5995
|
});
|
|
5964
5996
|
}
|
|
5965
5997
|
}), I.showLegend && Q.length > 0) {
|
|
5966
5998
|
const y = C / 2 - 10;
|
|
5967
5999
|
let J = -g / 2 + 15;
|
|
5968
|
-
const
|
|
5969
|
-
A.font = `${
|
|
5970
|
-
const c =
|
|
5971
|
-
A.beginPath(), A.rect(y -
|
|
6000
|
+
const S = I.legendFontSize || 10, F = S + 5;
|
|
6001
|
+
A.font = `${S}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", Q.forEach((U) => {
|
|
6002
|
+
const c = U.label || "Series", r = A.measureText(c).width;
|
|
6003
|
+
A.beginPath(), A.rect(y - r - 8 - 5, J - (8 / 2 + 2), 8, 8), A.fillStyle = U.lineColor || "#3b82f6", A.fill(), A.fillStyle = I.legendColor || "#333333", A.fillText(c, y, J), J += F;
|
|
5972
6004
|
});
|
|
5973
6005
|
}
|
|
5974
6006
|
}
|
|
5975
6007
|
_catmullRom(A, I, C, g, Q) {
|
|
5976
|
-
const B = (C - A) * 0.5, D = (g - I) * 0.5,
|
|
5977
|
-
return (2 * I - 2 * C + B + D) *
|
|
6008
|
+
const B = (C - A) * 0.5, D = (g - I) * 0.5, w = Q * Q, o = Q * w;
|
|
6009
|
+
return (2 * I - 2 * C + B + D) * o + (-3 * I + 3 * C - 2 * B - D) * w + B * Q + I;
|
|
5978
6010
|
}
|
|
5979
6011
|
createCanvasFill(A, I, C, g) {
|
|
5980
|
-
var Q, B, D,
|
|
6012
|
+
var Q, B, D, w, o, h;
|
|
5981
6013
|
if (!I || I.type === "None") return null;
|
|
5982
6014
|
if (I.type === "Solid")
|
|
5983
6015
|
return I.color;
|
|
5984
6016
|
if (I.type === "LinearGradient" && I.stops) {
|
|
5985
|
-
const G = (((Q = I.start) == null ? void 0 : Q[0]) ?? 0) * C - C / 2,
|
|
6017
|
+
const G = (((Q = I.start) == null ? void 0 : Q[0]) ?? 0) * C - C / 2, s = (((B = I.start) == null ? void 0 : B[1]) ?? 0) * g - g / 2, a = (((D = I.end) == null ? void 0 : D[0]) ?? 1) * C - C / 2, M = (((w = I.end) == null ? void 0 : w[1]) ?? 0) * g - g / 2, y = A.createLinearGradient(G, s, a, M);
|
|
5986
6018
|
return I.stops.forEach((J) => y.addColorStop(J.offset, J.color)), y;
|
|
5987
6019
|
}
|
|
5988
6020
|
if (I.type === "RadialGradient" && I.stops) {
|
|
5989
|
-
const G = (((
|
|
6021
|
+
const G = (((o = I.center) == null ? void 0 : o[0]) ?? 0.5) * C - C / 2, s = (((h = I.center) == null ? void 0 : h[1]) ?? 0.5) * g - g / 2, a = (I.radius ?? 0.5) * Math.max(C, g), M = A.createRadialGradient(G, s, 0, G, s, a);
|
|
5990
6022
|
return I.stops.forEach((y) => M.addColorStop(y.offset, y.color)), M;
|
|
5991
6023
|
}
|
|
5992
6024
|
if (I.type === "Pattern" && I.url) {
|
|
5993
6025
|
let G = this.imageCache.get(I.url);
|
|
5994
6026
|
if (G || (G = new Image(), G.src = I.url, this.imageCache.set(I.url, G)), G.complete && G.naturalWidth > 0) {
|
|
5995
|
-
const
|
|
5996
|
-
if (
|
|
5997
|
-
const a = new DOMMatrix(), M = I.scaleX ?? 1, y = I.scaleY ?? 1, J = I.offsetX ?? 0,
|
|
5998
|
-
a.translateSelf(J,
|
|
6027
|
+
const s = A.createPattern(G, "repeat");
|
|
6028
|
+
if (s && (I.scaleX !== void 0 || I.offsetX !== void 0)) {
|
|
6029
|
+
const a = new DOMMatrix(), M = I.scaleX ?? 1, y = I.scaleY ?? 1, J = I.offsetX ?? 0, S = I.offsetY ?? 0, F = I.rotation ?? 0;
|
|
6030
|
+
a.translateSelf(J, S), a.rotateSelf(F), a.scaleSelf(M, y), s.setTransform(a);
|
|
5999
6031
|
}
|
|
6000
|
-
return
|
|
6032
|
+
return s;
|
|
6001
6033
|
}
|
|
6002
6034
|
}
|
|
6003
6035
|
return I.color || null;
|
|
@@ -6010,53 +6042,64 @@ class WC {
|
|
|
6010
6042
|
} catch {
|
|
6011
6043
|
D = parseFloat(D) || 0;
|
|
6012
6044
|
}
|
|
6013
|
-
let
|
|
6014
|
-
typeof D == "number" ?
|
|
6015
|
-
const
|
|
6016
|
-
A.moveTo(I + h, C), A.lineTo(I + g - G, C), G > 0 ? A.arcTo(I + g, C, I + g, C + G, G) : A.lineTo(I + g, C), A.lineTo(I + g, C + Q -
|
|
6045
|
+
let w = [0, 0, 0, 0];
|
|
6046
|
+
typeof D == "number" ? w = [D, D, D, D] : Array.isArray(D) && (D.length === 1 ? w = [D[0], D[0], D[0], D[0]] : D.length === 2 ? w = [D[0], D[1], D[0], D[1]] : D.length === 4 && (w = D));
|
|
6047
|
+
const o = Math.min(Math.abs(g) / 2, Math.abs(Q) / 2), h = Math.max(0, Math.min(Number(w[0]) || 0, o)), G = Math.max(0, Math.min(Number(w[1]) || 0, o)), s = Math.max(0, Math.min(Number(w[2]) || 0, o)), a = Math.max(0, Math.min(Number(w[3]) || 0, o));
|
|
6048
|
+
A.moveTo(I + h, C), A.lineTo(I + g - G, C), G > 0 ? A.arcTo(I + g, C, I + g, C + G, G) : A.lineTo(I + g, C), A.lineTo(I + g, C + Q - s), s > 0 ? A.arcTo(I + g, C + Q, I + g - s, C + Q, s) : A.lineTo(I + g, C + Q), A.lineTo(I + a, C + Q), a > 0 ? A.arcTo(I, C + Q, I, C + Q - a, a) : A.lineTo(I, C + Q), A.lineTo(I, C + h), h > 0 ? A.arcTo(I, C, I + h, C, h) : A.lineTo(I, C), A.closePath();
|
|
6017
6049
|
}
|
|
6018
6050
|
renderListView(A, I) {
|
|
6019
|
-
var v,
|
|
6020
|
-
const C = this.objectStates.get(I.id) || {}, g = C.options || I.options || {}, Q = C.width !== void 0 ? C.width : ((
|
|
6021
|
-
if (A.save(),
|
|
6022
|
-
const
|
|
6023
|
-
A.fillStyle =
|
|
6024
|
-
const
|
|
6025
|
-
|
|
6051
|
+
var wA, v, x, q;
|
|
6052
|
+
const C = this.objectStates.get(I.id) || {}, g = C.options || I.options || {}, Q = C.width !== void 0 ? C.width : ((wA = I.geometry) == null ? void 0 : wA.width) || 200, B = C.height !== void 0 ? C.height : ((v = I.geometry) == null ? void 0 : v.height) || 300, D = -Q / 2, w = -B / 2, o = C.cornerRadius !== void 0 ? C.cornerRadius : g.cornerRadius ?? 0, h = g.orientation || "vertical", G = g.items || [], s = g.itemGap ?? 10, a = g.itemHeight ?? 50, M = g.itemWidth ?? 200, y = g.scrollOffset ?? 0, J = g.padding ?? 0, S = g.glassEffect !== !1, F = g.accentColor || "#3b82f6", U = g.itemTextColor || "#333333", R = g.itemBackgroundColor || "#ffffff", c = g.hoveredIndex ?? null, r = g.activeItemIndex ?? null, n = g.glowIntensity ?? 0, p = g.glowColor || "#3b82f6", Z = typeof p == "string" ? p : p.color || ((q = (x = p.stops) == null ? void 0 : x[0]) == null ? void 0 : q.color) || "#3b82f6", H = g.opacity !== void 0 ? g.opacity : I.opacity !== void 0 ? I.opacity : 1;
|
|
6053
|
+
if (A.save(), A.globalAlpha *= H, n > 0 && (A.shadowColor = Z, A.shadowBlur = n * 2, A.shadowOffsetX = 0, A.shadowOffsetY = 0), S) {
|
|
6054
|
+
const b = g.listBackgroundColor || "rgba(31, 41, 55, 0.4)", T = this.createCanvasFill(A, b, Q, B);
|
|
6055
|
+
A.fillStyle = T || "rgba(31, 41, 55, 0.4)", this.drawListViewRect(A, D, w, Q, B, o), A.fill();
|
|
6056
|
+
const Y = A.createLinearGradient(D, w, D + Q, w + B);
|
|
6057
|
+
Y.addColorStop(0, "rgba(255, 255, 255, 0.15)"), Y.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), Y.addColorStop(1, "rgba(255, 255, 255, 0.03)"), A.fillStyle = Y, this.drawListViewRect(A, D, w, Q, B, o), A.fill(), A.strokeStyle = "rgba(255, 255, 255, 0.25)", A.lineWidth = 1, this.drawListViewRect(A, D, w, Q, B, o), A.stroke();
|
|
6026
6058
|
} else {
|
|
6027
|
-
const
|
|
6028
|
-
|
|
6059
|
+
const b = g.listBackgroundColor || "transparent", T = this.createCanvasFill(A, b, Q, B);
|
|
6060
|
+
T && (A.fillStyle = T, this.drawListViewRect(A, D, w, Q, B, o), A.fill());
|
|
6061
|
+
const Y = g.borderWidth ?? 0;
|
|
6062
|
+
Y > 0 && (A.strokeStyle = g.borderColor || "#cccccc", A.lineWidth = Y, this.drawListViewRect(A, D, w, Q, B, o), A.stroke());
|
|
6029
6063
|
}
|
|
6030
|
-
A.shadowBlur = 0, A.save(), this.drawListViewRect(A, D,
|
|
6031
|
-
const
|
|
6032
|
-
let
|
|
6033
|
-
if (A.textBaseline = "middle", G.forEach((
|
|
6034
|
-
const
|
|
6035
|
-
if (
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6064
|
+
A.shadowBlur = 0, A.save(), this.drawListViewRect(A, D, w, Q, B, o), A.clip();
|
|
6065
|
+
const X = typeof J == "number" ? J : h === "vertical" ? J[0] : J[3];
|
|
6066
|
+
let QA = (h === "vertical" ? w : D) + y + X;
|
|
6067
|
+
if (A.textBaseline = "middle", G.forEach((b, T) => {
|
|
6068
|
+
const Y = h === "vertical" ? Q : M, f = h === "vertical" ? a : B, t = h === "vertical" ? D : QA, l = h === "vertical" ? QA : w, e = c === T, O = r === T;
|
|
6069
|
+
if (O) {
|
|
6070
|
+
const u = this.createCanvasFill(A, F, Y, f);
|
|
6071
|
+
A.fillStyle = u || F;
|
|
6072
|
+
const iA = A.globalAlpha;
|
|
6073
|
+
A.globalAlpha = iA * 0.8, A.fillRect(t, l, Y, f), A.globalAlpha = iA;
|
|
6074
|
+
} else if (e)
|
|
6075
|
+
A.fillStyle = S ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", A.fillRect(t, l, Y, f);
|
|
6076
|
+
else if (R !== "transparent") {
|
|
6077
|
+
const u = this.createCanvasFill(A, R, Y, f);
|
|
6078
|
+
A.fillStyle = u || R, A.fillRect(t, l, Y, f);
|
|
6079
|
+
}
|
|
6080
|
+
if (O || e) {
|
|
6081
|
+
const u = this.createCanvasFill(A, F, h === "vertical" ? 3 : Y, h === "vertical" ? f : 3);
|
|
6082
|
+
A.fillStyle = u || F, h === "vertical" ? A.fillRect(t, l, 3, f) : A.fillRect(t, l + f - 3, Y, 3);
|
|
6083
|
+
}
|
|
6084
|
+
const _ = O ? "#ffffff" : S ? "rgba(255, 255, 255, 0.9)" : U;
|
|
6085
|
+
A.fillStyle = _, A.font = O || e ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
|
|
6086
|
+
const BA = typeof b == "string" ? b : b.label || `Item ${T + 1}`, V = t + (h === "vertical" ? 16 : Y / 2), gA = l + f / 2;
|
|
6087
|
+
h === "horizontal" ? A.textAlign = "center" : A.textAlign = "left", A.fillText(BA, V, gA), QA += (h === "vertical" ? a : M) + s;
|
|
6045
6088
|
}), A.restore(), g.showScrollbar !== !1) {
|
|
6046
|
-
const
|
|
6047
|
-
if (
|
|
6048
|
-
const
|
|
6049
|
-
A.fillStyle =
|
|
6089
|
+
const b = (G.length || 0) * (h === "vertical" ? a : M) + ((G.length || 0) - 1) * s, T = h === "vertical" ? B : Q;
|
|
6090
|
+
if (b > T) {
|
|
6091
|
+
const Y = T / b, f = T * Y, t = -y / b * T, l = g.scrollbarColor || "rgba(255,255,255,0.3)", e = g.scrollbarWidth || 4;
|
|
6092
|
+
A.fillStyle = l, h === "vertical" ? A.fillRect(D + Q - e - 2, w + t, e, f) : A.fillRect(D + t, w + B - e - 2, f, e);
|
|
6050
6093
|
}
|
|
6051
6094
|
}
|
|
6052
6095
|
A.restore();
|
|
6053
6096
|
}
|
|
6054
6097
|
updateListViewScrollFromPointer(A) {
|
|
6055
|
-
var J,
|
|
6098
|
+
var J, S;
|
|
6056
6099
|
if (!this._lastPointerPos || !this._prevPointerPos) return;
|
|
6057
6100
|
const I = A.options || {}, C = I.orientation || "vertical", g = this._lastPointerPos.x - this._prevPointerPos.x, Q = this._lastPointerPos.y - this._prevPointerPos.y;
|
|
6058
6101
|
C === "vertical" ? I.scrollOffset = (I.scrollOffset || 0) + Q : I.scrollOffset = (I.scrollOffset || 0) + g;
|
|
6059
|
-
const B = this.objectStates.get(A.id) || {}, D = I.items || [],
|
|
6102
|
+
const B = this.objectStates.get(A.id) || {}, D = I.items || [], w = I.itemGap ?? 10, o = I.itemHeight ?? 50, h = I.itemWidth ?? 200, G = B.width !== void 0 ? B.width : ((J = A.geometry) == null ? void 0 : J.width) || 200, s = B.height !== void 0 ? B.height : ((S = A.geometry) == null ? void 0 : S.height) || 300, a = (D.length || 0) * (C === "vertical" ? o : h) + ((D.length || 0) - 1) * w, y = Math.max(0, a - (C === "vertical" ? s : G) + (I.padding * 2 || 0));
|
|
6060
6103
|
I.scrollOffset > 0 && (I.scrollOffset = 0), I.scrollOffset < -y && (I.scrollOffset = -y);
|
|
6061
6104
|
}
|
|
6062
6105
|
updateListViewHoverFromPointer(A, I, C) {
|
|
@@ -6064,16 +6107,16 @@ class WC {
|
|
|
6064
6107
|
Q.hoveredIndex !== g && (Q.hoveredIndex = g);
|
|
6065
6108
|
}
|
|
6066
6109
|
getListViewItemIndexAtPointer(A, I, C) {
|
|
6067
|
-
var
|
|
6110
|
+
var X, QA;
|
|
6068
6111
|
const g = A.options || {}, Q = this.objectStates.get(A.id) || {}, B = g.items || [];
|
|
6069
6112
|
if (B.length === 0) return null;
|
|
6070
|
-
const D = Q.width !== void 0 ? Q.width : ((
|
|
6071
|
-
let
|
|
6072
|
-
for (let
|
|
6073
|
-
const
|
|
6074
|
-
if (c >=
|
|
6075
|
-
return
|
|
6076
|
-
|
|
6113
|
+
const D = Q.width !== void 0 ? Q.width : ((X = A.geometry) == null ? void 0 : X.width) || 200, w = Q.height !== void 0 ? Q.height : ((QA = A.geometry) == null ? void 0 : QA.height) || 300, o = g.orientation || "vertical", h = g.itemGap ?? 10, G = g.itemHeight ?? 50, s = g.itemWidth ?? 200, a = g.scrollOffset ?? 0, M = g.padding ?? 0, y = this.getWorldTransform(A.id), J = I - y.x, S = C - y.y, F = -y.rotation * (Math.PI / 180), U = Math.cos(F), R = Math.sin(F), c = J * U - S * R, r = J * R + S * U, n = -D / 2, p = -w / 2, Z = typeof M == "number" ? M : o === "vertical" ? M[0] : M[3];
|
|
6114
|
+
let H = (o === "vertical" ? p : n) + a + Z;
|
|
6115
|
+
for (let SA = 0; SA < B.length; SA++) {
|
|
6116
|
+
const wA = o === "vertical" ? D : s, v = o === "vertical" ? G : w, x = o === "vertical" ? n : H, q = o === "vertical" ? H : p;
|
|
6117
|
+
if (c >= x && c <= x + wA && r >= q && r <= q + v)
|
|
6118
|
+
return SA;
|
|
6119
|
+
H += (o === "vertical" ? G : s) + h;
|
|
6077
6120
|
}
|
|
6078
6121
|
return null;
|
|
6079
6122
|
}
|
|
@@ -6082,84 +6125,88 @@ class WC {
|
|
|
6082
6125
|
}
|
|
6083
6126
|
}
|
|
6084
6127
|
const xC = FC(
|
|
6085
|
-
({ artboard: i, src: A, className: I, style: C, autoPlay: g = !0, fit: Q = "Contain", alignment: B = "Center", onReady: D, onTrigger:
|
|
6086
|
-
const
|
|
6087
|
-
MC(G, () =>
|
|
6128
|
+
({ artboard: i, src: A, className: I, style: C, autoPlay: g = !0, fit: Q = "Contain", alignment: B = "Center", onReady: D, onTrigger: w, onInputUpdate: o, onComponentChange: h }, G) => {
|
|
6129
|
+
const s = DI(null), a = DI(new OC()), M = DI(), y = DI(0);
|
|
6130
|
+
MC(G, () => s.current), jA(() => {
|
|
6088
6131
|
console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"), a.current.setLayout(Q, B);
|
|
6089
|
-
}, [Q, B]),
|
|
6090
|
-
|
|
6091
|
-
}, [
|
|
6092
|
-
|
|
6093
|
-
}, [
|
|
6132
|
+
}, [Q, B]), jA(() => {
|
|
6133
|
+
w && a.current.setTriggerCallback(w);
|
|
6134
|
+
}, [w]), jA(() => {
|
|
6135
|
+
o && a.current.setInputUpdateCallback(o);
|
|
6136
|
+
}, [o]), jA(() => {
|
|
6094
6137
|
h && a.current.setComponentChangeCallback(h);
|
|
6095
|
-
}, [h]),
|
|
6138
|
+
}, [h]), jA(() => {
|
|
6096
6139
|
(async () => {
|
|
6097
6140
|
const F = a.current;
|
|
6098
|
-
let
|
|
6099
|
-
if (!
|
|
6141
|
+
let U = i;
|
|
6142
|
+
if (!U && A)
|
|
6100
6143
|
try {
|
|
6101
|
-
|
|
6102
|
-
} catch (
|
|
6103
|
-
console.error("Failed to load ExodeUI animation:",
|
|
6144
|
+
U = await (await fetch(A)).json();
|
|
6145
|
+
} catch (R) {
|
|
6146
|
+
console.error("Failed to load ExodeUI animation:", R);
|
|
6104
6147
|
return;
|
|
6105
6148
|
}
|
|
6106
|
-
|
|
6149
|
+
U && (F.load(U), D && D(F));
|
|
6107
6150
|
})();
|
|
6108
|
-
}, [i, A]),
|
|
6109
|
-
const
|
|
6151
|
+
}, [i, A]), jA(() => {
|
|
6152
|
+
const S = a.current, F = s.current;
|
|
6110
6153
|
if (!F) return;
|
|
6111
|
-
const
|
|
6112
|
-
if (!
|
|
6113
|
-
const
|
|
6154
|
+
const U = F.getContext("2d");
|
|
6155
|
+
if (!U) return;
|
|
6156
|
+
const R = (c) => {
|
|
6114
6157
|
y.current || (y.current = c);
|
|
6115
|
-
const
|
|
6116
|
-
y.current = c, g &&
|
|
6117
|
-
const
|
|
6118
|
-
(F.width !== Z || F.height !==
|
|
6158
|
+
const r = (c - y.current) / 1e3;
|
|
6159
|
+
y.current = c, g && S.advance(r);
|
|
6160
|
+
const n = window.devicePixelRatio || 1, p = F.getBoundingClientRect(), Z = Math.floor(p.width * n), H = Math.floor(p.height * n);
|
|
6161
|
+
(F.width !== Z || F.height !== H) && (F.width = Z, F.height = H), S.render(U, Z, H), M.current = requestAnimationFrame(R);
|
|
6119
6162
|
};
|
|
6120
|
-
return M.current = requestAnimationFrame(
|
|
6163
|
+
return M.current = requestAnimationFrame(R), () => {
|
|
6121
6164
|
M.current && cancelAnimationFrame(M.current);
|
|
6122
6165
|
};
|
|
6123
6166
|
}, [g]);
|
|
6124
|
-
const J = (
|
|
6125
|
-
const
|
|
6126
|
-
a.current.handlePointerInput(F,
|
|
6167
|
+
const J = (S, F) => {
|
|
6168
|
+
const U = S.currentTarget.getBoundingClientRect(), R = S.clientX - U.left, c = S.clientY - U.top, r = U.width, n = U.height;
|
|
6169
|
+
a.current.handlePointerInput(F, R, c, r, n);
|
|
6127
6170
|
};
|
|
6128
6171
|
return /* @__PURE__ */ yC(
|
|
6129
6172
|
"canvas",
|
|
6130
6173
|
{
|
|
6131
|
-
ref:
|
|
6174
|
+
ref: s,
|
|
6132
6175
|
style: { width: "100%", height: "100%", outline: "none", ...C },
|
|
6133
6176
|
className: I,
|
|
6134
6177
|
tabIndex: 0,
|
|
6135
|
-
onPointerDown: (
|
|
6178
|
+
onPointerDown: (S) => {
|
|
6136
6179
|
var F;
|
|
6137
|
-
J(
|
|
6180
|
+
J(S, "down"), (F = s.current) == null || F.focus();
|
|
6138
6181
|
},
|
|
6139
|
-
onPointerUp: (
|
|
6140
|
-
onPointerMove: (
|
|
6141
|
-
onPointerLeave: (
|
|
6142
|
-
onClick: (
|
|
6143
|
-
onKeyDown: (
|
|
6144
|
-
|
|
6182
|
+
onPointerUp: (S) => J(S, "up"),
|
|
6183
|
+
onPointerMove: (S) => J(S, "move"),
|
|
6184
|
+
onPointerLeave: (S) => J(S, "blur"),
|
|
6185
|
+
onClick: (S) => J(S, "click"),
|
|
6186
|
+
onKeyDown: (S) => {
|
|
6187
|
+
S.key === "Backspace" || S.key === "Enter" || S.key, a.current.handleKeyDown(S.nativeEvent);
|
|
6145
6188
|
}
|
|
6146
6189
|
}
|
|
6147
6190
|
);
|
|
6148
6191
|
}
|
|
6149
6192
|
);
|
|
6150
6193
|
function XC() {
|
|
6151
|
-
const [i, A] = JC(null), I =
|
|
6152
|
-
i == null || i.setInputBool(
|
|
6153
|
-
}, [i]), C =
|
|
6154
|
-
i == null || i.setInputNumber(
|
|
6155
|
-
}, [i]), g =
|
|
6156
|
-
i == null || i.fireTrigger(
|
|
6157
|
-
}, [i]), Q =
|
|
6158
|
-
i == null || i.setInputText(
|
|
6159
|
-
}, [i]), B =
|
|
6160
|
-
i == null || i.setInputNumberArray(
|
|
6161
|
-
}, [i]), D =
|
|
6162
|
-
i == null || i.
|
|
6194
|
+
const [i, A] = JC(null), I = HA((h, G) => {
|
|
6195
|
+
i == null || i.setInputBool(h, G);
|
|
6196
|
+
}, [i]), C = HA((h, G) => {
|
|
6197
|
+
i == null || i.setInputNumber(h, G);
|
|
6198
|
+
}, [i]), g = HA((h) => {
|
|
6199
|
+
i == null || i.fireTrigger(h);
|
|
6200
|
+
}, [i]), Q = HA((h, G) => {
|
|
6201
|
+
i == null || i.setInputText(h, G);
|
|
6202
|
+
}, [i]), B = HA((h, G) => {
|
|
6203
|
+
i == null || i.setInputNumberArray(h, G);
|
|
6204
|
+
}, [i]), D = HA((h, G) => {
|
|
6205
|
+
i == null || i.setInputStringArray(h, G);
|
|
6206
|
+
}, [i]), w = HA((h, G) => {
|
|
6207
|
+
i == null || i.updateObjectOptions(h, G);
|
|
6208
|
+
}, [i]), o = HA((h, G, s) => {
|
|
6209
|
+
i == null || i.updateConstraint(h, G, s);
|
|
6163
6210
|
}, [i]);
|
|
6164
6211
|
return {
|
|
6165
6212
|
setEngine: A,
|
|
@@ -6170,13 +6217,15 @@ function XC() {
|
|
|
6170
6217
|
fireTrigger: g,
|
|
6171
6218
|
setInputText: Q,
|
|
6172
6219
|
setInputNumberArray: B,
|
|
6173
|
-
|
|
6220
|
+
setInputStringArray: D,
|
|
6221
|
+
updateConstraint: o,
|
|
6222
|
+
updateObjectOptions: w
|
|
6174
6223
|
};
|
|
6175
6224
|
}
|
|
6176
6225
|
export {
|
|
6177
6226
|
UC as ConditionOp,
|
|
6178
6227
|
xC as ExodeUICanvas,
|
|
6179
|
-
|
|
6228
|
+
OC as ExodeUIEngine,
|
|
6180
6229
|
uA as LogicOp,
|
|
6181
6230
|
XC as useExodeUI
|
|
6182
6231
|
};
|