Page 1 of 1

Dynamic segment shapes

Posted: Sat Jan 26, 2013 2:24 pm
by yzsolt
Hello slembcke,

I saw that segment-to-segment collision detection have been implemented. I've ported it to my Chipmunk JS port, but it hasn't worked as I expected. My first thought was that it would have to make possible to create and simulate dynamic "pill" shapes (segments with radius), but I was wrong as I see. I've created a dynamic body with a segment shape and it has moved around very unrealistic... :D
I came to the conclusion that it's not a bug, rather a missing (or never-wanted-to-implement) feature of segment shapes (their center of mass and related calculations) causes it. My first question is, am I right? And the second: will it be ever implemented, or not - because a polygon and two circle shapes on a body can act like a segment shape with a radius?

Re: Dynamic segment shapes

Posted: Mon Jan 28, 2013 6:22 pm
by slembcke
Strangely related to this thread started at nearly the same time:
http://chipmunk-physics.net/forum/viewt ... f=3&t=2535

Proper segment-segment collisions are coming with the GJK port, but it's not ready yet. Unfortunately I don't really have an ETA for it either. (See above)

Though the segment-segment collision code that exists now should work pretty well though. It will report some weird contact points for deeply overlapping segments though. What exactly was the issue you were having?

Re: Dynamic segment shapes

Posted: Tue Jan 29, 2013 1:22 pm
by yzsolt
If they would have to work well, then I will revise the ported code again... In my physics sandbox dynamic segment shapes collide perfectly, but they can rotate only counter-clockwise, and produce strange movement.
I think there's a pretty little mistake I made while porting...