w0rm/elm-physics/3.2.0

NOTE: the latest version is 6.2.0

Physics.Constraint

type alias Constraint =
Constraint

Constraint allows to limit the freedom of movement of two bodies with relation to each other.

{ pivot1 :
{ x : Float
, y : Float
, z : Float
}
, pivot2 :
{ x : Float
, y : Float
, z : Float
}
}
-> Constraint

Connect a point on the first body with a point on the second body. Points are defined within the bodies’ local coordinate systems.

{ pivot1 :
{ x : Float
, y : Float
, z : Float
}
, axis1 :
{ x : Float
, y : Float
, z : Float
}
, pivot2 :
{ x : Float
, y : Float
, z : Float
}
, axis2 :
{ x : Float
, y : Float
, z : Float
}
}
-> Constraint

Keep two bodies connected with each other like pointToPoint, but also limit the freedom of rotation. Useful for e.g. connecting a window to a window frame.