From 4d78971bbd6e0945218aa18a706f128eae1d0da2 Mon Sep 17 00:00:00 2001 From: Arthur Guiot Date: Thu, 4 Oct 2018 13:23:55 +0800 Subject: [PATCH] Let -> Const in lights.js --- HoloJS/ThreeJSApp/Scripts/lights.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/HoloJS/ThreeJSApp/Scripts/lights.js b/HoloJS/ThreeJSApp/Scripts/lights.js index 61257a2..6f5925c 100644 --- a/HoloJS/ThreeJSApp/Scripts/lights.js +++ b/HoloJS/ThreeJSApp/Scripts/lights.js @@ -1,33 +1,33 @@ function LightsExample(scene, renderer) { - let material = new THREE.MeshPhysicalMaterial({ color: 0x00ff00, roughness: 0.5, metalness: 1.0 }); + const material = new THREE.MeshPhysicalMaterial({ color: 0x00ff00, roughness: 0.5, metalness: 1.0 }); - let sphere = new THREE.Mesh(initColors(new THREE.SphereBufferGeometry(0.1, 20, 20)), material.clone()); + const sphere = new THREE.Mesh(initColors(new THREE.SphereBufferGeometry(0.1, 20, 20)), material.clone()); sphere.position.set(0.4, 0, -1.5); sphere.material.color.set(0xff0000); sphere.material.roughness = 0.3; sphere.material.metalness = 0.2; scene.add(sphere); - let cone = new THREE.Mesh(initColors(new THREE.ConeBufferGeometry(0.1, 0.2, 20, 20)), material.clone()); + const cone = new THREE.Mesh(initColors(new THREE.ConeBufferGeometry(0.1, 0.2, 20, 20)), material.clone()); cone.position.set(-0.4, 0, -1.5); cone.material.color.set(0x0000ff); cone.material.roughness = 0.5; scene.add(cone); - let torus = new THREE.Mesh(initColors(new THREE.TorusKnotBufferGeometry(0.2, 0.02, 100, 100)), material.clone()); + const torus = new THREE.Mesh(initColors(new THREE.TorusKnotBufferGeometry(0.2, 0.02, 100, 100)), material.clone()); torus.scale.set(1.5, 1.5, 1.5); torus.material.color.set(0x00ff00); torus.material.roughness = 0.5; torus.material.metalness = 1.0; scene.add(torus); - let directionalLight = new THREE.DirectionalLight(0xFFFFFF, 0.5); + const directionalLight = new THREE.DirectionalLight(0xFFFFFF, 0.5); directionalLight.position.set(0, 2, 0); scene.add(directionalLight); - let ambientLight = new THREE.AmbientLight(0xFFFFFF, 0.8); + const ambientLight = new THREE.AmbientLight(0xFFFFFF, 0.8); scene.add(ambientLight); this.pointLight = new THREE.PointLight(0xFFFFFF, 0.5); @@ -40,4 +40,4 @@ function LightsExample(scene, renderer) { this.update = function (delta, elapsed) { this.pointLight.position.set(0 + 2.0 * Math.cos(elapsed * 0.5), 0, -1.5 + 2.0 * Math.sin(elapsed * 0.5)); }; -} \ No newline at end of file +}