| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.jinx.math.Matrix3
public class Matrix3
Matrix3 is a 3x3 matrix class, suitable for graphics and physics operations.
 
API Stability: Beta.
| Field Summary | |
|---|---|
static Matrix3 | 
IDENTITY
The indetity Matrix3 is usually your starting point for building a transformation Matrix3  | 
| Constructor Summary | |
|---|---|
Matrix3(float[] values)
Constructs a Matrix3 using an array of floats.  | 
|
Matrix3(Vector r1,
        Vector r2,
        Vector r3)
Constructs a Matrix3 from four Quaternions.  | 
|
| Method Summary | |
|---|---|
 Matrix3 | 
add(Matrix3 m)
 | 
 boolean | 
equals(java.lang.Object obj)
 | 
 float | 
get(int row,
    int col)
Returns a given element of this Matrix3 The indices are not zero based, like an array.  | 
 Matrix3 | 
multiply(float v)
Multiplies this Matrix3 by v.  | 
 Matrix3 | 
multiply(Matrix3 m)
Multiplies m (the multiplicand) by this (the multiplier).  | 
 Matrix3 | 
rotate(Quaternion q)
Applies a rotation transformation and returns the result.  | 
 Matrix3 | 
rotate(Vector v)
Applies a rotation transformation and returns the result.  | 
 Matrix3 | 
rotateX(float t)
Applies a rotation transformation and returns the result.  | 
 Matrix3 | 
rotateY(float t)
Applies a rotation transformation and returns the result.  | 
 Matrix3 | 
rotateZ(float t)
Applies a rotation transformation and returns the result.  | 
static Matrix3 | 
rotationMatrix(Quaternion q)
Constructs a rotation Matrix3 for q.  | 
static Matrix3 | 
rotationMatrix(Vector v)
Constructs a rotation Matrix3 for v.  | 
 Matrix3 | 
scale(float s)
Applies a scale transformation and returns the result.  | 
 Matrix3 | 
scale(float x,
      float y,
      float z)
Applies a scale transformation and returns the result.  | 
 Matrix3 | 
scale(Vector v)
Applies a scale transformation and returns the result.  | 
static Matrix3 | 
scalingMatrix(float s)
Constructs a scaling Matrix3  | 
static Matrix3 | 
scalingMatrix(float vx,
              float vy,
              float vz)
Constructs a scaling Matrix3  | 
static Matrix3 | 
scalingMatrix(Vector v)
Constructs a scaling Matrix3  | 
 Matrix3 | 
subtract(Matrix3 m)
 | 
 float[] | 
toFloatArray()
Converts this Matrix3 to a column ordered float array.  | 
 java.lang.String | 
toString()
 | 
 void | 
transform(float[] v)
Transforms v as though it were either a Vector or a Quaternion (depending on length), modifying the array with the result.  | 
 void | 
transform(float[][] va)
Transforms a vertex array.  | 
 float[] | 
transform(float xv,
          float yv,
          float zv)
Transforms vx, vy, vz, and vw as though they were a Vector and returns the result.  | 
 Vector | 
transform(Vector v)
Transforms v and returns the result.  | 
 Matrix3 | 
transpose()
Returns a transposed version of this Matrix3  | 
static Matrix3 | 
xRotationMatrix(float t)
Constructs a rotation Matrix3 for rotating around the X axis.  | 
static Matrix3 | 
yRotationMatrix(float t)
Constructs a rotation Matrix3 for rotating around the Y axis.  | 
static Matrix3 | 
zRotationMatrix(float t)
Constructs a rotation Matrix3 for rotating around the Z axis.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static final Matrix3 IDENTITY
| Constructor Detail | 
|---|
public Matrix3(Vector r1,
               Vector r2,
               Vector r3)
r1 - the first row.r2 - the first row.r3 - the first row.public Matrix3(float[] values)
values - the floats to use., in column order.| Method Detail | 
|---|
public boolean equals(java.lang.Object obj)
equals in class java.lang.Object
public float get(int row,
                 int col)
row - the row to access.col - the column to access.
public Matrix3 transpose()
public void transform(float[][] va)
va - the vertex array.public void transform(float[] v)
v - the float array.
public float[] transform(float xv,
                         float yv,
                         float zv)
xv - the X component.yv - the Y component.zv - the Z component.
public Vector transform(Vector v)
v - the Vector to transform.
public Matrix3 add(Matrix3 m)
public Matrix3 subtract(Matrix3 m)
public Matrix3 multiply(float v)
v - the float to multiply by.
public Matrix3 multiply(Matrix3 m)
m - the multiplicand.
public Matrix3 scale(Vector v)
v - the Vector containing scaling factors for the three axes.
public Matrix3 scale(float s)
s - the scaling factor for all three axes.
public Matrix3 scale(float x,
                     float y,
                     float z)
x - the scaling factor along the X axis.y - the scaling factor along the Y axis.z - the scaling factor along the Z axis.
public Matrix3 rotateX(float t)
t - the angle of rotation used to rotate around the X axis.
public Matrix3 rotateY(float t)
t - the angle of rotation used to rotate around the Y axis.
public Matrix3 rotateZ(float t)
t - the angle of rotation used to rotate around the Z axis.
public Matrix3 rotate(Vector v)
v - the Vector representing the rotation.
public Matrix3 rotate(Quaternion q)
q - the Quaternion representing the rotation.
public float[] toFloatArray()
public java.lang.String toString()
toString in class java.lang.Objectpublic static Matrix3 scalingMatrix(float s)
s - the scaling factor all three axes.
public static Matrix3 scalingMatrix(Vector v)
v - the scaling Vector with factors for the three axes.
public static Matrix3 scalingMatrix(float vx,
                                    float vy,
                                    float vz)
vx - the scaling factor along the X axis.vy - the scaling factor along the Y axis.vz - the scaling factor along the Z axis.
public static Matrix3 xRotationMatrix(float t)
t - (short for theta) the angle of rotation.
public static Matrix3 yRotationMatrix(float t)
t - (short for theta) the angle of rotation.
public static Matrix3 zRotationMatrix(float t)
t - (short for theta) the angle of rotation.
public static Matrix3 rotationMatrix(Vector v)
v - the Vector describing a 3D rotation.
public static Matrix3 rotationMatrix(Quaternion q)
q - the Quaternion being used to represent a 3D rotation.
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||