w0rm/elm-physics/6.1.0

NOTE: the latest version is 6.2.0

Physics.Lock

Restrict a body’s degrees of freedom along world axes.

Pass a list of Lock tokens to Physics.lock. Each entry removes one degree of freedom from the body. The list fully describes the body’s lock state — calling lock again with a different list replaces the previous one. An empty list clears all locks.

type alias Lock =
Lock

A single degree of freedom to lock.

Translation

translateX : Lock

Lock translation along the world X axis.

translateY : Lock

Lock translation along the world Y axis.

translateZ : Lock

Lock translation along the world Z axis.

Rotation

rotateX : Lock

Lock rotation about the world X axis.

rotateY : Lock

Lock rotation about the world Y axis.

rotateZ : Lock

Lock rotation about the world Z axis.

Presets

allTranslation : List Lock

All three translation axes locked. The body cannot move.

allRotation : List Lock

All three rotation axes locked. The body cannot tip or spin. Useful for character capsules whose orientation is driven outside of physics.