@perplexdotgg/bounce 1.0.5 → 1.1.0

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/build/bounce.js CHANGED
@@ -11,6 +11,21 @@ function NumberType(defaultValue, readOnly) {
11
11
  };
12
12
  }
13
13
  // @__NO_SIDE_EFFECTS__
14
+ function StringType(defaultValue, readOnly, maxLength) {
15
+ return {
16
+ monomorph: maxLength === void 0 ? {
17
+ serializedSize: 0,
18
+ getDynamicSize: (str) => str.length
19
+ } : {
20
+ serializedSize: maxLength
21
+ },
22
+ propertyType: 1,
23
+ optional: defaultValue !== void 0,
24
+ defaultValue,
25
+ readOnly
26
+ };
27
+ }
28
+ // @__NO_SIDE_EFFECTS__
14
29
  function BooleanType(defaultValue, readOnly) {
15
30
  return {
16
31
  monomorph: {
@@ -28,6 +43,7 @@ function ReferenceListType(monomorphClass) {
28
43
  monomorph: {
29
44
  serializedSize: 1,
30
45
  // getDynamicSize: (obj: ReferenceListClass<M>) => obj.length,
46
+ // @ts-ignore
31
47
  theClass: monomorphClass
32
48
  },
33
49
  propertyType: 7,
@@ -77,7 +93,7 @@ function ReferenceType(monomorphClass, defaultValue, readOnly) {
77
93
  };
78
94
  }
79
95
  // @__NO_SIDE_EFFECTS__
80
- function MonomorphType(monomorphClass, defaultValue, readOnly) {
96
+ function ChildType(monomorphClass, defaultValue, readOnly) {
81
97
  return {
82
98
  monomorph: monomorphClass,
83
99
  propertyType: 9,
@@ -91,11 +107,29 @@ function makeSafeAsVariableName(name) {
91
107
  return name.replaceAll(".", "DOT");
92
108
  }
93
109
  function populatePropsQueue(props, propsQueue, keySoFar = "", monomorphPathSoFar = "", depth = 0) {
94
- for (const [key, propertyDefinition] of Object.entries(props)) {
110
+ for (const [key, maybePropertyDefinition] of Object.entries(props)) {
95
111
  const fullKey = keySoFar + key;
96
112
  const fullMonomorphPath = monomorphPathSoFar + key;
97
113
  const referencePath = keySoFar + "__reference__" + key;
98
114
  const uniqueKey = /* @__PURE__ */ makeSafeAsVariableName(fullKey);
115
+ const theType = typeof maybePropertyDefinition;
116
+ let propertyDefinition;
117
+ if (theType === "object" && "monomorph" in maybePropertyDefinition) {
118
+ propertyDefinition = maybePropertyDefinition;
119
+ } else {
120
+ if (theType === "function" && "serializedSize" in maybePropertyDefinition) {
121
+ propertyDefinition = /* @__PURE__ */ ChildType(maybePropertyDefinition);
122
+ } else if (theType === "number") {
123
+ propertyDefinition = /* @__PURE__ */ NumberType(maybePropertyDefinition);
124
+ } else if (theType === "boolean") {
125
+ propertyDefinition = /* @__PURE__ */ BooleanType(maybePropertyDefinition);
126
+ } else if (theType === "string") {
127
+ propertyDefinition = /* @__PURE__ */ StringType(maybePropertyDefinition);
128
+ } else {
129
+ throw new Error(`Invalid property definition for key "${fullKey}", theType ${theType} ${"serializedSize" in maybePropertyDefinition}`);
130
+ }
131
+ props[key] = propertyDefinition;
132
+ }
99
133
  propsQueue.push({
100
134
  key,
101
135
  fullKey,
@@ -127,7 +161,8 @@ function getClassCode(props, options = {}) {
127
161
  let beforeClass = "";
128
162
  let constructorCode = "";
129
163
  let fullSetDataCode = "";
130
- let fullSetDataDefaultValueCode = "";
164
+ let constructorAndFullSetDataDefaultValueCode = "";
165
+ let onlyFullSetDataDefaultValueCode = "";
131
166
  let setDataCode = "";
132
167
  let copyCode = "";
133
168
  let toArrayCode = "";
@@ -219,9 +254,9 @@ function getClassCode(props, options = {}) {
219
254
  let poolArray;
220
255
  `;
221
256
  fromArrayOnlyReferencesCode += fromArrayCode;
222
- fullSetDataDefaultValueCode = `
257
+ constructorAndFullSetDataDefaultValueCode = `
223
258
  if (data !== undefined) {
224
- ${fullSetDataDefaultValueCode}
259
+ ${constructorAndFullSetDataDefaultValueCode}
225
260
  }
226
261
  `;
227
262
  }
@@ -247,14 +282,12 @@ function getClassCode(props, options = {}) {
247
282
  this.${fullKey} = ${propertyDefinition.monomorph.name}.create(data${hasRequiredProps ? "" : "?"}.${fullKey});
248
283
  `;
249
284
  if (propertyDefinition.defaultValue === void 0) {
250
- if (!dataHasBeenInitializedInFullSetCode) {
251
- dataHasBeenInitializedInFullSetCode = true;
252
- fullSetDataDefaultValueCode += `
253
- data = data ?? {};
254
- `;
255
- }
256
- fullSetDataDefaultValueCode += `
257
- data.${fullKey} = data.${fullKey} ?? {};
285
+ onlyFullSetDataDefaultValueCode += `
286
+ this.${fullKey}.fullSet(data?.${fullKey});
287
+ `;
288
+ } else {
289
+ onlyFullSetDataDefaultValueCode += `
290
+ this.${fullKey}.fullSet(data?.${fullKey}) ?? ${JSON.stringify(propertyDefinition.defaultValue)};
258
291
  `;
259
292
  }
260
293
  } else if (propertyDefinition.propertyType === 3 || propertyDefinition.propertyType === 4 || propertyDefinition.propertyType === 5) {
@@ -308,30 +341,48 @@ function getClassCode(props, options = {}) {
308
341
  }
309
342
  `;
310
343
  } else if (propertyDefinition.propertyType === 7) {
344
+ const className = propertyDefinition.monomorph.theClass.name;
311
345
  constructorCode += `
312
346
  if (this.${fullKey}) {
313
347
  this.${fullKey}.length = 0;
314
348
  } else {
315
- this.${fullKey} = new ${propertyDefinition.monomorph.theClass.name}.ReferenceList(data${hasRequiredProps ? "" : "?"}.${fullKey}?.pool || new ${propertyDefinition.monomorph.theClass.name}.Pool(), data${hasRequiredProps ? "" : "?"}.${fullKey}?.maxLength, data${hasRequiredProps ? "" : "?"}.${fullKey}?.items, ${propertyDefinition.monomorph.theClass.name});
349
+ this.${fullKey} = new ${className}.ReferenceList(data${hasRequiredProps ? "" : "?"}.${fullKey}?.pool || new ${className}.Pool(), data${hasRequiredProps ? "" : "?"}.${fullKey}?.maxLength, data${hasRequiredProps ? "" : "?"}.${fullKey}?.items, ${className});
316
350
  }
317
351
  `;
318
352
  }
319
- }
320
- if (propertyDefinition.defaultValue !== void 0 && propertyDefinition.propertyType !== 7 && propertyDefinition.propertyType !== 8) {
321
- if (!dataHasBeenInitializedInFullSetCode) {
322
- dataHasBeenInitializedInFullSetCode = true;
323
- fullSetDataDefaultValueCode += `
324
- data = data ?? {};
353
+ if (propertyDefinition.defaultValue !== void 0 && propertyDefinition.propertyType !== 7 && propertyDefinition.propertyType !== 8) {
354
+ if (!dataHasBeenInitializedInFullSetCode) {
355
+ dataHasBeenInitializedInFullSetCode = true;
356
+ constructorAndFullSetDataDefaultValueCode += `
357
+ data = data ?? {};
358
+ `;
359
+ }
360
+ if (parentKey) {
361
+ constructorAndFullSetDataDefaultValueCode += `
362
+ data.${parentKey} = data.${parentKey} ?? {};
363
+ `;
364
+ }
365
+ constructorAndFullSetDataDefaultValueCode += `
366
+ data.${fullKey} = data.${fullKey} ?? ${JSON.stringify(propertyDefinition.defaultValue)};
325
367
  `;
326
368
  }
327
- if (parentKey) {
328
- fullSetDataDefaultValueCode += `
329
- data.${parentKey} = data.${parentKey} ?? {};
330
- `;
369
+ if (propertyDefinition.propertyType !== 9 && propertyDefinition.propertyType !== 7 && propertyDefinition.propertyType !== 8) {
370
+ if (hasRequiredProps) {
371
+ if (propertyDefinition.optional) {
372
+ fullSetDataCode += `
373
+ this.${fullKey} = data.${fullKey} ?? ${propertyDefinition.defaultValue};
374
+ `;
375
+ } else {
376
+ fullSetDataCode += `
377
+ this.${fullKey} = data.${fullKey};
378
+ `;
379
+ }
380
+ } else {
381
+ fullSetDataCode += `
382
+ this.${fullKey} = data.${keyWithOptionalChaining}; // test 456
383
+ `;
384
+ }
331
385
  }
332
- fullSetDataDefaultValueCode += `
333
- data.${fullKey} = data.${fullKey} ?? ${JSON.stringify(propertyDefinition.defaultValue)};
334
- `;
335
386
  }
336
387
  if (previousDepth < depth) {
337
388
  if (depth - previousDepth > 1) {
@@ -360,11 +411,12 @@ function getClassCode(props, options = {}) {
360
411
  }
361
412
  } else if (propertyDefinition.propertyType === 7) {
362
413
  const monomorph = propertyDefinition.monomorph;
363
- if (!monomorphsAlreadyAdded.has(monomorph.theClass.name)) {
414
+ const className = monomorph.theClass.name;
415
+ if (!monomorphsAlreadyAdded.has(className)) {
364
416
  beforeClass += `
365
- const ${monomorph.theClass.name} = input.${monomorphPath}.monomorph.theClass;
417
+ const ${className} = input.${monomorphPath}.monomorph.theClass;
366
418
  `;
367
- monomorphsAlreadyAdded.add(monomorph.theClass.name);
419
+ monomorphsAlreadyAdded.add(className);
368
420
  }
369
421
  } else if (propertyDefinition.propertyType === 4) {
370
422
  const name = "lazyRefMonomorph" + propIndex;
@@ -409,21 +461,6 @@ function getClassCode(props, options = {}) {
409
461
  copyCode += `
410
462
  this.${fullKey} = other.${fullKey};
411
463
  `;
412
- if (hasRequiredProps) {
413
- if (propertyDefinition.optional) {
414
- fullSetDataCode += `
415
- this.${fullKey} = data.${fullKey} ?? ${propertyDefinition.defaultValue};
416
- `;
417
- } else {
418
- fullSetDataCode += `
419
- this.${fullKey} = data.${fullKey};
420
- `;
421
- }
422
- } else {
423
- fullSetDataCode += `
424
- this.${fullKey} = data.${keyWithOptionalChaining};
425
- `;
426
- }
427
464
  }
428
465
  switch (propertyDefinition.propertyType) {
429
466
  case 0:
@@ -620,8 +657,6 @@ function getClassCode(props, options = {}) {
620
657
  const poolArray = referenceList.pool.array;
621
658
  const arrayOfIndices = referenceList.arrayOfIndices;
622
659
  const arrayOfVersions = referenceList.arrayOfVersions;
623
- const array = referenceList.array;
624
- const maxLength = referenceList.maxLength;
625
660
  const iteratorResult = {
626
661
  done: false,
627
662
  value: null,
@@ -674,19 +709,20 @@ function getClassCode(props, options = {}) {
674
709
  static hasDynamicSize = ${hasDynamicSize};
675
710
 
676
711
  constructor(data, index, pool) {
677
- ${fullSetDataDefaultValueCode}
712
+ ${constructorAndFullSetDataDefaultValueCode}
678
713
  ${constructorCode}
679
- ${options.afterConstructorCode}
680
714
  ${fullSetDataCode}
681
715
  this.index = index;
682
716
  this.version = 0; ${""}
683
717
  this.pool = (pool === undefined) ? null : pool;
718
+ ${options.afterConstructorCode}
684
719
  }
685
720
 
686
721
  ${referenceGettersAndSettersCode}
687
722
 
688
723
  fullSet(data) {
689
- ${fullSetDataDefaultValueCode}
724
+ ${constructorAndFullSetDataDefaultValueCode}
725
+ ${onlyFullSetDataDefaultValueCode}
690
726
  ${fullSetDataCode}
691
727
  return this;
692
728
  }
@@ -1156,15 +1192,15 @@ function createClass(props, options = {}) {
1156
1192
  }
1157
1193
  const mat3Keys = ["e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8"];
1158
1194
  const mat3Props = {
1159
- e0: /* @__PURE__ */ NumberType(0),
1160
- e1: /* @__PURE__ */ NumberType(0),
1161
- e2: /* @__PURE__ */ NumberType(0),
1162
- e3: /* @__PURE__ */ NumberType(0),
1163
- e4: /* @__PURE__ */ NumberType(0),
1164
- e5: /* @__PURE__ */ NumberType(0),
1165
- e6: /* @__PURE__ */ NumberType(0),
1166
- e7: /* @__PURE__ */ NumberType(0),
1167
- e8: /* @__PURE__ */ NumberType(0)
1195
+ e0: 0,
1196
+ e1: 0,
1197
+ e2: 0,
1198
+ e3: 0,
1199
+ e4: 0,
1200
+ e5: 0,
1201
+ e6: 0,
1202
+ e7: 0,
1203
+ e8: 0
1168
1204
  };
1169
1205
  class Mat3 extends (/* @__PURE__ */ createClass(mat3Props)) {
1170
1206
  adjointMatrix(a3) {
@@ -1576,11 +1612,51 @@ function squaredDistance(a3, b3) {
1576
1612
  return x2 * x2 + y4 * y4 + z * z;
1577
1613
  }
1578
1614
  const vec3Props = {
1579
- x: /* @__PURE__ */ NumberType(0),
1580
- y: /* @__PURE__ */ NumberType(0),
1581
- z: /* @__PURE__ */ NumberType(0)
1615
+ x: 0,
1616
+ y: 0,
1617
+ z: 0
1582
1618
  };
1583
1619
  class Vec3 extends (/* @__PURE__ */ createClass(vec3Props)) {
1620
+ constructor(data, index, pool) {
1621
+ if (Array.isArray(data)) {
1622
+ data = {
1623
+ x: data[0] ?? 0,
1624
+ y: data[1] ?? 0,
1625
+ z: data[2] ?? 0
1626
+ };
1627
+ }
1628
+ super(data, index, pool);
1629
+ }
1630
+ fullSet(data) {
1631
+ if (Array.isArray(data)) {
1632
+ this.x = data[0] ?? 0;
1633
+ this.y = data[1] ?? 0;
1634
+ this.z = data[2] ?? 0;
1635
+ } else {
1636
+ this.x = data?.x ?? 0;
1637
+ this.y = data?.y ?? 0;
1638
+ this.z = data?.z ?? 0;
1639
+ }
1640
+ return this;
1641
+ }
1642
+ set(data) {
1643
+ if (Array.isArray(data)) {
1644
+ this.x = data[0] ?? 0;
1645
+ this.y = data[1] ?? 0;
1646
+ this.z = data[2] ?? 0;
1647
+ } else if (data) {
1648
+ if (data.x !== void 0) {
1649
+ this.x = data.x;
1650
+ }
1651
+ if (data.y !== void 0) {
1652
+ this.y = data.y;
1653
+ }
1654
+ if (data.z !== void 0) {
1655
+ this.z = data.z;
1656
+ }
1657
+ }
1658
+ return this;
1659
+ }
1584
1660
  toObject() {
1585
1661
  return {
1586
1662
  x: this.x,
@@ -2039,8 +2115,8 @@ const temp = /* @__PURE__ */ Vec3.create();
2039
2115
  const rotatedVector = /* @__PURE__ */ Vec3.create();
2040
2116
  const rotationMatrix$3 = /* @__PURE__ */ Mat3.create();
2041
2117
  const lineProps = {
2042
- a: /* @__PURE__ */ MonomorphType(Vec3),
2043
- b: /* @__PURE__ */ MonomorphType(Vec3)
2118
+ a: Vec3,
2119
+ b: Vec3
2044
2120
  };
2045
2121
  class Line extends (/* @__PURE__ */ createClass(lineProps)) {
2046
2122
  setFromPointAndDirection(point2, direction2, length) {
@@ -2050,12 +2126,68 @@ class Line extends (/* @__PURE__ */ createClass(lineProps)) {
2050
2126
  }
2051
2127
  const quatKeys = ["x", "y", "z", "w"];
2052
2128
  const quatProps = {
2053
- x: /* @__PURE__ */ NumberType(0),
2054
- y: /* @__PURE__ */ NumberType(0),
2055
- z: /* @__PURE__ */ NumberType(0),
2056
- w: /* @__PURE__ */ NumberType(1)
2129
+ x: 0,
2130
+ y: 0,
2131
+ z: 0,
2132
+ w: 1
2057
2133
  };
2058
2134
  class Quat extends (/* @__PURE__ */ createClass(quatProps)) {
2135
+ constructor(data, index, pool) {
2136
+ if (Array.isArray(data)) {
2137
+ data = {
2138
+ x: data[0] ?? 0,
2139
+ y: data[1] ?? 0,
2140
+ z: data[2] ?? 0,
2141
+ w: data[3] ?? 1
2142
+ };
2143
+ }
2144
+ super(data, index, pool);
2145
+ }
2146
+ fullSet(data) {
2147
+ if (Array.isArray(data)) {
2148
+ if (data.length && data.length < 4) {
2149
+ return this.setFromEulerRadians(data[0], data[1] ?? 0, data[2] ?? 0);
2150
+ }
2151
+ this.x = data[0] ?? 0;
2152
+ this.y = data[1] ?? 0;
2153
+ this.z = data[2] ?? 0;
2154
+ this.w = data[3] ?? 1;
2155
+ } else {
2156
+ if (data && data.w === void 0 && (data.x || data.y || data.z)) {
2157
+ return this.setFromEulerRadians(data.x ?? 0, data.y ?? 0, data.z ?? 0);
2158
+ }
2159
+ this.x = data?.x ?? 0;
2160
+ this.y = data?.y ?? 0;
2161
+ this.z = data?.z ?? 0;
2162
+ this.w = data?.w ?? 1;
2163
+ }
2164
+ return this;
2165
+ }
2166
+ set(data) {
2167
+ if (Array.isArray(data)) {
2168
+ if (data.length && data.length < 4) {
2169
+ return this.setFromEulerRadians(data[0], data[1] ?? 0, data[2] ?? 0);
2170
+ }
2171
+ this.x = data[0] ?? 0;
2172
+ this.y = data[1] ?? 0;
2173
+ this.z = data[2] ?? 0;
2174
+ this.w = data[3] ?? 1;
2175
+ } else if (data) {
2176
+ if (data.x !== void 0) {
2177
+ this.x = data.x;
2178
+ }
2179
+ if (data.y !== void 0) {
2180
+ this.y = data.y;
2181
+ }
2182
+ if (data.z !== void 0) {
2183
+ this.z = data.z;
2184
+ }
2185
+ if (data.w !== void 0) {
2186
+ this.w = data.w;
2187
+ }
2188
+ }
2189
+ return this;
2190
+ }
2059
2191
  length() {
2060
2192
  return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
2061
2193
  }
@@ -2183,6 +2315,22 @@ class Quat extends (/* @__PURE__ */ createClass(quatProps)) {
2183
2315
  return 2 * Math.atan(vector.dot(axis2) / this.w);
2184
2316
  }
2185
2317
  }
2318
+ setFromEulerRadians(x2, y4, z) {
2319
+ const halfX = x2 * 0.5;
2320
+ const halfY = y4 * 0.5;
2321
+ const halfZ = z * 0.5;
2322
+ const c12 = Math.cos(halfX);
2323
+ const c22 = Math.cos(halfY);
2324
+ const c3 = Math.cos(halfZ);
2325
+ const s1 = Math.sin(halfX);
2326
+ const s2 = Math.sin(halfY);
2327
+ const s3 = Math.sin(halfZ);
2328
+ this.x = s1 * c22 * c3 + c12 * s2 * s3;
2329
+ this.y = c12 * s2 * c3 - s1 * c22 * s3;
2330
+ this.z = c12 * c22 * s3 + s1 * s2 * c3;
2331
+ this.w = c12 * c22 * c3 - s1 * s2 * s3;
2332
+ return this;
2333
+ }
2186
2334
  toObject() {
2187
2335
  return {
2188
2336
  x: this.x,
@@ -2199,22 +2347,22 @@ const scaling = /* @__PURE__ */ Vec3.create();
2199
2347
  const conjugatedRotation = /* @__PURE__ */ Quat.create();
2200
2348
  const rotatedTranslation = /* @__PURE__ */ Vec3.create();
2201
2349
  const mat4Props = {
2202
- e0: /* @__PURE__ */ NumberType(0),
2203
- e1: /* @__PURE__ */ NumberType(0),
2204
- e2: /* @__PURE__ */ NumberType(0),
2205
- e3: /* @__PURE__ */ NumberType(0),
2206
- e4: /* @__PURE__ */ NumberType(0),
2207
- e5: /* @__PURE__ */ NumberType(0),
2208
- e6: /* @__PURE__ */ NumberType(0),
2209
- e7: /* @__PURE__ */ NumberType(0),
2210
- e8: /* @__PURE__ */ NumberType(0),
2211
- e9: /* @__PURE__ */ NumberType(0),
2212
- e10: /* @__PURE__ */ NumberType(0),
2213
- e11: /* @__PURE__ */ NumberType(0),
2214
- e12: /* @__PURE__ */ NumberType(0),
2215
- e13: /* @__PURE__ */ NumberType(0),
2216
- e14: /* @__PURE__ */ NumberType(0),
2217
- e15: /* @__PURE__ */ NumberType(0)
2350
+ e0: 0,
2351
+ e1: 0,
2352
+ e2: 0,
2353
+ e3: 0,
2354
+ e4: 0,
2355
+ e5: 0,
2356
+ e6: 0,
2357
+ e7: 0,
2358
+ e8: 0,
2359
+ e9: 0,
2360
+ e10: 0,
2361
+ e11: 0,
2362
+ e12: 0,
2363
+ e13: 0,
2364
+ e14: 0,
2365
+ e15: 0
2218
2366
  };
2219
2367
  class Mat4 extends (/* @__PURE__ */ createClass(mat4Props)) {
2220
2368
  multiply3x3(out, a3) {
@@ -2677,8 +2825,8 @@ class Mat4 extends (/* @__PURE__ */ createClass(mat4Props)) {
2677
2825
  const rotation$3 = /* @__PURE__ */ Quat.create();
2678
2826
  const cross_bn_cn = /* @__PURE__ */ Vec3.create();
2679
2827
  const planeProps = {
2680
- normal: /* @__PURE__ */ MonomorphType(Vec3),
2681
- constant: /* @__PURE__ */ NumberType(0)
2828
+ normal: Vec3,
2829
+ constant: 0
2682
2830
  };
2683
2831
  class Plane extends (/* @__PURE__ */ createClass(planeProps)) {
2684
2832
  toObject() {
@@ -2749,8 +2897,8 @@ class Plane extends (/* @__PURE__ */ createClass(planeProps)) {
2749
2897
  }
2750
2898
  }
2751
2899
  const segmentProps = {
2752
- pointA: /* @__PURE__ */ MonomorphType(Vec3),
2753
- pointB: /* @__PURE__ */ MonomorphType(Vec3)
2900
+ pointA: Vec3,
2901
+ pointB: Vec3
2754
2902
  };
2755
2903
  class Segment extends (/* @__PURE__ */ createClass(segmentProps)) {
2756
2904
  computeCenter(out) {
@@ -2773,9 +2921,9 @@ const col = /* @__PURE__ */ Vec3.create();
2773
2921
  const a$2 = /* @__PURE__ */ Vec3.create();
2774
2922
  const b$1 = /* @__PURE__ */ Vec3.create();
2775
2923
  const aabbProps = {
2776
- min: /* @__PURE__ */ MonomorphType(Vec3),
2777
- max: /* @__PURE__ */ MonomorphType(Vec3),
2778
- centroid: /* @__PURE__ */ MonomorphType(Vec3, void 0, true)
2924
+ min: Vec3,
2925
+ max: Vec3,
2926
+ centroid: /* @__PURE__ */ ChildType(Vec3, void 0, true)
2779
2927
  };
2780
2928
  class Aabb extends (/* @__PURE__ */ createClass(aabbProps)) {
2781
2929
  computeSupport(out, direction2) {
@@ -3051,11 +3199,11 @@ const aabbHalfExtents = /* @__PURE__ */ Vec3.create();
3051
3199
  const segmentCenter = /* @__PURE__ */ Vec3.create();
3052
3200
  const segmentHalfExtents = /* @__PURE__ */ Vec3.create();
3053
3201
  const triangleProps$1 = {
3054
- computedBounds: /* @__PURE__ */ MonomorphType(Aabb, void 0, true),
3055
- normal: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
3056
- a: /* @__PURE__ */ MonomorphType(Vec3),
3057
- b: /* @__PURE__ */ MonomorphType(Vec3),
3058
- c: /* @__PURE__ */ MonomorphType(Vec3),
3202
+ computedBounds: /* @__PURE__ */ ChildType(Aabb, void 0, true),
3203
+ normal: /* @__PURE__ */ ChildType(Vec3, void 0, true),
3204
+ a: Vec3,
3205
+ b: Vec3,
3206
+ c: Vec3,
3059
3207
  subShapeId: /* @__PURE__ */ NumberType(0, true),
3060
3208
  activeEdges: /* @__PURE__ */ NumberType(0, true)
3061
3209
  // aabb: { struct: Aabb, readOnly: true },
@@ -3138,7 +3286,7 @@ let Triangle$1 = class Triangle extends (/* @__PURE__ */ createClass(trianglePro
3138
3286
  }
3139
3287
  };
3140
3288
  const faceProps = {
3141
- numVertices: /* @__PURE__ */ NumberType(0),
3289
+ numVertices: 0,
3142
3290
  buffer: /* @__PURE__ */ LazyReferenceListType((() => Vec3))
3143
3291
  };
3144
3292
  const triangle$1 = /* @__PURE__ */ Triangle$1.create();
@@ -3244,7 +3392,10 @@ const baseConstraintProps = {
3244
3392
  bodyA: /* @__PURE__ */ LazyReferenceType((() => Body)),
3245
3393
  bodyB: /* @__PURE__ */ LazyReferenceType((() => Body)),
3246
3394
  constraintPairNode: /* @__PURE__ */ LazyReferenceType((() => ConstraintPairNode)),
3247
- referenceFrame: /* @__PURE__ */ NumberType(0),
3395
+ referenceFrame: /* @__PURE__ */ NumberType(
3396
+ 0
3397
+ /* local */
3398
+ ),
3248
3399
  isEnabled: /* @__PURE__ */ BooleanType(true)
3249
3400
  };
3250
3401
  const localToWorldTransformA$1 = /* @__PURE__ */ Mat4.create();
@@ -3253,15 +3404,15 @@ const contactManifoldProps = {
3253
3404
  // meta data
3254
3405
  bodyA: /* @__PURE__ */ LazyReferenceType((() => Body)),
3255
3406
  bodyB: /* @__PURE__ */ LazyReferenceType((() => Body)),
3256
- subShapeIdA: /* @__PURE__ */ NumberType(0),
3257
- subShapeIdB: /* @__PURE__ */ NumberType(0),
3407
+ subShapeIdA: 0,
3408
+ subShapeIdB: 0,
3258
3409
  nextContactManifold: /* @__PURE__ */ LazyReferenceType((() => ContactManifold)),
3259
3410
  // geometric data
3260
- baseTranslation: /* @__PURE__ */ MonomorphType(Vec3),
3261
- firstWorldSpaceNormal: /* @__PURE__ */ MonomorphType(Vec3),
3262
- worldSpaceNormal: /* @__PURE__ */ MonomorphType(Vec3),
3263
- penetrationDepth: /* @__PURE__ */ NumberType(0),
3264
- numContacts: /* @__PURE__ */ NumberType(0),
3411
+ baseTranslation: Vec3,
3412
+ firstWorldSpaceNormal: Vec3,
3413
+ worldSpaceNormal: Vec3,
3414
+ penetrationDepth: 0,
3415
+ numContacts: 0,
3265
3416
  contactPointsA: /* @__PURE__ */ ReferenceListType(Vec3),
3266
3417
  contactPointsB: /* @__PURE__ */ ReferenceListType(Vec3),
3267
3418
  lambdas: /* @__PURE__ */ ReferenceListType(Vec3)
@@ -3390,8 +3541,8 @@ const contactPairProps = {
3390
3541
  bodyA: /* @__PURE__ */ LazyReferenceType((() => Body)),
3391
3542
  bodyB: /* @__PURE__ */ LazyReferenceType((() => Body)),
3392
3543
  firstContactManifold: /* @__PURE__ */ ReferenceType(ContactManifold),
3393
- translationAB: /* @__PURE__ */ MonomorphType(Vec3),
3394
- rotationAB: /* @__PURE__ */ MonomorphType(Quat)
3544
+ translationAB: Vec3,
3545
+ rotationAB: Quat
3395
3546
  };
3396
3547
  class ContactPair extends (/* @__PURE__ */ createClass(contactPairProps)) {
3397
3548
  get key() {
@@ -3411,14 +3562,14 @@ const angularVelocityB = /* @__PURE__ */ Vec3.create();
3411
3562
  const inverseInertiaA$2 = /* @__PURE__ */ Mat3.create();
3412
3563
  const inverseInertiaB$2 = /* @__PURE__ */ Mat3.create();
3413
3564
  const directionalConstraintProps = {
3414
- mR1PlusUxAxis: /* @__PURE__ */ MonomorphType(Vec3),
3415
- mR2xAxis: /* @__PURE__ */ MonomorphType(Vec3),
3416
- mInvI1_R1PlusUxAxis: /* @__PURE__ */ MonomorphType(Vec3),
3417
- mInvI2_R2xAxis: /* @__PURE__ */ MonomorphType(Vec3),
3418
- effectiveMass: /* @__PURE__ */ NumberType(0),
3419
- bias: /* @__PURE__ */ NumberType(0),
3420
- softness: /* @__PURE__ */ NumberType(0),
3421
- totalLambda: /* @__PURE__ */ NumberType(0)
3565
+ mR1PlusUxAxis: Vec3,
3566
+ mR2xAxis: Vec3,
3567
+ mInvI1_R1PlusUxAxis: Vec3,
3568
+ mInvI2_R2xAxis: Vec3,
3569
+ effectiveMass: 0,
3570
+ bias: 0,
3571
+ softness: 0,
3572
+ totalLambda: 0
3422
3573
  };
3423
3574
  class DirectionalConstraint extends (/* @__PURE__ */ createClass(
3424
3575
  directionalConstraintProps
@@ -3553,11 +3704,11 @@ class DirectionalConstraint extends (/* @__PURE__ */ createClass(
3553
3704
  }
3554
3705
  }
3555
3706
  const contactConstraintProps = {
3556
- normalConstraint: /* @__PURE__ */ MonomorphType(DirectionalConstraint),
3557
- tangentConstraint: /* @__PURE__ */ MonomorphType(DirectionalConstraint),
3558
- bitangentConstraint: /* @__PURE__ */ MonomorphType(DirectionalConstraint),
3559
- localPositionA: /* @__PURE__ */ MonomorphType(Vec3),
3560
- localPositionB: /* @__PURE__ */ MonomorphType(Vec3)
3707
+ normalConstraint: DirectionalConstraint,
3708
+ tangentConstraint: DirectionalConstraint,
3709
+ bitangentConstraint: DirectionalConstraint,
3710
+ localPositionA: Vec3,
3711
+ localPositionB: Vec3
3561
3712
  };
3562
3713
  class ContactConstraint extends (/* @__PURE__ */ createClass(
3563
3714
  contactConstraintProps
@@ -3586,17 +3737,17 @@ class ContactConstraint extends (/* @__PURE__ */ createClass(
3586
3737
  const manifoldConstraintProps = {
3587
3738
  bodyA: /* @__PURE__ */ LazyReferenceType((() => Body)),
3588
3739
  bodyB: /* @__PURE__ */ LazyReferenceType((() => Body)),
3589
- subShapeIdA: /* @__PURE__ */ NumberType(0),
3590
- subShapeIdB: /* @__PURE__ */ NumberType(0),
3591
- friction: /* @__PURE__ */ NumberType(0),
3592
- restitution: /* @__PURE__ */ NumberType(0),
3593
- worldSpaceNormal: /* @__PURE__ */ MonomorphType(Vec3),
3594
- worldSpaceTangent: /* @__PURE__ */ MonomorphType(Vec3),
3595
- worldSpaceBitangent: /* @__PURE__ */ MonomorphType(Vec3),
3596
- inverseMassA: /* @__PURE__ */ NumberType(0),
3597
- inverseMassB: /* @__PURE__ */ NumberType(0),
3740
+ subShapeIdA: 0,
3741
+ subShapeIdB: 0,
3742
+ friction: 0,
3743
+ restitution: 0,
3744
+ worldSpaceNormal: Vec3,
3745
+ worldSpaceTangent: Vec3,
3746
+ worldSpaceBitangent: Vec3,
3747
+ inverseMassA: 0,
3748
+ inverseMassB: 0,
3598
3749
  contactConstraints: /* @__PURE__ */ ReferenceListType(ContactConstraint),
3599
- numContacts: /* @__PURE__ */ NumberType(0)
3750
+ numContacts: 0
3600
3751
  };
3601
3752
  class ManifoldConstraint extends (/* @__PURE__ */ createClass(
3602
3753
  manifoldConstraintProps
@@ -3701,7 +3852,7 @@ function computeClosestPowersOfTwo(n2) {
3701
3852
  return { previous, next };
3702
3853
  }
3703
3854
  const isometryProps = {
3704
- matrix: /* @__PURE__ */ MonomorphType(Mat4)
3855
+ matrix: Mat4
3705
3856
  };
3706
3857
  const tempTranslation = /* @__PURE__ */ Vec3.create();
3707
3858
  const tempRotation = /* @__PURE__ */ Quat.create();
@@ -4314,7 +4465,7 @@ class TransformedConvexObject {
4314
4465
  }
4315
4466
  }
4316
4467
  const transformedConvexShapeProps = {
4317
- transform: /* @__PURE__ */ MonomorphType(Isometry)
4468
+ transform: Isometry
4318
4469
  };
4319
4470
  const direction = /* @__PURE__ */ Vec3.create();
4320
4471
  class TransformedConvexShape extends (/* @__PURE__ */ createClass(
@@ -4332,7 +4483,7 @@ class TransformedConvexShape extends (/* @__PURE__ */ createClass(
4332
4483
  }
4333
4484
  }
4334
4485
  const convexRadiusObjectProps = {
4335
- radius: /* @__PURE__ */ NumberType(0)
4486
+ radius: 0
4336
4487
  };
4337
4488
  class ConvexRadiusObject extends (/* @__PURE__ */ createClass(
4338
4489
  convexRadiusObjectProps
@@ -4384,7 +4535,7 @@ var ShapeType = /* @__PURE__ */ ((ShapeType2) => {
4384
4535
  return ShapeType2;
4385
4536
  })(ShapeType || {});
4386
4537
  const sphereNoConvexProps = {
4387
- radius: /* @__PURE__ */ NumberType(0)
4538
+ radius: 0
4388
4539
  };
4389
4540
  class SphereNoConvex extends (/* @__PURE__ */ createClass(sphereNoConvexProps)) {
4390
4541
  getConvexRadius() {
@@ -4395,7 +4546,7 @@ class SphereNoConvex extends (/* @__PURE__ */ createClass(sphereNoConvexProps))
4395
4546
  }
4396
4547
  }
4397
4548
  const sphereWithConvexProps = {
4398
- radius: /* @__PURE__ */ NumberType(0)
4549
+ radius: 0
4399
4550
  };
4400
4551
  class SphereWithConvex extends (/* @__PURE__ */ createClass(sphereWithConvexProps)) {
4401
4552
  getConvexRadius() {
@@ -4411,13 +4562,13 @@ class SphereWithConvex extends (/* @__PURE__ */ createClass(sphereWithConvexProp
4411
4562
  }
4412
4563
  }
4413
4564
  const sphereProps = {
4414
- computedCenterOfMass: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
4565
+ computedCenterOfMass: /* @__PURE__ */ ChildType(Vec3, void 0, true),
4415
4566
  computedVolume: /* @__PURE__ */ NumberType(0, true),
4416
- computedAabb: /* @__PURE__ */ MonomorphType(Aabb, void 0, true),
4417
- radius: /* @__PURE__ */ NumberType(1),
4567
+ computedAabb: /* @__PURE__ */ ChildType(Aabb, void 0, true),
4568
+ radius: 1,
4418
4569
  copyForDiff: /* @__PURE__ */ LazyReferenceType((() => Sphere)),
4419
- sphereNoConvex: /* @__PURE__ */ MonomorphType(SphereNoConvex, void 0, true),
4420
- sphereWithConvex: /* @__PURE__ */ MonomorphType(SphereWithConvex, void 0, true)
4570
+ sphereNoConvex: /* @__PURE__ */ ChildType(SphereNoConvex, void 0, true),
4571
+ sphereWithConvex: /* @__PURE__ */ ChildType(SphereWithConvex, void 0, true)
4421
4572
  };
4422
4573
  const afterConstructorCode$a = `
4423
4574
  this.world = null;
@@ -4519,9 +4670,9 @@ const absLocalSurfacePosition = /* @__PURE__ */ Vec3.create();
4519
4670
  const tempVector$4 = /* @__PURE__ */ Vec3.create();
4520
4671
  const defaultConvexRadius = 0.05;
4521
4672
  const boxSupportProps = {
4522
- convexRadius: /* @__PURE__ */ NumberType(0),
4673
+ convexRadius: 0,
4523
4674
  // TODO: cannot used undefined default for this, possibly due to it being used as a deeply nested prop
4524
- computedAabb: /* @__PURE__ */ MonomorphType(Aabb, {}, true)
4675
+ computedAabb: /* @__PURE__ */ ChildType(Aabb, {}, true)
4525
4676
  };
4526
4677
  class BoxSupport extends (/* @__PURE__ */ createClass(boxSupportProps)) {
4527
4678
  computeSupport(out, direction2) {
@@ -4532,14 +4683,14 @@ class BoxSupport extends (/* @__PURE__ */ createClass(boxSupportProps)) {
4532
4683
  }
4533
4684
  }
4534
4685
  const boxProps = {
4535
- computedCenterOfMass: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
4686
+ computedCenterOfMass: /* @__PURE__ */ ChildType(Vec3, void 0, true),
4536
4687
  computedVolume: /* @__PURE__ */ NumberType(0, true),
4537
- computedAabb: /* @__PURE__ */ MonomorphType(Aabb, void 0, true),
4538
- convexRadius: /* @__PURE__ */ NumberType(0),
4539
- width: /* @__PURE__ */ NumberType(0),
4540
- height: /* @__PURE__ */ NumberType(0),
4541
- depth: /* @__PURE__ */ NumberType(0),
4542
- boxSupport: /* @__PURE__ */ MonomorphType(BoxSupport, void 0, true),
4688
+ computedAabb: /* @__PURE__ */ ChildType(Aabb, void 0, true),
4689
+ convexRadius: 0,
4690
+ width: 0,
4691
+ height: 0,
4692
+ depth: 0,
4693
+ boxSupport: /* @__PURE__ */ ChildType(BoxSupport, void 0, true),
4543
4694
  copyForDiff: /* @__PURE__ */ LazyReferenceType((() => Box))
4544
4695
  };
4545
4696
  const afterConstructorCode$9 = `
@@ -4918,9 +5069,9 @@ class BodyPairsModule {
4918
5069
  }
4919
5070
  }
4920
5071
  const rayProps = {
4921
- origin: /* @__PURE__ */ MonomorphType(Vec3),
4922
- direction: /* @__PURE__ */ MonomorphType(Vec3),
4923
- length: /* @__PURE__ */ NumberType(0)
5072
+ origin: Vec3,
5073
+ direction: Vec3,
5074
+ length: 0
4924
5075
  };
4925
5076
  class Ray extends (/* @__PURE__ */ createClass(rayProps)) {
4926
5077
  intersectsAabb(aabb) {
@@ -5041,8 +5192,8 @@ const bvhNodeProps$1 = {
5041
5192
  parent: /* @__PURE__ */ LazyReferenceType((() => BvhNode)),
5042
5193
  left: /* @__PURE__ */ LazyReferenceType((() => BvhNode)),
5043
5194
  right: /* @__PURE__ */ LazyReferenceType((() => BvhNode)),
5044
- computedBounds: /* @__PURE__ */ MonomorphType(Aabb, void 0, true),
5045
- height: /* @__PURE__ */ NumberType(0),
5195
+ computedBounds: /* @__PURE__ */ ChildType(Aabb, void 0, true),
5196
+ height: 0,
5046
5197
  objects: /* @__PURE__ */ LazyReferenceListType((() => Body))
5047
5198
  };
5048
5199
  class BvhNode extends (/* @__PURE__ */ createClass(bvhNodeProps$1)) {
@@ -5557,9 +5708,9 @@ class BvhTree {
5557
5708
  }
5558
5709
  }
5559
5710
  const basicTransformProps = {
5560
- position: /* @__PURE__ */ MonomorphType(Vec3),
5561
- rotation: /* @__PURE__ */ MonomorphType(Quat),
5562
- scale: /* @__PURE__ */ NumberType(1)
5711
+ position: Vec3,
5712
+ rotation: Quat,
5713
+ scale: 1
5563
5714
  };
5564
5715
  class BasicTransform extends (/* @__PURE__ */ createClass(basicTransformProps)) {
5565
5716
  equals(other, tolerance = 1e-6) {
@@ -5567,7 +5718,7 @@ class BasicTransform extends (/* @__PURE__ */ createClass(basicTransformProps))
5567
5718
  }
5568
5719
  }
5569
5720
  const numberValueProps = {
5570
- value: /* @__PURE__ */ NumberType(0)
5721
+ value: 0
5571
5722
  };
5572
5723
  class NumberValue extends (/* @__PURE__ */ createClass(numberValueProps)) {
5573
5724
  toObject() {
@@ -5632,9 +5783,9 @@ class ConvexHullWithConvex {
5632
5783
  }
5633
5784
  }
5634
5785
  const convexHullPointProps = {
5635
- position: /* @__PURE__ */ MonomorphType(Vec3),
5636
- numFaces: /* @__PURE__ */ NumberType(0),
5637
- faces: /* @__PURE__ */ MonomorphType(Vec3)
5786
+ position: Vec3,
5787
+ numFaces: 0,
5788
+ faces: Vec3
5638
5789
  };
5639
5790
  class ConvexHullPoint extends (/* @__PURE__ */ createClass(convexHullPointProps)) {
5640
5791
  toObject() {
@@ -5646,8 +5797,8 @@ class ConvexHullPoint extends (/* @__PURE__ */ createClass(convexHullPointProps)
5646
5797
  }
5647
5798
  }
5648
5799
  const convexHullFaceProps = {
5649
- firstVertex: /* @__PURE__ */ NumberType(0),
5650
- numVertices: /* @__PURE__ */ NumberType(0)
5800
+ firstVertex: 0,
5801
+ numVertices: 0
5651
5802
  };
5652
5803
  class ConvexHullFace extends (/* @__PURE__ */ createClass(convexHullFaceProps)) {
5653
5804
  toObject() {
@@ -5658,12 +5809,12 @@ class ConvexHullFace extends (/* @__PURE__ */ createClass(convexHullFaceProps))
5658
5809
  }
5659
5810
  }
5660
5811
  const convexHullProps = {
5661
- computedCenterOfMass: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
5812
+ computedCenterOfMass: /* @__PURE__ */ ChildType(Vec3, void 0, true),
5662
5813
  computedVolume: /* @__PURE__ */ NumberType(0, true),
5663
- computedAabb: /* @__PURE__ */ MonomorphType(Aabb, void 0, true),
5664
- convexRadius: /* @__PURE__ */ NumberType(0),
5814
+ computedAabb: /* @__PURE__ */ ChildType(Aabb, void 0, true),
5815
+ convexRadius: 0,
5665
5816
  innerRadius: /* @__PURE__ */ NumberType(0, true),
5666
- inertia: /* @__PURE__ */ MonomorphType(Mat3, void 0, true),
5817
+ inertia: /* @__PURE__ */ ChildType(Mat3, void 0, true),
5667
5818
  points: /* @__PURE__ */ ReferenceListType(ConvexHullPoint),
5668
5819
  // { array: Float64Array(b), itemMaxCount: b / 7, itemSize: 7 } [ConvexHullPoint], points on the convex hull surface
5669
5820
  faces: /* @__PURE__ */ ReferenceListType(ConvexHullFace),
@@ -5674,7 +5825,7 @@ const convexHullProps = {
5674
5825
  // { array: Float64Array(e), itemMaxCount: e, itemSize: 1 } [Uint32], vertex indices for each of the faces
5675
5826
  shapeNoConvexPoints: /* @__PURE__ */ ReferenceListType(Vec3),
5676
5827
  // { array: Float64Array(f), itemMaxCount: f / 3, itemSize: 3 } [Vec3], transformed points used by ConvexHullNoConvex
5677
- translation: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 0, z: 0 }),
5828
+ translation: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 0, z: 0 }),
5678
5829
  copyForDiff: /* @__PURE__ */ LazyReferenceType((() => ConvexHull))
5679
5830
  };
5680
5831
  const afterConstructorCode$8 = `
@@ -5869,9 +6020,9 @@ const multiplier = /* @__PURE__ */ Vec3.create();
5869
6020
  const transform$1 = /* @__PURE__ */ Mat4.create();
5870
6021
  const isometry$6 = /* @__PURE__ */ Isometry.create();
5871
6022
  const cylinderSupportShapeProps = {
5872
- halfHeight: /* @__PURE__ */ NumberType(0),
5873
- radius: /* @__PURE__ */ NumberType(0),
5874
- convexRadius: /* @__PURE__ */ NumberType(0)
6023
+ halfHeight: 0,
6024
+ radius: 0,
6025
+ convexRadius: 0
5875
6026
  };
5876
6027
  class CylinderSupportShape extends (/* @__PURE__ */ createClass(
5877
6028
  cylinderSupportShapeProps
@@ -5899,14 +6050,14 @@ class CylinderSupportShape extends (/* @__PURE__ */ createClass(
5899
6050
  }
5900
6051
  }
5901
6052
  const cylinderProps = {
5902
- computedCenterOfMass: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
6053
+ computedCenterOfMass: /* @__PURE__ */ ChildType(Vec3, void 0, true),
5903
6054
  computedVolume: /* @__PURE__ */ NumberType(0, true),
5904
- computedAabb: /* @__PURE__ */ MonomorphType(Aabb, void 0, true),
5905
- radius: /* @__PURE__ */ NumberType(0),
5906
- halfHeight: /* @__PURE__ */ NumberType(0),
5907
- convexRadius: /* @__PURE__ */ NumberType(0),
5908
- translation: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
5909
- supportShape: /* @__PURE__ */ MonomorphType(CylinderSupportShape, void 0, true),
6055
+ computedAabb: /* @__PURE__ */ ChildType(Aabb, void 0, true),
6056
+ radius: 0,
6057
+ halfHeight: 0,
6058
+ convexRadius: 0,
6059
+ translation: /* @__PURE__ */ ChildType(Vec3, void 0, true),
6060
+ supportShape: /* @__PURE__ */ ChildType(CylinderSupportShape, void 0, true),
5910
6061
  copyForDiff: /* @__PURE__ */ LazyReferenceType((() => Cylinder))
5911
6062
  };
5912
6063
  const afterConstructorCode$7 = `
@@ -6069,8 +6220,8 @@ const supportTop = /* @__PURE__ */ Vec3.create();
6069
6220
  const negatedScaledHalfHeightOfCylinder = /* @__PURE__ */ Vec3.create();
6070
6221
  const supportBottom = /* @__PURE__ */ Vec3.create();
6071
6222
  const capsuleNoConvexProps = {
6072
- halfHeightOfCylinder: /* @__PURE__ */ MonomorphType(Vec3),
6073
- convexRadius: /* @__PURE__ */ NumberType(0)
6223
+ halfHeightOfCylinder: Vec3,
6224
+ convexRadius: 0
6074
6225
  };
6075
6226
  class CapsuleNoConvex extends (/* @__PURE__ */ createClass(capsuleNoConvexProps)) {
6076
6227
  computeSupport(out, direction2) {
@@ -6088,8 +6239,8 @@ class CapsuleNoConvex extends (/* @__PURE__ */ createClass(capsuleNoConvexProps)
6088
6239
  }
6089
6240
  }
6090
6241
  const capsuleWithConvexProps = {
6091
- halfHeightOfCylinder: /* @__PURE__ */ MonomorphType(Vec3),
6092
- radius: /* @__PURE__ */ NumberType(0)
6242
+ halfHeightOfCylinder: Vec3,
6243
+ radius: 0
6093
6244
  };
6094
6245
  class CapsuleWithConvex extends (/* @__PURE__ */ createClass(
6095
6246
  capsuleWithConvexProps
@@ -6115,14 +6266,14 @@ class CapsuleWithConvex extends (/* @__PURE__ */ createClass(
6115
6266
  }
6116
6267
  }
6117
6268
  const capsuleProps = {
6118
- computedCenterOfMass: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
6269
+ computedCenterOfMass: /* @__PURE__ */ ChildType(Vec3, void 0, true),
6119
6270
  computedVolume: /* @__PURE__ */ NumberType(0, true),
6120
- computedAabb: /* @__PURE__ */ MonomorphType(Aabb, void 0, true),
6121
- radius: /* @__PURE__ */ NumberType(0),
6122
- height: /* @__PURE__ */ NumberType(0),
6271
+ computedAabb: /* @__PURE__ */ ChildType(Aabb, void 0, true),
6272
+ radius: 0,
6273
+ height: 0,
6123
6274
  copyForDiff: /* @__PURE__ */ LazyReferenceType((() => Capsule)),
6124
- capsuleNoConvex: /* @__PURE__ */ MonomorphType(CapsuleNoConvex, void 0, true),
6125
- capsuleWithConvex: /* @__PURE__ */ MonomorphType(CapsuleWithConvex, void 0, true)
6275
+ capsuleNoConvex: /* @__PURE__ */ ChildType(CapsuleNoConvex, void 0, true),
6276
+ capsuleWithConvex: /* @__PURE__ */ ChildType(CapsuleWithConvex, void 0, true)
6126
6277
  };
6127
6278
  const afterConstructorCode$6 = `
6128
6279
  this.world = null;
@@ -6283,7 +6434,7 @@ const transformedShapeProps = {
6283
6434
  // heightMap not supported
6284
6435
  ["shape" + ShapeType.sphere]: /* @__PURE__ */ ReferenceType(Sphere, void 0, true),
6285
6436
  // triangleMesh not supported
6286
- transform: /* @__PURE__ */ MonomorphType(BasicTransform)
6437
+ transform: BasicTransform
6287
6438
  };
6288
6439
  const afterConstructorCode$5 = `
6289
6440
  this.world = null;
@@ -6314,9 +6465,9 @@ const transformSubshapeToCompound = /* @__PURE__ */ Isometry.create();
6314
6465
  const subShapeDirection = /* @__PURE__ */ Vec3.create();
6315
6466
  const subShapeToWorld = /* @__PURE__ */ Isometry.create();
6316
6467
  const compoundShapeProps = {
6317
- computedCenterOfMass: /* @__PURE__ */ MonomorphType(Vec3, {}, true),
6468
+ computedCenterOfMass: /* @__PURE__ */ ChildType(Vec3, {}, true),
6318
6469
  computedVolume: /* @__PURE__ */ NumberType(0, true),
6319
- computedAabb: /* @__PURE__ */ MonomorphType(Aabb, {}, true),
6470
+ computedAabb: /* @__PURE__ */ ChildType(Aabb, {}, true),
6320
6471
  copyForDiff: /* @__PURE__ */ LazyReferenceType((() => CompoundShape)),
6321
6472
  shapes: /* @__PURE__ */ ReferenceListType(TransformedShape)
6322
6473
  };
@@ -6529,13 +6680,13 @@ const scale$1 = /* @__PURE__ */ Vec3.create();
6529
6680
  const blockAabb = /* @__PURE__ */ Aabb.create();
6530
6681
  const normal$1 = /* @__PURE__ */ Vec3.create();
6531
6682
  const heightMapProps = {
6532
- computedCenterOfMass: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
6683
+ computedCenterOfMass: /* @__PURE__ */ ChildType(Vec3, void 0, true),
6533
6684
  computedVolume: /* @__PURE__ */ NumberType(0, true),
6534
- computedAabb: /* @__PURE__ */ MonomorphType(Aabb, {}, true),
6685
+ computedAabb: /* @__PURE__ */ ChildType(Aabb, {}, true),
6535
6686
  copyForDiff: /* @__PURE__ */ LazyReferenceType((() => HeightMap)),
6536
- subdivisionsCount: /* @__PURE__ */ NumberType(0),
6537
- scale: /* @__PURE__ */ MonomorphType(Vec3),
6538
- positionOffset: /* @__PURE__ */ MonomorphType(Vec3)
6687
+ subdivisionsCount: 0,
6688
+ scale: Vec3,
6689
+ positionOffset: Vec3
6539
6690
  // heights: PoolReferenceType(Vec1),
6540
6691
  // minHeights: PoolReferenceType(Vec1),
6541
6692
  // maxHeights: PoolReferenceType(Vec1),
@@ -6787,7 +6938,7 @@ const bvhNodeProps = {
6787
6938
  parent: /* @__PURE__ */ LazyReferenceType((() => TriangleMeshBvhNode)),
6788
6939
  left: /* @__PURE__ */ LazyReferenceType((() => TriangleMeshBvhNode)),
6789
6940
  right: /* @__PURE__ */ LazyReferenceType((() => TriangleMeshBvhNode)),
6790
- computedBounds: /* @__PURE__ */ MonomorphType(Aabb, void 0, true),
6941
+ computedBounds: /* @__PURE__ */ ChildType(Aabb, void 0, true),
6791
6942
  depth: /* @__PURE__ */ NumberType(0, true),
6792
6943
  objects: /* @__PURE__ */ LazyReferenceListType((() => Triangle$1))
6793
6944
  };
@@ -7047,11 +7198,11 @@ const nodeBounds = /* @__PURE__ */ Aabb.create();
7047
7198
  const bodyBounds = /* @__PURE__ */ Aabb.create();
7048
7199
  const isometry$2 = /* @__PURE__ */ Isometry.create();
7049
7200
  const triangleMeshProps = {
7050
- computedCenterOfMass: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7201
+ computedCenterOfMass: /* @__PURE__ */ ChildType(Vec3, void 0, true),
7051
7202
  computedVolume: /* @__PURE__ */ NumberType(0, true),
7052
- computedAabb: /* @__PURE__ */ MonomorphType(Aabb, void 0, true),
7053
- translation: /* @__PURE__ */ MonomorphType(Vec3),
7054
- inertia: /* @__PURE__ */ MonomorphType(Mat3, void 0, true),
7203
+ computedAabb: /* @__PURE__ */ ChildType(Aabb, void 0, true),
7204
+ translation: Vec3,
7205
+ inertia: /* @__PURE__ */ ChildType(Mat3, void 0, true),
7055
7206
  vertexPositions: /* @__PURE__ */ ReferenceListType(Vec3),
7056
7207
  faceIndices: /* @__PURE__ */ ReferenceListType(Vec3),
7057
7208
  triangles: /* @__PURE__ */ ReferenceListType(Triangle$1),
@@ -7153,15 +7304,15 @@ const constraintOptionsProps = {
7153
7304
  /**
7154
7305
  * Value used to scale the amount of position error to correct per solve iteration. Expected to be in the interval [0, 1]
7155
7306
  */
7156
- positionBaumgarte: /* @__PURE__ */ NumberType(0.8),
7307
+ positionBaumgarte: 0.8,
7157
7308
  /**
7158
7309
  * Value used to scale the amount of velocity error to correct per solve iteration. Expected to be in the interval [0, 1]
7159
7310
  */
7160
- velocityBaumgarte: /* @__PURE__ */ NumberType(1),
7311
+ velocityBaumgarte: 1,
7161
7312
  /**
7162
7313
  * Value used to scale the strength of the constraint. recommend to tune in the interval of [0, 1], with 0 being no correction, 1 being full correction
7163
7314
  */
7164
- strength: /* @__PURE__ */ NumberType(1)
7315
+ strength: 1
7165
7316
  };
7166
7317
  class ConstraintOptions extends (/* @__PURE__ */ createClass(
7167
7318
  constraintOptionsProps
@@ -7170,17 +7321,17 @@ class ConstraintOptions extends (/* @__PURE__ */ createClass(
7170
7321
  const pointConstraintComponentProps = {
7171
7322
  bodyA: /* @__PURE__ */ LazyReferenceType((() => Body)),
7172
7323
  bodyB: /* @__PURE__ */ LazyReferenceType((() => Body)),
7173
- options: /* @__PURE__ */ MonomorphType(ConstraintOptions, {
7324
+ options: /* @__PURE__ */ ChildType(ConstraintOptions, {
7174
7325
  positionBaumgarte: 0.8,
7175
7326
  velocityBaumgarte: 1,
7176
7327
  strength: 1
7177
7328
  }),
7178
- momentArmA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7179
- momentArmB: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7180
- effectiveMass: /* @__PURE__ */ MonomorphType(Mat3, void 0, true),
7181
- effectiveInverseInertiaA: /* @__PURE__ */ MonomorphType(Mat3, void 0, true),
7182
- effectiveInverseInertiaB: /* @__PURE__ */ MonomorphType(Mat3, void 0, true),
7183
- totalLambda: /* @__PURE__ */ MonomorphType(Vec3, void 0, true)
7329
+ momentArmA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
7330
+ momentArmB: /* @__PURE__ */ ChildType(Vec3, void 0, true),
7331
+ effectiveMass: /* @__PURE__ */ ChildType(Mat3, void 0, true),
7332
+ effectiveInverseInertiaA: /* @__PURE__ */ ChildType(Mat3, void 0, true),
7333
+ effectiveInverseInertiaB: /* @__PURE__ */ ChildType(Mat3, void 0, true),
7334
+ totalLambda: /* @__PURE__ */ ChildType(Vec3, void 0, true)
7184
7335
  };
7185
7336
  class PointConstraintComponent extends (/* @__PURE__ */ createClass(pointConstraintComponentProps)) {
7186
7337
  deactivate() {
@@ -7293,11 +7444,11 @@ const transformWorldToLocalB$2 = /* @__PURE__ */ Isometry.create();
7293
7444
  const transformLocalToWorld$3 = /* @__PURE__ */ Mat4.create();
7294
7445
  const pointConstraintProps = {
7295
7446
  ...baseConstraintProps,
7296
- positionA: /* @__PURE__ */ MonomorphType(Vec3),
7297
- positionB: /* @__PURE__ */ MonomorphType(Vec3),
7298
- localPositionA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7299
- localPositionB: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7300
- translationComponent: /* @__PURE__ */ MonomorphType(PointConstraintComponent)
7447
+ positionA: Vec3,
7448
+ positionB: Vec3,
7449
+ localPositionA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
7450
+ localPositionB: /* @__PURE__ */ ChildType(Vec3, void 0, true),
7451
+ translationComponent: PointConstraintComponent
7301
7452
  };
7302
7453
  class PointConstraint extends (/* @__PURE__ */ createClass(pointConstraintProps)) {
7303
7454
  constructor() {
@@ -7371,15 +7522,15 @@ PointConstraint.create = function() {
7371
7522
  const rotationEulerComponentProps = {
7372
7523
  bodyA: /* @__PURE__ */ LazyReferenceType((() => Body)),
7373
7524
  bodyB: /* @__PURE__ */ LazyReferenceType((() => Body)),
7374
- options: /* @__PURE__ */ MonomorphType(ConstraintOptions, {
7525
+ options: /* @__PURE__ */ ChildType(ConstraintOptions, {
7375
7526
  positionBaumgarte: 0.8,
7376
7527
  velocityBaumgarte: 1,
7377
7528
  strength: 1
7378
7529
  }),
7379
- mInvI1: /* @__PURE__ */ MonomorphType(Mat3, void 0, true),
7380
- mInvI2: /* @__PURE__ */ MonomorphType(Mat3, void 0, true),
7381
- effectiveMassRotationComponent: /* @__PURE__ */ MonomorphType(Mat3, void 0, true),
7382
- totalLambdaRotationComponent: /* @__PURE__ */ MonomorphType(Vec3, void 0, true)
7530
+ mInvI1: /* @__PURE__ */ ChildType(Mat3, void 0, true),
7531
+ mInvI2: /* @__PURE__ */ ChildType(Mat3, void 0, true),
7532
+ effectiveMassRotationComponent: /* @__PURE__ */ ChildType(Mat3, void 0, true),
7533
+ totalLambdaRotationComponent: /* @__PURE__ */ ChildType(Vec3, void 0, true)
7383
7534
  };
7384
7535
  class RotationEulerComponent extends (/* @__PURE__ */ createClass(
7385
7536
  rotationEulerComponentProps
@@ -7477,23 +7628,23 @@ const transformWorldToLocalB$1 = /* @__PURE__ */ Mat4.create();
7477
7628
  const inverseRotationB = /* @__PURE__ */ Quat.create();
7478
7629
  const fixedConstraintProps = {
7479
7630
  ...baseConstraintProps,
7480
- positionA: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 0, z: 0 }),
7481
- positionB: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 0, z: 0 }),
7482
- axisXA: /* @__PURE__ */ MonomorphType(Vec3, { x: 1, y: 0, z: 0 }),
7483
- axisXB: /* @__PURE__ */ MonomorphType(Vec3, { x: 1, y: 0, z: 0 }),
7484
- axisYA: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 1, z: 0 }),
7485
- axisYB: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 1, z: 0 }),
7486
- localPositionA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7487
- localPositionB: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7488
- localAxisXA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7489
- localAxisXB: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7490
- localAxisYA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7491
- localAxisYB: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7492
- localAxisZA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7493
- localAxisZB: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7494
- inverseInitialRotationAToB: /* @__PURE__ */ MonomorphType(Quat, void 0, true),
7495
- translationComponent: /* @__PURE__ */ MonomorphType(PointConstraintComponent),
7496
- rotationComponent: /* @__PURE__ */ MonomorphType(RotationEulerComponent)
7631
+ positionA: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 0, z: 0 }),
7632
+ positionB: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 0, z: 0 }),
7633
+ axisXA: /* @__PURE__ */ ChildType(Vec3, { x: 1, y: 0, z: 0 }),
7634
+ axisXB: /* @__PURE__ */ ChildType(Vec3, { x: 1, y: 0, z: 0 }),
7635
+ axisYA: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 1, z: 0 }),
7636
+ axisYB: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 1, z: 0 }),
7637
+ localPositionA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
7638
+ localPositionB: /* @__PURE__ */ ChildType(Vec3, void 0, true),
7639
+ localAxisXA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
7640
+ localAxisXB: /* @__PURE__ */ ChildType(Vec3, void 0, true),
7641
+ localAxisYA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
7642
+ localAxisYB: /* @__PURE__ */ ChildType(Vec3, void 0, true),
7643
+ localAxisZA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
7644
+ localAxisZB: /* @__PURE__ */ ChildType(Vec3, void 0, true),
7645
+ inverseInitialRotationAToB: /* @__PURE__ */ ChildType(Quat, void 0, true),
7646
+ translationComponent: PointConstraintComponent,
7647
+ rotationComponent: RotationEulerComponent
7497
7648
  };
7498
7649
  class FixedConstraint extends (/* @__PURE__ */ createClass(fixedConstraintProps)) {
7499
7650
  constructor() {
@@ -7633,9 +7784,9 @@ const springProps = {
7633
7784
  0
7634
7785
  /* UseFrequency */
7635
7786
  ),
7636
- damping: /* @__PURE__ */ NumberType(0),
7637
- frequency: /* @__PURE__ */ NumberType(0),
7638
- stiffness: /* @__PURE__ */ NumberType(0)
7787
+ damping: 0,
7788
+ frequency: 0,
7789
+ stiffness: 0
7639
7790
  };
7640
7791
  class Spring extends (/* @__PURE__ */ createClass(springProps)) {
7641
7792
  reset() {
@@ -7652,8 +7803,8 @@ class Spring extends (/* @__PURE__ */ createClass(springProps)) {
7652
7803
  }
7653
7804
  }
7654
7805
  const springComponentProps = {
7655
- bias: /* @__PURE__ */ NumberType(0),
7656
- softness: /* @__PURE__ */ NumberType(0)
7806
+ bias: 0,
7807
+ softness: 0
7657
7808
  };
7658
7809
  class SpringComponent extends (/* @__PURE__ */ createClass(springComponentProps)) {
7659
7810
  getBias(lambda2) {
@@ -7700,18 +7851,18 @@ const angularImpulse = /* @__PURE__ */ Vec3.create();
7700
7851
  const axisComponentProps = {
7701
7852
  bodyA: /* @__PURE__ */ LazyReferenceType((() => Body)),
7702
7853
  bodyB: /* @__PURE__ */ LazyReferenceType((() => Body)),
7703
- options: /* @__PURE__ */ MonomorphType(ConstraintOptions, {
7854
+ options: /* @__PURE__ */ ChildType(ConstraintOptions, {
7704
7855
  positionBaumgarte: 0.8,
7705
7856
  velocityBaumgarte: 1,
7706
7857
  strength: 1
7707
7858
  }),
7708
- mR1PlusUxAxis: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 0, z: 0 }),
7709
- mR2xAxis: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 0, z: 0 }),
7710
- mInvI1_R1PlusUxAxis: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 0, z: 0 }),
7711
- mInvI2_R2xAxis: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 0, z: 0 }),
7712
- effectiveMass: /* @__PURE__ */ NumberType(0),
7713
- totalLambda: /* @__PURE__ */ NumberType(0),
7714
- springComponent: /* @__PURE__ */ MonomorphType(SpringComponent)
7859
+ mR1PlusUxAxis: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 0, z: 0 }),
7860
+ mR2xAxis: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 0, z: 0 }),
7861
+ mInvI1_R1PlusUxAxis: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 0, z: 0 }),
7862
+ mInvI2_R2xAxis: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 0, z: 0 }),
7863
+ effectiveMass: 0,
7864
+ totalLambda: 0,
7865
+ springComponent: SpringComponent
7715
7866
  };
7716
7867
  class AxisComponent extends (/* @__PURE__ */ createClass(axisComponentProps)) {
7717
7868
  deactivate() {
@@ -7870,17 +8021,17 @@ const armB = /* @__PURE__ */ Vec3.create();
7870
8021
  const vectorAB$5 = /* @__PURE__ */ Vec3.create();
7871
8022
  const distanceConstraintProps = {
7872
8023
  ...baseConstraintProps,
7873
- positionA: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 0, z: 0 }),
7874
- positionB: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 0, z: 0 }),
7875
- minDistance: /* @__PURE__ */ NumberType(-1),
7876
- maxDistance: /* @__PURE__ */ NumberType(-1),
7877
- spring: /* @__PURE__ */ MonomorphType(Spring),
7878
- axisComponent: /* @__PURE__ */ MonomorphType(AxisComponent),
7879
- localPositionA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7880
- localPositionB: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7881
- worldPositionA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7882
- worldPositionB: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
7883
- worldNormal: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8024
+ positionA: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 0, z: 0 }),
8025
+ positionB: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 0, z: 0 }),
8026
+ minDistance: -1,
8027
+ maxDistance: -1,
8028
+ spring: Spring,
8029
+ axisComponent: AxisComponent,
8030
+ localPositionA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8031
+ localPositionB: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8032
+ worldPositionA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8033
+ worldPositionB: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8034
+ worldNormal: /* @__PURE__ */ ChildType(Vec3, void 0, true),
7884
8035
  minLambda: /* @__PURE__ */ NumberType(0, true),
7885
8036
  maxLambda: /* @__PURE__ */ NumberType(0, true)
7886
8037
  };
@@ -8032,7 +8183,7 @@ var MotorMode = /* @__PURE__ */ ((MotorMode2) => {
8032
8183
  return MotorMode2;
8033
8184
  })(MotorMode || {});
8034
8185
  const motorProps = {
8035
- spring: /* @__PURE__ */ MonomorphType(Spring, { mode: SpringMode.UseFrequency, damping: 1, frequency: 2, stiffness: 2 }),
8186
+ spring: /* @__PURE__ */ ChildType(Spring, { mode: SpringMode.UseFrequency, damping: 1, frequency: 2, stiffness: 2 }),
8036
8187
  minForce: /* @__PURE__ */ NumberType(-Infinity),
8037
8188
  maxForce: /* @__PURE__ */ NumberType(Infinity),
8038
8189
  minTorque: /* @__PURE__ */ NumberType(-Infinity),
@@ -8069,22 +8220,22 @@ const massCA = /* @__PURE__ */ Vec3.create();
8069
8220
  const hingeComponentProps = {
8070
8221
  bodyA: /* @__PURE__ */ LazyReferenceType((() => Body)),
8071
8222
  bodyB: /* @__PURE__ */ LazyReferenceType((() => Body)),
8072
- options: /* @__PURE__ */ MonomorphType(ConstraintOptions, {
8223
+ options: /* @__PURE__ */ ChildType(ConstraintOptions, {
8073
8224
  positionBaumgarte: 0.8,
8074
8225
  velocityBaumgarte: 1,
8075
8226
  strength: 1
8076
8227
  }),
8077
- axisA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8078
- axisB: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8079
- axisC: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8080
- crossBA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8081
- crossCA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8228
+ axisA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8229
+ axisB: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8230
+ axisC: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8231
+ crossBA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8232
+ crossCA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8082
8233
  effectiveMass00: /* @__PURE__ */ NumberType(0, true),
8083
8234
  effectiveMass01: /* @__PURE__ */ NumberType(0, true),
8084
8235
  effectiveMass10: /* @__PURE__ */ NumberType(0, true),
8085
8236
  effectiveMass11: /* @__PURE__ */ NumberType(0, true),
8086
- inverseInertiaA: /* @__PURE__ */ MonomorphType(Mat3, void 0, true),
8087
- inverseInertiaB: /* @__PURE__ */ MonomorphType(Mat3, void 0, true),
8237
+ inverseInertiaA: /* @__PURE__ */ ChildType(Mat3, void 0, true),
8238
+ inverseInertiaB: /* @__PURE__ */ ChildType(Mat3, void 0, true),
8088
8239
  totalLambdaA: /* @__PURE__ */ NumberType(0, true),
8089
8240
  totalLambdaB: /* @__PURE__ */ NumberType(0, true)
8090
8241
  };
@@ -8216,15 +8367,15 @@ const inverseEffectiveMass = /* @__PURE__ */ Vec3.create();
8216
8367
  const angleComponentProps = {
8217
8368
  bodyA: /* @__PURE__ */ LazyReferenceType((() => Body)),
8218
8369
  bodyB: /* @__PURE__ */ LazyReferenceType((() => Body)),
8219
- options: /* @__PURE__ */ MonomorphType(ConstraintOptions, {
8370
+ options: /* @__PURE__ */ ChildType(ConstraintOptions, {
8220
8371
  positionBaumgarte: 0.8,
8221
8372
  velocityBaumgarte: 1,
8222
8373
  strength: 1
8223
8374
  }),
8224
- springConstraintPart: /* @__PURE__ */ MonomorphType(SpringComponent, void 0, true),
8375
+ springConstraintPart: /* @__PURE__ */ ChildType(SpringComponent, void 0, true),
8225
8376
  effectiveMass: /* @__PURE__ */ NumberType(0, true),
8226
- effectiveInverseInertiaA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8227
- effectiveInverseInertiaB: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8377
+ effectiveInverseInertiaA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8378
+ effectiveInverseInertiaB: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8228
8379
  totalLambda: /* @__PURE__ */ NumberType(0, true)
8229
8380
  };
8230
8381
  class AngleComponent extends (/* @__PURE__ */ createClass(angleComponentProps)) {
@@ -8383,35 +8534,35 @@ const transformLocalToWorld = /* @__PURE__ */ Mat4.create();
8383
8534
  const hingeConstraintProps = {
8384
8535
  ...baseConstraintProps,
8385
8536
  // init data
8386
- pointA: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 0, z: 0 }),
8387
- pointB: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 0, z: 0 }),
8388
- hingeA: /* @__PURE__ */ MonomorphType(Vec3, { x: 1, y: 0, z: 0 }),
8389
- hingeB: /* @__PURE__ */ MonomorphType(Vec3, { x: 1, y: 0, z: 0 }),
8390
- normalA: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 1, z: 0 }),
8391
- normalB: /* @__PURE__ */ MonomorphType(Vec3, { x: 0, y: 1, z: 0 }),
8392
- spring: /* @__PURE__ */ MonomorphType(Spring),
8393
- motor: /* @__PURE__ */ MonomorphType(Motor),
8537
+ pointA: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 0, z: 0 }),
8538
+ pointB: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 0, z: 0 }),
8539
+ hingeA: /* @__PURE__ */ ChildType(Vec3, { x: 1, y: 0, z: 0 }),
8540
+ hingeB: /* @__PURE__ */ ChildType(Vec3, { x: 1, y: 0, z: 0 }),
8541
+ normalA: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 1, z: 0 }),
8542
+ normalB: /* @__PURE__ */ ChildType(Vec3, { x: 0, y: 1, z: 0 }),
8543
+ spring: Spring,
8544
+ motor: Motor,
8394
8545
  minHingeAngle: /* @__PURE__ */ NumberType(-Math.PI),
8395
8546
  maxHingeAngle: /* @__PURE__ */ NumberType(+Math.PI),
8396
- maxFrictionTorque: /* @__PURE__ */ NumberType(0),
8547
+ maxFrictionTorque: 0,
8397
8548
  // constraint data
8398
- localPointA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8399
- localPointB: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8400
- localHingeA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8401
- localHingeB: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8402
- localNormalA: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8403
- localNormalB: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8404
- inverseInitialRotationAB: /* @__PURE__ */ MonomorphType(Quat, void 0, true),
8549
+ localPointA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8550
+ localPointB: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8551
+ localHingeA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8552
+ localHingeB: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8553
+ localNormalA: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8554
+ localNormalB: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8555
+ inverseInitialRotationAB: /* @__PURE__ */ ChildType(Quat, void 0, true),
8405
8556
  areLimitsEnabled: /* @__PURE__ */ BooleanType(false, true),
8406
- targetAngularSpeed: /* @__PURE__ */ NumberType(0),
8407
- targetAngle: /* @__PURE__ */ NumberType(0),
8557
+ targetAngularSpeed: 0,
8558
+ targetAngle: 0,
8408
8559
  hingeAngle: /* @__PURE__ */ NumberType(0, true),
8409
- axis1: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
8560
+ axis1: /* @__PURE__ */ ChildType(Vec3, void 0, true),
8410
8561
  // constraint parts
8411
- pointConstraintPart: /* @__PURE__ */ MonomorphType(PointConstraintComponent),
8412
- rotationConstraintPart: /* @__PURE__ */ MonomorphType(HingeComponent),
8413
- rotationLimitsConstraintPart: /* @__PURE__ */ MonomorphType(AngleComponent),
8414
- motorConstraintPart: /* @__PURE__ */ MonomorphType(AngleComponent)
8562
+ pointConstraintPart: PointConstraintComponent,
8563
+ rotationConstraintPart: HingeComponent,
8564
+ rotationLimitsConstraintPart: AngleComponent,
8565
+ motorConstraintPart: AngleComponent
8415
8566
  };
8416
8567
  class HingeConstraint extends (/* @__PURE__ */ createClass(hingeConstraintProps)) {
8417
8568
  constructor() {
@@ -9004,38 +9155,38 @@ const bodyProps = {
9004
9155
  0
9005
9156
  /* dynamic */
9006
9157
  ),
9007
- position: /* @__PURE__ */ MonomorphType(Vec3),
9008
- orientation: /* @__PURE__ */ MonomorphType(Quat),
9009
- linearVelocity: /* @__PURE__ */ MonomorphType(Vec3),
9010
- angularVelocity: /* @__PURE__ */ MonomorphType(Vec3),
9011
- computedCenterOfMassPosition: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
9012
- computedBounds: /* @__PURE__ */ MonomorphType(Aabb, void 0, true),
9013
- previousPosition: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
9014
- previousOrientation: /* @__PURE__ */ MonomorphType(Quat, void 0, true),
9158
+ position: Vec3,
9159
+ orientation: Quat,
9160
+ linearVelocity: Vec3,
9161
+ angularVelocity: Vec3,
9162
+ computedCenterOfMassPosition: /* @__PURE__ */ ChildType(Vec3, void 0, true),
9163
+ computedBounds: /* @__PURE__ */ ChildType(Aabb, void 0, true),
9164
+ previousPosition: /* @__PURE__ */ ChildType(Vec3, void 0, true),
9165
+ previousOrientation: /* @__PURE__ */ ChildType(Quat, void 0, true),
9015
9166
  isSleeping: /* @__PURE__ */ BooleanType(false, true),
9016
9167
  timeWithoutMoving: /* @__PURE__ */ NumberType(0, true),
9017
- friction: /* @__PURE__ */ NumberType(0),
9018
- restitution: /* @__PURE__ */ NumberType(0),
9168
+ friction: 0,
9169
+ restitution: 0,
9019
9170
  frictionFunction: /* @__PURE__ */ NumberType(CoefficientFunctionType.average),
9020
9171
  restitutionFunction: /* @__PURE__ */ NumberType(CoefficientFunctionType.average),
9021
- mass: /* @__PURE__ */ NumberType(0),
9022
- density: /* @__PURE__ */ NumberType(0),
9172
+ mass: 0,
9173
+ density: 0,
9023
9174
  inverseMass: /* @__PURE__ */ NumberType(0, true),
9024
- computedLocalInverseInertia: /* @__PURE__ */ MonomorphType(Mat3, void 0, true),
9025
- computedWorldInverseInertia: /* @__PURE__ */ MonomorphType(Mat3, void 0, true),
9175
+ computedLocalInverseInertia: /* @__PURE__ */ ChildType(Mat3, void 0, true),
9176
+ computedWorldInverseInertia: /* @__PURE__ */ ChildType(Mat3, void 0, true),
9026
9177
  colliderType: /* @__PURE__ */ NumberType(
9027
9178
  2
9028
9179
  /* resolveContact */
9029
9180
  ),
9030
- gravityScale: /* @__PURE__ */ NumberType(1),
9031
- linearForces: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
9032
- angularForces: /* @__PURE__ */ MonomorphType(Vec3, void 0, true),
9181
+ gravityScale: 1,
9182
+ linearForces: /* @__PURE__ */ ChildType(Vec3, void 0, true),
9183
+ angularForces: /* @__PURE__ */ ChildType(Vec3, void 0, true),
9033
9184
  copyForDiff: /* @__PURE__ */ LazyReferenceType((() => Body)),
9034
9185
  firstPotentialPairEdge: /* @__PURE__ */ LazyReferenceType((() => BodyPairEdge)),
9035
9186
  belongsToGroups: /* @__PURE__ */ NumberType(AllFlag),
9036
9187
  collidesWithGroups: /* @__PURE__ */ NumberType(AllFlag),
9037
9188
  node: /* @__PURE__ */ LazyReferenceType((() => BvhNode)),
9038
- shapeType: /* @__PURE__ */ NumberType(0),
9189
+ shapeType: /* @__PURE__ */ NumberType(ShapeType.box),
9039
9190
  // we need to do "as 'shape' ..." otherwise they are just 'string' and not the actual specific keys
9040
9191
  ["shape" + ShapeType.box]: /* @__PURE__ */ ReferenceType(Box, void 0, true),
9041
9192
  ["shape" + ShapeType.capsule]: /* @__PURE__ */ ReferenceType(Capsule, void 0, true),
@@ -9046,8 +9197,8 @@ const bodyProps = {
9046
9197
  ["shape" + ShapeType.sphere]: /* @__PURE__ */ ReferenceType(Sphere, void 0, true),
9047
9198
  ["shape" + ShapeType.triangleMesh]: /* @__PURE__ */ ReferenceType(TriangleMesh, void 0, true),
9048
9199
  isSleepingEnabled: /* @__PURE__ */ BooleanType(true),
9049
- linearDamping: /* @__PURE__ */ NumberType(-1),
9050
- angularDamping: /* @__PURE__ */ NumberType(-1),
9200
+ linearDamping: -1,
9201
+ angularDamping: -1,
9051
9202
  firstPotentialConstraintPairEdge: /* @__PURE__ */ LazyReferenceType(
9052
9203
  (() => ConstraintPairEdge)
9053
9204
  ),
@@ -9391,24 +9542,24 @@ var CollisionStatus = /* @__PURE__ */ ((CollisionStatus2) => {
9391
9542
  return CollisionStatus2;
9392
9543
  })(CollisionStatus || {});
9393
9544
  const collisionResultProps = {
9394
- status: /* @__PURE__ */ NumberType(0),
9545
+ status: 0,
9395
9546
  hasContact: /* @__PURE__ */ BooleanType(false),
9396
- penetration: /* @__PURE__ */ NumberType(0),
9397
- contactPointA: /* @__PURE__ */ MonomorphType(Vec3),
9398
- contactPointB: /* @__PURE__ */ MonomorphType(Vec3),
9399
- normalA: /* @__PURE__ */ MonomorphType(Vec3),
9400
- normalB: /* @__PURE__ */ MonomorphType(Vec3),
9401
- momentArmA: /* @__PURE__ */ MonomorphType(Vec3),
9402
- momentArmB: /* @__PURE__ */ MonomorphType(Vec3),
9403
- surfaceNormalA: /* @__PURE__ */ MonomorphType(Vec3),
9404
- surfaceNormalB: /* @__PURE__ */ MonomorphType(Vec3),
9547
+ penetration: 0,
9548
+ contactPointA: Vec3,
9549
+ contactPointB: Vec3,
9550
+ normalA: Vec3,
9551
+ normalB: Vec3,
9552
+ momentArmA: Vec3,
9553
+ momentArmB: Vec3,
9554
+ surfaceNormalA: Vec3,
9555
+ surfaceNormalB: Vec3,
9405
9556
  bodyA: /* @__PURE__ */ LazyReferenceType((() => Body)),
9406
9557
  bodyB: /* @__PURE__ */ LazyReferenceType((() => Body)),
9407
- subShapeIdA: /* @__PURE__ */ NumberType(0),
9408
- subShapeIdB: /* @__PURE__ */ NumberType(0),
9558
+ subShapeIdA: 0,
9559
+ subShapeIdB: 0,
9409
9560
  isBackFace: /* @__PURE__ */ BooleanType(false),
9410
- faceA: /* @__PURE__ */ MonomorphType(Face),
9411
- faceB: /* @__PURE__ */ MonomorphType(Face)
9561
+ faceA: Face,
9562
+ faceB: Face
9412
9563
  };
9413
9564
  class CollisionResult extends (/* @__PURE__ */ createClass(collisionResultProps)) {
9414
9565
  reset() {
@@ -9496,25 +9647,25 @@ function createDefaultCollisionSettings() {
9496
9647
  };
9497
9648
  }
9498
9649
  const castResultProps = {
9499
- status: /* @__PURE__ */ NumberType(0),
9650
+ status: 0,
9500
9651
  hasContact: /* @__PURE__ */ BooleanType(false),
9501
- penetration: /* @__PURE__ */ NumberType(0),
9502
- contactPointA: /* @__PURE__ */ MonomorphType(Vec3),
9503
- contactPointB: /* @__PURE__ */ MonomorphType(Vec3),
9504
- normalA: /* @__PURE__ */ MonomorphType(Vec3),
9505
- normalB: /* @__PURE__ */ MonomorphType(Vec3),
9506
- momentArmA: /* @__PURE__ */ MonomorphType(Vec3),
9507
- momentArmB: /* @__PURE__ */ MonomorphType(Vec3),
9508
- surfaceNormalA: /* @__PURE__ */ MonomorphType(Vec3),
9509
- surfaceNormalB: /* @__PURE__ */ MonomorphType(Vec3),
9652
+ penetration: 0,
9653
+ contactPointA: Vec3,
9654
+ contactPointB: Vec3,
9655
+ normalA: Vec3,
9656
+ normalB: Vec3,
9657
+ momentArmA: Vec3,
9658
+ momentArmB: Vec3,
9659
+ surfaceNormalA: Vec3,
9660
+ surfaceNormalB: Vec3,
9510
9661
  bodyA: /* @__PURE__ */ LazyReferenceType((() => Body)),
9511
9662
  bodyB: /* @__PURE__ */ LazyReferenceType((() => Body)),
9512
- subShapeIdA: /* @__PURE__ */ NumberType(0),
9513
- subShapeIdB: /* @__PURE__ */ NumberType(0),
9663
+ subShapeIdA: 0,
9664
+ subShapeIdB: 0,
9514
9665
  isBackFace: /* @__PURE__ */ BooleanType(false),
9515
- faceA: /* @__PURE__ */ MonomorphType(Face),
9516
- faceB: /* @__PURE__ */ MonomorphType(Face),
9517
- fraction: /* @__PURE__ */ NumberType(0),
9666
+ faceA: Face,
9667
+ faceB: Face,
9668
+ fraction: 0,
9518
9669
  isBackFaceHit: /* @__PURE__ */ BooleanType(false)
9519
9670
  };
9520
9671
  class CastResult extends (/* @__PURE__ */ createClass(castResultProps)) {
@@ -9615,17 +9766,17 @@ function computeBarycentricCoordinates2d(outBarycentric, a3, b3, squaredToleranc
9615
9766
  outBarycentric.isValid = true;
9616
9767
  }
9617
9768
  const closestPointResultProps = {
9618
- point: /* @__PURE__ */ MonomorphType(Vec3),
9619
- pointSet: /* @__PURE__ */ NumberType(0)
9769
+ point: Vec3,
9770
+ pointSet: 0
9620
9771
  };
9621
9772
  class ClosestPointResult extends (/* @__PURE__ */ createClass(
9622
9773
  closestPointResultProps
9623
9774
  )) {
9624
9775
  }
9625
9776
  const barycentricCoordinatesResultProps = {
9626
- u: /* @__PURE__ */ NumberType(0),
9627
- v: /* @__PURE__ */ NumberType(0),
9628
- w: /* @__PURE__ */ NumberType(0),
9777
+ u: 0,
9778
+ v: 0,
9779
+ w: 0,
9629
9780
  isValid: /* @__PURE__ */ BooleanType(false)
9630
9781
  };
9631
9782
  class BarycentricCoordinatesResult extends (/* @__PURE__ */ createClass(barycentricCoordinatesResultProps)) {
@@ -9840,10 +9991,10 @@ function computeClosestPointOnTriangle(outClosestPoint, inA, inB, inC, mustInclu
9840
9991
  outClosestPoint.point.scaleVector(n$1, tempVector$2.dot(n$1) / (3 * normalLengthSquared));
9841
9992
  }
9842
9993
  const vec4Props = {
9843
- x: /* @__PURE__ */ NumberType(0),
9844
- y: /* @__PURE__ */ NumberType(0),
9845
- z: /* @__PURE__ */ NumberType(0),
9846
- w: /* @__PURE__ */ NumberType(0)
9994
+ x: 0,
9995
+ y: 0,
9996
+ z: 0,
9997
+ w: 0
9847
9998
  };
9848
9999
  class Vec4 extends (/* @__PURE__ */ createClass(vec4Props)) {
9849
10000
  }
@@ -9948,9 +10099,9 @@ function computeClosestPointOnTetrahedron(result2, inA, inB, inC, inD, mustInclu
9948
10099
  }
9949
10100
  }
9950
10101
  const closestPointToSimplexProps = {
9951
- point: /* @__PURE__ */ MonomorphType(Vec3),
9952
- squaredDistance: /* @__PURE__ */ NumberType(0),
9953
- pointSet: /* @__PURE__ */ NumberType(0),
10102
+ point: Vec3,
10103
+ squaredDistance: 0,
10104
+ pointSet: 0,
9954
10105
  closestPointFound: /* @__PURE__ */ BooleanType(false)
9955
10106
  };
9956
10107
  class ClosestPointToSimplex extends (/* @__PURE__ */ createClass(
@@ -9958,10 +10109,10 @@ class ClosestPointToSimplex extends (/* @__PURE__ */ createClass(
9958
10109
  )) {
9959
10110
  }
9960
10111
  const gjkClosestPointsProps = {
9961
- squaredDistance: /* @__PURE__ */ NumberType(0),
9962
- penetrationAxis: /* @__PURE__ */ MonomorphType(Vec3),
9963
- pointA: /* @__PURE__ */ MonomorphType(Vec3),
9964
- pointB: /* @__PURE__ */ MonomorphType(Vec3)
10112
+ squaredDistance: 0,
10113
+ penetrationAxis: Vec3,
10114
+ pointA: Vec3,
10115
+ pointB: Vec3
9965
10116
  };
9966
10117
  class GjkClosestPoints extends (/* @__PURE__ */ createClass(
9967
10118
  gjkClosestPointsProps
@@ -9975,10 +10126,10 @@ class GjkClosestPoints extends (/* @__PURE__ */ createClass(
9975
10126
  }
9976
10127
  const gjkCastShapeResultProps = {
9977
10128
  isHitFound: /* @__PURE__ */ BooleanType(false),
9978
- lambda: /* @__PURE__ */ NumberType(0),
9979
- separatingAxis: /* @__PURE__ */ MonomorphType(Vec3),
9980
- pointA: /* @__PURE__ */ MonomorphType(Vec3),
9981
- pointB: /* @__PURE__ */ MonomorphType(Vec3)
10129
+ lambda: 0,
10130
+ separatingAxis: Vec3,
10131
+ pointA: Vec3,
10132
+ pointB: Vec3
9982
10133
  };
9983
10134
  class GjkCastShapeResult extends (/* @__PURE__ */ createClass(
9984
10135
  gjkCastShapeResultProps
@@ -10474,26 +10625,26 @@ class GjkModule {
10474
10625
  const v = /* @__PURE__ */ Vec3.create();
10475
10626
  const edgeProps = {
10476
10627
  neighbourTriangle: /* @__PURE__ */ LazyReferenceType((() => Triangle2)),
10477
- neighbourEdge: /* @__PURE__ */ NumberType(0),
10478
- startIndex: /* @__PURE__ */ NumberType(0)
10628
+ neighbourEdge: 0,
10629
+ startIndex: 0
10479
10630
  };
10480
10631
  class Edge extends (/* @__PURE__ */ createClass(edgeProps)) {
10481
10632
  //
10482
10633
  }
10483
10634
  const triangleProps = {
10484
- edge0: /* @__PURE__ */ MonomorphType(Edge),
10485
- edge1: /* @__PURE__ */ MonomorphType(Edge),
10486
- edge2: /* @__PURE__ */ MonomorphType(Edge),
10487
- normal: /* @__PURE__ */ MonomorphType(Vec3),
10488
- centroid: /* @__PURE__ */ MonomorphType(Vec3),
10489
- closestLengthSq: /* @__PURE__ */ NumberType(Infinity),
10490
- lambda0: /* @__PURE__ */ NumberType(0),
10491
- lambda1: /* @__PURE__ */ NumberType(0),
10635
+ edge0: Edge,
10636
+ edge1: Edge,
10637
+ edge2: Edge,
10638
+ normal: Vec3,
10639
+ centroid: Vec3,
10640
+ closestLengthSq: Infinity,
10641
+ lambda0: 0,
10642
+ lambda1: 0,
10492
10643
  lambdaRelativeTo0: /* @__PURE__ */ BooleanType(false),
10493
10644
  closestPointInterior: /* @__PURE__ */ BooleanType(false),
10494
10645
  removed: /* @__PURE__ */ BooleanType(false),
10495
10646
  inQueue: /* @__PURE__ */ BooleanType(false),
10496
- iteration: /* @__PURE__ */ NumberType(0)
10647
+ iteration: 0
10497
10648
  };
10498
10649
  const vectorAB$4 = /* @__PURE__ */ Vec3.create();
10499
10650
  const y10 = /* @__PURE__ */ Vec3.create();
@@ -11084,10 +11235,10 @@ const p12 = /* @__PURE__ */ Vec3.create();
11084
11235
  const q10 = /* @__PURE__ */ Vec3.create();
11085
11236
  const q12 = /* @__PURE__ */ Vec3.create();
11086
11237
  const penetrationDepthProps = {
11087
- status: /* @__PURE__ */ NumberType(0),
11088
- penetrationAxis: /* @__PURE__ */ MonomorphType(Vec3),
11089
- pointA: /* @__PURE__ */ MonomorphType(Vec3),
11090
- pointB: /* @__PURE__ */ MonomorphType(Vec3)
11238
+ status: 0,
11239
+ penetrationAxis: Vec3,
11240
+ pointA: Vec3,
11241
+ pointB: Vec3
11091
11242
  };
11092
11243
  class PenetrationDepth extends (/* @__PURE__ */ createClass(
11093
11244
  penetrationDepthProps
@@ -13033,7 +13184,7 @@ const contactPairCacheMaxDeltaPositionSquared = squared(1e-3);
13033
13184
  const contactPairCacheCosMaxDeltaRotationDiv2 = Math.cos(degreesToRadians(2) / 2);
13034
13185
  const negatedPenetrationAxis = /* @__PURE__ */ Vec3.create();
13035
13186
  const vec3BufferProps = {
13036
- numItems: /* @__PURE__ */ NumberType(0),
13187
+ numItems: 0,
13037
13188
  vec3List: /* @__PURE__ */ ReferenceListType(Vec3)
13038
13189
  };
13039
13190
  class Vec3Buffer extends (/* @__PURE__ */ createClass(vec3BufferProps)) {
@@ -16123,9 +16274,11 @@ class TriangleMeshBuilder {
16123
16274
  nodes: { pool: nodes }
16124
16275
  }, bvhTreePool);
16125
16276
  mesh.bvh.build(mesh, triangles);
16126
- const hull = this.convexHullBuilder.buildFromPoints(params.vertexPositions, 0, 1e-3);
16127
- mesh.computedVolume = hull.computedVolume;
16128
- mesh.inertia.copy(hull.inertia);
16277
+ if (!params.skipHullCreation) {
16278
+ const hull = this.convexHullBuilder.buildFromPoints(params.vertexPositions, 0, 1e-3);
16279
+ mesh.computedVolume = hull.computedVolume;
16280
+ mesh.inertia.copy(hull.inertia);
16281
+ }
16129
16282
  return mesh;
16130
16283
  }
16131
16284
  }