Maven module :un.api : api-math :
Class : un.impl.math.Matrix4
Extends/Implements : un.impl.math.AbstractMatrix
Subclasses : -

4x4 matrix
author  Johann Sorel


Variables : -
Functions : Matrix4, Matrix4, Matrix4, Matrix4, get, set, getRotation, setToIdentity, getRotationQuaternion, setRotation, getTranslation, setTranslation, copy, getDeterminant, fromEuler, invert, invert, transpose, isIdentity, createFromComponents, createRotationEuler, createFromAxis, focusedOrbit, transform



public void Matrix4 ()

public void Matrix4 (Matrix m)

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

public void Matrix4 (double[][] values)

public double get (int row, int col)

public void set (int row, int col, double value)


Get 3x3 part of the matrix.
return  3x3 rotation part of the matrix
public Matrix3 getRotation ()


{@inheritDoc }
public Matrix4 setToIdentity ()


Transform rotation part of the matrix in quaternion.
return  Quaternion
public Quaternion getRotationQuaternion ()

public void setRotation (Matrix3 rotation)

public Vector getTranslation ()

public void setTranslation (Tuple translation)

public Matrix4 copy ()


return  determinant
public double getDeterminant ()


Build rotation matrix from euler angle.
param  euler angles in radians (heading/yaw , elevation/pitch , bank/roll)
return  Matrix4
public Matrix4 fromEuler (Tuple euler)


{@inheritDoc }
public Matrix4 invert ()

public MatrixRW invert (MatrixRW buffer)

public Matrix4 transpose ()


{@inheritDoc }
public boolean isIdentity ()


Build matrix from rotation,scale and translation.
param  rotation Matrix[3x3]
param  scale Tuple[3]
param  translation Tuple[3]
return  Matrix4
public Matrix4 createFromComponents (DefaultMatrix rotation, Tuple scale, Tuple translation)


Build rotation matrix from euler angle.
param  euler angles in radians (heading/yaw , elevation/pitch , bank/roll)
return  Matrix4
public Matrix4 createRotationEuler (Tuple euler)


Create rotation matrix from 3 axis.
Each Tuple must be unit length(normalized)
param  xAxis values are copied in 1th row
param  yAxis values are copied in 2nd row
param  zAxis values are copied in 3rd row
return  rotation matrix
public Matrix4 createFromAxis (Tuple xAxis, Tuple yAxis, Tuple zAxis)


Create and orbit matrix 4x4 focus on the root point (0,0,0).
param  xAngle horizontal angle
param  yAngle vertical angle
param  rollAngle roll angle
param  distance distance from base
return  orbit matrix 4x4
public Matrix4 focusedOrbit (double xAngle, double yAngle, double rollAngle, double distance)

protected void transform (double[] vector, double[] buffer, double fillValue)