org.ogre4j
Class Matrix4

java.lang.Object
  extended by org.xbig.base.NativeObject
      extended by org.ogre4j.Matrix4
All Implemented Interfaces:
IMatrix4, INativeObject

public class Matrix4
extends NativeObject
implements IMatrix4


Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  Matrix4()
          Default constructor.
  Matrix4(float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33)
           
  Matrix4(IMatrix3 m3x3)
          Creates a standard 4x4 transformation matrix with a zero translation part from a rotation/scaling 3x3 matrix.
  Matrix4(InstancePointer p)
          This constructor is public for internal useage only!
protected Matrix4(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  Matrix4(IQuaternion rot)
          Creates a standard 4x4 transformation matrix with a zero translation part from a rotation/scaling .
  Matrix4(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 void adjoint(IMatrix4 returnValue)
           
 void concatenate(IMatrix4 returnValue, IMatrix4 m2)
           
 void concatenateAffine(IMatrix4 returnValue, IMatrix4 m2)
          Concatenate two affine matrix.
 void delete()
          Deletes the corresponding C++ object.
 float determinant()
           
 void extract3x3Matrix(IMatrix3 m3x3)
          Extracts the rotation / scaling part of the Matrix as a 3x3 matrix.
 void extractQuaternion(IQuaternion returnValue)
          Extracts the rotation / scaling part as a quaternion from the Matrix.
 void finalize()
           
static IMatrix4 getCLIPSPACE2DTOIMAGESPACE()
           
static IMatrix4 getIDENTITY()
           
static void getScale(IMatrix4 returnValue, float s_x, float s_y, float s_z)
          Gets a scale matrix - variation for not using a vector.
static void getScale(IMatrix4 returnValue, IVector3 v)
          Gets a scale matrix.
static void getTrans(IMatrix4 returnValue, float t_x, float t_y, float t_z)
          Gets a translation matrix - variation for not using a vector.
static void getTrans(IMatrix4 returnValue, IVector3 v)
          Gets a translation matrix.
 void getTrans(IVector3 returnValue)
          Extracts the translation transformation part of the matrix.
static IMatrix4 getZERO()
           
 boolean hasNegativeScale()
          Determines if this matrix involves a negative scaling.
 boolean hasScale()
          Determines if this matrix involves a scaling.
 void inverse(IMatrix4 returnValue)
           
 void inverseAffine(IMatrix4 returnValue)
          Returns the inverse of the affine matrix.
 boolean isAffine()
          Check whether or not the matrix is affine matrix.
 void makeInverseTransform(IVector3 position, IVector3 scale, IQuaternion orientation)
          Building an inverse from orientation / scale / position.
 void makeTrans(float tx, float ty, float tz)
           
 void makeTrans(IVector3 v)
          Builds a translation matrix
 void makeTransform(IVector3 position, IVector3 scale, IQuaternion orientation)
          Building a from orientation / scale / position.
 void operatorAddition(IMatrix4 returnValue, IMatrix4 m2)
          Matrix addition.
 void operatorAssignment(IMatrix3 mat3)
          Assignment from 3x3 matrix.
 boolean operatorEqual(IMatrix4 m2)
          Tests 2 matrices for equality.
 FloatPointer operatorIndex_const(int iRow)
           
 FloatPointer operatorIndex(int iRow)
           
 void operatorMultiplication(IMatrix4 returnValue, float scalar)
           
 void operatorMultiplication(IMatrix4 returnValue, IMatrix4 m2)
          Matrix concatenation using '*'.
 void operatorMultiplication(IPlane returnValue, IPlane p)
           
 void operatorMultiplication(IVector3 returnValue, IVector3 v)
          Vector transformation using '*'.
 void operatorMultiplication(IVector4 returnValue, IVector4 v)
           
 boolean operatorNotEqual(IMatrix4 m2)
          Tests 2 matrices for inequality.
 void operatorSubtraction(IMatrix4 returnValue, IMatrix4 m2)
          Matrix subtraction.
 void setScale(IVector3 v)
          Sets the scale part of the matrix.
 void setTrans(IVector3 v)
          Sets the translation transformation part of the matrix.
 void transformAffine(IVector3 returnValue, IVector3 v)
          3-D Vector transformation specially for affine matrix.
 void transformAffine(IVector4 returnValue, IVector4 v)
          4-D Vector transformation specially for affine matrix.
 void transpose(IMatrix4 returnValue)
           
 
Methods inherited from class org.xbig.base.NativeObject
disconnectFromNativeObject, equals, getInstancePointer, hashCode, setInstancePointer, setInstancePointer, setInstancePointer, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xbig.base.INativeObject
disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Constructor Detail

Matrix4

public Matrix4(InstancePointer p)
This constructor is public for internal useage only! Do not use it!


Matrix4

protected Matrix4(InstancePointer p,
                  boolean remote)
Creates a Java wrapper object for an existing C++ object. If remote is set to 'true' this object cannot be deleted in Java.


Matrix4

public Matrix4(WithoutNativeObject val)
Allows creation of Java objects without C++ objects.

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()

Matrix4

public Matrix4()
Default constructor.


Matrix4

public Matrix4(float m00,
               float m01,
               float m02,
               float m03,
               float m10,
               float m11,
               float m12,
               float m13,
               float m20,
               float m21,
               float m22,
               float m23,
               float m30,
               float m31,
               float m32,
               float m33)

Matrix4

public Matrix4(IMatrix3 m3x3)
Creates a standard 4x4 transformation matrix with a zero translation part from a rotation/scaling 3x3 matrix.


Matrix4

public Matrix4(IQuaternion rot)
Creates a standard 4x4 transformation matrix with a zero translation part from a rotation/scaling .

Method Detail

delete

public void delete()
Description copied from interface: INativeObject
Deletes the corresponding C++ object.

Subclasses must implement this but if the native instance was created by the underlying library the native call to dispose must not happen!

Specified by:
delete in interface INativeObject
Specified by:
delete in class NativeObject
See Also:
#remote

finalize

public void finalize()
Overrides:
finalize in class NativeObject

operatorIndex

public FloatPointer operatorIndex(int iRow)
Specified by:
operatorIndex in interface IMatrix4

operatorIndex_const

public FloatPointer operatorIndex_const(int iRow)
Specified by:
operatorIndex_const in interface IMatrix4

concatenate

public void concatenate(IMatrix4 returnValue,
                        IMatrix4 m2)
Specified by:
concatenate in interface IMatrix4

operatorMultiplication

public void operatorMultiplication(IMatrix4 returnValue,
                                   IMatrix4 m2)
Matrix concatenation using '*'.

Specified by:
operatorMultiplication in interface IMatrix4

operatorMultiplication

public void operatorMultiplication(IVector3 returnValue,
                                   IVector3 v)
Vector transformation using '*'.

Specified by:
operatorMultiplication in interface IMatrix4

operatorMultiplication

public void operatorMultiplication(IVector4 returnValue,
                                   IVector4 v)
Specified by:
operatorMultiplication in interface IMatrix4

operatorMultiplication

public void operatorMultiplication(IPlane returnValue,
                                   IPlane p)
Specified by:
operatorMultiplication in interface IMatrix4

operatorAddition

public void operatorAddition(IMatrix4 returnValue,
                             IMatrix4 m2)
Matrix addition.

Specified by:
operatorAddition in interface IMatrix4

operatorSubtraction

public void operatorSubtraction(IMatrix4 returnValue,
                                IMatrix4 m2)
Matrix subtraction.

Specified by:
operatorSubtraction in interface IMatrix4

operatorEqual

public boolean operatorEqual(IMatrix4 m2)
Tests 2 matrices for equality.

Specified by:
operatorEqual in interface IMatrix4

operatorNotEqual

public boolean operatorNotEqual(IMatrix4 m2)
Tests 2 matrices for inequality.

Specified by:
operatorNotEqual in interface IMatrix4

operatorAssignment

public void operatorAssignment(IMatrix3 mat3)
Assignment from 3x3 matrix.

Specified by:
operatorAssignment in interface IMatrix4

transpose

public void transpose(IMatrix4 returnValue)
Specified by:
transpose in interface IMatrix4

setTrans

public void setTrans(IVector3 v)
Sets the translation transformation part of the matrix.

Specified by:
setTrans in interface IMatrix4

getTrans

public void getTrans(IVector3 returnValue)
Extracts the translation transformation part of the matrix.

Specified by:
getTrans in interface IMatrix4

makeTrans

public void makeTrans(IVector3 v)
Builds a translation matrix

Specified by:
makeTrans in interface IMatrix4

makeTrans

public void makeTrans(float tx,
                      float ty,
                      float tz)
Specified by:
makeTrans in interface IMatrix4

setScale

public void setScale(IVector3 v)
Sets the scale part of the matrix.

Specified by:
setScale in interface IMatrix4

extract3x3Matrix

public void extract3x3Matrix(IMatrix3 m3x3)
Extracts the rotation / scaling part of the Matrix as a 3x3 matrix.

Specified by:
extract3x3Matrix in interface IMatrix4

hasScale

public boolean hasScale()
Determines if this matrix involves a scaling.

Specified by:
hasScale in interface IMatrix4

hasNegativeScale

public boolean hasNegativeScale()
Determines if this matrix involves a negative scaling.

Specified by:
hasNegativeScale in interface IMatrix4

extractQuaternion

public void extractQuaternion(IQuaternion returnValue)
Extracts the rotation / scaling part as a quaternion from the Matrix.

Specified by:
extractQuaternion in interface IMatrix4

operatorMultiplication

public void operatorMultiplication(IMatrix4 returnValue,
                                   float scalar)
Specified by:
operatorMultiplication in interface IMatrix4

adjoint

public void adjoint(IMatrix4 returnValue)
Specified by:
adjoint in interface IMatrix4

determinant

public float determinant()
Specified by:
determinant in interface IMatrix4

inverse

public void inverse(IMatrix4 returnValue)
Specified by:
inverse in interface IMatrix4

makeTransform

public void makeTransform(IVector3 position,
                          IVector3 scale,
                          IQuaternion orientation)
Building a from orientation / scale / position.

Specified by:
makeTransform in interface IMatrix4

makeInverseTransform

public void makeInverseTransform(IVector3 position,
                                 IVector3 scale,
                                 IQuaternion orientation)
Building an inverse from orientation / scale / position.

Specified by:
makeInverseTransform in interface IMatrix4

isAffine

public boolean isAffine()
Check whether or not the matrix is affine matrix.

Specified by:
isAffine in interface IMatrix4

inverseAffine

public void inverseAffine(IMatrix4 returnValue)
Returns the inverse of the affine matrix.

Specified by:
inverseAffine in interface IMatrix4

concatenateAffine

public void concatenateAffine(IMatrix4 returnValue,
                              IMatrix4 m2)
Concatenate two affine matrix.

Specified by:
concatenateAffine in interface IMatrix4

transformAffine

public void transformAffine(IVector3 returnValue,
                            IVector3 v)
3-D Vector transformation specially for affine matrix.

Specified by:
transformAffine in interface IMatrix4

transformAffine

public void transformAffine(IVector4 returnValue,
                            IVector4 v)
4-D Vector transformation specially for affine matrix.

Specified by:
transformAffine in interface IMatrix4

getTrans

public static void getTrans(IMatrix4 returnValue,
                            IVector3 v)
Gets a translation matrix.


getTrans

public static void getTrans(IMatrix4 returnValue,
                            float t_x,
                            float t_y,
                            float t_z)
Gets a translation matrix - variation for not using a vector.


getScale

public static void getScale(IMatrix4 returnValue,
                            IVector3 v)
Gets a scale matrix.


getScale

public static void getScale(IMatrix4 returnValue,
                            float s_x,
                            float s_y,
                            float s_z)
Gets a scale matrix - variation for not using a vector.


getZERO

public static IMatrix4 getZERO()

getIDENTITY

public static IMatrix4 getIDENTITY()

getCLIPSPACE2DTOIMAGESPACE

public static IMatrix4 getCLIPSPACE2DTOIMAGESPACE()


Copyright © 2007 netAllied GmbH. All Rights Reserved.