Matrix

Base template for all matrix-types. Params: E = all values get stored as this type rows_ = rows of the matrix cols_ = columns of the matrix layout = matrix layout

Constructors

this
this(Args args)

Constructs the matrix: If a single value is passed, the matrix will be cleared with this value (each column in each row will contain this value). If a matrix with more rows and columns is passed, the matrix will be the upper left nxm matrix. If a matrix with less rows and columns is passed, the passed matrix will be stored in the upper left of an identity matrix. It's also allowed to pass vectors and scalars at a time, but the vectors dimension must match the number of columns and align correctly. Examples: --- mat2 m2 = mat2(0.0f); // mat2 m2 = mat2(0.0f, 0.0f, 0.0f, 0.0f); mat3 m3 = mat3(m2); // mat3 m3 = mat3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); mat3 m3_2 = mat3(vec3(1.0f, 2.0f, 3.0f), 4.0f, 5.0f, 6.0f, vec3(7.0f, 8.0f, 9.0f)); mat4 m4 = mat4.identity; // just an identity matrix mat3 m3_3 = mat3(m4); // mat3 m3_3 = mat3.identity ---

Alias This

_matrix

Members

Functions

clear
void clear(E value)

Sets all values of the matrix to value (each column in each row will contain this value).

makeIdentity
void makeIdentity()

Makes the current matrix an identity matrix.

toPrettyString
string toPrettyString()
toString
void toString(void delegate(scope const(char)[]) @(safe) sink)
transpose
void transpose()

Transpose Current Matrix.

transposed
Matrix!(E, cols, rows) transposed()

Static functions

identity
Matrix identity()

Variables

_matrix
E[cols][rows] _matrix;

Matrix row-major in memory.

Meta