iicm.utils3d
Class Mat4f

java.lang.Object
  extended by iicm.utils3d.Mat4f

public final class Mat4f
extends java.lang.Object

Mat4f - small utilities for 4D matrices. Copyright (c) 1997 IICM

Version:
1.0, changed: 22 Jul 97
Author:
Michael Pichler

Field Summary
static float[] identity3d
          3x3 identity matrix
static float[] identity4d
          4x4 identity matrix
 
Constructor Summary
private Mat4f()
           
 
Method Summary
static boolean invertMatrix33(float[] mat, float[] inv)
          compute the inverse of a 3x3 matrix.
static boolean invertMatrix33inside44(float[] mat, float[] inv)
          compute the inverse of the 3x3 subpart of a 4x4 matrix without changing other elements.
static boolean invertMatrix33of44(float[] mat, float[] inv)
          compute the inverse of a 3x3 subpart of a 4x4 matrix in: 4x4 float[], out: 3x3 float[]
static boolean invertMatrix44(float[] mat, float[] inv)
          compute the inverse of a 4x4 matrix, where the last column is supposed to be (0, 0, 0, 1), i.e. without perspective transformation.
static float[] multiplyMat43in44(float[] a, float[] b)
          multiply to 4x4 matrices, where the last column is (0, 0, 0, 1)
static void printMat33(float[] mat)
           
static void printMat44(float[] mat)
           
static Vec3f transformPoint3Mat44(float[] p, float[] mat)
          transform 3D point by 4D matrix (incl. translation)
static Vec3f transformVector3Mat44(float[] p, float[] mat)
          transform 3D vector by 3x3 subpart of 4D matrix (w/o translation)
static Vec3f transformVector3Mat44transp(float[] p, float[] mat)
          transform 3D vector by the transposed 3x3 subpart of 4D matrix.
static void transposeMatrix33(float[] mat)
          transpose a 3x3 matrix
static void transposeMatrix33inside44(float[] mat)
          transpose the 3x3 subpart of a 4x4 matrix without changing other elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identity3d

public static float[] identity3d
3x3 identity matrix


identity4d

public static float[] identity4d
4x4 identity matrix

Constructor Detail

Mat4f

private Mat4f()
Method Detail

invertMatrix33

public static boolean invertMatrix33(float[] mat,
                                     float[] inv)
compute the inverse of a 3x3 matrix. matrix storage: 3x3 float[] mat and inv must not point to the same storage.

Returns:
flag whether matrix was regular

invertMatrix44

public static boolean invertMatrix44(float[] mat,
                                     float[] inv)
compute the inverse of a 4x4 matrix, where the last column is supposed to be (0, 0, 0, 1), i.e. without perspective transformation. mat and inv must not point to the same storage.

Returns:
flag whether matrix was regular

invertMatrix33of44

public static boolean invertMatrix33of44(float[] mat,
                                         float[] inv)
compute the inverse of a 3x3 subpart of a 4x4 matrix in: 4x4 float[], out: 3x3 float[]

Returns:
flag whether matrix was regular

invertMatrix33inside44

public static boolean invertMatrix33inside44(float[] mat,
                                             float[] inv)
compute the inverse of the 3x3 subpart of a 4x4 matrix without changing other elements. mat and inv must not point to the same storage.

Returns:
flag whether matrix was regular

transposeMatrix33

public static void transposeMatrix33(float[] mat)
transpose a 3x3 matrix


transposeMatrix33inside44

public static void transposeMatrix33inside44(float[] mat)
transpose the 3x3 subpart of a 4x4 matrix without changing other elements.


transformPoint3Mat44

public static Vec3f transformPoint3Mat44(float[] p,
                                         float[] mat)
transform 3D point by 4D matrix (incl. translation)


transformVector3Mat44

public static Vec3f transformVector3Mat44(float[] p,
                                          float[] mat)
transform 3D vector by 3x3 subpart of 4D matrix (w/o translation)


transformVector3Mat44transp

public static Vec3f transformVector3Mat44transp(float[] p,
                                                float[] mat)
transform 3D vector by the transposed 3x3 subpart of 4D matrix. (typical operation for transforming normal vectors.)


multiplyMat43in44

public static float[] multiplyMat43in44(float[] a,
                                        float[] b)
multiply to 4x4 matrices, where the last column is (0, 0, 0, 1)


printMat44

public static void printMat44(float[] mat)

printMat33

public static void printMat33(float[] mat)