Two shapes:
* A segment from -50,-100 to 50,100
* A box which is 300 wide, 100 tall centered around the origin
Somehow, they don't collide with each other. I've tried putting them on bodies in an updating space and so on, and I get the same behaviour. If the box is 200 wide instead, they collide correctly. (??)
Code: Select all
cpShape *seg = cpSegmentShapeNew(NULL, cpv(-50, -100), cpv(50, 100), 10);
cpShapeUpdate(seg, cpvzero, cpvforangle(0));
cpShape *poly = cpBoxShapeNew(NULL, 300, 100);
cpShapeUpdate(poly, cpvzero, cpvforangle(0));
cpContact c[100];
int num = cpCollideShapes(seg, poly, c);
printf("%d\n", num); // prints 0