Package limn.math
Class Mat3
java.lang.Object
limn.math.Mat3
An immutable column-major 3×3 matrix (
m[col*3 + row]). Mainly the
normal matrix (inverse-transpose of a model's upper-left 3×3) and the rotation
part of orientations.-
Method Summary
Modifier and TypeMethodDescriptionfloatThe determinant; zero means the matrix is singular and has no inverse.floatget(int row, int col) Element at (row, col).static Mat3identity()The identity matrix.invert()float[]toArray()Column-major copy (length 9), for GPU upload.voidtoArray(float[] out) Column-major copy intoout(length ≥ 9), the allocation-free upload path.Transforms a direction; no translation exists in a 3x3.The transpose.
-
Method Details
-
identity
The identity matrix. -
get
public float get(int row, int col) Element at (row, col). -
transpose
The transpose. -
determinant
public float determinant()The determinant; zero means the matrix is singular and has no inverse. -
invert
- Throws:
ArithmeticException- if the matrix is singular
-
transform
Transforms a direction; no translation exists in a 3x3. -
toArray
public float[] toArray()Column-major copy (length 9), for GPU upload. -
toArray
public void toArray(float[] out) Column-major copy intoout(length ≥ 9), the allocation-free upload path.
-