Page 1 of 1

Re: Chipmunk warning: high GJK iterations

Posted: Thu Dec 03, 2015 2:11 pm
by slembcke
Try adding "-fno-fast-math" to the compiler flags for cpRobust.c. (Click the project > Build Phases > Compile Sources)

The version of clang that comes with Xcode 7+ broke a risky optimization I had used in the GJK and EPA algorithms to avoid needing arbitrary thresholds. I was relying on an inlined function to generate the exact same results when inlined in different places. The fix was to move the two functions to a separate file where unsafe math optimizations were not allowed. It fixes the problem without requiring me to add thresholds, and without measurably affecting performance. It did make the build a little more complicated though.

I would *highly* recommend compiling Chipmunk as a static library or adding the Chipmunk project to yours as a subproject. It avoids build problems like this and makes it easy to integrate bug fixes. Really I would recommend this for any library.

Re: Chipmunk warning: high GJK iterations

Posted: Thu Dec 10, 2015 9:57 pm
by s_ridenour
LOL my posts got deleted, but this fixed my problem. Thanks!

I have the Chipmunk source included in the project mainly to keep from having to manage separate debug/release static libraries for both iOS and tvOS. I'll probably add Chipmunk as a subproject instead, eventually.

Re: Chipmunk warning: high GJK iterations

Posted: Fri Dec 11, 2015 9:25 am
by slembcke
I suppose I should add a build target for tvOS, until then it's easy to do yourself. You just need to duplicate the iOS target and change the SDK I think.