浏览代码

Changed ColladaLoader to create SkinnedMesh using bone uniforms instead of newly default bone texture.

This just gets back to using the old way, though this whole skinning thing in Collada is weird and should be maybe rewritten - skinning is baked into morphs but then SkinnedMesh is still used which means skeleton is getting updated all the time even while this has no effect on already baked morphs.

Fixes #2243
alteredq 13 年之前
父节点
当前提交
dd1c5e9305
共有 1 个文件被更改,包括 15 次插入15 次删除
  1. 15 15
      examples/js/loaders/ColladaLoader.js

+ 15 - 15
examples/js/loaders/ColladaLoader.js

@@ -41,10 +41,10 @@ THREE.ColladaLoader = function () {
 		subdivideFaces: true,
 		subdivideFaces: true,
 
 
 		upAxis: 'Y',
 		upAxis: 'Y',
-		
+
 		// For reflective or refractive materials we'll use this cubemap
 		// For reflective or refractive materials we'll use this cubemap
 		defaultEnvMap: null
 		defaultEnvMap: null
-		
+
 	};
 	};
 
 
 	// TODO: support unit conversion as well
 	// TODO: support unit conversion as well
@@ -772,13 +772,13 @@ THREE.ColladaLoader = function () {
 
 
 				}
 				}
 
 
-				if ( skinController !== undefined) {
+				if ( skinController !== undefined ) {
 
 
 					applySkin( geom, skinController );
 					applySkin( geom, skinController );
 
 
 					material.morphTargets = true;
 					material.morphTargets = true;
 
 
-					mesh = new THREE.SkinnedMesh( geom, material );
+					mesh = new THREE.SkinnedMesh( geom, material, false );
 					mesh.skeleton = skinController.skeleton;
 					mesh.skeleton = skinController.skeleton;
 					mesh.skinController = controllers[ skinController.url ];
 					mesh.skinController = controllers[ skinController.url ];
 					mesh.skinInstanceController = skinController;
 					mesh.skinInstanceController = skinController;
@@ -2007,7 +2007,7 @@ THREE.ColladaLoader = function () {
 
 
 					var propName = 'n' + ( member[ 0 ] + 1 ) + ( member[ 1 ] + 1 );
 					var propName = 'n' + ( member[ 0 ] + 1 ) + ( member[ 1 ] + 1 );
 					this.obj[ propName ] = data;
 					this.obj[ propName ] = data;
-					
+
 				} else {
 				} else {
 
 
 					console.log('Incorrect addressing of matrix in transform.');
 					console.log('Incorrect addressing of matrix in transform.');
@@ -2324,14 +2324,14 @@ THREE.ColladaLoader = function () {
 
 
 		this.geometry3js.computeCentroids();
 		this.geometry3js.computeCentroids();
 		this.geometry3js.computeFaceNormals();
 		this.geometry3js.computeFaceNormals();
-		
+
 		if ( this.geometry3js.calcNormals ) {
 		if ( this.geometry3js.calcNormals ) {
-			
+
 			this.geometry3js.computeVertexNormals();
 			this.geometry3js.computeVertexNormals();
 			delete this.geometry3js.calcNormals;
 			delete this.geometry3js.calcNormals;
-			
+
 		}
 		}
-		
+
 		this.geometry3js.computeBoundingBox();
 		this.geometry3js.computeBoundingBox();
 
 
 		return this;
 		return this;
@@ -2425,7 +2425,7 @@ THREE.ColladaLoader = function () {
 								break;
 								break;
 
 
 							default:
 							default:
-							
+
 								break;
 								break;
 
 
 						}
 						}
@@ -3126,13 +3126,13 @@ THREE.ColladaLoader = function () {
 				case 'shininess':
 				case 'shininess':
 					props[ prop ] = this[ prop ];
 					props[ prop ] = this[ prop ];
 					break;
 					break;
-					
+
 				case 'reflectivity':
 				case 'reflectivity':
 					props[ prop ] = this[ prop ];
 					props[ prop ] = this[ prop ];
 					if(props[ prop ] > 0.0) props['envMap'] = options.defaultEnvMap;
 					if(props[ prop ] > 0.0) props['envMap'] = options.defaultEnvMap;
 					props['combine'] = THREE.MixOperation;	//mix regular shading with reflective component
 					props['combine'] = THREE.MixOperation;	//mix regular shading with reflective component
 					break;
 					break;
-					
+
 				case 'index_of_refraction':
 				case 'index_of_refraction':
 					props[ 'refractionRatio' ] = this[ prop ]; //TODO: "index_of_refraction" becomes "refractionRatio" in shader, but I'm not sure if the two are actually comparable
 					props[ 'refractionRatio' ] = this[ prop ]; //TODO: "index_of_refraction" becomes "refractionRatio" in shader, but I'm not sure if the two are actually comparable
 					if(this[ prop ] != 1.0) props['envMap'] = options.defaultEnvMap;
 					if(this[ prop ] != 1.0) props['envMap'] = options.defaultEnvMap;
@@ -3984,11 +3984,11 @@ THREE.ColladaLoader = function () {
 					}
 					}
 
 
 				}
 				}
-				
+
 			}
 			}
 
 
 		}
 		}
-		
+
 		return this;
 		return this;
 
 
 	};
 	};
@@ -4351,7 +4351,7 @@ THREE.ColladaLoader = function () {
 		}
 		}
 
 
 		return index;
 		return index;
-		
+
 	};
 	};
 
 
 	function getConvertedMember( member ) {
 	function getConvertedMember( member ) {