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 Vec::sign_bits #345
Add Vec::sign_bits #345
Conversation
I'm wondering what the most general purpose method would be for most users here. For example, there are already methods on For your usage it seems like a |
My use-case needs to distinguish between three cases: all positive, all negative, or mixed signs. I don't need to know what the specific mix is if its mixed. Sample code:
|
Kind of a note to myself, it might be good to add |
Funny, there's a FALSE const for all BVecN types but no TRUE. I can PR this if its convenient |
The current false is private I think. If you want to make a PR, go for it. |
This is dependent on the fixes in #344 (those problems were found while adding this function)
I need this function for optimized tetrahedron face winding order checks (four dot products being put in a
Vec
and then grabbing the sign bits to check if its either0b0000
or0b1111
, thus having all the same winding order and not being degenerate) among other things.BVec::bitmask
almost does this, but gets the LSB for scalar implementations, but I need it onVec
anyways so its irrelevant