浏览代码

ColladaLoader: Support DirectionalLights.

Mr.doob 12 年之前
父节点
当前提交
21ebca8ecf
共有 1 个文件被更改,包括 13 次插入1 次删除
  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 ++ ) {
 
 			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 ) {
 
 				case 'point':
+				case 'directional':
 
 					this.technique = child.nodeName;