I have a problem with collisions, in the following scenario:
=> I have six segment shapes (lines, with ratio zero), for wich the body have infinity mass; These lines are been created like that
Code: Select all
cpBody *bodyLine;
cpShape *shapeLine;
bodyLine = cpBodyNew(INFINITY, INFINITY);
shapeLine = cpSegmentShapeNew(bodyLine, origem, destino, 0);
shapeLine->collision_type = 0;
shapeLine->e = 1.0;
shapeLine->u = 0.2;
cpSpaceAddStaticShape(space, shapeLine);
Code: Select all
cpBody *body = cpBodyNew(m, cpMomentForCircle(100, 50, 50, cpvzero));
body->p = cpv(160, 240)
cpSpaceAddBody(space, body);
shape = cpCircleShapeNew(body, 50, cpvzero);
shape->e = 1;
shape->u = 0.8;
shape->collision_type = 1;
cpSpaceAddShape(space, shape);
Code: Select all
shape->body->v = velocity_vector;
I placed a NSLog command to verify if this is due to a specific velocity value, but for a same value, sometimes the collision happens, sometime don't.
I have modified almost every parameter passed to the chipmunk, but unsuccessful.
I have no idea what is wrong.
Can you guys help me with this issue??
Thanks!
Dilson