Skip to content

Commit

Permalink
Fix Transform e2e error (#2466)
Browse files Browse the repository at this point in the history
* fix: transform e2e error
  • Loading branch information
cptbtptpbcptdtptp authored Dec 17, 2024
1 parent 1405f8b commit 4167e83
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/Transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,9 @@ export class Transform extends Component {
* @internal
*/
_copyFrom(transform: Transform): void {
this._position.copyFrom(transform._position);
this._rotation.copyFrom(transform._rotation);
this._scale.copyFrom(transform._scale);
this._position.copyFrom(transform.position);
this._rotation.copyFrom(transform.rotation);
this._scale.copyFrom(transform.scale);
}

protected override _onDestroy(): void {
Expand Down
7 changes: 6 additions & 1 deletion packages/core/src/mesh/SkinnedMeshRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,12 @@ export class SkinnedMeshRenderer extends MeshRenderer {
* @internal
*/
protected override _updateBounds(worldBounds: BoundingBox): void {
BoundingBox.transform(this._localBounds, this._transformEntity.transform.worldMatrix, worldBounds);
const rootBone = this.skin?.rootBone;
if (rootBone) {
BoundingBox.transform(this._localBounds, this._transformEntity.transform.worldMatrix, worldBounds);
} else {
super._updateBounds(worldBounds);
}
}

private _checkBlendShapeWeightLength(): void {
Expand Down

0 comments on commit 4167e83

Please sign in to comment.