Skip to content

Optimized quaternion rotation routine #476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

infusion
Copy link

Hello,

I'm the author of Quaternion.js and derived a simpler method to rotate a vector using normalized quaternions, reducing the number of multiplications quite a bit. Since gl-matrix is developed with performance in mind, I think this addition can improve quite a few code bases.

All your unit tests are passing. I removed the performance test link, since jsPerf is offline for quite some time now.

Robert

@gene-ressler
Copy link

gene-ressler commented Apr 17, 2025

This looks like an excellent improvement. I wish it would be merged. My only nit is that adding two floats to implement multiplication by two is probably not worthwhile and possibly slower, since the upshot is a simple increment of the exponent. At any rate, JIT compilation will do the right thing if the code ends up in a critical place.

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