Skip to content

Quaternion - Support extrapolation in slerp methods#32541

Merged
mrdoob merged 2 commits intomrdoob:devfrom
WestLangley:dev-slerp
Dec 13, 2025
Merged

Quaternion - Support extrapolation in slerp methods#32541
mrdoob merged 2 commits intomrdoob:devfrom
WestLangley:dev-slerp

Conversation

@WestLangley
Copy link
Collaborator

As suggested in #31875 (comment).

Prior to #31875, the three.js quaternion slerp methods allowed values of the parameter t outside of the interval [0, 1].

This PR restores the former behavior.

@WestLangley WestLangley added this to the r183 milestone Dec 13, 2025
@github-actions
Copy link

github-actions bot commented Dec 13, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 355.12
84.44
355.12
84.44
+0 B
+0 B
WebGPU 616.54
171.12
616.54
171.12
+0 B
+0 B
WebGPU Nodes 615.14
170.85
615.14
170.85
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 487.45
119.37
487.29
119.31
-162 B
-54 B
WebGPU 687.45
186.71
687.29
186.66
-162 B
-51 B
WebGPU Nodes 637.29
173.93
637.13
173.88
-162 B
-50 B

const a = new Quaternion( x, y, z, w );
const b = new Quaternion( - x, - y, - z, - w );
const a = new Quaternion( x, y, z, w ).normalize();
const b = new Quaternion( w, x, y, z ).normalize();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This test case was failing.

A quaternion and its negation represent the same rotation, so the equality test used here is invalid.

For now, I made an arbitrary change that passes the test.

@mrdoob mrdoob merged commit 0994520 into mrdoob:dev Dec 13, 2025
10 checks passed
@WestLangley WestLangley deleted the dev-slerp branch December 17, 2025 23:31
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.

2 participants