EdgeShapes (aka Thin Line Segments)

shaktool wrote:
EdgeShapes can be attached to any body now.

Shaktool, could you please give some info/code about how to attach edge shapes to a dynamic body?
The broken version looks like a line, but it's actually a very long, very thin loop. So, the first problem is that your shapes may be colliding with both sides of the line at roughly the same time, since the top of the loop and the bottom of the loop are nearly overlapping. But perhaps the bigger problem is that the upper side of the loop -- the side that your shapes would ideally collide with first -- is going in the wrong direction. It's a ceiling. So the broken SVG is a very long, thing interior, like an ant tunnel, rather than an exterior, like a rope.

I leave it up to you to figure out what tools to use in Inkscape to make proper SVGs for EdgeShapes.
The easiest way to attach edge shapes to a dynamic body is to attach a circle or polygon with density to that same body before setting its mass from shapes. The circle or polygon will determine the body's mass and center.

Dynamic edge shapes may behave strangely. They will never collide with each other, or with static edge shapes. I will not provide much support for them.
Hi Shaktool

appreciated your answer. The reason I needed edge shape as dynamic can be seen in my demo: This is the skateboard I am working on: http://www.3dsurrealism.com/test/skateb ... Test2.html
The problem I have is that I am trying to make the ramp dynamic to make the skateboard simulated when I drag one edge of the ramp move from up to down vice versa. It would be great if the skateboard can be animated not by moving the skateboard around but the ramp. Could you please give suggestion how to do it?

Sincerely,
shaktool wrote:
So the broken SVG is a very long, thing interior, like an ant tunnel, rather than an exterior, like a rope.


Ahh it took me a little while to get what you were saying there but i see now and understand what you mean. Thanks for replying.
FInally, I attached the edge shape to a dynamic body, but the edge shape lost collision on both sides. Is there anyway to turn the one side of the edge shape collision on?
The EdgeShapes should still collide properly on one side, even in a dynamic body. Remember, though, that EdgeShapes will never collide against other EdgeShapes.
Hello,

I am the beginner of Box2D AS3...and Flash..
I want to draw the EdgeShapes..
but i don't know how to use shaktool's "EdgeShapes"
I just download from http://box2dflash.svn.sourceforge.net/viewvc/box2dflash/Source/
and put all the file into/replace my original ones ??
then I can use the method "EdgeShapes"
Thanks!!!

Code:
var draw_bodyDef:b2BodyDef=new b2BodyDef  ;
var chainDef: b2StaticEdgeChainDef = new b2StaticEdgeChainDef();
chainDef.vertexCount = mouse_recode;
chainDef.isALoop = false;
chainDef.vertices = stored_XY;
var body_draw:b2Body=the_world.CreateBody(draw_bodyDef);
body_draw.CreateShape(chainDef);
body_draw=the_world.CreateBody(draw_bodyDef);
body_draw.SetMassFromShapes();


i use the above code, but it can't draw anything on the display
Plaase help me...
I got the solution by Google~
THX
Hello,

first, great great job on this !

I used the package, i saw some modified b2Classes, no problem for me it works great.
But when i want to plug the b2BuoyancyController from boristhebrave or the b2SpringController, it seems it have its own modifications in the b2Classes. So when i merge the two i have a lot of complication...

Is there a way to merge properly the two packages ? Because for a newbie like me, it's very difficult !

I saw there is some modification in the main SVN repository, but is there all the good packages ?

Sorry for my english, i'm french.

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