public final class PMatrixM4x4F extends Object
A 4x4 mutable matrix type with float elements.
| Modifier and Type | Class and Description |
|---|---|
static class |
PMatrixM4x4F.ContextPM4F
The
ContextPM4F type contains the minimum storage required for
all of the functions of the PMatrixM4x4F class. |
| Modifier and Type | Method and Description |
|---|---|
static <T0,T1,M extends PMatrixWritable4x4FType<T0,T1>> |
copy(PMatrixReadable4x4FType<T0,T1> input,
M output)
Copy the contents of the matrix
input to the matrix output,
completely replacing all elements. |
static <T0,T1,MOUT extends PMatrixWritable4x4FType<T1,T0>> |
invert(PMatrixM4x4F.ContextPM4F context,
PMatrixReadable4x4FType<T0,T1> m,
MOUT out)
Calculate the inverse of the matrix
m, saving the resulting matrix
to out. |
static <T0,T1,T2,MOUT extends PMatrixWritable4x4FType<T0,T2>> |
multiply(PMatrixReadable4x4FType<T1,T2> m0,
PMatrixReadable4x4FType<T0,T1> m1,
MOUT out)
Multiply the matrix
m0 with the matrix m1, writing the
result to out. |
static <T0,T1,V extends PVectorWritable4FType<T1>> |
multiplyVector4F(PMatrixM4x4F.ContextPM4F context,
PMatrixReadable4x4FType<T0,T1> m,
PVectorReadable4FType<T0> v,
V out)
Multiply the matrix
m with the vector v, writing the
resulting vector to out. |
public static <T0,T1,MOUT extends PMatrixWritable4x4FType<T1,T0>> boolean invert(PMatrixM4x4F.ContextPM4F context, PMatrixReadable4x4FType<T0,T1> m, MOUT out)
m, saving the resulting matrix
to out. The function returns Some(out) iff it was possible
to invert the matrix, and None otherwise. It is not possible to
invert a matrix that has a determinant of 0. The function uses
preallocated storage in context to avoid allocating memory. If the
function returns None, m is untouched.T0 - A phantom type parameterT1 - A phantom type parameterMOUT - The precise type of output matrixcontext - Preallocated storagem - The input matrixout - The output matrixtrue iff the matrix was invertiblepublic static <T0,T1,T2,MOUT extends PMatrixWritable4x4FType<T0,T2>> MOUT multiply(PMatrixReadable4x4FType<T1,T2> m0, PMatrixReadable4x4FType<T0,T1> m1, MOUT out)
m0 with the matrix m1, writing the
result to out.T0 - A phantom type parameterT1 - A phantom type parameterT2 - A phantom type parameterMOUT - The precise type of output matrixm0 - The left input vectorm1 - The right input vectorout - The output vectoroutpublic static <T0,T1,V extends PVectorWritable4FType<T1>> V multiplyVector4F(PMatrixM4x4F.ContextPM4F context, PMatrixReadable4x4FType<T0,T1> m, PVectorReadable4FType<T0> v, V out)
Multiply the matrix m with the vector v, writing the
resulting vector to out.
The function uses preallocated
storage in context to avoid allocating memory.
Formally,
this can be considered to be premultiplication of the column vector v with the matrix m.
T0 - A phantom type parameterT1 - A phantom type parameterV - The precise type of writable vectorcontext - Preallocated storagem - The input matrixv - The input vectorout - The output vectoroutpublic static <T0,T1,M extends PMatrixWritable4x4FType<T0,T1>> M copy(PMatrixReadable4x4FType<T0,T1> input, M output)
input to the matrix output,
completely replacing all elements.M - The precise type of matrixT0 - A phantom type parameterT1 - A phantom type parameterinput - The input vectoroutput - The output vectoroutputCopyright © 2015 <code@io7m.com> http://io7m.com