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

Updated builds.

上级 4ffd1d1f
......@@ -15142,8 +15142,7 @@ THREE.Skeleton.prototype.pose = function () {
bone.matrix.getInverse( bone.parent.matrixWorld );
bone.matrix.multiply( bone.matrixWorld );
}
else {
} else {
bone.matrix.copy( bone.matrixWorld );
......@@ -15157,30 +15156,34 @@ THREE.Skeleton.prototype.pose = function () {
};
THREE.Skeleton.prototype.update = function () {
THREE.Skeleton.prototype.update = ( function () {
var offsetMatrix = new THREE.Matrix4();
return function () {
// flatten bone matrices to array
// flatten bone matrices to array
for ( var b = 0, bl = this.bones.length; b < bl; b ++ ) {
for ( var b = 0, bl = this.bones.length; b < bl; b ++ ) {
// compute the offset between the current and the original transform
// compute the offset between the current and the original transform
var matrix = this.bones[ b ] ? this.bones[ b ].matrixWorld : this.identityMatrix;
var matrix = this.bones[ b ] ? this.bones[ b ].matrixWorld : this.identityMatrix;
offsetMatrix.multiplyMatrices( matrix, this.boneInverses[ b ] );
offsetMatrix.flattenToArrayOffset( this.boneMatrices, b * 16 );
offsetMatrix.multiplyMatrices( matrix, this.boneInverses[ b ] );
offsetMatrix.flattenToArrayOffset( this.boneMatrices, b * 16 );
}
}
if ( this.useVertexTexture ) {
if ( this.useVertexTexture ) {
this.boneTexture.needsUpdate = true;
this.boneTexture.needsUpdate = true;
}
}
};
};
} )();
// File:src/objects/SkinnedMesh.js
......@@ -21939,7 +21942,8 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( camera.parent === undefined ) camera.updateMatrixWorld();
// update Skeleton objects
function updateSkeletons( object ) {
scene.traverse( function ( object ) {
if ( object instanceof THREE.SkinnedMesh ) {
......@@ -21947,15 +21951,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
for ( var i = 0, l = object.children.length; i < l; i ++ ) {
updateSkeletons( object.children[ i ] );
}
}
updateSkeletons( scene );
} );
camera.matrixWorldInverse.getInverse( camera.matrixWorld );
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册