[of-dev] glm

arturo castro arturo at openframeworks.cc
Mon Mar 28 10:56:50 PDT 2016



On 28.03.2016 19:39, Elliot Woods wrote:
> 
> (Maybe that's what's on the table already?)

:) yeah that's more or less what's in there now, it even has a macro in
ofConstants that switches the only 2 vec containers in the core from
using glm <-> ofVec so old projects should work right away and there
shouldn't be any copies even for vectors.

the only case that won't compile in old projects is something like:

camera.getPosition().length()

which would need to be changed to one of:


ofVec3f pos = camera.getPosition();
pos.length()


or


glm::length(camera.getPosition());


And yes totally agree that the main reason for changing to glm is that
the current classes are super inconsistent, didn't knew that there were
issues with inversions ... but if there are more reason to switch, this
is the kind of code that we really don't want to maintain.


Also I've just spoke with theo and he seems to be ok with switching to
the current implementation if we keep the "legacy" mode as the default
by now and all the examples still using ofVec. additionally we could
enable glm by default while it's in master and then switch to legacy for
the release

again, switching from legacy to glm is only a matter of changing a macro
in ofConstants and only involves the return types of ofMesh/ofPolyline,
the vector math internally and the return types for everything else
would still be glm which auto converts from/to ofVec


More information about the of-dev mailing list