Skip to content

[raymath] Fix: QuaternionMultiply#5729

Open
0stamina wants to merge 2 commits intoraysan5:masterfrom
0stamina:patch-2
Open

[raymath] Fix: QuaternionMultiply#5729
0stamina wants to merge 2 commits intoraysan5:masterfrom
0stamina:patch-2

Conversation

@0stamina
Copy link
Copy Markdown
Contributor

@0stamina 0stamina commented Apr 6, 2026

the multiplication algorithm was slightly off
previously when combining quaternion rotations objects would shrink now they rotate as expected

trying to get around the issue by using QuaternionToMatrix then QuaternionTransform doesn't work, and I'm not sure why

the multiplication algorithm was slightly off
previously when combining quaternion rotations objects would shrink
now they rotate as expected

trying to get around the issue by using QuaternionToMatrix then QuaternionTransform doesn't work, and I'm not sure why
@0stamina 0stamina changed the title [raymath] QuaternionMultiply [raymath] Fix: QuaternionMultiply Apr 6, 2026
@raysan5
Copy link
Copy Markdown
Owner

raysan5 commented Apr 6, 2026

@0stamina This is a sensible change, used by raylib animation system, did you verify it does not break animations rotations?

@0stamina
Copy link
Copy Markdown
Contributor Author

0stamina commented Apr 7, 2026

turns out the multiplications for animations were swapped to account for the mistake in the formula, I can't find any other instance of using quaternion multiplication to check

@raysan5
Copy link
Copy Markdown
Owner

raysan5 commented Apr 7, 2026

@0stamina I'm afraid I need some time to review this sensible change. Sending it without checking the implications in raylib from your side is very concerning and makes me doubt.

@casperbear
Copy link
Copy Markdown

casperbear commented Apr 7, 2026

AI doesn't recommend to merge the fix and suggests to check for problems on user side, in particular 1) whether a Left-Handed coordinate system is used in a Right-Handed library (RayLib/OpenGL). 2) whether arguments are passed in incorrect order to QuaternionMultiply - new/local rotation should be passed first, base/world rotation second

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