Closed rapsys closed 1 year ago
I think it should be enough if you just cast the constants btScalar(0), btScalar(1) etc, would be less noisy that way.
Although I'd be also fine with explicit instantiation Min<btScalar>(...)
etc.
Although I'd be also fine with explicit instantiation
Min<btScalar>(...)
etc.
Sorry, I am not a c++ expert, I don't see what you mean.
An example of code would be welcome.
Min/Max/Clamp are so called function templates expecting the same argument type. The compiler will complain if they get mixed type arguments (like float and double for example), thus the casting business.
Alternatively you can explicitly tell the compiler which type of function should be used (instantiated) by writing Min<float>
or Min<double>
etc and the compiler will cast the arguments accordingly if possible.
So instead of
Min(btScalar(a), btScalar(b));
you can write
Min<btScalar>(a, b);
I've pushed a slightly cleaner variant of the fix.
Thanks for looking into it.
Thanks for the upstream integration.
This pull request should fix issue #191