crystalspace.jbind.impl.csgeom.matrix3
Class csMatrix3

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csgeom.matrix3.csMatrix3
All Implemented Interfaces:
iPointer

public class csMatrix3
extends csNativeObject

A 3x3 matrix.

Author:
Quentin Anciaux

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csMatrix3()
          Construct a matrix, initialized to be the identity.
csMatrix3(csQuaternion quat)
          Construct a matrix with a quaternion.
csMatrix3(float am11, float am12, float am13, float am21, float am22, float am23, float am31, float am32, float am33)
          Construct a matrix and initialize it.
csMatrix3(iPointer nPointer)
          Create a java csMatrix3 object which points to the native csMatrix3 nPointer.
 
Method Summary
 csMatrix3 add()
          Unary + operator.
 csMatrix3 add(csMatrix3 m)
          Add another matrix to this matrix.
static csMatrix3 add(csMatrix3 m1, csMatrix3 m2)
          Add two matricies.
 csVector3 col1()
          Get the first column of this matrix as a vector.
 csVector3 col2()
          Get the second column of this matrix as a vector.
 csVector3 col3()
          Get the third column of this matrix as a vector.
 float determinant()
          Compute the determinant of this matrix.
static csMatrix3 div(csMatrix3 m, float f)
          Divide a matrix by a scalar
 csMatrix3 div(float s)
          Divide this matrix by a scalar.
static boolean equals(csMatrix3 m1, csMatrix3 m2)
          Check if two matricies are equal.
 boolean equals(java.lang.Object obj)
          Check if two matricies are equal.
 csMatrix3 getInverse()
          Return the inverse of this matrix.
 csMatrix3 getTranspose()
          Return the transpose of this matrix.
static boolean greater(float f, csMatrix3 m)
          Test if each component of a matrix is greater than a small epsilon value.
 void identity()
          Set this matrix to the identity matrix.
 void invert()
          Invert this matrix.
 boolean isIdentity()
          Check if the matrix is identity.
protected  boolean isNativePointerValidSafe(long nPointer)
           
static boolean less(csMatrix3 m, float f)
          Test if each component of a matrix is less than a small epsilon value.
 csMatrix3 minus()
          Unary - operator.
 csMatrix3 minus(csMatrix3 m)
          Subtract another matrix from this matrix.
static csMatrix3 minus(csMatrix3 m1, csMatrix3 m2)
          Subtract two matricies.
 csMatrix3 mul(csMatrix3 m)
          Multiply another matrix with this matrix.
static csMatrix3 mul(csMatrix3 m1, csMatrix3 m2)
          Multiply two matricies.
static csVector3 mul(csMatrix3 m, csVector3 v)
          Multiply a vector by a matrix (transform it).
static csMatrix3 mul(csMatrix3 m, float f)
          Multiply a matrix and a scalar.
 csMatrix3 mul(float s)
          Multiply this matrix with a scalar.
static csMatrix3 mul(float f, csMatrix3 m)
          Multiply a matrix and a scalar.
protected  void nDelete(long pointer)
           
static boolean nEquals(csMatrix3 m1, csMatrix3 m2)
          Check if two matricies are not equal.
 csVector3 row1()
          Get the first row of this matrix as a vector.
 csVector3 row2()
          Get the second row of this matrix as a vector.
 csVector3 row3()
          Get the third row of this matrix as a vector.
 void set(csQuaternion quat)
          Initialize matrix with a quaternion.
 void set(float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33)
          Set matrix values.
 void transpose()
          Transpose this matrix.
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, finalize, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, newNativeObject, setMemoryOwner, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

csMatrix3

public csMatrix3(iPointer nPointer)
Create a java csMatrix3 object which points to the native csMatrix3 nPointer.

Parameters:
nPointer -

csMatrix3

public csMatrix3()
Construct a matrix, initialized to be the identity.


csMatrix3

public csMatrix3(float am11,
                 float am12,
                 float am13,
                 float am21,
                 float am22,
                 float am23,
                 float am31,
                 float am32,
                 float am33)
Construct a matrix and initialize it.

Parameters:
am11 -
am12 -
am13 -
am21 -
am22 -
am23 -
am31 -
am32 -
am33 -

csMatrix3

public csMatrix3(csQuaternion quat)
Construct a matrix with a quaternion.

Parameters:
quat -
Method Detail

nDelete

protected void nDelete(long pointer)
Specified by:
nDelete in class csNativeObject
See Also:
csNativeObject.nDelete(long)

isNativePointerValidSafe

