bg2e-js 2.3.13 → 2.3.14

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/bg2e-js.js CHANGED
@@ -1,4 +1,4 @@
1
- var ct = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.X = 1] = "X", t[t.Y = 2] = "Y", t[t.Z = 3] = "Z", t[t.W = 4] = "W", t))(ct || {});
1
+ var gt = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.X = 1] = "X", t[t.Y = 2] = "Y", t[t.Z = 3] = "Z", t[t.W = 4] = "W", t))(gt || {});
2
2
  ((t) => {
3
3
  function e(r) {
4
4
  switch (r) {
@@ -17,11 +17,11 @@ var ct = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.X = 1] = "X", t[t.
17
17
  }
18
18
  }
19
19
  t.name = e;
20
- })(ct || (ct = {}));
21
- const _r = 3.141592653589793, $r = 0.01745329251994, ei = 57.29577951308233, qn = 1.5707963267948966, _n = 0.785398163397448, $n = 0.392699081698724, es = 6.283185307179586, gt = 1e-7, Le = Float32Array, ts = Float64Array, rs = 3402823e32, Ge = (t, e) => t.length >= e;
20
+ })(gt || (gt = {}));
21
+ const _r = 3.141592653589793, $r = 0.01745329251994, ei = 57.29577951308233, qn = 1.5707963267948966, _n = 0.785398163397448, $n = 0.392699081698724, es = 6.283185307179586, ut = 1e-7, Le = Float32Array, ts = Float64Array, rs = 3402823e32, Ge = (t, e) => t.length >= e;
22
22
  let Ft = Date.now();
23
- const is = (t) => typeof t != "number" ? !1 : t !== 0 && (t & t - 1) === 0, le = (t) => t > -gt && t < gt ? 0 : t, b = (t) => le(t) === 0, E = (t, e) => Math.abs(t - e) < gt, We = (t) => Math.fround(le(t * $r)), ti = (t) => Math.fround(le(t * ei)), ns = (t) => Math.fround(le(Math.sin(t))), ss = (t) => Math.fround(le(Math.cos(t))), ri = (t) => Math.fround(le(Math.tan(t))), os = (t) => Math.fround(le(1 / ri(t))), as = (t) => Math.fround(le(Math.atan(t))), hs = (t, e) => Math.fround(le(Math.atan2(t, e))), As = () => Math.random(), fs = () => (Ft = (Ft * 9301 + 49297) % 233280, 0 + Ft / 233280 * 1), ls = (t, e) => Math.fround(Math.max(t, e)), cs = (t, e) => Math.fround(Math.min(t, e)), gs = (t) => Math.fround(Math.abs(t)), us = (t) => Math.fround(Math.sqrt(t)), J = (t, e, r) => (r = r > 1 ? 1 : r, Math.fround((1 - r) * t + r * e)), ds = (t) => Math.fround(t * t), Z = (t, e, r) => Math.fround(Math.max(e, Math.min(t, r))), ws = {
24
- Axis: ct,
23
+ const is = (t) => typeof t != "number" ? !1 : t !== 0 && (t & t - 1) === 0, le = (t) => t > -ut && t < ut ? 0 : t, b = (t) => le(t) === 0, E = (t, e) => Math.abs(t - e) < ut, We = (t) => Math.fround(le(t * $r)), ti = (t) => Math.fround(le(t * ei)), ns = (t) => Math.fround(le(Math.sin(t))), ss = (t) => Math.fround(le(Math.cos(t))), ri = (t) => Math.fround(le(Math.tan(t))), os = (t) => Math.fround(le(1 / ri(t))), as = (t) => Math.fround(le(Math.atan(t))), hs = (t, e) => Math.fround(le(Math.atan2(t, e))), As = () => Math.random(), fs = () => (Ft = (Ft * 9301 + 49297) % 233280, 0 + Ft / 233280 * 1), ls = (t, e) => Math.fround(Math.max(t, e)), cs = (t, e) => Math.fround(Math.min(t, e)), gs = (t) => Math.fround(Math.abs(t)), us = (t) => Math.fround(Math.sqrt(t)), J = (t, e, r) => (r = r > 1 ? 1 : r, Math.fround((1 - r) * t + r * e)), ds = (t) => Math.fround(t * t), Z = (t, e, r) => Math.fround(Math.max(e, Math.min(t, r))), ws = {
24
+ Axis: gt,
25
25
  PI: _r,
26
26
  DEG_TO_RAD: $r,
27
27
  RAD_TO_DEG: ei,
@@ -29,7 +29,7 @@ const is = (t) => typeof t != "number" ? !1 : t !== 0 && (t & t - 1) === 0, le =
29
29
  PI_4: _n,
30
30
  PI_8: $n,
31
31
  TWO_PI: es,
32
- EPSILON: gt,
32
+ EPSILON: ut,
33
33
  NumericArray: Le,
34
34
  NumericArrayHighP: ts,
35
35
  FLOAT_MAX: rs,
@@ -1447,7 +1447,7 @@ const Cs = (t) => {
1447
1447
  return "Browser";
1448
1448
  }
1449
1449
  }, ar = () => 0, ps = () => ar() === 0, Ds = () => ar() === 1, bs = async (t) => new Uint8Array(atob(t).split("").map((e) => e.charCodeAt(0)));
1450
- class Ze {
1450
+ class qe {
1451
1451
  set writeStrategy(e) {
1452
1452
  this._writeStrategy = e;
1453
1453
  }
@@ -1494,7 +1494,7 @@ const Gt = (t) => {
1494
1494
  Gt(s.target), i(new Error(`Image load aborted '${t}'.`));
1495
1495
  }), n.src = t + (e ? `?${Pt()}` : "");
1496
1496
  });
1497
- class ai extends Ze {
1497
+ class ai extends qe {
1498
1498
  async load(e) {
1499
1499
  return await Es(e, !1);
1500
1500
  }
@@ -1513,7 +1513,7 @@ const Ut = (t) => {
1513
1513
  Ut(n.target), r(new Error(`Video load aborted '${t}'`));
1514
1514
  }), i.src = t;
1515
1515
  });
