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

Merge pull request #6703 from TatumCreative/SkinnedMesh-calculate-inverses

SkinnedMesh.bind calculates the skeleton inverses
......@@ -43,9 +43,6 @@
// Bind the skeleton to the mesh
mesh.bind( armSkeleton );
// Update the inverse matrices in the skeleton to reflect the newly bound skeleton
armSkeleton.calculateInverses();
// Move the bones and manipulate the model
armSkeleton.bones[ 0 ].rotation.x = -0.1;
armSkeleton.bones[ 1 ].rotation.x = 0.2;
......
......@@ -159,7 +159,6 @@
mesh.add( bones[ 0 ] );
mesh.bind( skeleton );
skeleton.calculateInverses();
skeletonHelper = new THREE.SkeletonHelper( mesh );
skeletonHelper.material.linewidth = 2;
......
......@@ -1209,7 +1209,7 @@ THREE.glTFLoader.prototype.load = function( url, callback ) {
}
}
threeMesh.bind(new THREE.Skeleton(bones, boneInverses, false));
threeMesh.bind( new THREE.Skeleton( bones, boneInverses, false ), threeMesh.matrixWorld );
}
if (threeMesh) {
......
......@@ -60,7 +60,7 @@ THREE.SkinnedMesh = function ( geometry, material, useVertexTexture ) {
this.normalizeSkinWeights();
this.updateMatrixWorld( true );
this.bind( new THREE.Skeleton( bones, undefined, useVertexTexture ) );
this.bind( new THREE.Skeleton( bones, undefined, useVertexTexture ), this.matrixWorld );
};
......@@ -75,6 +75,8 @@ THREE.SkinnedMesh.prototype.bind = function( skeleton, bindMatrix ) {
if ( bindMatrix === undefined ) {
this.updateMatrixWorld( true );
this.skeleton.calculateInverses();
bindMatrix = this.matrixWorld;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册