Bug... Segments don't make collisions between them
Posted: Thu Jan 01, 2009 9:17 pm
Hi, Happy new year 
I'm working on a game for Academic work and I use the very nice physics library Chipmunk. (dowloaded here: http://files.slembcke.net/chipmunk/rele ... Latest.tgz)
But after all my work and after checking all my project, a bug still here: the Segments (Static or active) don't generate collisions between them...
just see this screen capture:
http://fr.youtube.com/watch?v=YLpxWxfYhxM
don't make matter about the grey Circle, and the force which is apply to the segment, it's normal...
but see the 2 active segments and the top part of the balance (which is made with active Segments):
- the 1st fall and don't hit the top part of the balance (which is made with active Segments)...
- the 2nd turn and don't hit the 2 static Segments near its, but it hit the balls...
- then, the top part of the balance hit the balls, and the triangle (which is made with static polygon) but it don't hit the 1st segment...
in my code, the Chipmunk step are like that:
finally, this 3 active segment shape which each one is linked with differents bodies, with the default group ( 0 ) and default layers ( (int) 65535 ), don't generate collisions with all others static or active segments 
Can I find a solution or a fix here ? or maybe It can be my code ?

I'm working on a game for Academic work and I use the very nice physics library Chipmunk. (dowloaded here: http://files.slembcke.net/chipmunk/rele ... Latest.tgz)
But after all my work and after checking all my project, a bug still here: the Segments (Static or active) don't generate collisions between them...
just see this screen capture:
http://fr.youtube.com/watch?v=YLpxWxfYhxM
don't make matter about the grey Circle, and the force which is apply to the segment, it's normal...
but see the 2 active segments and the top part of the balance (which is made with active Segments):
- the 1st fall and don't hit the top part of the balance (which is made with active Segments)...
- the 2nd turn and don't hit the 2 static Segments near its, but it hit the balls...
- then, the top part of the balance hit the balls, and the triangle (which is made with static polygon) but it don't hit the 1st segment...
in my code, the Chipmunk step are like that:
Code: Select all
if (m == INFINITY)
{
_isStatic = true;
obj = cpBodyNew(INFINITY, INFINITY);
}
else
{
_isStatic = false;
obj = cpBodyNew(m, 500);
}
obj->p = cpv(xpos, ypos);
....
if (_isStatic == false)
cpSpaceAddBody(space, obj);
shape = cpSegmentShapeNew(obj, pos1, pos2, radius);
shape->e = e; shape->u = u;
cpShapeCacheBB(shape);
if (_isStatic == true)
{
shape->collision_type = 3;
cpSpaceAddStaticShape(space, shape);
}
else
{
shape->collision_type = 1;
shape->data = this;
cpSpaceAddShape(space, shape);
}
cpResetShapeIdCounter();

Can I find a solution or a fix here ? or maybe It can be my code ?