@@ -244,6 +244,7 @@ var World = new Class({
244244 showBody : GetFastValue ( debugConfig , 'showBody' , true ) ,
245245 showStaticBody : GetFastValue ( debugConfig , 'showStaticBody' , true ) ,
246246 showSleeping : GetFastValue ( debugConfig , 'showSleeping' , false ) ,
247+ showBodyPosition : GetFastValue ( debugConfig , 'showBodyPosition' , true ) ,
247248 showJoint : GetFastValue ( debugConfig , 'showJoint' , true ) ,
248249 showInternalEdges : GetFastValue ( debugConfig , 'showInternalEdges' , false ) ,
249250 showConvexHulls : GetFastValue ( debugConfig , 'showConvexHulls' , false ) ,
@@ -264,6 +265,9 @@ var World = new Class({
264265 sleepFillColor : GetFastValue ( debugConfig , 'sleepFillColor' , 0x464646 ) ,
265266 sleepLineColor : GetFastValue ( debugConfig , 'sleepLineColor' , 0x999a99 ) ,
266267
268+ positionSize : GetFastValue ( debugConfig , 'positionSize' , 4 ) ,
269+ positionColor : GetFastValue ( debugConfig , 'positionColor' , 0xe042da ) ,
270+
267271 jointColor : GetFastValue ( debugConfig , 'jointColor' , 0xe0e042 ) ,
268272 jointLineOpacity : GetFastValue ( debugConfig , 'jointLineOpacity' , 1 ) ,
269273 jointLineThickness : GetFastValue ( debugConfig , 'jointLineThickness' , 2 ) ,
@@ -1411,21 +1415,12 @@ var World = new Class({
14111415 if ( fillColor === undefined ) { fillColor = null ; }
14121416 if ( fillOpacity === undefined ) { fillOpacity = null ; }
14131417
1418+ var config = this . debugConfig ;
1419+
14141420 // Handle compound parts
14151421 var parts = body . parts ;
14161422 var partsLength = parts . length ;
14171423
1418- /*
1419- if (!body.isStatic)
1420- {
1421- var w = body.bounds.max.x - body.bounds.min.x;
1422- var h = body.bounds.max.y - body.bounds.min.y;
1423-
1424- graphics.fillStyle(0x6d6d6d, 0.3);
1425- graphics.fillRect(body.bounds.min.x, body.bounds.min.y, w, h);
1426- }
1427- */
1428-
14291424 for ( var k = ( partsLength > 1 ) ? 1 : 0 ; k < partsLength ; k ++ )
14301425 {
14311426 var part = parts [ k ] ;
@@ -1498,13 +1493,14 @@ var World = new Class({
14981493 }
14991494 }
15001495
1501- if ( ! body . isStatic )
1496+ if ( config . showBodyPosition && ! body . isStatic )
15021497 {
15031498 var px = body . position . x ;
15041499 var py = body . position . y ;
1500+ var hs = Math . ceil ( config . positionSize / 2 ) ;
15051501
1506- graphics . fillStyle ( 0xff00ff , 1 ) ;
1507- graphics . fillRect ( px - 3 , py - 3 , 6 , 6 ) ;
1502+ graphics . fillStyle ( config . positionColor , 1 ) ;
1503+ graphics . fillRect ( px - hs , py - hs , config . positionSize , config . positionSize ) ;
15081504 }
15091505
15101506 return this ;
0 commit comments