Module mat

Module mat 

Source
Expand description

Matrices and linear and affine transforms.

TODO Docs

Structs§

Matrix
A generic matrix type.
RealToProj
Mapping from real to projective space.
RealToReal
A change of basis in real vector space of dimension DIM.

Traits§

Apply
Trait for applying a transform to a type.
Compose
Composition of two LinearMaps, SelfInner.
LinearMap
A linear transform from one space (or basis) to another.

Functions§

orient_y
Returns a matrix applying a rotation such that the original y-axis is now parallel with new_y and the new z axis is orthogonal to both x and new_y.
orient_z
Returns a matrix applying a rotation such that the original z axis is now parallel with new_z and the new y-axis is orthogonal to both new_z and x.
orthographic
Creates an orthographic projection matrix.
perspective
Creates a perspective projection matrix.
rotate
Returns a matrix applying a 3D rotation about an arbitrary axis.
rotate2
Returns a matrix applying a 2D rotation by an angle.
rotate_x
Returns a matrix applying a 3D rotation about the x-axis.
rotate_y
Returns a matrix applying a 3D rotation about the y-axis.
rotate_z
Returns a matrix applying a 3D rotation about the z axis.
scale
Returns a matrix applying a scaling by s.
scale3
translate
Returns a matrix applying a translation by t.
translate3
viewport
Creates a viewport transform matrix with the given pixel space bounds.

Type Aliases§

Mat2x2
Type alias for a 2x2 float matrix.
Mat3x3
Type alias for a 3x3 float matrix.
Mat4x4
Type alias for a 4x4 float matrix.