Sfoglia il codice sorgente

SceneLoader2/SceneExporter2: Added PointLight's distance.

Mr.doob 12 anni fa
parent
commit
3106280993

+ 1 - 0
examples/js/exporters/SceneExporter2.js

@@ -207,6 +207,7 @@ THREE.SceneExporter2.prototype = {
 				data.type = 'PointLight';
 				data.color = object.color.getHex();
 				data.intensity = object.intensity;
+				data.distance = object.distance;
 				data.position = object.position.toArray();
 
 			} else if ( object instanceof THREE.SpotLight ) {

+ 1 - 1
examples/js/loaders/SceneLoader2.js

@@ -225,7 +225,7 @@ THREE.SceneLoader2.prototype = {
 
 				case 'PointLight':
 
-					object = new THREE.PointLight( data.color, data.intensity );
+					object = new THREE.PointLight( data.color, data.intensity, data.distance );
 					object.position.fromArray( data.position );
 
 					break;