Skip to content

Commit

Permalink
Fix bone scaling (#14987)
Browse files Browse the repository at this point in the history
  • Loading branch information
Popov72 committed Apr 17, 2024
1 parent 5b1c4bf commit 5ec504d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/dev/core/src/Bones/boneLookController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ export class BoneLookController {
const xaxis = BoneLookController._TmpVecs[6];
const yaxis = BoneLookController._TmpVecs[7];
const tmpQuat = BoneLookController._TmpQuat;
const boneScaling = BoneLookController._TmpVecs[9];

target.subtractToRef(bonePos, zaxis);
zaxis.normalize();
Expand All @@ -502,6 +503,8 @@ export class BoneLookController {
_tmpMat2.multiplyToRef(_tmpMat1, _tmpMat1);
}

boneScaling.copyFrom(this.bone.getScale());

if (this.slerpAmount < 1) {
if (!this._slerping) {
this.bone.getRotationQuaternionToRef(Space.WORLD, this.mesh, this._boneQuat);
Expand All @@ -522,6 +525,8 @@ export class BoneLookController {
this._slerping = false;
}

this.bone.setScale(boneScaling);

this._updateLinkedTransformRotation();
}

Expand Down

0 comments on commit 5ec504d

Please sign in to comment.