Browse Source

ColladaLoader: Support DirectionalLights.

Mr.doob 12 years ago
parent
commit
21ebca8ecf
1 changed files with 13 additions and 1 deletions
  1. 13 1
      examples/js/loaders/ColladaLoader.js

+ 13 - 1
examples/js/loaders/ColladaLoader.js

@@ -844,7 +844,18 @@ THREE.ColladaLoader = function () {
 		for ( i = 0; i < node.lights.length; i ++ ) {
 		for ( i = 0; i < node.lights.length; i ++ ) {
 
 
 			var params = lights[node.lights[i].url];
 			var params = lights[node.lights[i].url];
-			obj = new THREE.PointLight(params.color);
+
+			switch ( params.technique ) {
+
+				case 'point':
+					obj = new THREE.PointLight(params.color);
+					break;
+
+				case 'directional':
+					obj = new THREE.DirectionalLight(params.color);
+					break;
+
+			}
 
 
 		}
 		}
 
 
@@ -4101,6 +4112,7 @@ THREE.ColladaLoader = function () {
 			switch ( child.nodeName ) {
 			switch ( child.nodeName ) {
 
 
 				case 'point':
 				case 'point':
+				case 'directional':
 
 
 					this.technique = child.nodeName;
 					this.technique = child.nodeName;