The physics body default values seem to vary depending on the type of body. For example, in the following code I think the circles, the rectangle and the rectangular-shaped polygon all behave differently with respect to bounce and friction:
local physics = require "physics" physics.start() physics.setDrawMode("hybrid") ball = display.newCircle(80, 40, 16) physics.addBody(ball, "dynamic", {radius=16}) ball2 = display.newCircle(240, 40, 16) physics.addBody(ball2, "dynamic", {radius=16}) plank1 = display.newRect(80, 320, 140, 8) physics.addBody(plank1, "static") plank1:rotate(-10) plank2 = display.newRect(240, 320, 140, 8) physics.addBody(plank2, "static", {shape={-70,-4, 70,-4, 70,4, -70,4}}) plank2:rotate(10)
The solution is to explicitly set the defaults on all bodies ({density=1.0, friction=0.3, bounce=0.2}) but it still seems confusing and at odds with the documentation – or am I misunderstanding something?
In the above code I tried to work out the values for friction and bounce that would give the same effect as that which occurs with no values set (so I could work out what the defaults were), but I couldn’t find any values that seemed to fit.
Thanks,
Warwick