-
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
Limiting floating point checks #378
Comments
Dear @Groovounet, I'm a computer vision researcher at FORTH (Foundation of Research and Technology Hellas) and work together with @nkyriazis. We're fond users of glm. However, the design choice outlined in this issue is very unfortunate for us as we deal with many data types that, while they are not, behave like floats. This prevents us from using many of the algorithms inside glm. Is this something on your radar? Or are we perhaps missing a deeper motivation behind restricting template arguments to single types? Many thanks in advance! |
The purpose of these asserts is purely to limit the behavior differences between GLSL and GLM. Some extensions implement integer flavors of code functions. I could also add a define to avoid these checking. |
@Groovounet A define would be awesome. Thanks for looking into this. |
This issue should be more or less fixed in GLM 0.9.8 branch for GLM 0.9.8.3 release and master branch. There is very likely many places missing, please just open new issues if you need additional cases. Thanks, |
@Groovounet Well, I think the subject (dot) shall be guarded with GLM_FORCE_UNRESTRICTED_GENTYPE too. |
Looking here: The static asserts are still there with no workaround. I'm also having issues with auto-differentiators with glm |
GLM is templetized over the type of scalar. Static checking of whether scalar type is float acts on the opposite direction of templetization.
e.g.
Personally, I don't get why these checks are there. They are preventing me (so I had to comment them out) to use the glm math with scalar types that are not single precision, or actual scalars for that matter. By removing the checks I have successfully used the math libraries, in conjunction with dual numbers algebra, to e.g. compute derivatives of math routines, using OO autodiff.
This also means that some hard coded numbers here and there should be converted to T. For example, glm::mat3_cast should be changed to (notice the T() wraps around numbers)
The text was updated successfully, but these errors were encountered: