EdgeShapes (aka Thin Line Segments)

The version I made for you doesn't break down when the parent body of the static edges is rotated or is not at the origin. It has some extra matrix transform operations in b2StaticEdgeAndCircleContact.as and b2PolygonAndStaticEdgeContact.as. However, I don't want to encourage people to try manipulating the body containing static edges like they would manipulate other bodies, since the static edges still don't behave like other shapes and their vertices stay in the world coordinate system.

Or do you think it would be worth it to throw in a few more matrix transformation operations so that static edges truly moved along with their parent body?
I'm not sure about the performance tradeoff, but it might be worth it to make the engine as consistent/uniform as possible. Though, even if you do that, the staticedges will still require special treatment.

[EDIT] I changed my mind.. I cannot foresee a use for the static edges being able to move along with their parent body, they're static for a reason, right?[/EDIT]
I've been using the edges, but I found some more weird behavior, that I think is related to the static edges.

If there is an object, on another large object, that is on top of the edges, the top object tends to "sink" into the one that's on top of the edges.
I suspect this is caused by the edges, because if the large object rests on tessellated poly's, this behavior does not occur.

[s]I haven't been able to recreate the circumstances, because they're very specific, so I made some demo's of the exact situation this happened in:
(Just let the demo's run, you may "drive" using arrows, but the bug usually happens when you don't)
All is normal using polys: [url](temporarily) offline[/url]
Objects "sink" when using edges: [url](temporarily) offline[/url][/s]
Aha, that would be a problem with warm starting. I'll fix that soon. Thank you for the bug report and demos. 🙂
I want to add a line chain too my body but i can now see that it is not possible.
I need to add it to a body since some of my custom collision filtering depends on the userdata of the parents of the shapes, will this be implemented in future?
It seems that enough people want to use custom bodies with their static edges that it should become a standard feature. I will fix that. In the meantime, though, use the code that I gave android a few posts up, and read the discussion between android and I for an explanation of the code.
What's with the c++ port? I could help you do it if you tell me which files need translation?
mm2d wrote:
What's with the c++ port? I could help you do it if you tell me which files need translation?

Blah, why do so many people ask this? Diff is not a difficult tool to use. Then again, you will have difficulty porting this, as it includes some of my code (b2ConcaveArc) that is probably unpleasant to port. You could quite easily excise it though, I presume shaktool included it just to establish a unified set of reserved integers for shape types, and a small amount linking code.
I am working on the C++ port. It will not have any of BorisTheBrave's code in it. It will probably allow the line segments to be added to dynamic bodies. The API will be closer to the standard Box2D api.

... And yeah, the files that changed are obvious with a diff program. 😛
hm i'm having trouble using the chains... It keeps throwing "Shape type not found or cannot be added to Dynamic Bodies."
but uh i'm adding the chain to a new body so shouldn't it be static?

Original thread: https://box2d.org/forum/viewtopic.php?t=1437