protected boolean isNativePointerValidSafe(long nPointer)
Specified by:
isNativePointerValidSafe in class csNativeObject
See Also:
crystalspace.jbind.impl.csNativeObject#isNativePointerValidSafe()

row1

public final csVector3 row1()
Get the first row of this matrix as a vector.

Returns:

row2

public final csVector3 row2()
Get the second row of this matrix as a vector.

Returns:

row3

public final csVector3 row3()
Get the third row of this matrix as a vector.

Returns:

col1

public final csVector3 col1()
Get the first column of this matrix as a vector.

Returns:

col2

public final csVector3 col2()
Get the second column of this matrix as a vector.

Returns:

col3

public final csVector3 col3()
Get the third column of this matrix as a vector.

Returns:

set

public final void set(float m11,
                      float m12,
                      float m13,
                      float m21,
                      float m22,
                      float m23,
                      float m31,
                      float m32,
                      float m33)
Set matrix values.

Parameters:
m11 -
m12 -
m13 -
m21 -
m22 -
m23 -
m31 -
m32 -
m33 -

set

public final void set(csQuaternion quat)
Initialize matrix with a quaternion.

Parameters:
quat -

add

public final csMatrix3 add(csMatrix3 m)
Add another matrix to this matrix.

Parameters:
m -
Returns:

minus

public final csMatrix3 minus(csMatrix3 m)
Subtract another matrix from this matrix.

Parameters:
m -
Returns:

mul

public final csMatrix3 mul(csMatrix3 m)
Multiply another matrix with this matrix.

Parameters:
m -
Returns:

mul

public final csMatrix3 mul(float s)
Multiply this matrix with a scalar.

Parameters:
s -
Returns:

div

public final csMatrix3 div(float s)
Divide this matrix by a scalar.

Parameters:
s -
Returns:

add

public final csMatrix3 add()
Unary + operator.

Returns:

minus

public final csMatrix3 minus()
Unary - operator.

Returns:

transpose

public final void transpose()
Transpose this matrix.


getTranspose

public final csMatrix3 getTranspose()
Return the transpose of this matrix.

Returns:

getInverse

public final csMatrix3 getInverse()
Return the inverse of this matrix.

Returns:

invert

public final void invert()
Invert this matrix.


determinant

public final float determinant()
Compute the determinant of this matrix.

Returns:

identity

public final void identity()
Set this matrix to the identity matrix.


isIdentity

public final boolean isIdentity()
Check if the matrix is identity.

Returns:

add

public static final csMatrix3 add(csMatrix3 m1,
                                  csMatrix3 m2)
Add two matricies.

Parameters:
m1 -
m2 -
Returns:

minus

public static final csMatrix3 minus(csMatrix3 m1,
                                    csMatrix3 m2)
Subtract two matricies.

Parameters:
m1 -
m2 -
Returns:

mul

public static final csMatrix3 mul(csMatrix3 m1,
                                  csMatrix3 m2)
Multiply two matricies.

Parameters:
m1 -
m2 -
Returns:

mul

public static final csVector3 mul(csMatrix3 m,
                                  csVector3 v)
Multiply a vector by a matrix (transform it).

Parameters:
m -
v -
Returns:

mul

public static final csMatrix3 mul(csMatrix3 m,
                                  float f)
Multiply a matrix and a scalar.

Parameters:
m -
f -
Returns:

mul

public static final csMatrix3 mul(float f,
                                  csMatrix3 m)
Multiply a matrix and a scalar.

Parameters:
f -
m -
Returns:

div

public static final csMatrix3 div(csMatrix3 m,
                                  float f)
Divide a matrix by a scalar

Parameters:
m -
f -
Returns:

equals

public final boolean equals(java.lang.Object obj)
Check if two matricies are equal.

Overrides:
equals in class csNativeObject
See Also:
Object.equals(java.lang.Object)

equals

public static final boolean equals(csMatrix3 m1,
                                   csMatrix3 m2)
Check if two matricies are equal.

Parameters:
m1 -
m2 -
Returns:

nEquals

public static final boolean nEquals(csMatrix3 m1,
                                    csMatrix3 m2)
Check if two matricies are not equal.

Parameters:
m1 -
m2 -
Returns:

less

public static final boolean less(csMatrix3 m,
                                 float f)
Test if each component of a matrix is less than a small epsilon value.

Parameters:
m -
f -
Returns:

greater

public static final boolean greater(float f,
                                    csMatrix3 m)
Test if each component of a matrix is greater than a small epsilon value.

Parameters:
f -
m -
Returns: