Skip to content

Object3D: Correctly copy pivot.#33163

Merged
Mugen87 merged 3 commits into
mrdoob:devfrom
PoseidonEnergy:fix-stale-pivot-1
Mar 13, 2026
Merged

Object3D: Correctly copy pivot.#33163
Mugen87 merged 3 commits into
mrdoob:devfrom
PoseidonEnergy:fix-stale-pivot-1

Conversation

@PoseidonEnergy

Copy link
Copy Markdown
Contributor

Description

Object3D.pivot does not get set in Object3D.copy() if source.pivot is null. This PR fixes that.

@github-actions

github-actions Bot commented Mar 13, 2026

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 359.32
85.32
359.32
85.32
+0 B
+0 B
WebGPU 630.01
174.94
630.01
174.94
+0 B
+0 B
WebGPU Nodes 628.59
174.7
628.59
174.7
+0 B
+0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 491.52
119.9
491.52
119.9
+0 B
+0 B
WebGPU 703.24
189.9
703.24
189.9
+0 B
+0 B
WebGPU Nodes 652.47
177.3
652.47
177.3
+0 B
+0 B

Comment thread src/core/Object3D.js Outdated
this.pivot = source.pivot.clone();

}
this.pivot = source.pivot ? source.pivot.clone() : null;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.pivot = source.pivot !== null ? source.pivot.clone() : null;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Mugen87 Mugen87 added this to the r184 milestone Mar 13, 2026
@Mugen87 Mugen87 changed the title Set Object3D.pivot in Object3D.copy() even if the source.pivot is null Object3D: Correctly copy pivot. Mar 13, 2026
@Mugen87 Mugen87 merged commit 7b64502 into mrdoob:dev Mar 13, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants