w0rm/elm-physics/5.1.3

NOTE: the latest version is 6.2.0

Physics.Contact

type alias Contact data =
Protected data

Contact between two colliding bodies.

bodies : Contact data -> ( Body data, Body data )

Get contacting bodies in unspecified order.

either : (Body data -> Bool) -> Contact data -> Bool

Return true if at least one body satisfies the test.

both : (Body data -> Bool) -> Contact data -> Bool

Return true if both bodies satisfy the test.

Contact data
-> List
{ point : Point3d Meters WorldCoordinates
, normal : Direction3d WorldCoordinates
}

Get coordinates and normals of contact points.

Normals are defined on the surface of the first body, that is returned from bodies.

centerPoint : Contact data -> Point3d Meters WorldCoordinates

Get the centroid of all the contact points.