@eturnity/eturnity_3d 7.35.0-EPDM-11386.0 → 7.35.0
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/package.json +3 -3
- package/src/Overlay/Overlay.js +0 -1
- package/src/helper/cameraMixin.js +1 -1
- package/src/helper/initializeThree.js +0 -21
- package/src/helper/materialMixin.js +1 -3
- package/src/helper/render/base.js +0 -4
- package/src/helper/render/obstacle.js +0 -5
- package/src/helper/render/roof.js +0 -2
- package/src/helper/render/tile.js +3 -8
- package/src/helper/render/tileProjection.js +0 -1
- package/src/helper/threeMixin.js +10 -25
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eturnity/eturnity_3d",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "7.35.0
|
|
4
|
+
"version": "7.35.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"src"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"prettier": "prettier --write \"**/*.{js,vue}\""
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@eturnity/eturnity_maths": "7.35.0
|
|
18
|
+
"@eturnity/eturnity_maths": "7.35.0",
|
|
19
19
|
"@originjs/vite-plugin-commonjs": "1.0.3",
|
|
20
20
|
"core-js": "2.6.12",
|
|
21
21
|
"cors": "2.8.5",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"leaflet.gridlayer.googlemutant": "0.14.0",
|
|
27
27
|
"lodash": "4.17.21",
|
|
28
28
|
"svd-js": "1.1.1",
|
|
29
|
-
"three": "0.
|
|
29
|
+
"three": "0.142.0",
|
|
30
30
|
"tween": "0.9.0",
|
|
31
31
|
"uuid": "9.0.0",
|
|
32
32
|
"vite-plugin-require": "1.2.14",
|
package/src/Overlay/Overlay.js
CHANGED
|
@@ -8,28 +8,7 @@ export default {
|
|
|
8
8
|
preserveDrawingBuffer: true,
|
|
9
9
|
powerPreference: 'high-performance',
|
|
10
10
|
})
|
|
11
|
-
this.renderer.shadowMap.enabled = true
|
|
12
|
-
this.renderer.shadowMap.type = THREE.BasicShadowMap;
|
|
13
11
|
this.raycaster = new THREE.Raycaster()
|
|
14
12
|
this.loader = new THREE.TextureLoader()
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const sphereGeometry = new THREE.SphereGeometry( 5, 32, 32 );
|
|
19
|
-
const sphereMaterial = new THREE.MeshStandardMaterial( { color: 0xff0000 } );
|
|
20
|
-
const sphere = new THREE.Mesh( sphereGeometry, sphereMaterial );
|
|
21
|
-
sphere.castShadow = true
|
|
22
|
-
sphere.receiveShadow = false
|
|
23
|
-
sphere.position.set(0,7,4)
|
|
24
|
-
this.scene.add( sphere );
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const planeGeometry = new THREE.PlaneGeometry( 70, 70, 32, 32 );
|
|
29
|
-
const planeMaterial = new THREE.MeshStandardMaterial( { color: 0x00ff00 } )
|
|
30
|
-
const plane = new THREE.Mesh( planeGeometry, planeMaterial );
|
|
31
|
-
plane.position.set(0,0,1)
|
|
32
|
-
plane.receiveShadow = true;
|
|
33
|
-
this.scene.add( plane );
|
|
34
13
|
},
|
|
35
14
|
}
|
|
@@ -22,13 +22,11 @@ export default {
|
|
|
22
22
|
side: THREE.DoubleSide,
|
|
23
23
|
})
|
|
24
24
|
|
|
25
|
-
this.material.wall = new THREE.
|
|
25
|
+
this.material.wall = new THREE.MeshLambertMaterial({
|
|
26
26
|
color: wallColor,
|
|
27
27
|
side: THREE.DoubleSide,
|
|
28
28
|
transparent: true,
|
|
29
29
|
opacity: this.wallColor == '#ffffff00' ? 0.2 : 1,
|
|
30
|
-
shadowSide: THREE.DoubleSide,
|
|
31
|
-
flatShading: true
|
|
32
30
|
})
|
|
33
31
|
|
|
34
32
|
this.material.obstacle = new THREE.MeshPhongMaterial({
|
|
@@ -39,8 +39,6 @@ export default {
|
|
|
39
39
|
mesh.userData.polygonId = roofPolygon.id
|
|
40
40
|
mesh.matrixAutoUpdate = false
|
|
41
41
|
mesh.frustumCulled = false
|
|
42
|
-
mesh.receiveShadow = true
|
|
43
|
-
mesh.castShadow = true
|
|
44
42
|
this.meshes.baseMeshes[roofPolygon.id] = mesh
|
|
45
43
|
}
|
|
46
44
|
baseGeometries.push(this.meshes.baseMeshes[roofPolygon.id].geometry)
|
|
@@ -52,8 +50,6 @@ export default {
|
|
|
52
50
|
this.material.wall
|
|
53
51
|
)
|
|
54
52
|
this.mergedBaseMesh.renderOrder = 10
|
|
55
|
-
this.mergedBaseMesh.receiveShadow = true
|
|
56
|
-
this.mergedBaseMesh.castShadow = true
|
|
57
53
|
},
|
|
58
54
|
},
|
|
59
55
|
}
|
|
@@ -82,11 +82,6 @@ export default {
|
|
|
82
82
|
this.material.wall
|
|
83
83
|
)
|
|
84
84
|
this.mergedObstacleSideMesh.renderOrder = 10
|
|
85
|
-
//shadow
|
|
86
|
-
this.mergedObstacleSideMesh.receiveShadow = true
|
|
87
|
-
this.mergedObstacleSideMesh.castShadow = true
|
|
88
|
-
this.mergedObstacleMesh.receiveShadow = true
|
|
89
|
-
this.mergedObstacleMesh.castShadow = true
|
|
90
85
|
this.applyTextureOnObstacles(this.material.roof)
|
|
91
86
|
},
|
|
92
87
|
},
|
|
@@ -114,8 +114,6 @@ export default {
|
|
|
114
114
|
mesh.userData.meshId = roofPolygon.id
|
|
115
115
|
mesh.userData.polygonId = roofPolygon.id
|
|
116
116
|
mesh.frustumCulled = false
|
|
117
|
-
mesh.receiveShadow = true
|
|
118
|
-
mesh.castShadow = true
|
|
119
117
|
this.meshes.roofMeshes[roofPolygon.id] = mesh
|
|
120
118
|
this.scene.add(mesh)
|
|
121
119
|
}
|
|
@@ -280,15 +280,13 @@ export default {
|
|
|
280
280
|
mesh.userData.meshId = meshId
|
|
281
281
|
mesh.frustumCulled = false
|
|
282
282
|
mesh.needsUpdate = true
|
|
283
|
-
mesh.receiveShadow = true
|
|
284
283
|
mesh.updateMatrix()
|
|
285
284
|
} else {
|
|
286
|
-
material = new THREE.
|
|
285
|
+
material = new THREE.MeshBasicMaterial({
|
|
287
286
|
map: texture,
|
|
288
287
|
color: 0xffffff,
|
|
289
288
|
side: THREE.FrontSide,
|
|
290
289
|
transparent: false,
|
|
291
|
-
shininess: 0
|
|
292
290
|
// opacity:isTileOnRoofBound?0.8:1,
|
|
293
291
|
// color:isTileOnRoofBound?'red':'white'
|
|
294
292
|
})
|
|
@@ -301,7 +299,7 @@ export default {
|
|
|
301
299
|
mesh.userData.meshId = meshId
|
|
302
300
|
mesh.userData.mapLayer = this.provider.mapLayer
|
|
303
301
|
mesh.name = meshId
|
|
304
|
-
|
|
302
|
+
|
|
305
303
|
if (!this.scene.getObjectByName(meshId)) {
|
|
306
304
|
this.meshes.tileMeshes[meshId] = mesh
|
|
307
305
|
this.scene.add(this.meshes.tileMeshes[meshId])
|
|
@@ -434,7 +432,7 @@ export default {
|
|
|
434
432
|
googleMapType
|
|
435
433
|
)
|
|
436
434
|
}
|
|
437
|
-
planeMaterial[indexGoogleBackground] = new THREE.
|
|
435
|
+
planeMaterial[indexGoogleBackground] = new THREE.MeshBasicMaterial({
|
|
438
436
|
map: texture[indexGoogleBackground],
|
|
439
437
|
side: THREE.DoubleSide,
|
|
440
438
|
})
|
|
@@ -450,8 +448,6 @@ export default {
|
|
|
450
448
|
-indexGoogleBackground / 2
|
|
451
449
|
backgroundPlane[indexGoogleBackground].visible = true
|
|
452
450
|
backgroundPlane[indexGoogleBackground].needsUpdate = true
|
|
453
|
-
|
|
454
|
-
backgroundPlane[indexGoogleBackground].receiveShadow = true
|
|
455
451
|
backgroundPlane[indexGoogleBackground].userData.index =
|
|
456
452
|
indexGoogleBackground
|
|
457
453
|
const meshToRemove = this.googleBackgroundMap.children.find(
|
|
@@ -466,7 +462,6 @@ export default {
|
|
|
466
462
|
if (this.numberOfTilesRendered == this.numberOfTilesToRender) {
|
|
467
463
|
this.googleBackgroundMap.needsUpdate = true
|
|
468
464
|
this.googleBackgroundMap.visible = true
|
|
469
|
-
this.googleBackgroundMap.receiveShadow = true
|
|
470
465
|
this.render()
|
|
471
466
|
}
|
|
472
467
|
})
|
package/src/helper/threeMixin.js
CHANGED
|
@@ -105,31 +105,16 @@ export default {
|
|
|
105
105
|
})
|
|
106
106
|
},
|
|
107
107
|
initialiseLights() {
|
|
108
|
-
const ambientLight = new THREE.AmbientLight(0xffffff, 0.5)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
light.shadow.mapSize.height = 2048
|
|
119
|
-
light.shadow.camera.near = 0.5
|
|
120
|
-
light.shadow.camera.far = 500
|
|
121
|
-
light.shadow.camera.left = -50
|
|
122
|
-
light.shadow.camera.right = 50
|
|
123
|
-
light.shadow.camera.top = 50
|
|
124
|
-
light.shadow.camera.bottom = -50
|
|
125
|
-
light.shadow.bias = -0.001
|
|
126
|
-
|
|
127
|
-
// Add the light to the scene
|
|
128
|
-
this.scene.add(light)
|
|
129
|
-
this.scene.add(ambientLight)
|
|
130
|
-
|
|
131
|
-
const helper = new THREE.CameraHelper(light.shadow.camera)
|
|
132
|
-
this.scene.add(helper)
|
|
108
|
+
// const ambientLight = new THREE.AmbientLight(0xffffff, 0.5)
|
|
109
|
+
var hemiLight = new THREE.HemisphereLight(0xffffff, 0x444444)
|
|
110
|
+
hemiLight.position.set(0, 0, 300)
|
|
111
|
+
this.scene.add(hemiLight)
|
|
112
|
+
let directionalLight = new THREE.DirectionalLight(0xffffff, 0.5)
|
|
113
|
+
directionalLight.position.set(0, 1000, 500)
|
|
114
|
+
let directionalLight2 = new THREE.DirectionalLight(0xffffff, 0.5)
|
|
115
|
+
directionalLight2.position.set(0, -1000, 500)
|
|
116
|
+
this.scene.add(directionalLight)
|
|
117
|
+
this.scene.add(directionalLight2)
|
|
133
118
|
},
|
|
134
119
|
initialiseSky() {
|
|
135
120
|
// Add Sky
|