Hi,
I have some concave objects and thought that I’d try using an “Outline body” as described here.
First I tried with the old shape functionality like this:
local w = display.contentWidth local h = display.contentHeight local physics = require("physics") physics.start() physics.setDrawMode("debug") shape1 = { -128,-128, 0,-128, 128,0, 128,128, -128,128 } local element = display.newRect(w/2, h/2, 256, 256) element.rotation = 90 physics.addBody(element, "static", { density=2.0, friction=0.9, bounce=0.0, shape=shape1})
And all is well. Using the physics engine in debug mode I can see that the shape looks good.
Then I tried to just change the last line to:
physics.addBody(element, "static", { density=2.0, friction=0.9, bounce=0.0, outline=shape1})
In other words; Using outline and set it to the shape array. This, apparently, does not work. Running the project in the emulator results in a square shape of the physics object. Isn’t the outline supposed to be an array just line shape?
I know that the graphics.newOutline() function is limited to the Pro versions of Corona, but I cannot se any mention that the usage of outline in addBody() has this limitation?
So what am I doing wrong?