-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Added support for bvecX not
operator
#1347
base: master
Are you sure you want to change the base?
Conversation
80db4a0
to
140c311
Compare
Is this needed? we have |
I think so? https://en.cppreference.com/w/cpp/language/operator_logical For example, this is valid with my patch applied, else not: if( all(cond) || all(not(cond)) ) s*=-1.0; So yes, I would say having it is a good idea in place of |
they are second class they are alternatives.
I don't think glm allows exact copy pasting of code into C++ due to language differences. glm tries to and the fix is just this
notice the also with your patch code like this compiles if(any(not vec)) and if we are following GLSL spec then this code should not compile. I don't think it is important we have GLSL also having 2 functions for the same thing is weird, have one or the other and GLM uses GLSL tldr just use |
Sorry but I am really having a hard time following your points.
Even if, then what? I will agree that some of the digraphs are not often used in the modern world of unicode, but I don't quite get where your "second class" label is coming from to be honest. They are there, the standard describes them as fully interchangeable, people use them, so...
Sure, I agree, but why artificially introducing some when it is not needed?
Yes, but why would anyone able to choose pick the underscore in place of same code?
Valid point, but I see two problems there:
From template<length_t L, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool any(vec<L, bool, Q> const& v)
{
bool Result = false;
for(length_t i = 0; i < L; ++i)
Result = Result || v[i];
return Result;
}
If we want it removed, a different PR might do that (alongside any other invalid overload which has been defined).
I agree, |
You are correct, indeed && and || are not defined in GLSL, so this makes sense to be added as well, since glm already extends the vector class |
Added support for the missing not operator (only for boolean vectors).