@loaders.gl/terrain 4.0.0-beta.3 → 4.0.0-beta.4

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/dist.dev.js CHANGED
@@ -427,20 +427,16 @@ var __exports__ = (() => {
427
427
  triangleIndices = newTriangles;
428
428
  }
429
429
  return {
430
- // Data return by this loader implementation
431
430
  loaderData: {
432
431
  header: {}
433
432
  },
434
433
  header: {
435
- // @ts-ignore
436
434
  vertexCount: triangleIndices.length,
437
435
  boundingBox
438
436
  },
439
- // TODO
440
437
  schema: void 0,
441
438
  topology: "triangle-list",
442
439
  mode: 4,
443
- // TRIANGLES
444
440
  indices: {
445
441
  value: triangleIndices,
446
442
  size: 1
@@ -479,8 +475,6 @@ var __exports__ = (() => {
479
475
  value: texCoords,
480
476
  size: 2
481
477
  }
482
- // TODO: Parse normals if they exist in the file
483
- // NORMAL: {}, - optional, but creates the high poly look with lighting
484
478
  };
485
479
  }
486
480
 
@@ -648,30 +642,24 @@ var __exports__ = (() => {
648
642
  this._addTriangle(p0, p3, p1, t0, -1, -1);
649
643
  this._flush();
650
644
  }
651
- // refine the mesh until its maximum error gets below the given one
652
645
  run(maxError = 1) {
653
646
  while (this.getMaxError() > maxError) {
654
647
  this.refine();
655
648
  }
656
649
  }
657
- // refine the mesh with a single point
658
650
  refine() {
659
651
  this._step();
660
652
  this._flush();
661
653
  }
662
- // max error of the current mesh
663
654
  getMaxError() {
664
655
  return this._errors[0];
665
656
  }
666
- // root-mean-square deviation of the current mesh
667
657
  getRMSD() {
668
658
  return this._rmsSum > 0 ? Math.sqrt(this._rmsSum / (this.width * this.height)) : 0;
669
659
  }
670
- // height value at a given position
671
660
  heightAt(x, y) {
672
661
  return this.data[this.width * y + x];
673
662
  }
674
- // rasterize and queue all triangles that got added or updated in _step
675
663
  _flush() {
676
664
  const coords = this.coords;
677
665
  for (let i = 0; i < this._pendingLen; i++) {
@@ -683,7 +671,6 @@ var __exports__ = (() => {
683
671
  }
684
672
  this._pendingLen = 0;
685
673
  }
686
- // rasterize a triangle, find its max error, and queue it for processing
687
674
  _findCandidate(p0x, p0y, p1x, p1y, p2x, p2y, t) {
688
675
  const minX = Math.min(p0x, p1x, p2x);
689
676
  const minY = Math.min(p0y, p1y, p2y);
@@ -751,7 +738,6 @@ var __exports__ = (() => {
751
738
  this._rms[t] = rms;
752
739
  this._queuePush(t, maxError, rms);
753
740
  }
754
- // process the next triangle in the queue, splitting it with a new point
755
741
  _step() {
756
742
  const t = this._queuePop();
757
743
  const e0 = t * 3 + 0;
@@ -787,13 +773,11 @@ var __exports__ = (() => {
787
773
  this._legalize(t2);
788
774
  }
789
775
  }
790
- // add coordinates for a new vertex
791
776
  _addPoint(x, y) {
792
777
  const i = this.coords.length >> 1;
793
778
  this.coords.push(x, y);
794
779
  return i;
795
780
  }
796
- // add or update a triangle in the mesh
797
781
  _addTriangle(a, b, c, ab, bc, ca, e = this.triangles.length) {
798
782
  const t = e / 3;
799
783
  this.triangles[e + 0] = a;
@@ -848,7 +832,6 @@ var __exports__ = (() => {
848
832
  this._legalize(t0 + 1);
849
833
  this._legalize(t1 + 2);
850
834
  }
851
- // handle a case where new vertex is on the edge of a triangle
852
835
  _handleCollinear(pn, a) {
853
836
  const a0 = a - a % 3;
854
837
  const al = a0 + (a + 1) % 3;
@@ -882,7 +865,6 @@ var __exports__ = (() => {
882
865
  this._legalize(t2);
883
866
  this._legalize(t3);
884
867
  }
885
- // priority queue methods
886
868
  _queuePush(t, error, rms) {
887
869
  const i = this._queue.length;
888
870
  this._queueIndices[t] = i;
@@ -1036,7 +1018,6 @@ var __exports__ = (() => {
1036
1018
  triangles = newTriangles;
1037
1019
  }
1038
1020
  return {
1039
- // Data return by this loader implementation
1040
1021
  loaderData: {
1041
1022
  header: {}
1042
1023
  },
@@ -1045,7 +1026,6 @@ var __exports__ = (() => {
1045
1026
  boundingBox
1046
1027
  },
1047
1028
  mode: 4,
1048
- // TRIANGLES
1049
1029
  indices: {
1050
1030
  value: Uint32Array.from(triangles),
1051
1031
  size: 1
@@ -1133,7 +1113,6 @@ var __exports__ = (() => {
1133
1113
  value: texCoords,
1134
1114
  size: 2
1135
1115
  }
1136
- // NORMAL: {}, - optional, but creates the high poly look with lighting
1137
1116
  };
1138
1117
  }
1139
1118
 
@@ -1293,7 +1293,7 @@
1293
1293
  }
1294
1294
 
1295
1295
  // src/lib/utils/version.ts
1296
- var VERSION = true ? "4.0.0-beta.3" : "latest";
1296
+ var VERSION = true ? "4.0.0-beta.4" : "latest";
1297
1297
 
1298
1298
  // src/terrain-loader.ts
1299
1299
  var TerrainLoader = {
@@ -1293,7 +1293,7 @@
1293
1293
  }
1294
1294
 
1295
1295
  // src/lib/utils/version.ts
1296
- var VERSION = true ? "4.0.0-beta.3" : "latest";
1296
+ var VERSION = true ? "4.0.0-beta.4" : "latest";
1297
1297
 
1298
1298
  // src/terrain-loader.ts
1299
1299
  var TerrainLoader = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/terrain",
3
- "version": "4.0.0-beta.3",
3
+ "version": "4.0.0-beta.4",
4
4
  "description": "Framework-independent loader for terrain raster formats",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -43,10 +43,10 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@babel/runtime": "^7.3.1",
46
- "@loaders.gl/images": "4.0.0-beta.3",
47
- "@loaders.gl/loader-utils": "4.0.0-beta.3",
48
- "@loaders.gl/schema": "4.0.0-beta.3",
46
+ "@loaders.gl/images": "4.0.0-beta.4",
47
+ "@loaders.gl/loader-utils": "4.0.0-beta.4",
48
+ "@loaders.gl/schema": "4.0.0-beta.4",
49
49
  "@mapbox/martini": "^0.2.0"
50
50
  },
51
- "gitHead": "7ba9621cc51c7a26c407086ac86171f35b8712af"
51
+ "gitHead": "848c20b474532d301f2c3f8d4e1fb9bf262b86d4"
52
52
  }