question about friction of a circle on an inclined plan

Hello,

The friction’default value is 0.3, but there is a problem :

when a circle slips over a ramp, the circle gives differents responds if the friction value is explicity 0.3.

If i don’t write it, the circle slide but don’t rotate ( just like if the default friction value was 0 )

Thanks for explains.

local w,h=display.contentWidth,display.contentHeight local wC,hC=w/2,h/2 local g=display.newGroup() g.x,g.y=wC,hC local cc=display.newCircle(g,0,0, 50) local ll=display.newLine(g, 0, 0, 100, 0 ) ll.strokeWidth=8 ll:setStrokeColor(1,0,0) physics.addBody( g, {radius=50,friction=0.3} ) local sol=display.newRect( wC, h, 300, 300) physics.addBody( sol, "static") sol.rotation=3 physics.setDrawMode( "hybrid" ) g:toFront() timer.performWithDelay( 100, function( ) print( g.rotation ) -- with the friction, it's rotate, but without writing the friction it doesn't (but slids) end ,30 )
  1. Where did you determine that 0.3 was the default friction?  For some reason I thought it was 0.2

  2. In my experience, circular bodies have poor point/contact friction.

  3. I’m not 100% sure I understand this post’s goal.

Can you re-iterate your post as:

A. What you did.

B. What you expected to see.

C. What you saw instead.

D. Why you think ‘C’ is wrong.

Tip: B and D are not the same.

( just like if the default friction value was 0 )

because the default value for friction is 0.0

friction converts some portion of linear velocity to angular velocity, which will result in the rotation you expect

(aside:  friction is not equivalent to drag – drag can be partially mimicked with linear/angularDamping)

For the default value, i look on 

https://docs.coronalabs.com/api/library/physics/addBody.html

It’s written that in the code parameter that the friction’default value is 0.3, and not 0.

So when friction equal 0, the circle “scrap” the inclined ground without rotating and slide over, and then drop ?

except that the docs are wrong

there have been previous attempts to correct, but hasn’t happened yet

it’s easily verified experimentally (as in the original post) that the default is not 0.3

@davebolinger, what leads you to believe that friction defaults to 0? 

Rob

I was thinking that rob or roamingamer have created corona sdk lol.

Thanks for the answer, which is that default value on docs are not always the exact value.

Just using it, ie “experimentally”.  Here’s a somewhat “cleaner” demonstration, showing simultaneous comparison:

local physics = require("physics") physics.start() physics.setDrawMode("hybrid") physics.setTimeStep(0.01) -- optional 'slow motion' local function createDemo(x,y,w,h,f) local r = h/10 local circ = display.newCircle( x, y-h/4, r, r ) physics.addBody( circ, "dynamic", { radius=r, friction=f }) local rect = display.newRect( x, y+h/4, w, r ) rect.rotation = 5 physics.addBody( rect, "static" ) end local ACW, ACH = display.actualContentWidth, display.actualContentHeight createDemo( ACW\*0.5, ACH\*0.25, ACW, ACH\*0.5, nil ) -- the demo on top uses default friction createDemo( ACW\*0.5, ACH\*0.75, ACW, ACH\*0.5, 0.3 ) -- the demo on bottom explicit friction = 0.3 -- the two demos should behave essentially the same IFF the default value for friction is 0.3 -- OTOH, if the default value for friction is 0.0, then only the bottom demo will act 'correctly' -- (friction will convert some linear velocity to angular, causing rotation and slower movement)

I’m asking engineering to look into this. 

Rob

  1. Where did you determine that 0.3 was the default friction?  For some reason I thought it was 0.2

  2. In my experience, circular bodies have poor point/contact friction.

  3. I’m not 100% sure I understand this post’s goal.

Can you re-iterate your post as:

A. What you did.

B. What you expected to see.

C. What you saw instead.

D. Why you think ‘C’ is wrong.

Tip: B and D are not the same.

( just like if the default friction value was 0 )

because the default value for friction is 0.0

friction converts some portion of linear velocity to angular velocity, which will result in the rotation you expect

(aside:  friction is not equivalent to drag – drag can be partially mimicked with linear/angularDamping)

For the default value, i look on 

https://docs.coronalabs.com/api/library/physics/addBody.html

It’s written that in the code parameter that the friction’default value is 0.3, and not 0.

So when friction equal 0, the circle “scrap” the inclined ground without rotating and slide over, and then drop ?

except that the docs are wrong

there have been previous attempts to correct, but hasn’t happened yet

it’s easily verified experimentally (as in the original post) that the default is not 0.3

@davebolinger, what leads you to believe that friction defaults to 0? 

Rob

I was thinking that rob or roamingamer have created corona sdk lol.

Thanks for the answer, which is that default value on docs are not always the exact value.

Just using it, ie “experimentally”.  Here’s a somewhat “cleaner” demonstration, showing simultaneous comparison:

local physics = require("physics") physics.start() physics.setDrawMode("hybrid") physics.setTimeStep(0.01) -- optional 'slow motion' local function createDemo(x,y,w,h,f) local r = h/10 local circ = display.newCircle( x, y-h/4, r, r ) physics.addBody( circ, "dynamic", { radius=r, friction=f }) local rect = display.newRect( x, y+h/4, w, r ) rect.rotation = 5 physics.addBody( rect, "static" ) end local ACW, ACH = display.actualContentWidth, display.actualContentHeight createDemo( ACW\*0.5, ACH\*0.25, ACW, ACH\*0.5, nil ) -- the demo on top uses default friction createDemo( ACW\*0.5, ACH\*0.75, ACW, ACH\*0.5, 0.3 ) -- the demo on bottom explicit friction = 0.3 -- the two demos should behave essentially the same IFF the default value for friction is 0.3 -- OTOH, if the default value for friction is 0.0, then only the bottom demo will act 'correctly' -- (friction will convert some linear velocity to angular, causing rotation and slower movement)

I’m asking engineering to look into this. 

Rob