I suspect it is not implemented yet. The code below shows two boxes, where the friction of the bottom one and its ground can be varied. There are walls on both sides (not drawn), and the boxes don’t bounce (restitution = 0). A force is applied to the boxes everytime you tap ( on the right to move the boxes to the right, on the left to move them to the left. Notice that the boxes stay on the same coordinate, no matter what the friction settings.
-- Use this function to perform your initial setup
function setup()
--ground=physics.body(EDGE,vec2(0,0),vec2(WIDTH,0))
ground=physics.body(POLYGON,vec2(0,-10),vec2(WIDTH,-10),vec2(WIDTH,0),vec2(0,0))
ground.x=0
ground.y=0
ground.type=STATIC
ground2=physics.body(POLYGON,vec2(0,-10),vec2(WIDTH,-10),vec2(WIDTH,0),vec2(0,0))
ground2.x=0
ground2.y=100
ground2.type=STATIC
lwall=physics.body(EDGE,vec2(0,0),vec2(0,HEIGHT))
rwall=physics.body(EDGE,vec2(WIDTH,0),vec2(WIDTH,HEIGHT))
box=physics.body(POLYGON,vec2(0,0),vec2(20,0),vec2(20,20),vec2(0,20))
box.x=0
box.y=50
box.sleepingAllowed=false
box2=physics.body(POLYGON,vec2(0,0),vec2(20,0),vec2(20,20),vec2(0,20))
box2.x=0
box2.y=150
box2.sleepingAllowed=false
parameter("friction",0,100,0.2)
end
function touched(touch)
if (touch.state==BEGAN) then
if (touch.x>WIDTH/2) then
box:applyForce(vec2(50,0))
box2:applyForce(vec2(50,0))
else
box:applyForce(vec2(-50,0))
box2:applyForce(vec2(-50,0))
end
end
end
function drawObject(obj)
pushMatrix()
translate(obj.x,obj.y)
rotate(obj.angle)
local points = obj.points
for j = 1,#points do
a = points[j]
b = points[(j % #points)+1]
line(a.x, a.y, b.x, b.y)
end
popMatrix()
end
-- This function gets called once every frame
function draw()
box.friction=friction
ground.friction=friction
-- This sets a dark background color
background(0, 0, 0, 255)
-- This sets the line thickness
strokeWidth(5)
line(0,0,WIDTH,0)
-- Do your drawing here
stroke(255, 255, 255, 255)
drawObject(ground)
drawObject(ground2)
stroke(31, 0, 255, 255)
drawObject(box)
drawObject(box2)
end