w0rm/elm-physics/3.2.1

NOTE: the latest version is 6.2.0

Physics.Material

type alias Material =
Protected

Materials allow to control friction and bounciness. You can change materials using Body.setMaterial.

default : Material

All bodies initially use this material, it is defined like this:

default =
    custom { friction = 0.3, bounciness = 0 }
{ friction : Float
, bounciness : Float
}
-> Material

Creates a custom material, e.g.

slippery =
    custom { friction = 0, bounciness = 0 }


bouncy =
    custom { friction = 0.3, bounciness = 0.9 }

When two materials collide, their properties are averaged and clamped between 0 and 1.