gl-draw 0.9.0 → 0.9.2

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.
@@ -2,11 +2,9 @@ function o(t) {
2
2
  return Object.prototype.toString.call(t) === "[object Object]";
3
3
  }
4
4
  function n(t) {
5
- if (o(t) === !1)
6
- return !1;
5
+ if (o(t) === !1) return !1;
7
6
  const r = t.constructor;
8
- if (r === void 0)
9
- return !0;
7
+ if (r === void 0) return !0;
10
8
  const e = r.prototype;
11
9
  return !(o(e) === !1 || e.hasOwnProperty("isPrototypeOf") === !1);
12
10
  }
@@ -1,2 +1,5 @@
1
- export declare const ExtrudeGeometry: "ExtrudeGeometry";
2
- export declare const PlaneGeometry: "PlaneGeometry";
1
+ declare const ov: boolean;
2
+ type OV = typeof ov;
3
+ export declare const ExtrudeGeometry: OV extends 1 ? "ExtrudeBufferGeometry" : "ExtrudeGeometry";
4
+ export declare const PlaneGeometry: OV extends 1 ? "PlaneBufferGeometry" : "PlaneGeometry";
5
+ export {};
@@ -168,8 +168,7 @@ class qe extends X {
168
168
  alphaTest: h,
169
169
  sprite: l
170
170
  } = this.options, f = re();
171
- if (!t)
172
- return Promise.reject("src is required");
171
+ if (!t) return Promise.reject("src is required");
173
172
  const p = document.createElement("video");
174
173
  return p.addEventListener(
175
174
  "loadedmetadata",
@@ -280,8 +279,7 @@ class Xe extends X {
280
279
  const { data: t, maxDepth: e, colors: s, material: i, percentDepth: r, activeIndex: o } = this.options, a = Math.max(...t), c = t.reduce((l, f) => l + f, 0);
281
280
  let h = Math.PI / 2;
282
281
  t.forEach((l, f) => {
283
- if (l === 0)
284
- return;
282
+ if (l === 0) return;
285
283
  const p = Math.PI * 2 * (l / c), u = s[f], b = r ? e * (l / a) : e, d = this.createGeometry(b, p), A = i ? i.clone() : new w.MeshBasicMaterial({
286
284
  color: u
287
285
  });
@@ -307,8 +305,7 @@ class Xe extends X {
307
305
  const s = this.object3d.children[t];
308
306
  if (this.object3d.children.forEach((i) => {
309
307
  if (!(s && s === i) && i.scale.z !== 1) {
310
- if (i.userData.levTween)
311
- return;
308
+ if (i.userData.levTween) return;
312
309
  i.userData.enTween && (i.userData.enTween.stop(), i.userData.enTween = null);
313
310
  const r = new Y.Tween(i.scale).to({ z: 1 }, 100);
314
311
  i.userData.levTween = r, r.start();
@@ -371,8 +368,7 @@ class Ze extends X {
371
368
  if (this.spotLight || this.directionalLight) {
372
369
  const e = this.spotLight || this.directionalLight;
373
370
  e.position.copy(t), e.target.position.copy(t);
374
- } else
375
- this.pointLight && this.pointLight.position.copy(t);
371
+ } else this.pointLight && this.pointLight.position.copy(t);
376
372
  }
377
373
  dispose() {
378
374
  const t = this.object3d;
@@ -393,8 +389,7 @@ function dt(n, t, e, s, i) {
393
389
  ) : n, e.set)
394
390
  e.set(n, s);
395
391
  else
396
- for (r = 0; r < n.length; r++)
397
- e[r + s] = n[r];
392
+ for (r = 0; r < n.length; r++) e[r + s] = n[r];
398
393
  return e;
399
394
  }
400
395
  function xe(n) {
@@ -482,8 +477,7 @@ class we extends w.BufferGeometry {
482
477
  }
483
478
  function Ke(n, t) {
484
479
  const e = new w.Matrix4(), s = new w.Ray(), i = new w.Sphere(), r = new w.Vector3(), o = this.geometry;
485
- if (i.copy(o.boundingSphere), i.applyMatrix4(this.matrixWorld), !n.ray.intersectSphere(i, r))
486
- return;
480
+ if (i.copy(o.boundingSphere), i.applyMatrix4(this.matrixWorld), !n.ray.intersectSphere(i, r)) return;
487
481
  e.copy(this.matrixWorld).invert(), s.copy(n.ray).applyMatrix4(e);
488
482
  const a = new w.Vector3(), c = new w.Vector3(), h = new w.Vector3(), l = this instanceof w.LineSegments ? 2 : 1, f = o.index, p = o.attributes;
489
483
  if (f !== null) {
@@ -497,8 +491,7 @@ function Ke(n, t) {
497
491
  c,
498
492
  r,
499
493
  h
500
- ) > B)
501
- continue;
494
+ ) > B) continue;
502
495
  r.applyMatrix4(this.matrixWorld);
503
496
  const z = n.ray.origin.distanceTo(r);
504
497
  z < n.near || z > n.far || (t.push({
@@ -593,8 +586,7 @@ function K(n, t = 0) {
593
586
  }
594
587
  for (const l in o) {
595
588
  const f = o[l][0].length;
596
- if (f === 0)
597
- break;
589
+ if (f === 0) break;
598
590
  c.morphAttributes = c.morphAttributes || {}, c.morphAttributes[l] = [];
599
591
  for (let p = 0; p < f; ++p) {
600
592
  const u = [];
@@ -933,8 +925,7 @@ function Te(n, t, e, s, i) {
933
925
  }
934
926
  const u = [];
935
927
  for (let b = 1; b >= 0; b--)
936
- for (let d = 0; d < h; d += 1)
937
- u.push(d / (h - 1), b);
928
+ for (let d = 0; d < h; d += 1) u.push(d / (h - 1), b);
938
929
  return { indices: p, vertices: c, uvs: u, topVerts: a };
939
930
  }
940
931
  function Nt(n, t, e, s, i, r) {