google-code-export / pushbuttonengine

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

queryCircle querys only half the radius #163

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Just look at the source code of com.pblabs.box2D.Box2DManagerComponent,
line 229. Maybe someone has just mixed up radius and diameter:

var box:Rectangle = new Rectangle(center.x - radius / 2, center.y - radius
/ 2, radius, radius );

must instead be:

var box:Rectangle = new Rectangle(center.x - radius, center.y - radius,
radius * 2, radius *2);

Original issue reported on code.google.com by squ...@web.de on 2 Jun 2010 at 10:01

GoogleCodeExporter commented 9 years ago
squ1sh@web.de are you saying that you would expect 
var box:Rectangle = new Rectangle(center.x - radius / 2, center.y - radius / 2, 
radius, radius );
to draw a square around the entire circle?  If so, I think you may have radius 
and diameter mixed up.  Radius is the distance from the center of the circle to 
the edge.  So to draw a square around the entire circle you would need to use 
the code you provided.

Original comment by boush...@gmail.com on 12 Jul 2010 at 2:40

GoogleCodeExporter commented 9 years ago

Original comment by zaal...@gmail.com on 16 Jul 2010 at 8:21

GoogleCodeExporter commented 9 years ago

Original comment by zaal...@gmail.com on 16 Jul 2010 at 8:21