瀏覽代碼

Update ColladaLoader.js

Variable m1 declared inside else-scope but used in the if-scope before.
setJointValue didn't update the value at jointMap => Not possible to use getJointValue() with correct new value after use of setJointValue()
Fallstream 8 年之前
父節點
當前提交
486b519fca
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      examples/js/loaders/ColladaLoader.js

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

@@ -913,6 +913,7 @@ THREE.ColladaLoader = function () {
 							var transform = transforms[ i ];
 
 							// kinda ghetto joint detection
+							var m1 = new THREE.Matrix4();
 							if ( transform.sid && transform.sid.indexOf( 'joint' + jointIndex ) !== -1 ) {
 
 								// apply actual joint value here
@@ -937,7 +938,6 @@ THREE.ColladaLoader = function () {
 
 							} else {
 
-								var m1 = new THREE.Matrix4();
 
 								switch ( transform.type ) {
 
@@ -988,6 +988,7 @@ THREE.ColladaLoader = function () {
 
 						threejsNode.matrix.set.apply( threejsNode.matrix, elementsRowMajor );
 						threejsNode.matrix.decompose( threejsNode.position, threejsNode.quaternion, threejsNode.scale );
+						jointMap[jointIndex].position=value;
 					}
 
 				} else {