1516
- class hi extends Ze {
1516
+ class hi extends qe {
1517
1517
  async load(e) {
1518
1518
  return await xs(e);
1519
1519
  }
@@ -1521,7 +1521,7 @@ class hi extends Ze {
1521
1521
  throw new Error("VideoResourceProvider.write(): not supported");
1522
1522
  }
1523
1523
  }
1524
- class Ai extends Ze {
1524
+ class Ai extends qe {
1525
1525
  async load(e) {
1526
1526
  const r = await fetch(e);
1527
1527
  if (r.ok)
@@ -1529,7 +1529,7 @@ class Ai extends Ze {
1529
1529
  throw new Error(`Resource not found at '${e}'`);
1530
1530
  }
1531
1531
  }
1532
- class fi extends Ze {
1532
+ class fi extends qe {
1533
1533
  async load(e) {
1534
1534
  const r = await fetch(e);
1535
1535
  if (r.ok) {
@@ -1581,7 +1581,7 @@ const Qs = (t) => {
1581
1581
  ], di = (t) => Bt(t, cr), zs = (t) => {
1582
1582
  Ct(t, cr);
1583
1583
  }, Ls = () => cr;
1584
- class qe {
1584
+ class _e {
1585
1585
  constructor({
1586
1586
  imageProvider: e = null,
1587
1587
  videoProvider: r = null,
@@ -1622,7 +1622,7 @@ const Is = {
1622
1622
  isBigEndian: ms,
1623
1623
  isLittleEndian: Ps,
1624
1624
  UserAgent: Bs,
1625
- Resource: qe,
1625
+ Resource: _e,
1626
1626
  isFormat: Bt,
1627
1627
  addFormats: Ct,
1628
1628
  isValidImage: gi,
@@ -1634,7 +1634,7 @@ const Is = {
1634
1634
  isValidBinary: di,
1635
1635
  addBinaryFormats: zs,
1636
1636
  getValidBinaryFormats: Ls,
1637
- ResourceProvider: Ze,
1637
+ ResourceProvider: qe,
1638
1638
  ImageResourceProvider: ai,
1639
1639
  VideoResourceProvider: hi,
1640
1640
  BinaryResourceProvider: Ai,
@@ -1804,7 +1804,7 @@ class p extends h {
1804
1804
  }
1805
1805
  var wi = /* @__PURE__ */ ((t) => (t[t.VERTEX = 1] = "VERTEX", t[t.NORMAL = 2] = "NORMAL", t[t.TEX_COORD_0 = 4] = "TEX_COORD_0", t[t.TEX_COORD_1 = 8] = "TEX_COORD_1", t[t.TEX_COORD_2 = 16] = "TEX_COORD_2", t[t.COLOR = 32] = "COLOR", t[t.TANGENT = 64] = "TANGENT", t[t.INDEX = 128] = "INDEX", t))(wi || {}), ae = /* @__PURE__ */ ((t) => (t[t.POINTS = 0] = "POINTS", t[t.TRIANGLES = 1] = "TRIANGLES", t[t.TRIANGLE_FAN = 2] = "TRIANGLE_FAN", t[t.TRIANGLE_STRIP = 3] = "TRIANGLE_STRIP", t[t.LINES = 4] = "LINES", t[t.LINE_STRIP = 5] = "LINE_STRIP", t))(ae || {}), k = /* @__PURE__ */ ((t) => (t[t.LAYER_0 = 1] = "LAYER_0", t[t.OPAQUE_DEFAULT = 1] = "OPAQUE_DEFAULT", t[t.LAYER_1 = 2] = "LAYER_1", t[t.LAYER_2 = 4] = "LAYER_2", t[t.LAYER_3 = 8] = "LAYER_3", t[t.LAYER_4 = 16] = "LAYER_4", t[t.LAYER_5 = 32] = "LAYER_5", t[t.LAYER_6 = 64] = "LAYER_6", t[t.LAYER_7 = 128] = "LAYER_7", t[t.LAYER_8 = 256] = "LAYER_8", t[t.LAYER_9 = 512] = "LAYER_9", t[t.LAYER_10 = 1024] = "LAYER_10", t[t.LAYER_11 = 2048] = "LAYER_11", t[t.LAYER_12 = 4096] = "LAYER_12", t[t.LAYER_13 = 8192] = "LAYER_13", t[t.LAYER_14 = 16384] = "LAYER_14", t[t.LAYER_15 = 32768] = "LAYER_15", t[t.TRANSPARENT_DEFAULT = 32768] = "TRANSPARENT_DEFAULT", t[t.LAYER_16 = 65536] = "LAYER_16", t[t.LAYER_17 = 131072] = "LAYER_17", t[t.LAYER_18 = 262144] = "LAYER_18", t[t.LAYER_19 = 524288] = "LAYER_19", t[t.LAYER_20 = 1048576] = "LAYER_20", t[t.LAYER_21 = 2097152] = "LAYER_21", t[t.LAYER_22 = 4194304] = "LAYER_22", t[t.LAYER_23 = 8388608] = "LAYER_23", t[t.LAYER_24 = 16777216] = "LAYER_24", t[t.LAYER_25 = 33554432] = "LAYER_25", t[t.LAYER_26 = 67108864] = "LAYER_26", t[t.LAYER_27 = 134217728] = "LAYER_27", t[t.LAYER_28 = 268435456] = "LAYER_28", t[t.LAYER_29 = 536870912] = "LAYER_29", t[t.LAYER_30 = 1073741824] = "LAYER_30", t[t.LAYER_31 = -2147483648] = "LAYER_31", t[t.SELECTION_DEFAULT = -2147483648] = "SELECTION_DEFAULT", t[t.ALL = 4294967295] = "ALL", t[t.AUTO = 0] = "AUTO", t))(k || {});
1806
1806
  const vi = (t, e) => t.renderLayers === 0 ? (e.isTransparent ? 32768 : 1) | -2147483648 : t.renderLayers;
1807
- var ut = /* @__PURE__ */ ((t) => (t[t.CW = 0] = "CW", t[t.CCW = 1] = "CCW", t))(ut || {}), De = /* @__PURE__ */ ((t) => (t[t.FRONT = 0] = "FRONT", t[t.BACK = 1] = "BACK", t[t.FRONT_AND_BACK = 2] = "FRONT_AND_BACK", t))(De || {});
1807
+ var dt = /* @__PURE__ */ ((t) => (t[t.CW = 0] = "CW", t[t.CCW = 1] = "CCW", t))(dt || {}), De = /* @__PURE__ */ ((t) => (t[t.FRONT = 0] = "FRONT", t[t.BACK = 1] = "BACK", t[t.FRONT_AND_BACK = 2] = "FRONT_AND_BACK", t))(De || {});
1808
1808
  function yr(t) {
1809
1809
  const e = [], r = (s) => ({
1810
1810
  pos: new h(t.vertex[s] * 3, t.vertex[s + 1] * 3, t.vertex[s + 2] * 3),
@@ -1967,6 +1967,15 @@ class de {
1967
1967
  set selectable(e) {
1968
1968
  this._selectable = e;
1969
1969
  }
1970
+ // The mainDrawable is a reference to the las Drawable object that contains this polyList. Note that
1971
+ // in some circunstances a polyList can be shared by several Drawable objects, but the mainDrawable
1972
+ // will be the last one that was assigned.
1973
+ get mainDrawable() {
1974
+ return this._mainDrawable;
1975
+ }
1976
+ set mainDrawable(e) {
1977
+ this._mainDrawable = e;
1978
+ }
1970
1979
  // The this._renderer variable is initialized by the polyListRenderer factory
1971
1980
  get renderer() {
1972
1981
  return this._renderer;
@@ -2022,15 +2031,15 @@ const Ss = (t, e = "image/jpeg") => {
2022
2031
  radiusY: n.radiusY
2023
2032
  }));
2024
2033
  };
2025
- let rt = null;
2026
- class _e {
2034
+ let it = null;
2035
+ class $e {
2027
2036
  static FirstCanvas() {
2028
- if (!rt)
2037
+ if (!it)
2029
2038
  throw new Error("No Canvas instance has been created yet.");
2030
- return rt;
2039
+ return it;
2031
2040
  }
2032
2041
  constructor(e, r) {
2033
- this._renderer = r, this._domElement = e, this._domElement._bg2e_id = Pt(), rt = rt || this, this._mainLoop = null;
2042
+ this._renderer = r, this._domElement = e, this._domElement._bg2e_id = Pt(), it = it || this, this._mainLoop = null;
2034
2043
  }
2035
2044
  get id() {
2036
2045
  return this._domElement._bg2e_id;
@@ -2128,9 +2137,9 @@ const Ci = Object.freeze({
2128
2137
  2: "G",
2129
2138
  3: "B",
2130
2139
  4: "A"
2131
- }), it = {};
2140
+ }), nt = {};
2132
2141
  let Xt = null;
2133
- const kt = {}, Rs = async (t) => (Xt || (Xt = new qe()), kt[t] ? console.log(`Image already loaded or loading: ${t}`) : (console.log(`Loading image: ${t}`), kt[t] = new Promise(async (e, r) => {
2142
+ const kt = {}, Rs = async (t) => (Xt || (Xt = new _e()), kt[t] ? console.log(`Image already loaded or loading: ${t}`) : (console.log(`Loading image: ${t}`), kt[t] = new Promise(async (e, r) => {
2134
2143
  const i = await Xt?.load(t), n = document.createElement("canvas");
2135
2144
  n.width = i.naturalWidth, n.height = i.naturalHeight;
2136
2145
  const s = n.getContext("2d");
@@ -2184,7 +2193,7 @@ function ks(t) {
2184
2193
  }
2185
2194
  class x {
2186
2195
  constructor(e = null) {
2187
- const r = e || _e.FirstCanvas();
2196
+ const r = e || $e.FirstCanvas();
2188
2197
  if (!r)
2189
2198
  throw new Error("Error creating Texture: no Canvas available.");
2190
2199
  this._canvas = r, this._dirty = !0, this._dataType = 0, this._wrapModeX = 0, this._wrapModeY = 0, this._magFilter = 5, this._minFilter = 5, this._target = 0, this._size = new h(64, 64), this._fileName = "", this._proceduralFunction = 0, this._proceduralParameters = {}, this._renderTargetAttachment = 0, this._componentFormat = 0, this._imageData = null, this._references = 0, this._name = "";
@@ -2325,9 +2334,9 @@ class x {
2325
2334
  }
2326
2335
  async loadImageData(e = !1) {
2327
2336
  if (this.fileName) {
2328
- it[this.fileName] && e && delete it[this.fileName];
2329
- let r = it[this.fileName];
2330
- r ? console.debug(`Texture: loadImageData(): image already loaded or is loading: ${this.fileName}`) : (r = Rs(this.fileName), it[this.fileName] = r), this._imageData = await r, this._size = new h(this._imageData.width, this._imageData.height), this._dirty = !0;
2337
+ nt[this.fileName] && e && delete nt[this.fileName];
2338
+ let r = nt[this.fileName];
2339
+ r ? console.debug(`Texture: loadImageData(): image already loaded or is loading: ${this.fileName}`) : (r = Rs(this.fileName), nt[this.fileName] = r), this._imageData = await r, this._size = new h(this._imageData.width, this._imageData.height), this._dirty = !0;
2331
2340
  } else if (this.dataType === 7)
2332
2341
  this._imageData = {
2333
2342
  currentSize: new h(this.size)
@@ -2367,9 +2376,9 @@ class x {
2367
2376
  }
2368
2377
  }
2369
2378
  const ye = {};
2370
- class dt {
2379
+ class wt {
2371
2380
  static Get(e = null) {
2372
- return e = e || _e.FirstCanvas(), !e && !ye.__no_canvas__ && console.warn("TextureCache.Get() No canvas available. If your application uses a canvas, ensure that it has been created before using TexturCache. If your application does not use a canvas, you may disregard this message."), e && !ye[e.id] ? ye[e.id] = new dt(e) : !e && !ye.__no_canvas__ && (ye.__no_canvas__ = new dt(null)), ye[e ? e.id : "__no_canvas__"];
2381
+ return e = e || $e.FirstCanvas(), !e && !ye.__no_canvas__ && console.warn("TextureCache.Get() No canvas available. If your application uses a canvas, ensure that it has been created before using TexturCache. If your application does not use a canvas, you may disregard this message."), e && !ye[e.id] ? ye[e.id] = new wt(e) : !e && !ye.__no_canvas__ && (ye.__no_canvas__ = new wt(null)), ye[e ? e.id : "__no_canvas__"];
2373
2382
  }
2374
2383
  constructor(e) {
2375
2384
  this._canvas = e, this._cache = {};
@@ -2405,7 +2414,7 @@ const Ce = {
2405
2414
  if (t === "ambientOcclussion" && typeof e == "number")
2406
2415
  return null;
2407
2416
  if (typeof e == "string") {
2408
- const n = r + e, s = dt.Get(i);
2417
+ const n = r + e, s = wt.Get(i);
2409
2418
  if (s.findTexture(n))
2410
2419
  return console.debug(`Texture '${n}' already loaded. Reusing texture.`), s.getTexture(n);
2411
2420
  {
@@ -2417,7 +2426,7 @@ const Ce = {
2417
2426
  throw new Error("Invalid parameter found in material deserialization. The required parameter type is string (file path)");
2418
2427
  } else return null;
2419
2428
  }
2420
- }, nt = {
2429
+ }, st = {
2421
2430
  serialize: (t, e) => {
2422
2431
  if (!e)
2423
2432
  return null;
@@ -2456,11 +2465,11 @@ const Ce = {
2456
2465
  }, S = {
2457
2466
  serialize: (t, e) => e || null,
2458
2467
  deserialize: (t, e) => e
2459
- }, st = {
2468
+ }, ot = {
2460
2469
  type: { loader: S },
2461
2470
  alphaCutoff: { loader: S },
2462
2471
  isTransparent: { loader: S },
2463
- albedo: { loader: nt },
2472
+ albedo: { loader: st },
2464
2473
  albedoTexture: { loader: Ce },
2465
2474
  albedoScale: { loader: Me },
2466
2475
  albedoUV: { loader: S },
@@ -2477,10 +2486,10 @@ const Ce = {
2477
2486
  roughnessChannel: { loader: S },
2478
2487
  roughnessScale: { loader: Me },
2479
2488
  roughnessUV: { loader: S },
2480
- fresnelTint: { loader: nt },
2489
+ fresnelTint: { loader: st },
2481
2490
  sheenIntensity: { loader: S },
2482
- sheenColor: { loader: nt },
2483
- lightEmission: { loader: nt },
2491
+ sheenColor: { loader: st },
2492
+ lightEmission: { loader: st },
2484
2493
  lightEmissionTexture: { loader: Ce },
2485
2494
  lightEmissionChannel: { loader: S },
2486
2495
  lightEmissionScale: { loader: Me },
@@ -2511,7 +2520,7 @@ class ne {
2511
2520
  return await n.deserialize(e, r, i), n;
2512
2521
  }
2513
2522
  constructor(e = null) {
2514
- this._canvas = e || _e.FirstCanvas(), this._type = "pbr", this._renderer = null, this._alphaCutoff = 0.5, this._isTransparent = !1, this._albedo = p.White(), this._albedoTexture = null, this._albedoScale = new h(1, 1), this._albedoUV = 0, this._normalTexture = null, this._normalScale = new h(1, 1), this._normalUV = 0, this._normalChannel = 0, this._metalness = 0, this._metalnessTexture = null, this._metalnessChannel = 0, this._metalnessScale = new h(1, 1), this._metalnessUV = 0, this._roughness = 1, this._roughnessTexture = null, this._roughnessChannel = 0, this._roughnessScale = new h(1, 1), this._roughnessUV = 0, this._fresnelTint = p.White(), this._sheenIntensity = 0, this._sheenColor = p.White(), this._lightEmission = 0, this._lightEmissionTexture = null, this._lightEmissionChannel = 0, this._lightEmissionScale = new h(1, 1), this._lightEmissionUV = 0, this._ambientOcclussion = null, this._ambientOcclussionChannel = 0, this._ambientOcclussionUV = 1, this._heightTexture = null, this._heightChannel = 0, this._heightScale = new h(1, 1), this._heightUV = 0, this._heightIntensity = 1, this._castShadows = !0, this._unlit = !1, this._dirty = !0;
2523
+ this._canvas = e || $e.FirstCanvas(), this._type = "pbr", this._renderer = null, this._alphaCutoff = 0.5, this._isTransparent = !1, this._albedo = p.White(), this._albedoTexture = null, this._albedoScale = new h(1, 1), this._albedoUV = 0, this._normalTexture = null, this._normalScale = new h(1, 1), this._normalUV = 0, this._normalChannel = 0, this._metalness = 0, this._metalnessTexture = null, this._metalnessChannel = 0, this._metalnessScale = new h(1, 1), this._metalnessUV = 0, this._roughness = 1, this._roughnessTexture = null, this._roughnessChannel = 0, this._roughnessScale = new h(1, 1), this._roughnessUV = 0, this._fresnelTint = p.White(), this._sheenIntensity = 0, this._sheenColor = p.White(), this._lightEmission = 0, this._lightEmissionTexture = null, this._lightEmissionChannel = 0, this._lightEmissionScale = new h(1, 1), this._lightEmissionUV = 0, this._ambientOcclussion = null, this._ambientOcclussionChannel = 0, this._ambientOcclussionUV = 1, this._heightTexture = null, this._heightChannel = 0, this._heightScale = new h(1, 1), this._heightUV = 0, this._heightIntensity = 1, this._castShadows = !0, this._unlit = !1, this._dirty = !0;
2515
2524
  }
2516
2525
  get canvas() {
2517
2526
  return this._canvas;
@@ -2767,16 +2776,16 @@ class ne {
2767
2776
  this._unlit = e, this._dirty = !0;
2768
2777
  }
2769
2778
  async serialize(e) {
2770
- for (const r in st) {
2771
- const i = st[r].loader.serialize(r, this[r]);
2779
+ for (const r in ot) {
2780
+ const i = ot[r].loader.serialize(r, this[r]);
2772
2781
  i && (e[r] = i);
2773
2782
  }
2774
2783
  }
2775
2784
  async deserialize(e, r, i) {
2776
2785
  const n = [];
2777
2786
  this.type = e.type || "pbr", this.alphaCutoff = e.alphaCutoff || 0.5, this.isTransparent = e.isTransparent || !1;
2778
- for (const s in st) {
2779
- const o = st[s]?.loader;
2787
+ for (const s in ot) {
2788
+ const o = ot[s]?.loader;
2780
2789
  if (o) {
2781
2790
  const a = o.deserialize(s, e[s], r, this.canvas);
2782
2791
  a instanceof x && n.push(a.loadImageData()), a != null && (this[s] = a);
@@ -3281,7 +3290,7 @@ function qs(t) {
3281
3290
  let e = /s\s+(.*)/.exec(t);
3282
3291
  e && this._currentPlist?.name == "" && (this._currentPlist.name = e[1]);
3283
3292
  }
3284
- function ot() {
3293
+ function at() {
3285
3294
  this._addPlist && (this._currentPlist && this._plistArray.push(this._currentPlist), this._currentPlist = new de(), this._addPlist = !1);
3286
3295
  }
3287
3296
  function _s() {
@@ -3306,13 +3315,13 @@ function _s() {
3306
3315
  ) : console.warn("Error parsing line " + r);
3307
3316
  break;
3308
3317
  case "m":
3309
- ot.apply(this), js.apply(this, [r]);
3318
+ at.apply(this), js.apply(this, [r]);
3310
3319
  break;
3311
3320
  case "g":
3312
- ot.apply(this), Vs.apply(this, [r]);
3321
+ at.apply(this), Vs.apply(this, [r]);
3313
3322
  break;
3314
3323
  case "u":
3315
- ot.apply(this), Ks.apply(this, [r]);
3324
+ at.apply(this), Ks.apply(this, [r]);
3316
3325
  break;
3317
3326
  case "s":
3318
3327
  Ws.apply(this, [r]);
@@ -3321,7 +3330,7 @@ function _s() {
3321
3330
  Zs.apply(this, [r]);
3322
3331
  break;
3323
3332
  case "o":
3324
- ot.apply(this), qs.apply(this, [r]);
3333
+ at.apply(this), qs.apply(this, [r]);
3325
3334
  break;
3326
3335
  }
3327
3336
  }), this._currentPlist && this._addPlist && this._plistArray.push(this._currentPlist);
@@ -4929,10 +4938,10 @@ const Ir = {
4929
4938
  gl_FragColor = result;
4930
4939
  }`
4931
4940
  }
4932
- }, at = {};
4941
+ }, ht = {};
4933
4942
  class bt extends V {
4934
4943
  static GetUnique(e) {
4935
- return at[e.uniqueId] || (at[e.uniqueId] = new bt(e), at[e.uniqueId].load()), at[e.uniqueId];
4944
+ return ht[e.uniqueId] || (ht[e.uniqueId] = new bt(e), ht[e.uniqueId].load()), ht[e.uniqueId];
4936
4945
  }
4937
4946
  constructor(e) {
4938
4947
  if (super(e), e.typeId !== "WebGL")
@@ -5648,7 +5657,7 @@ class Ui extends pt {
5648
5657
  throw new Error(`VitscnjLoaderPlugin.load() unexpected resource type received: ${r}`);
5649
5658
  const n = i.currentPath;
5650
5659
  i.currentPath = li(e);
5651
- const s = new qe(), o = new fe("Scene Root"), { scene: a } = await s.load(e);
5660
+ const s = new _e(), o = new fe("Scene Root"), { scene: a } = await s.load(e);
5652
5661
  for (const f of a) {
5653
5662
  const c = await Gi(f, i);
5654
5663
  o.addChild(c);
@@ -5695,10 +5704,10 @@ class Oe extends se {
5695
5704
  throw new Error("Error adding polyList to drawable object: material is not an instance of Material");
5696
5705
  if (!(i instanceof w))
5697
5706
  throw new Error("Error adding polyList to drawable object: transform is not an instance of Mat4");
5698
- this._items.push({ polyList: e, material: r, transform: i });
5707
+ this._items.push({ polyList: e, material: r, transform: i }), e.mainDrawable = this;
5699
5708
  }
5700
5709
  removePolyList(e) {
5701
- this._items = this._items.filter((r) => r.polyList != e);
5710
+ this._items = this._items.filter((r) => r.polyList != e), e.mainDrawable === this && (e.mainDrawable = void 0);
5702
5711
  }
5703
5712
  destroy() {
5704
5713
  }
@@ -5905,11 +5914,11 @@ var mo = async ({ debug: t = !1, wasmPath: e = "" } = {}) => {
5905
5914
  const r = await Bg2ioModule();
5906
5915
  return new wo({ instance: r, debug: t });
5907
5916
  };
5908
- let ht = null;
5917
+ let At = null;
5909
5918
  const Po = async (t) => {
5910
- if (ht === null && (ht = await mo(t ? { wasmPath: t } : {}), !ht))
5919
+ if (At === null && (At = await mo(t ? { wasmPath: t } : {}), !At))
5911
5920
  throw new Error("Bg2LoaderPlugin: unable to initialize bg2io library");
5912
- return ht;
5921
+ return At;
5913
5922
  }, Xi = (t, e) => t.polyLists.map((i) => {
5914
5923
  const n = new de(), s = t.materials.find((o) => o.name === i.matName);
5915
5924
  return n.name = i.name, n.visible = i.visible, s && (n.groupName = s.groupName || "", n.enableCullFace = s.cullFace), n.vertex = i.vertex, n.normal = i.normal, n.texCoord0 = i.texCoord0, n.texCoord1 = i.texCoord1, n.texCoord2 = i.texCoord2, n.index = i.index, { plist: n, materialData: s };
@@ -5937,7 +5946,7 @@ class Yi extends pt {
5937
5946
  bg2ioPath: e = null,
5938
5947
  materialImportCallback: r
5939
5948
  } = {}) {
5940
- super(), this._bg2ioPath = e, this._materialImportCallback = r, this._resource = new qe();
5949
+ super(), this._bg2ioPath = e, this._materialImportCallback = r, this._resource = new _e();
5941
5950
  }
5942
5951
  get supportedExtensions() {
5943
5952
  return ["bg2", "vwglb"];
@@ -5971,7 +5980,7 @@ const vr = {
5971
5980
  }, mr = (t) => ({
5972
5981
  operationType: t,
5973
5982
  plugins: {}
5974
- }), wt = (t, e) => {
5983
+ }), vt = (t, e) => {
5975
5984
  t.resourceTypes.forEach((r) => {
5976
5985
  e.plugins[r] = e.plugins[r] || [], e.plugins[r].push(t);
5977
5986
  });
@@ -5985,7 +5994,7 @@ const vr = {
5985
5994
  } else
5986
5995
  throw new Error(s);
5987
5996
  }, ir = mr(vr.Read), Co = (t) => {
5988
- t.dependencies.forEach((e) => wt(e, ir)), wt(t, ir);
5997
+ t.dependencies.forEach((e) => vt(e, ir)), vt(t, ir);
5989
5998
  }, nr = (t, e) => Pr(t, e, ir), Or = () => ({
5990
5999
  [M.PolyList]: {},
5991
6000
  [M.Drawable]: {},
@@ -5995,7 +6004,7 @@ const vr = {
5995
6004
  });
5996
6005
  class po {
5997
6006
  constructor(e) {
5998
- this._canvas = e || _e.FirstCanvas(), this._cache = Or(), this._currentPath = "";
6007
+ this._canvas = e || $e.FirstCanvas(), this._cache = Or(), this._currentPath = "";
5999
6008
  }
6000
6009
  get canvas() {
6001
6010
  return this._canvas;
@@ -6052,7 +6061,7 @@ const bo = (t, e, r) => {
6052
6061
  };
6053
6062
  class Eo extends pt {
6054
6063
  constructor() {
6055
- super(), this._resource = new qe();
6064
+ super(), this._resource = new _e();
6056
6065
  }
6057
6066
  get supportedExtensions() {
6058
6067
  return ["obj"];
@@ -6104,7 +6113,7 @@ class xo extends ji {
6104
6113
  }
6105
6114
  }
6106
6115
  const Vi = mr(vr.Write), Qo = (t) => {
6107
- wt(t, Vi);
6116
+ vt(t, Vi);
6108
6117
  }, Ki = (t, e) => Pr(t, e, Vi);
6109
6118
  class To {
6110
6119
  constructor() {
@@ -6132,7 +6141,7 @@ const yo = {
6132
6141
  Bg2LoaderPlugin: Yi,
6133
6142
  PluginOperationType: vr,
6134
6143
  createPluginDatabase: mr,
6135
- registerPluginInDatabase: wt,
6144
+ registerPluginInDatabase: vt,
6136
6145
  getPluginFromDatabase: Pr,
6137
6146
  Loader: po,
6138
6147
  registerLoaderPlugin: Co,
@@ -6395,7 +6404,7 @@ const Mo = {
6395
6404
  DrawMode: ae,
6396
6405
  RenderLayer: k,
6397
6406
  getLayers: vi,
6398
- PolyListFrontFace: ut,
6407
+ PolyListFrontFace: dt,
6399
6408
  PolyListCullFace: De,
6400
6409
  Texture: x,
6401
6410
  TextureDataType: Qe,
@@ -6744,7 +6753,7 @@ class he extends se {
6744
6753
  e.addLight(this.light, r);
6745
6754
  }
6746
6755
  }
6747
- class $e extends ii {
6756
+ class et extends ii {
6748
6757
  static Factory(e) {
6749
6758
  if (!e)
6750
6759
  return null;
@@ -6796,7 +6805,7 @@ class $e extends ii {
6796
6805
  this.near = e.near ?? this.near, this.far = e.far ?? this.far, Array.isArray(e.viewport) ? this.viewport = new h(e.viewport) : e.viewport instanceof h && (this.viewport = new h(e.viewport));
6797
6806
  }
6798
6807
  }
6799
- class Mt extends $e {
6808
+ class Mt extends et {
6800
6809
  constructor(e = null) {
6801
6810
  super(e), this._fov = 60;
6802
6811
  }
@@ -6823,7 +6832,7 @@ class Mt extends $e {
6823
6832
  super.deserialize(e), this.fov = e.fov ?? this.fov;
6824
6833
  }
6825
6834
  }
6826
- class Nt extends $e {
6835
+ class Nt extends et {
6827
6836
  constructor(e = null) {
6828
6837
  super(e), this._focalLength = 50, this._frameSize = 35;
6829
6838
  }
@@ -6862,7 +6871,7 @@ class Nt extends $e {
6862
6871
  super.deserialize(e), this.frameSize = e.frameSize ?? this.frameSize, this.focalLength = e.focalLength ?? this.focalLength;
6863
6872
  }
6864
6873
  }
6865
- class Ie extends $e {
6874
+ class Ie extends et {
6866
6875
  constructor(e = null) {
6867
6876
  super(e), this._viewWidth = 100;
6868
6877
  }
@@ -6987,7 +6996,7 @@ class j extends se {
6987
6996
  }
6988
6997
  async deserialize(e = {}, r) {
6989
6998
  if (await super.deserialize(e, r), this.focusDistance = e.focusDistance ?? this._focusDistance, e.projectionMethod) {
6990
- const i = $e.Factory(e.projectionMethod);
6999
+ const i = et.Factory(e.projectionMethod);
6991
7000
  i && (this.projectionStrategy = i);
6992
7001
  }
6993
7002
  }
@@ -7026,7 +7035,7 @@ class zt extends Ht {
7026
7035
  }
7027
7036
  }
7028
7037
  var Fe = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.UP = 1] = "UP", t[t.DOWN = 2] = "DOWN", t))(Fe || {});
7029
- const et = (t, e, r) => {
7038
+ const tt = (t, e, r) => {
7030
7039
  if (e.mouseStatus.pos = Pi(t, e.canvas), r !== 0) {
7031
7040
  const i = r === 2;
7032
7041
  t.button === 0 ? e.mouseStatus.leftButton = i : t.button === 1 ? e.mouseStatus.middleButton = i : t.button === 2 && (e.mouseStatus.rightButton = i);
@@ -7069,12 +7078,12 @@ function Oo(t) {
7069
7078
  return Ee.ZOOM;
7070
7079
  }
7071
7080
  }
7072
- class tt extends se {
7081
+ class rt extends se {
7073
7082
  constructor(e = null) {
7074
7083
  super(e ?? "OrbitCameraController"), this._rotateButtons = { left: !0, middle: !1, right: !1 }, this._panButtons = { left: !1, middle: !1, right: !0 }, this._zoomButtons = { left: !1, middle: !0, right: !1 }, this._rotation = new h([0, 0]), this._distance = 5, this._center = new h([0, 0, 0]), this._rotationSpeed = 0.2, this._forward = 0, this._left = 0, this._wheelSpeed = 1, this._minFocus = 2, this._minPitch = -85, this._maxPitch = 85, this._minDistance = 0.4, this._maxDistance = 24, this._maxX = 45, this._minX = -45, this._minY = -45, this._maxY = 45, this._maxZ = 45, this._minZ = -45, this._displacementSpeed = 0.1, this._enabled = !0, this._keys = {}, this._lastTouch = [];
7075
7084
  }
7076
7085
  clone() {
7077
- const e = new tt();
7086
+ const e = new rt();
7078
7087
  return e.assign(this), e;
7079
7088
  }
7080
7089
  assign(e) {
@@ -7292,7 +7301,7 @@ class tt extends se {
7292
7301
  this.enabled && (this._keys[e.key] = !1);
7293
7302
  }
7294
7303
  }
7295
- class Lt extends tt {
7304
+ class Lt extends rt {
7296
7305
  constructor() {
7297
7306
  super("SmoothOrbitCameraController"), this._smoothFactor = 9e-3, this._action = Ee.NONE;
7298
7307
  }
@@ -7391,7 +7400,7 @@ class It extends se {
7391
7400
  }
7392
7401
  }
7393
7402
  const $i = () => {
7394
- _("Drawable", Oe), _("Transform", oe), _("Light", he), _("LightComponent", he), _("Chain", Qt), _("InputChainJoint", Tt), _("OutputChainJoint", yt), _("Camera", j), _("OrbitCameraController", tt), _("SmoothOrbitCameraController", Lt), _("Environment", It);
7403
+ _("Drawable", Oe), _("Transform", oe), _("Light", he), _("LightComponent", he), _("Chain", Qt), _("InputChainJoint", Tt), _("OutputChainJoint", yt), _("Camera", j), _("OrbitCameraController", rt), _("SmoothOrbitCameraController", Lt), _("Environment", It);
7395
7404
  }, Fo = {
7396
7405
  Component: se,
7397
7406
  DrawableComponent: Oe,
@@ -7403,8 +7412,8 @@ const $i = () => {
7403
7412
  CameraComponent: j,
7404
7413
  OpticalProjectionStrategy: Nt,
7405
7414
  PerspectiveProjectionStrategy: Mt,
7406
- ProjectionStrategy: $e,
7407
- OrbitCameraControllerComponent: tt,
7415
+ ProjectionStrategy: et,
7416
+ OrbitCameraControllerComponent: rt,
7408
7417
  SmoothOrbitCameraControllerComponent: Lt,
7409
7418
  EnvironmentComponent: It,
7410
7419
  registerComponents: $i,
@@ -7555,26 +7564,26 @@ async function ko(t, e) {
7555
7564
  t.redisplay && (t.updateMode === 0 ? t._redisplayFrames = 1 : t._redisplayFrames--, (t._redisplayFrames > 0 || !t._firstFrameRendered) && (await t.appController.frame(e), t.appController.display(), t._firstFrameRendered = !0));
7556
7565
  }
7557
7566
  function Yo(t, e) {
7558
- const r = et(t, e, Fe.DOWN);
7567
+ const r = tt(t, e, Fe.DOWN);
7559
7568
  return qi(r, !0), e.appController.mouseDown(r), r;
7560
7569
  }
7561
7570
  function sn(t, e) {
7562
- const r = et(t, e, Fe.NONE);
7571
+ const r = tt(t, e, Fe.NONE);
7563
7572
  return e.appController.mouseMove(r), e.mouseStatus.anyButton && e.appController.mouseDrag(r), r;
7564
7573
  }
7565
7574
  function jo(t, e) {
7566
- const r = et(t, e, Fe.NONE);
7575
+ const r = tt(t, e, Fe.NONE);
7567
7576
  return Ro(), e.appController.mouseOut(r), r;
7568
7577
  }
7569
7578
  function Vo(t, e) {
7570
7579
  return sn(t, e);
7571
7580
  }
7572
7581
  function Ko(t, e) {
7573
- const r = et(t, e, Fe.UP);
7582
+ const r = tt(t, e, Fe.UP);
7574
7583
  return qi(r, !1), e.appController.mouseUp(r), r;
7575
7584
  }
7576
7585
  function Wo(t, e) {
7577
- const r = et(t, e, Fe.NONE);
7586
+ const r = tt(t, e, Fe.NONE);
7578
7587
  return r.delta = t.wheelDelta ? t.wheelDelta * -1 : t.detail * 10, e.appController.mouseWheel(r), r;
7579
7588
  }
7580
7589
  function Jo(t, e) {
@@ -7600,7 +7609,7 @@ function $o(t, e) {
7600
7609
  const e0 = {
7601
7610
  AppController: en,
7602
7611
  FrameUpdate: rn,
7603
- Canvas: _e,
7612
+ Canvas: $e,
7604
7613
  getMouseEventOffset: Pi,
7605
7614
  getEventTouches: Bi,
7606
7615
  EventBase: Ht,
@@ -7732,7 +7741,7 @@ const fn = {
7732
7741
  1: "TEXTURE",
7733
7742
  2: "CUBE_MAP"
7734
7743
  };
7735
- var vt = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.POSITIVE_X = 1] = "POSITIVE_X", t[t.NEGATIVE_X = 2] = "NEGATIVE_X", t[t.POSITIVE_Y = 3] = "POSITIVE_Y", t[t.NEGATIVE_Y = 4] = "NEGATIVE_Y", t[t.POSITIVE_Z = 5] = "POSITIVE_Z", t[t.NEGATIVE_Z = 6] = "NEGATIVE_Z", t))(vt || {});
7744
+ var mt = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.POSITIVE_X = 1] = "POSITIVE_X", t[t.NEGATIVE_X = 2] = "NEGATIVE_X", t[t.POSITIVE_Y = 3] = "POSITIVE_Y", t[t.NEGATIVE_Y = 4] = "NEGATIVE_Y", t[t.POSITIVE_Z = 5] = "POSITIVE_Z", t[t.NEGATIVE_Z = 6] = "NEGATIVE_Z", t))(mt || {});
7736
7745
  function Fr(t) {
7737
7746
  if (t.target === ee.TEXTURE_2D)
7738
7747
  return 1;
@@ -8698,11 +8707,11 @@ class d0 {
8698
8707
  this._renderBuffer?.destroy(), this._targetTexture?.destroy(), this._renderBuffer = null, this._targetTexture = null;
8699
8708
  }
8700
8709
  }
8701
- var mt = /* @__PURE__ */ ((t) => (t[t.OBJECT = 0] = "OBJECT", t[t.POLY_LIST = 1] = "POLY_LIST", t))(mt || {});
8702
- const At = (t) => "" + t[0] + t[1] + t[2];
8710
+ var Ze = /* @__PURE__ */ ((t) => (t[t.OBJECT = 0] = "OBJECT", t[t.POLY_LIST = 1] = "POLY_LIST", t))(Ze || {});
8711
+ const ft = (t) => "" + t[0] + t[1] + t[2];
8703
8712
  class w0 extends ce {
8704
8713
  constructor() {
8705
- super(), this._r = 0, this._g = 0, this._b = 0, this._selectionMode = mt.POLY_LIST, this._elements = {};
8714
+ super(), this._r = 0, this._g = 0, this._b = 0, this._selectionMode = Ze.POLY_LIST, this._elements = {};
8706
8715
  }
8707
8716
  set selectionMode(e) {
8708
8717
  this._selectionMode = e, this.clear();
@@ -8719,9 +8728,9 @@ class w0 extends ce {
8719
8728
  Math.round(Math.random() * 255),
8720
8729
  Math.round(Math.random() * 255)
8721
8730
  ];
8722
- let r = e(), i = At(r);
8731
+ let r = e(), i = ft(r);
8723
8732
  for (; this._elements[i]; )
8724
- r = e(), i = At(r);
8733
+ r = e(), i = ft(r);
8725
8734
  return this._r = r[0], this._g = r[1], this._b = r[2], new p([r[0] / 255, r[1] / 255, r[2] / 255, 1]);
8726
8735
  }
8727
8736
  findElement(e) {
@@ -8732,7 +8741,7 @@ class w0 extends ce {
8732
8741
  e[1],
8733
8742
  e[2]
8734
8743
  ];
8735
- return this._elements[At(r)];
8744
+ return this._elements[ft(r)] || null;
8736
8745
  }
8737
8746
  visit(e) {
8738
8747
  const { drawable: r } = e;
@@ -8741,21 +8750,21 @@ class w0 extends ce {
8741
8750
  r.items.forEach(({ polyList: n }, s, o) => {
8742
8751
  if (n.isSelectable) {
8743
8752
  n.colorCode = i, n.selected = !1;
8744
- const a = At([
8753
+ const a = ft([
8745
8754
  Math.round(i[0] * 255),
8746
8755
  Math.round(i[1] * 255),
8747
8756
  Math.round(i[2] * 255)
8748
8757
  ]);
8749
8758
  this._elements[a] = { polyList: n, drawable: r };
8750
8759
  }
8751
- s < o.length - 1 && this._selectionMode == mt.POLY_LIST && (i = this.getNextColor());
8760
+ s < o.length - 1 && this._selectionMode == Ze.POLY_LIST && (i = this.getNextColor());
8752
8761
  });
8753
8762
  }
8754
8763
  }
8755
8764
  }
8756
8765
  class v0 {
8757
8766
  constructor(e) {
8758
- this._selectionBuffer = null, this._selectionIdVisitor = null, this._downPosition = new h(), this._viewportSize = [1, 1], this._enabled = !0, this._renderer = e, this._sceneRoot = null, this._camera = null, this._selectionMode = mt.POLY_LIST, this._multiSelect = !1, this._selection = [], this._selectionChangedCallbacks = {};
8767
+ this._selectionBuffer = null, this._selectionIdVisitor = null, this._downPosition = new h(), this._viewportSize = [1, 1], this._enabled = !0, this._renderer = e, this._sceneRoot = null, this._camera = null, this._selectionMode = Ze.POLY_LIST, this._multiSelect = !1, this._selection = [], this._selectionChangedCallbacks = {};
8759
8768
  }
8760
8769
  async init() {
8761
8770
  this._selectionBuffer = new d0(this._renderer), await this._selectionBuffer.init(), this._selectionIdVisitor = new w0();
@@ -8826,8 +8835,8 @@ class v0 {
8826
8835
  this._selectionIdVisitor && this.sceneRoot && (this._selectionIdVisitor.selectionMode = this.selectionMode, this.sceneRoot.accept(this._selectionIdVisitor));
8827
8836
  const i = window.devicePixelRatio || 1;
8828
8837
  this._selectionBuffer?.reshape(this._viewportSize[0], this._viewportSize[1]);
8829
- const n = this._selectionBuffer.draw(this.sceneRoot, this.camera, e.x * i, e.y * i), s = this._selectionIdVisitor.findElement(n), o = () => this._selection.find((a) => a.polyList === s.polyList && a.drawable === s.drawable);
8830
- s && this._multiSelect && !o() ? (this._selection.push(s), this.triggerSelectionChanged()) : s && !o() ? (this._selection = [s], this.triggerSelectionChanged()) : !s && !this._multiSelect && this._selection.length > 0 && (this._selection = [], this.triggerSelectionChanged()), this._selection.forEach((a) => a.polyList.selected = !0);
8838
+ const n = this._selectionBuffer.draw(this.sceneRoot, this.camera, e.x * i, e.y * i), s = this._selectionIdVisitor.findElement(n), o = () => this._selection.find((a) => s && a.polyList === s.polyList && a.drawable === s.drawable);
8839
+ s && this.selectionMode === Ze.OBJECT && s.drawable.items.forEach((a) => a.polyList.selected = !0), s && this._multiSelect && !o() ? (this._selection.push(s), this.triggerSelectionChanged()) : s && !o() ? (this._selection = [s], this.triggerSelectionChanged()) : !s && !this._multiSelect && this._selection.length > 0 && (this._selection = [], this.triggerSelectionChanged()), this._selection.forEach((a) => a.polyList.selected = !0);
8831
8840
  }
8832
8841
  }
8833
8842
  mouseDown(e) {
@@ -9823,7 +9832,7 @@ const y0 = (t, e) => {
9823
9832
  return t.FUNC_REVERSE_SUBTRACT;
9824
9833
  }
9825
9834
  throw new Error(`Invalid blend equation specified in WebGLPipeline: ${e}`);
9826
- }, ft = (t, e) => {
9835
+ }, lt = (t, e) => {
9827
9836
  switch (e) {
9828
9837
  case R.NULL:
9829
9838
  return null;
@@ -9853,7 +9862,7 @@ const y0 = (t, e) => {
9853
9862
  class On extends hn {
9854
9863
  create() {
9855
9864
  const { gl: e } = this.renderer;
9856
- if (this._blendEquation = y0(e, this.blendState.blendEquation), this._blendFuncSrcColor = ft(e, this.blendState.blendFuncSrc), this._blendFuncSrcAlpha = ft(e, this.blendState.blendFuncSrcAlpha), this._blendFuncDstColor = ft(e, this.blendState.blendFuncDst), this._blendFuncDstAlpha = ft(e, this.blendState.blendFuncDstAlpha), this._blendFuncDstAlpha === null && this._blendFuncSrcAlpha !== null || this._blendFuncDstAlpha !== null && this._blendFuncSrcAlpha === null)
9865
+ if (this._blendEquation = y0(e, this.blendState.blendEquation), this._blendFuncSrcColor = lt(e, this.blendState.blendFuncSrc), this._blendFuncSrcAlpha = lt(e, this.blendState.blendFuncSrcAlpha), this._blendFuncDstColor = lt(e, this.blendState.blendFuncDst), this._blendFuncDstAlpha = lt(e, this.blendState.blendFuncDstAlpha), this._blendFuncDstAlpha === null && this._blendFuncSrcAlpha !== null || this._blendFuncDstAlpha !== null && this._blendFuncSrcAlpha === null)
9857
9866
  throw new Error("WebGLPipeline.create(): Invalid values of blendFuncDstAlpha and blendFuncSrcAlpha");
9858
9867
  this._blendFunc = this._blendFuncDstAlpha !== null ? (r, i) => e.blendFunc(r, i) : (r, i, n, s) => e.blendFuncSeparate(r, i, n, s);
9859
9868
  }
@@ -10001,10 +10010,10 @@ class Gn extends An {
10001
10010
  draw() {
10002
10011
  const { gl: e, state: r } = this.renderer;
10003
10012
  switch (r.cullFaceEnabled = this.polyList.enableCullFace, this.polyList.frontFace) {
10004
- case ut.CCW:
10013
+ case dt.CCW:
10005
10014
  r.frontFace = r.CCW;
10006
10015
  break;
10007
- case ut.CW:
10016
+ case dt.CW:
10008
10017
  r.frontFace = r.CW;
10009
10018
  break;
10010
10019
  }
@@ -10082,7 +10091,7 @@ class Un extends ln {
10082
10091
  const { gl: e } = this.renderer;
10083
10092
  e.bindBuffer(e.ARRAY_BUFFER, this._prevArrayBufferBinding), e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, this._prevElementBufferBinding);
10084
10093
  }
10085
- beginUpdate(e = vt.NONE) {
10094
+ beginUpdate(e = mt.NONE) {
10086
10095
  if (this.type === ve.TEXTURE)
10087
10096
  this.beginUpdateTexture();
10088
10097
  else if (this.type === ve.CUBE_MAP)
@@ -10090,7 +10099,7 @@ class Un extends ln {
10090
10099
  else
10091
10100
  throw new Error("The render buffer is not initialized");
10092
10101
  }
10093
- endUpdate(e = vt.NONE) {
10102
+ endUpdate(e = mt.NONE) {
10094
10103
  if (this.type === ve.TEXTURE)
10095
10104
  this.endUpdateTexture();
10096
10105
  else if (this.type === ve.CUBE_MAP)
@@ -10626,7 +10635,7 @@ const L0 = (t, e) => {
10626
10635
  default:
10627
10636
  throw new Error("Error creating WebGL Texture: invalid target");
10628
10637
  }
10629
- }, lt = (t, e) => {
10638
+ }, ct = (t, e) => {
10630
10639
  if (e === 1)
10631
10640
  return t.CLAMP_TO_EDGE;
10632
10641
  {
@@ -10660,14 +10669,14 @@ const L0 = (t, e) => {
10660
10669
  const { width: n, height: s } = e.size, o = e.renderTargetAttachment === Y.DEPTH_ATTACHMENT, a = o ? t.DEPTH_COMPONENT : t.RGBA;
10661
10670
  let f = o ? t.DEPTH_COMPONENT : t.RGBA;
10662
10671
  const c = o ? t.UNSIGNED_SHORT : i;
10663
- if (t.texParameteri(r, t.TEXTURE_MIN_FILTER, t.LINEAR), t.texParameteri(r, t.TEXTURE_MAG_FILTER, t.LINEAR), t.texParameteri(r, t.TEXTURE_WRAP_S, lt(t, e.wrapModeX)), t.texParameteri(r, t.TEXTURE_WRAP_T, lt(t, e.wrapModeY)), r === t.TEXTURE_CUBE_MAP)
10672
+ if (t.texParameteri(r, t.TEXTURE_MIN_FILTER, t.LINEAR), t.texParameteri(r, t.TEXTURE_MAG_FILTER, t.LINEAR), t.texParameteri(r, t.TEXTURE_WRAP_S, ct(t, e.wrapModeX)), t.texParameteri(r, t.TEXTURE_WRAP_T, ct(t, e.wrapModeY)), r === t.TEXTURE_CUBE_MAP)
10664
10673
  for (let d = 0; d < 6; ++d)
10665
10674
  t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + d, 0, a, n, s, 0, f, c, null);
10666
10675
  else
10667
10676
  t.texImage2D(r, 0, a, n, s, 0, f, c, null);
10668
10677
  e.imageData.currentSize = new h(e.size);
10669
10678
  } else
10670
- t.texImage2D(r, 0, t.RGBA, t.RGBA, i, e._imageData), t.texParameteri(r, t.TEXTURE_WRAP_S, lt(t, e.wrapModeX)), t.texParameteri(r, t.TEXTURE_WRAP_T, lt(t, e.wrapModeY)), t.texParameteri(r, t.TEXTURE_MAG_FILTER, Zr(t, e.magFilter)), t.texParameteri(r, t.TEXTURE_MIN_FILTER, Zr(t, e.minFilter)), e.mipmapRequired && t.generateMipmap(r);
10679
+ t.texImage2D(r, 0, t.RGBA, t.RGBA, i, e._imageData), t.texParameteri(r, t.TEXTURE_WRAP_S, ct(t, e.wrapModeX)), t.texParameteri(r, t.TEXTURE_WRAP_T, ct(t, e.wrapModeY)), t.texParameteri(r, t.TEXTURE_MAG_FILTER, Zr(t, e.magFilter)), t.texParameteri(r, t.TEXTURE_MIN_FILTER, Zr(t, e.minFilter)), e.mipmapRequired && t.generateMipmap(r);
10671
10680
  };
10672
10681
  class Jn extends Ln {
10673
10682
  static ListTextures(e) {
@@ -10846,7 +10855,7 @@ const U0 = {
10846
10855
  RenderBuffer: ln,
10847
10856
  RenderBufferType: ve,
10848
10857
  RenderBufferTypeName: fn,
10849
- CubeMapFace: vt,
10858
+ CubeMapFace: mt,
10850
10859
  Renderer: Et,
10851
10860
  EngineFeatures: Ve,
10852
10861
  RenderQueue: St,