It should be… but there is no such function:
var verts = [40,0,0,0,0,20, 40,20];
var shape = new cp.PolyShape(body, verts,pos);
shape.setElasticity( 0.5 );
shape.setFriction( 0.5 );
cc.log(shape.setVerts); // logs "undefined"*
Maybe in another port of Chipmunk? I’m using the version of Chipmunk provided with Cocos2d-x-2.2.1 (I’m developing on Eclipse/ADT and testing on Android device). Maybe unsafe.h was not ported on this version (or maybe there is just no appropriate js-binding to these functions)?
I found some other port, maybe I’ll copy function from there:
PolyShape.prototype.setVerts = function(verts, offset)
I’ve read also about autogeometry feature in Chipmunk which could be helpful, but I can’t use that because afaik it is available only in Chipmunk Pro (I’m using the free version).