Code: Select all
body[] bs = sb();
vec2 c = mv(0,0);
for (uint i= 0; i < bs.length; i++)
c += bs[i].getWorldCenter();
float n = bs.length; //this needs to be a float type
setCursor( 1/n * c );
Code: Select all
body[] bs = sb();
vec2 c = mv(0,0);
for (uint i= 0; i < bs.length; i++)
c += bs[i].getWorldCenter();
float n = bs.length; //this needs to be a float type
setCursor( 1/n * c );