Package limn.math

Class Mat3

java.lang.Object
limn.math.Mat3

public final class Mat3 extends Object
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 Details

    • identity

      public static Mat3 identity()
      The identity matrix.
    • get

      public float get(int row, int col)
      Element at (row, col).
    • transpose

      public Mat3 transpose()
      The transpose.
    • determinant

      public float determinant()
      The determinant; zero means the matrix is singular and has no inverse.
    • invert

      public Mat3 invert()
      Throws:
      ArithmeticException - if the matrix is singular
    • transform

      public Vec3 transform(Vec3 v)
      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 into out (length ≥ 9), the allocation-free upload path.