Chipmunk warning: high GJK iterations

Discuss any Chipmunk bugs here.

Re: Chipmunk warning: high GJK iterations

Postby slembcke » Thu Dec 03, 2015 2:11 pm

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.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Chipmunk warning: high GJK iterations

Postby s_ridenour » Thu Dec 10, 2015 9:57 pm

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.
s_ridenour
 
Posts: 2
Joined: Thu Dec 03, 2015 1:59 am
Location: Colorado, USA

Re: Chipmunk warning: high GJK iterations

Postby slembcke » Fri Dec 11, 2015 9:25 am

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.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest