Class Matrix4

java.lang.Object
  extended by Matrix4

public class Matrix4
extends java.lang.Object


Field Summary
 float a11
          The matrix coefficients.
 float a12
          The matrix coefficients.
 float a13
          The matrix coefficients.
 float a14
          The matrix coefficients.
 float a21
          The matrix coefficients.
 float a22
          The matrix coefficients.
 float a23
          The matrix coefficients.
 float a24
          The matrix coefficients.
 float a31
          The matrix coefficients.
 float a32
          The matrix coefficients.
 float a33
          The matrix coefficients.
 float a34
          The matrix coefficients.
 float a41
          The matrix coefficients.
 float a42
          The matrix coefficients.
 float a43
          The matrix coefficients.
 float a44
          The matrix coefficients.
 
Constructor Summary
Matrix4()
          Default constructor, yields indentity matrix
Matrix4(Matrix4 m)
          Matrix copy constructor, copies an existing matrix
 
Method Summary
static Matrix4 getRotateXInstance(float theta)
          Factory method to create a transformation matrix for rotation around X
static Matrix4 getRotateYInstance(float theta)
          Factory method to create a transformation matrix for rotation around Y
static Matrix4 getRotateZInstance(float theta)
          Factory method to create a transformation matrix for rotation around Z
 Matrix4 getRotMatrix(float phi, float theta, float sigma)
          Rotating matrix
static Matrix4 getScaleInstance(float s)
          Factory method to create a transformation matrix for uniform scaling
static Matrix4 getScaleInstance(float sx, float sy, float sz)
          Factory method to create a transformation matrix for non-uniform scaling
static void getTranslateInstance(Matrix4 m, float tx, float ty, float tz)
          Factory method to create a transformation matrix for translation
 void mult(Matrix4 m2)
          Matrix multiply two matrices
static Matrix4 mult(Matrix4 m1, Matrix4 m2)
          Matrix multiply two matrices
static void mult(Matrix4 m, Vector4 v)
           
 void set(Matrix4 m)
          Copy the coefficient vaules from another matrix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

a11

public float a11
The matrix coefficients. Element aij is at row i, column j.


a12

public float a12
The matrix coefficients. Element aij is at row i, column j.


a13

public float a13
The matrix coefficients. Element aij is at row i, column j.


a14

public float a14
The matrix coefficients. Element aij is at row i, column j.


a21

public float a21
The matrix coefficients. Element aij is at row i, column j.


a22

public float a22
The matrix coefficients. Element aij is at row i, column j.


a23

public float a23
The matrix coefficients. Element aij is at row i, column j.


a24

public float a24
The matrix coefficients. Element aij is at row i, column j.


a31

public float a31
The matrix coefficients. Element aij is at row i, column j.


a32

public float a32
The matrix coefficients. Element aij is at row i, column j.


a33

public float a33
The matrix coefficients. Element aij is at row i, column j.


a34

public float a34
The matrix coefficients. Element aij is at row i, column j.


a41

public float a41
The matrix coefficients. Element aij is at row i, column j.


a42

public float a42
The matrix coefficients. Element aij is at row i, column j.


a43

public float a43
The matrix coefficients. Element aij is at row i, column j.


a44

public float a44
The matrix coefficients. Element aij is at row i, column j.

Constructor Detail

Matrix4

public Matrix4()
Default constructor, yields indentity matrix


Matrix4

public Matrix4(Matrix4 m)
Matrix copy constructor, copies an existing matrix

Method Detail

getRotateXInstance

public static Matrix4 getRotateXInstance(float theta)
Factory method to create a transformation matrix for rotation around X

Parameters:
theta - The rotation angle
Returns:
A transformation matrix

getRotateYInstance

public static Matrix4 getRotateYInstance(float theta)
Factory method to create a transformation matrix for rotation around Y

Parameters:
theta - The rotation angle
Returns:
A transformation matrix

getRotateZInstance

public static Matrix4 getRotateZInstance(float theta)
Factory method to create a transformation matrix for rotation around Z

Parameters:
theta - The rotation angle
Returns:
A transformation matrix

getTranslateInstance

public static void getTranslateInstance(Matrix4 m,
                                        float tx,
                                        float ty,
                                        float tz)
Factory method to create a transformation matrix for translation

Parameters:
tx - The translation along the x dimension
ty - The translation along the y dimension
tz - The translation along the z dimension

getScaleInstance

public static Matrix4 getScaleInstance(float s)
Factory method to create a transformation matrix for uniform scaling

Parameters:
s - The scaling factor
Returns:
A transformation matrix

getScaleInstance

public static Matrix4 getScaleInstance(float sx,
                                       float sy,
                                       float sz)
Factory method to create a transformation matrix for non-uniform scaling

Parameters:
sx - The scaling factor along the x dimension
sy - The scaling factor along the y dimension
sz - The scaling factor along the z dimension
Returns:
A transformation matrix

set

public void set(Matrix4 m)
Copy the coefficient vaules from another matrix

Parameters:
m - The matrix to copy

getRotMatrix

public Matrix4 getRotMatrix(float phi,
                            float theta,
                            float sigma)
Rotating matrix

Parameters:
m1 - The first (left) matrix for the multiplication
m2 - The second (middle) matrix for the multiplication
m3 - The third (right) matrix for the multiplication
Returns:
The resulting matrix product

mult

public static void mult(Matrix4 m,
                        Vector4 v)

mult

public static Matrix4 mult(Matrix4 m1,
                           Matrix4 m2)
Matrix multiply two matrices

Parameters:
m1 - The first (left) matrix for the multiplication
m2 - The second (right) matrix for the multiplication
Returns:
The resulting matrix product

mult

public void mult(Matrix4 m2)
Matrix multiply two matrices

Parameters:
m2 - The second (right) matrix for the multiplication