Not signed in (Sign In)

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    So here's what I have:
    ***** FRICTION *****
    Here are the possibilities we've considered:
    • The product of the two frictions
    • The geometric mean (sqrt(a*b))
    • The lower of the two
    • The higher of the two

    The following test denies three and four:

    Frictions 1000 on 0.001 get the same as 1 on 1. Therefore it has to be product-related.

    The only way I can determine one vs two is to have a single-bounce test, where the friction ideally restricts the velocity of the object. If it's #1 then frictions {1,2} will have twice the restriction as {1,1}. If it's #2 then frictions {1,2} will have sqrt(2) times the slowing of {1,1}. At least, I think this is how friction works.

    ***** RESTITUTION *****
    I'm 95% confident it's simply the higher of the two. When a 1-restitution object hits anything less than 1, the result is 1. Simple as that.
    We could use tests with the OnPostCollide function and get the linear velocity, but eh. Unless someone has a profound argument against it, we'll assume it's the higher number.-----------------
    3.14159265358979323846264338327950288... Nothing Here
    On mine both blocks go "12.555648000000003" meters away from the start.-----------------
    3.14159265358979323846264338327950288... Nothing Here
    • CommentAuthorXyuzhg (Moderator)
    • CommentTimeMar 9th 2015 edited
    A few years ago we had some discussion on this topic, and I've fished out the known results:
    - Friction is the signed geometric mean of the absolute friction values (or sgn(f1*f2) * sqrt(abs(f1*f2)) ).
    - Restitution is the greater of the two values.

    Here are the two results for reference (wow, I was young back then):
    Friction -
    Restitution -

    Good to see that you're thinking about this though!
    If you wanted to find it out for yourself, it's a matter of approaching it scientifically - try designing methods to obtain more empirical evidence like I did (to a limited extent) for restitution:
    Hopefully PA is inconsistent.
      CommentAuthorTheDudeFromCI (Advanced Member)
    • CommentTimeMar 9th 2015
    Why is it that? Multiplication of the two values would've made much more sense. :P
    That way, 0 restitution shapes would be able to actually stop a shape with >1 restitution completely. (Realistically.)-----------------
    Orange is my favorite number.
    • CommentAuthorpuzzle geek (Advanced Member)
    • CommentTimeMar 9th 2015
    I also did some testing with friction a while back, i add varuos identical balls of varing frictions ranging from 0 to 1.something, and i found that after a bit, there was no differance in the speed at which the objects went.-----------------
    • CommentTimeMar 27th 2015
    Xyuzhg is right.
    Here is the source code:

    This is the current implementation. It would be easy to support more implementations, even can be implemented as an event handler style callback.-----------------
    My games: Tapir Games
    My phyards: Tapir@phyard
    • CommentTimeMar 27th 2015
    btw, I moved the Phyard Builder project from bitbucket to github.
    I just added a feature request there:
    My games: Tapir Games
    My phyards: Tapir@phyard
    Unfortunately, I don't know Flash.-----------------
    3.14159265358979323846264338327950288... Nothing Here