All Packages  This Package  Class Hierarchy  Class Search  Index

Inner Class


protected class  Tmatrix.Matrix4D
     extends java.lang.Object
          // Fields 1
     public float[][] matrix;

          // Constructors 4
     public Matrix4D();
     public Matrix4D(Tmatrix.Matrix4D);
     public Matrix4D(float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float);
     public Matrix4D(float[][]);

          // Methods 6
     public Tmatrix.Matrix4D add(Tmatrix.Matrix4D);
     public Tmatrix.Matrix4D multiply(Tmatrix.Matrix4D);
     public Tmatrix.Matrix4D subtract(Tmatrix.Matrix4D);
     public String toString();
     public void transform(Vector3D, Vector3D);
     public Tmatrix.Matrix4D transpose();

The Matrix4D class is a simple 4X4 matrix class used internally the Tmatrix to represent transformation matrices. This may be pulled out and made a separate class in its own right.

  Cross Reference

Returned By:
Tmatrix.Matrix4D.add(), Tmatrix.Matrix4D.multiply(), Tmatrix.Matrix4D.subtract(), Tmatrix.Matrix4D.transpose()


· matrix

Summary  |  Top
   public float[][] matrix


· Matrix4D

Summary  |  Top

   public Matrix4D() 

The first version of the Matrix4D constructor takes no arguments and produces the identity matrix.

· Matrix4D

Summary  |  Top
   public Matrix4D(float[][] matrix) 

This version of the constructor takes a two dimensional array of floats and makes it the matrix. No checking is done (for performance reasons) to make sure that this is actually a 4X4 array. This lack of checking is the primary reason for making Matrix4D a protected internal class.

· Matrix4D

Summary  |  Top
   public Matrix4D(Tmatrix.Matrix4D obj) 

This is the copy constructor.

· Matrix4D

Summary  |  Top
   public Matrix4D(float a1, 
                   float a2, 
                   float a3, 
                   float a4, 
                   float b1, 
                   float b2, 
                   float b3, 
                   float b4, 
                   float c1, 
                   float c2, 
                   float c3, 
                   float c4, 
                   float d1, 
                   float d2, 
                   float d3, 
                   float d4) 

This version of the constructor takes 16 floats in row-column order and produces the appropriate matrix.


· toString

Summary  |  Top
   public String toString() 
toString in class Object

· add

Summary  |  Top
   public Tmatrix.Matrix4D add(Tmatrix.Matrix4D B) 

The add method computes A + B

· subtract

Summary  |  Top
   public Tmatrix.Matrix4D subtract(Tmatrix.Matrix4D B) 

The subtract method computes A - B

· multiply

Summary  |  Top
   public Tmatrix.Matrix4D multiply(Tmatrix.Matrix4D B) 

The multiply method computes A * B

· transpose

Summary  |  Top
   public Tmatrix.Matrix4D transpose() 

The transpose method returns the transpose of the current matrix.

· transform

Summary  |  Top
   public void transform(Vector3D vect, 
                         Vector3D result) 

The transform method multiplies Vector3D vect by the current matrix as though it were a four dimensional column vector with a w value of 1, i.e. [x y z 1]. The result is then projected back into the w=1 plane, and returned as Vector3D result. Note that this method is going to get called a lot, so efficiency is critical.

All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7