提交 81d338e9 编写于 作者: M Mr.doob

ColladaLoader fixes.

* Fixed `ColladaLoader` and `Loader` url base extraction code.
* `ColladaLoader` now ignores non-joint nodes when constructing the skeleton. (Hopefuly, in a  year time, I'll find this fix stupid)
上级 435f7e7b
......@@ -135,7 +135,7 @@ This code creates a camera, then creates a scene, adds a cube on it, creates a &
### Change Log ###
2011 10 06 - **r45** (340.607 KB, gzip: 86.462 KB)
2011 10 06 - **r45** (340.863 KB, gzip: 86.568 KB)
* `Object/Scene.add*()` and `Object/Scene.remove*()` are now `Object/Scene.add()` and `Object/Scene.remove()`. ([mrdoob](http://github.com/mrdoob))
* `LOD.add()` is now `LOD.addLevel()`. ([mrdoob](http://github.com/mrdoob))
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
此差异已折叠。
......@@ -86,7 +86,7 @@ THREE.ColladaLoader = function () {
var parts = url.split( '/' );
parts.pop();
baseUrl = parts.join( '/' ) + '/';
baseUrl = parts.length < 1 ? '' : parts.join( '/' ) + '/';
}
......@@ -369,6 +369,8 @@ THREE.ColladaLoader = function () {
var bone = bones[ i ];
var found = -1;
if ( bone.type != 'JOINT' ) continue;
for ( var j = 0; j < skin.joints.length; j ++ ) {
if ( bone.sid == skin.joints[ j ] ) {
......@@ -408,7 +410,7 @@ THREE.ColladaLoader = function () {
} else {
throw "could not find joint!";
throw 'ColladaLoader: Could not find joint \'' + bone.sid + '\'.';
}
......@@ -424,14 +426,14 @@ THREE.ColladaLoader = function () {
if ( !skinController || !skinController.skin ) {
console.log("could not find skin controller!");
console.log( 'ColladaLoader: Could not find skin controller.' );
return;
}
if ( !instanceCtrl.skeleton || !instanceCtrl.skeleton.length ) {
console.log("could not find the skeleton for the skin!");
console.log( 'ColladaLoader: Could not find the skeleton for the skin. ' );
return;
}
......@@ -476,6 +478,8 @@ THREE.ColladaLoader = function () {
for ( i = 0; i < bones.length; i ++ ) {
if ( bones[ i ].type != 'JOINT' ) continue;
for ( j = 0; j < bones[ i ].weights.length; j ++ ) {
w = bones[ i ].weights[ j ];
......@@ -576,7 +580,7 @@ THREE.ColladaLoader = function () {
}
console.log("DAE: morph-controller partially supported.");
console.log( 'ColladaLoader: Morph-controller partially supported.' );
default:
break;
......@@ -2179,7 +2183,7 @@ THREE.ColladaLoader = function () {
break;
default:
//console.log(child.nodeName);
// console.log(child.nodeName);
break;
}
......@@ -2227,7 +2231,7 @@ THREE.ColladaLoader = function () {
default:
console.log('Dae::Source:read dont know how to read ' + param.type);
console.log( 'ColladaLoader: Source: Read dont know how to read ' + param.type + '.' );
break;
}
......
......@@ -59,9 +59,9 @@ THREE.Loader.prototype = {
extractUrlbase: function ( url ) {
var chunks = url.split( "/" );
chunks.pop();
return chunks.length < 1 ? "." : chunks.join( "/" );
var parts = url.split( '/' );
parts.pop();
return parts.length < 1 ? '' : parts.join( '/' ) + '/';
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册