w0rm/elm-physics/3.2.0

NOTE: the latest version is 6.2.0

Physics.Shape

type alias Shape =
Protected

Shapes are only needed for creating compound bodies.

If you need a body with a single shape, use the corresponding functions from the Physics.Body module.

The supported shapes are:

box :
{ x : Float
, y : Float
, z : Float
}
-> Shape

A box is defined by dimensions along the corresponding axes.

plane : Shape

A plane with the normal that points in the direction of the z axis.

sphere : Float -> Shape

A sphere is defined by a radius and a position.

Positioning and Orientation

Shapes are positioned in the local body coordinate system, they can be moved and rotated just like bodies in the world.

{ x : Float
, y : Float
, z : Float
}
-> Shape
-> Shape

Move the shape in a body by a vector offset from the current local position.

Float
-> { x : Float
, y : Float
, z : Float
}
-> Shape
-> Shape

Rotate the shape in a body by a specific angle around the axis from the current local orientation.

{ x : Float
, y : Float
, z : Float
}
-> Shape
-> Shape

Set the local position of the shape in a body.

{ x : Float
, y : Float
, z : Float
, w : Float
}
-> Shape
-> Shape

Set the local shape orientation to a unit quaternion.