// Transformation function for contactSet. static void * contactSetTrans(cpShape **shapes, cpSpace *space) { if(space->pooledArbiters->num == 0){ // arbiter pool is exhausted, make more int count = CP_BUFFER_BYTES/sizeof(cpArbiter); cpAssert(count, "Buffer size too small."); cpArbiter *buffer = (cpArbiter *)cpmalloc(CP_BUFFER_BYTES); cpArrayPush(space->allocatedBuffers, buffer); for(int i=0; i<count; i++) cpArrayPush(space->pooledArbiters, buffer + i); } return cpArbiterInit((cpArbiter *) cpArrayPop(space->pooledArbiters), shapes[0], shapes[1]); }
cpArbiter* cpArbiterNew(cpShape *a, cpShape *b) { return cpArbiterInit(cpArbiterAlloc(), a, b); }
cpArbiter* cpArbiterNew(cpShape *a, cpShape *b, int stamp) { return cpArbiterInit(cpArbiterAlloc(), a, b, stamp); }