-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
ofVec and ofMatrix wrapping glm #5449
Comments
i don't think this makes sense for older projects compatibility the best is to enable ofVec* as default in ofConstants and keep using ofVec/ofMatrix for new projects just use glm everywhere. trying to wrap glm with ofVec seems like it would make maintenance in the future even harder and make the transition to glm longer |
the thing is that by enabling the legacy vec in ofConstants.h the only thing that changes is ofMesh and ofPolyline, but there are a lot of other parts where ofVec was being used that are now glm::vec, which are actually where the conflict arises. But even if all these parts that now use glm::vec are changed to ofDefaultVec there would be problems with the functions related to ofVec, and this is why I'm proposing a wrapper. This wrapper could even have a deprecation flag so in the future we can finally get rid of ofVec. |
the main problem with transitioning to glm was returning or accepting as parameter
that's the only line of code in all the OF examples that needed to be changed when compiling in compatibility mode and can be easily solved like:
the other case is when a function accepts a what are the specific trouble you found? also i'm not very clear on how an ofVec wrapper around glm would make things easier as opposed to just keep using ofVec, can you put a concrete example? |
Hi, |
I'm going to close this issue in and move the discussion here: #5440 |
Sure! thanks |
Hi,
so as glm is now part of the OF core I have gotten into some really nasty issues dealing with code compatibility, in particular with addons.
So I was thinking about writing a sort of wrapper for glm that would not break older code.
The idea is to make ofVec and ofMatrix to inherit from their respective glm counterparts and make their methods to simply wrap the glm functions. This way, any code that used ofVec or ofMatrix would "see" no difference although all the inner work is done by glm.
How does this sound?
Is it worth the effort?
I already have some of it done, so I wouldn't have any problem on making this for all the math classes that now use glm.
cheers!
The text was updated successfully, but these errors were encountered: