I used the latest version of cocos2d-x from the develop branch, I created a multiplataform (js) project using the python script provided with cocos2d-x.
Then I created a html5 project (also with latest version from develop branch), and I created a PhysicsLayer.js (attached file) to test chipmunk.
All that the PhysicsLayer.js does is create some boxes and 1 ball and simulates it, it also has a PivotJoint for grabbing the boxes and circles (I just followed the same steps provided by the chipmunk original examples).
At some point in my code I have to use the following function of chipmunk: var shape = _space.pointQueryFirst(_mousePos, 1<<31, cp.NO_GROUP);
this version does work on web and iPhone simulator, but does NOT work on a iphone4s, by the time it reaches the original C function of chipmunk, the second argument (cpLayers) is always ZERO
however when I tried: var shape = _space.pointQueryFirst(_mousePos, cp.ALL_LAYERS, cp.NO_GROUP);
it did work fine on web, iphone simulator and iphone 4s…
I think it might have something to do with the huge value passed for cpLayers?
Let me know if its a bug or did I just use it wrong?