Swizzle methods


I tried to compile the (excellent) ofxWarp, using the latest release.

Like detailed here, it seems like the swizzle methods aren’t included in the latest release of OF.

Candidate 4 had it included (see screenshot) in the .d files:
for example in

line 24 :
../../../../libs/glm/include/glm/detail/_swizzle.hpp \ . How do I re include it?

I think the best is to fix ofxWarp but if it’s helpful this is the OF issue around removing the swizzle –

it sounds like #define GLM_FORCE_SWIZZLE in ofConstants was there before… maybe you can compare ofConstants from rc4 and the current release and see if you can hack it back in.

1 Like

you can also use GLM_FORCE_SWIZZLE at the beginning of your cpp (ofxWarp’s in this case) to use it there only. Don’t add it on .h so it doesn’t leak to other units.

As the issue zach points out says this was slowing things down a lot so we decided to remove it from the global includes at the last minute

1 Like

Ok thanks, I’ll try adding the preprocessor macro then, :slight_smile: .

Hi! I tried adding #define GLM_FORCE_SWIZZLE to my .cpp but apparently it made no difference as it would not compile.


    v = (quat * glm::vec4(v, 1)).xyz();


    v = glm::vec3(quat * glm::vec4(v, 1));

did work. Is this approach fine?

yes that’s the preferred method now that swizzles are disabled

1 Like