It’s been a while since I’ve used Physics Editor, but you should still be able to use the same principle as I mentioned above, but it would require “a few” extra steps and conditions.
Here’s an over simplified sample leaning on the idea from before:
local function newRect( x, y, width, height ) local rect = display.newRect( x, y, width, height ) function rect:newBody( bodyType, direction ) if self.bodyType then physics.removeBody( self ) end local vertices = {} if direction then vertices = flip( verticesOriginal, direction ) else vertices = verticesOriginal end physics.addBody( self, bodyType, { shape=vertices } ) end return rect end local object = newRect( display.contentCenterX, display.contentCenterY, 120, 40 ) object:newBody( "static", "v" )
If you created objects with a function like that (a more complex one of course, but with the same idea), then you could have just that one line of code that removes the old body and creates the new one.
This has actually piqued my interest somewhat. I have a few other plugins that will be coming out around next week, but once I’m done with them I could have a go at this. I think that developing something like this shouldn’t be too difficult, after all, something like this is almost purely just math.