How can I iterate multi-element physic object's elements?

So this is what I want:

[lua]

local object = display.newSprite(…)

physics.addBody( object, “dynamic”, {name = “element1”, shape={…}},

                                     {name = “element2” , shape={…}})

– here I want to disable element named “element1”

– “same as” object.isBodyActive = false

[/lua]

Is there any other way than collision detection to iterate physic objects elements?

The reason I am doing this is that I want to change my character in the middle of the game.  And the body shape needs to be changed to the new character’s width and height.

Of course I can check what character is now being used and use it as a flag in collision detection, but it feels wrong that you have elements active you don’t need.

I think you can just use physics.removeBody and then create the new body shape on the fly as required. I remember knocking up a Sonic demo and used this method to change his shape into a ball when he jumps or spins.

I think you can just use physics.removeBody and then create the new body shape on the fly as required. I remember knocking up a Sonic demo and used this method to change his shape into a ball when he jumps or spins.