Skip to content
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

Add packed/aligned quat types #1353

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

Conversation

alusch
Copy link

@alusch alusch commented Mar 21, 2025

In our projects we use aligned types by default, but in some data structures have a need for a tightly-packed quaternion to avoid padding. We're defining our own typedef at the moment, but seems like a nice thing to have in the library itself.

Not sure if there are any concerns about pulling in gtc/quaternion.hpp to gtc/type_aligned.hpp; I see it's not the first additional GTC header anyway. Happy to consider alternatives if it isn't desired, though.

Add aligned*_quat and packed*_quat typdefs mirroring vectors, and a new test to gtc_type_aligned.cpp.

@@ -200,6 +200,46 @@ static int test_copy_vec3()
return Error;
}

static int test_copy_quat()
Copy link

Choose a reason for hiding this comment

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

this could be made into a templated function

Copy link
Author

Choose a reason for hiding this comment

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

For sure! I was trying to follow what seemed to be the prevailing style in the tests, but happy to remove some duplication if that's desired.

Copy link

Choose a reason for hiding this comment

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

the previaling style in most of glm is not that great tbh.

In my pr I removed 7600~ lines of code and replaced them with just 2600

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