google-code-export / box2dweb

Automatically exported from code.google.com/p/box2dweb
0 stars 0 forks source link

EdgeShapes are not fully implemented #31

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When you try to use b2EdgeShapes one suddenly run into problems, because 
several parts are not yet fully implemented.

To get the shapes working I attached a preliminary patch (edge shapes can be 
created at least).

However, since the b2DistanceProxy.prototype.Set is yet not implemented for 
EdgeShapes, any collisions will result in an error.

Original issue reported on code.google.com by CWBudde on 24 Jul 2012 at 12:22

Attachments:

GoogleCodeExporter commented 9 years ago
Just fixed the patch (see attached)

Original comment by CWBudde on 24 Jul 2012 at 12:30

Attachments:

GoogleCodeExporter commented 9 years ago
Improved the patch, still not fully working, but at least no more hidden errors 
anymore.

Original comment by CWBudde on 24 Jul 2012 at 1:26

Attachments:

GoogleCodeExporter commented 9 years ago
I'm learning box2dweb & box2d(apologies for my ignorance) an I'd like to create 
'walls' around my game's boundaries.  One recommendation I read  was to use a 
body that contained EdgeShapes that surround the perimeter of my game. However, 
this doesn't work and I'm assuming it's due to this issue.  So it'd be great to 
see this fixed.

In the meantime, does anyone know of a work-around? Can I simply make a create 
a large box shape that contains my objects?  I'm assuming something like 
creating game boundaries is a common task and I'm probably just going about it 
the wrong way.

Original comment by jim.de...@gmail.com on 26 May 2013 at 10:30

GoogleCodeExporter commented 9 years ago
The current work-around seems to be to create a b2PolygonShape and use its 
SetAsEdge method, like so:

fixDef.shape = new b2PolygonShape()
fixDef.shape.SetAsEdge(new b2Vec2(x1, y1), new b2Vec2(x2, y2))

Original comment by iancbosw...@gmail.com on 6 Jun 2013 at 2:17

GoogleCodeExporter commented 9 years ago
Many thanks, Ian. Seems so simple I'm a bit embarrassed I didn't think to try 
it :-)

Original comment by jim.de...@gmail.com on 9 Jun 2013 at 9:20

GoogleCodeExporter commented 9 years ago
Any improvements yet?

Original comment by jonasvol...@gmail.com on 11 Nov 2013 at 5:18