hmi.math
Class MatrixMath

java.lang.Object
  extended by hmi.math.MatrixMath

public final class MatrixMath
extends Object

Some matrix utilities

Author:
Job Zwiers

Constructor Summary
private MatrixMath()
           
 
Method Summary
static float distanceToPlane(float[] p, float[] plane)
          Determine the distance of a point from a plane, given the point and the equation of the plane.
static void getNormalVector(float[] p, float[] q, float[] r, float[] c)
          auxiliary method: calculates the normal vector (of unit length) for a triangle p, q, r and stores it into array c.
static void getPlane(float[] p1, float[] p2, float[] p3, float[] plane)
          Gets the three coefficients of a plane equation given three points on the plane.
static void makeShadowMatrix(float[][] vPoints, float[] vLightPos, float[] destMat)
          Creates a shadow projection matrix out of the plane equation coefficients and the position of the light.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatrixMath

private MatrixMath()
Method Detail

getNormalVector

public static void getNormalVector(float[] p,
                                   float[] q,
                                   float[] r,
                                   float[] c)
auxiliary method: calculates the normal vector (of unit length) for a triangle p, q, r and stores it into array c.


getPlane

public static void getPlane(float[] p1,
                            float[] p2,
                            float[] p3,
                            float[] plane)
Gets the three coefficients of a plane equation given three points on the plane.


distanceToPlane

public static float distanceToPlane(float[] p,
                                    float[] plane)
Determine the distance of a point from a plane, given the point and the equation of the plane.


makeShadowMatrix

public static void makeShadowMatrix(float[][] vPoints,
                                    float[] vLightPos,
                                    float[] destMat)
Creates a shadow projection matrix out of the plane equation coefficients and the position of the light. The return value is stored in destMat