提交 6a53e95c 编写于 作者: T Takahiro

Add bone graph to SkinnedMesh

上级 77c5b1ff
......@@ -1622,6 +1622,31 @@ THREE.GLTFLoader = ( function () {
child.bind( new THREE.Skeleton( bones, boneInverses, false ), skinEntry.bindShapeMatrix );
var buildBoneGraph = function ( parentJson, parentObject, property ) {
var children = parentJson[ property ];
if ( children === undefined ) return;
for ( var i = 0, il = children.length; i < il; i ++ ) {
var nodeId = children[ i ];
var bone = __nodes[ nodeId ];
var boneJson = json.nodes[ nodeId ];
if ( bone !== undefined && bone.isBone === true && boneJson !== undefined ) {
parentObject.add( bone );
buildBoneGraph( boneJson, bone, 'children' );
}
}
}
buildBoneGraph( node, child, 'skeletons' );
}
_node.add( child );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册