itowns 2.44.3-next.37 → 2.44.3-next.39

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.
@@ -50,15 +50,19 @@
50
50
  <script type="importmap">
51
51
  {
52
52
  "imports": {
53
- "three": "https://cdn.jsdelivr.net/npm/three@0.165.0/build/three.module.js",
54
- "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.165.0/examples/jsm/"
53
+ "three": "https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js",
54
+ "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"
55
55
  }
56
56
  }
57
57
  </script>
58
58
 
59
59
  <script type="module">
60
- import { AmbientLight } from 'three';
60
+ import {
61
+ AmbientLight,
62
+ PMREMGenerator,
63
+ } from 'three';
61
64
  import { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js';
65
+ import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';
62
66
  import {
63
67
  zoomToLayer,
64
68
  fillHTMLWithPickingInfo,
@@ -106,6 +110,13 @@
106
110
  const light = new AmbientLight(0x404040, 40);
107
111
  view.scene.add(light);
108
112
 
113
+ // Set the environment map for all physical materials in the scene.
114
+ // Otherwise, mesh with only diffuse colors will appear black.
115
+ const environment = new RoomEnvironment();
116
+ const pmremGenerator = new PMREMGenerator(view.renderer);
117
+ view.scene.environment = pmremGenerator.fromScene(environment).texture;
118
+ pmremGenerator.dispose();
119
+
109
120
  // Setup loading screen
110
121
  setupLoadingScreen(viewerDiv, view);
111
122
 
@@ -23,8 +23,8 @@
23
23
  <script type="importmap">
24
24
  {
25
25
  "imports": {
26
- "three": "https://cdn.jsdelivr.net/npm/three@0.159.0/build/three.module.js",
27
- "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.159.0/examples/jsm/"
26
+ "three": "https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js",
27
+ "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"
28
28
  }
29
29
  }
30
30
  </script>
@@ -25,8 +25,8 @@
25
25
  <script type="importmap">
26
26
  {
27
27
  "imports": {
28
- "three": "https://cdn.jsdelivr.net/npm/three@0.159.0/build/three.module.js",
29
- "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.159.0/examples/jsm/"
28
+ "three": "https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js",
29
+ "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"
30
30
  }
31
31
  }
32
32
  </script>
@@ -14,7 +14,7 @@
14
14
  <script type="importmap">
15
15
  {
16
16
  "imports": {
17
- "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.159.0/examples/jsm/"
17
+ "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"
18
18
  }
19
19
  }
20
20
  </script>
@@ -43,6 +43,8 @@
43
43
  const view = new itowns.GlobeView(viewerDiv, placement, {
44
44
  webXR: { scale: 0.005 },
45
45
  });
46
+ // Temporary workaround to https://github.com/iTowns/itowns/issues/2473
47
+ view.scene.matrixWorldAutoUpdate = true;
46
48
 
47
49
  // Instantiate three's VR Button
48
50
  const vrButton = VRButton.createButton(view.renderer);
@@ -17,8 +17,8 @@
17
17
  <script type="importmap">
18
18
  {
19
19
  "imports": {
20
- "three": "https://cdn.jsdelivr.net/npm/three@0.159.0/build/three.module.js",
21
- "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.159.0/examples/jsm/"
20
+ "three": "https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js",
21
+ "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"
22
22
  }
23
23
  }
24
24
  </script>
@@ -1,5 +1,8 @@
1
1
  import * as THREE from 'three';
2
- import { TilesRenderer, GLTFStructuralMetadataExtension, GLTFMeshFeaturesExtension, GLTFCesiumRTCExtension, CesiumIonAuthPlugin, GoogleCloudAuthPlugin, ImplicitTilingPlugin } from '3d-tiles-renderer';
2
+ import { TilesRenderer } from '3d-tiles-renderer';
3
+ import { GLTFStructuralMetadataExtension, GLTFMeshFeaturesExtension, GLTFCesiumRTCExtension, CesiumIonAuthPlugin, GoogleCloudAuthPlugin, ImplicitTilingPlugin
4
+ // eslint-disable-next-line import/no-unresolved
5
+ } from '3d-tiles-renderer/plugins';
3
6
  import GeometryLayer from "./GeometryLayer.js";
4
7
  import iGLTFLoader from "../Parser/iGLTFLoader.js";
5
8
  import { DRACOLoader } from "../ThreeExtended/loaders/DRACOLoader.js";