Browse Source

Merge pull request #8953 from Popov72/fix-bone-returntorest

Bones: fix returnToRest + updateMatrix
David Catuhe 5 năm trước cách đây
mục cha
commit
54fd29a0f6
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      src/Bones/bone.ts

+ 3 - 2
src/Bones/bone.ts

@@ -242,9 +242,9 @@ export class Bone extends Node {
      */
     public returnToRest(): void {
         if (this._skeleton._numBonesWithLinkedTransformNode > 0) {
-            this.updateMatrix(this._restPose.clone(), false, false);
+            this.updateMatrix(this._restPose, false, false);
         } else {
-            this.updateMatrix(this._restPose.clone());
+            this.updateMatrix(this._restPose, false, true);
         }
     }
 
@@ -384,6 +384,7 @@ export class Bone extends Node {
         }
 
         if (updateLocalMatrix) {
+            this._needToCompose = false; // in case there was a pending compose
             this._localMatrix.copyFrom(matrix);
             this._markAsDirtyAndDecompose();
         }