|
|
@@ -24444,7 +24444,7 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
if ( object.skeleton.frame !== info.render.frame ) {
|
|
|
|
|
|
- object.skeleton.update();
|
|
|
+ object.skeleton.update(object);//xzw add object for avoidBigNumber
|
|
|
object.skeleton.frame = info.render.frame;
|
|
|
|
|
|
}
|
|
|
@@ -26337,7 +26337,9 @@ SkinnedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
|
|
|
|
|
|
if ( this.bindMode === 'attached' ) {
|
|
|
|
|
|
- this.bindMatrixInverse.copy( this.matrixWorld ).invert();
|
|
|
+ //this.bindMatrixInverse.copy( this.matrixWorld ).invert();
|
|
|
+ this.bindMatrixInverse.copy( this.matrix ).invert();//xzw改 for avoidBigNumber
|
|
|
+
|
|
|
|
|
|
} else if ( this.bindMode === 'detached' ) {
|
|
|
|
|
|
@@ -26521,7 +26523,7 @@ Object.assign( Skeleton.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- update: function () {
|
|
|
+ update: function (skinMesh) {//xzw add skinMesh
|
|
|
|
|
|
const bones = this.bones;
|
|
|
const boneInverses = this.boneInverses;
|
|
|
@@ -26529,12 +26531,13 @@ Object.assign( Skeleton.prototype, {
|
|
|
const boneTexture = this.boneTexture;
|
|
|
|
|
|
// flatten bone matrices to array
|
|
|
+ let matrixWorldInverse = skinMesh.matrixWorld.clone().invert() //add
|
|
|
|
|
|
for ( let i = 0, il = bones.length; i < il; i ++ ) {
|
|
|
|
|
|
// compute the offset between the current and the original transform
|
|
|
-
|
|
|
- const matrix = bones[ i ] ? bones[ i ].matrixWorld : _identityMatrix;
|
|
|
+ //const matrix = bones[ i ] ? bones[ i ].matrixWorld : _identityMatrix;
|
|
|
+ const matrix = bones[ i ] ? bones[ i ].matrixWorld.clone().premultiply(matrixWorldInverse) : _identityMatrix; //xzw 改 for avoidBigNumber
|
|
|
|
|
|
_offsetMatrix.multiplyMatrices( matrix, boneInverses[ i ] );
|
|
|
_offsetMatrix.toArray( boneMatrices, i * 16 );
|