@jdultra/threedtiles 6.0.1 → 6.0.3

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/README.md CHANGED
@@ -34,7 +34,16 @@ setInterval(function () {
34
34
  }, 20);
35
35
  ```
36
36
 
37
- Currently, the library is limmited to B3DM files.
37
+ The library is limmited to B3DM and glb/gltf tiles.
38
+
39
+ Here is a simple project : [Getting started](https://drive.google.com/file/d/1kJ-yfYmy8ShOMMPPXgqW2gMgGkLOIidf/view?usp=share_link)
40
+
41
+ Unzip and run :
42
+
43
+ > npm install
44
+
45
+ > npm run dev
46
+
38
47
 
39
48
  ## Features
40
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jdultra/threedtiles",
3
- "version": "6.0.1",
3
+ "version": "6.0.3",
4
4
  "description": "An OGC 3DTiles viewer for Three.js",
5
5
  "main": "tileset.js",
6
6
  "scripts": {
@@ -378,9 +378,6 @@ class OGC3DTile extends THREE.Object3D {
378
378
  if (allChildrenReady) {
379
379
  self.changeContentVisibility(false);
380
380
  }
381
- else{
382
- console.log("loading...")
383
- }
384
381
  }
385
382
  }
386
383
 
@@ -395,7 +392,7 @@ class OGC3DTile extends THREE.Object3D {
395
392
  !visibilityBeforeUpdate &&
396
393
  self.hasMeshContent &&
397
394
  self.meshContent &&
398
- self.meshesToDisplay == self.meshesDisplayed &&
395
+ self.meshDisplayed &&
399
396
  self.areAllChildrenLoadedAndHidden()) {
400
397
 
401
398
  self.disposeChildren();
@@ -447,7 +444,7 @@ class OGC3DTile extends THREE.Object3D {
447
444
  if (!child.inFrustum) {
448
445
  return true;
449
446
  };
450
- if (!child.materialVisibility || child.meshesToDisplay != child.meshesDisplayed) {
447
+ if (!child.materialVisibility || child.meshDisplayed) {
451
448
  allLoadedAndHidden = false;
452
449
  return false;
453
450
  } else if (self.occlusionCullingService.hasID(child.colorID)) {
@@ -504,7 +501,7 @@ class OGC3DTile extends THREE.Object3D {
504
501
  }
505
502
 
506
503
  // if all meshes have been displayed once
507
- if (this.meshesDisplayed == this.meshesToDisplay) {
504
+ if (this.meshDisplayed) {
508
505
  return true;
509
506
  }
510
507
 
@@ -537,8 +534,8 @@ class OGC3DTile extends THREE.Object3D {
537
534
  return;
538
535
  }
539
536
  self.materialVisibility = visibility
540
- self.meshesToDisplay = 0;
541
- self.meshesDisplayed = 0;
537
+
538
+ self.meshDisplayed = false;
542
539
  if (!!self.meshContent.traverse) {
543
540
  self.meshContent.traverse(function (element) {
544
541
  if (element.material) setMeshVisibility(element, visibility);
@@ -552,10 +549,9 @@ class OGC3DTile extends THREE.Object3D {
552
549
  function setMeshVisibility(mesh, visibility) {
553
550
  mesh.material.visible = visibility;
554
551
  if (!!visibility) {
555
- self.meshesToDisplay=1;
556
552
  mesh.onAfterRender = () => {
557
553
  delete mesh.onAfterRender;
558
- self.meshesDisplayed=1;
554
+ self.meshDisplayed = true;
559
555
  };
560
556
  }
561
557