BitmapScanner and creating static objects...

Hi, I've done this BitmapScaner class http://audionysos.cba.pl/bmscaner.html which returns arrays of vertices.
And I'm using this: http://www.psyked.co.uk/box2d/simple-box2d-custom-polygon-creation.htm to creating objects with these vertices. The thing is that i have no idea how to create static object with this box2d.

Can anyone help me?? It looks like author got me in the ass... :/
Maybe it's an alternative for this Custom Polygon creation??
Set your body definition to 1 of the 3 types.
b2Body.b2_staticBody
b2Body.b2_dynamicBody
b2Body.b2_kinematicBody

The one you want is static, right?

bodyDef.type = b2Body.b2_staticBody;

Hope this helps...
I think i didn't make myself clear. I know how to make static objects in box2d, but i don't know how to do that with this "Custom Polygon creation".
In this case, objects are creating like that:
Code:
box2dworld.createComplexPolygon( posX, posY, somePoitsArray )

and there are no more options in this function :/

And it's 2.0.2 wersion of box2d so no kinematic bodies... :/
I can't run your FLA file, but you can go into BoxWorld2D.as file, under the create createComplexPolygon() function, and add the line I mentioned before or you can also add in an extra parameter and have an if statement.

Ex:
public function createComplexPolygon( x:int, y:int, points:Array, rotation:int = 0, type:uint ):void
{
//..code here.. bodyDef stuff
if (type == b2Body.b2_staticBody)
{
bodyDef.type = b2Body.b2_staticBody;
}

//..more code
}

So when you call box2dworld.createComplexPolygon( posX, posY, somePoitsArray ) simply add the type you want to make it box2dworld.createComplexPolygon( posX, posY, somePoitsArray, (unit) type )
Another option is to copy/paste the function and make your own "createStaticComplexPolygon".

Let me know how it goes
That's not work... Becouse "type" in the b2bodyDef in 2.0.2 doesn't exist. But i finally found "shapeDef.density = 1.0" line in "makeComplexBody()" function and changed it to 0 for default 😉

Dziękuję za pomoc. Pozdrawiam 😉
Hi, i separated this makeComplexBody() from Box2dWorld class and it's now working with v2.1a of box2d and returns only array of b2PolygonShape's. I also modifed my BitmapScaner class and now for default it only examines one shape(or shape with holes) in bitmap, so it's working immediately, becouse it dont have to calculate so much...

Pozdrawiam

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