[of-dev] glm

arturo castro arturo at openframeworks.cc
Mon Mar 28 11:14:36 PDT 2016


no, i don't think there's any way to do that cause those classes are
also used in the core so the core needs to be recompiled and use the
same setting as the project if that setting changes.

the only solution i think would be to have anything that uses those
classes also templated but it seems to much

but the idea is that that would be changed by users just that you would
change it for all your projects instead of for per project.

also even if you have that setting set to glm most things will still
work, it's mostly things like:

vector<ofVec3f> vec = mesh.getVertices()

or anything that returns a vector of vec that would need to be fixed
when using glm as the default.

On 28.03.2016 19:59, Elliot Woods wrote:
> Is it possible to switch on a project macro
> rather than necessarily needing to edit the ofConstants.h?
> (users can have the option on how they make the switch themselves)
> 
> -- 
> -- 
> Elliot Woods
> elliot <mailto:elliot at kimchiandchips.com>@KimchiAndChips.com
> <http://www.kimchiandchips.com/>
> 
> UK : +447944977628
> KR : +821034458086
> 
> On 29 March 2016 at 02:56:56, arturo castro (arturo at openframeworks.cc
> <mailto:arturo at openframeworks.cc>) wrote:
> 
>>
>>
>> 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
>> _______________________________________________
>> of-dev mailing list
>> of-dev at dev.openframeworks.cc
>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc


More information about the of-dev mailing list