Browse Source

SceneLoader: Rescued lost DirectionalLight handler.

Mr.doob 11 years ago
parent
commit
b66d8b01c5
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/loaders/SceneLoader.js

+ 8 - 1
src/loaders/SceneLoader.js

@@ -361,7 +361,9 @@ THREE.SceneLoader.prototype = {
 
 					// lights
 
-					} else if (objJSON.type === "PointLight" || objJSON.type === "AmbientLight" || objJSON.type === "SpotLight" || objJSON.type === "HemisphereLight" || objJSON.type === "AreaLight") {
+					} else if ( objJSON.type === "AmbientLight" || objJSON.type === "PointLight" ||
+						objJSON.type === "DirectionalLight" || objJSON.type === "SpotLight" ||
+						objJSON.type === "HemisphereLight" || objJSON.type === "AreaLight" ) {
 
 						var color = objJSON.color;
 						var intensity = objJSON.intensity;
@@ -380,6 +382,11 @@ THREE.SceneLoader.prototype = {
 								light.position.fromArray( position );
 								break;
 
+							case 'DirectionalLight':
+								light = new THREE.DirectionalLight( color, intensity );
+								light.position.fromArray( objJSON.direction );
+								break;
+
 							case 'SpotLight':
 								light = new THREE.SpotLight( color, intensity, distance, 1 );
 								light.angle = objJSON.angle;