Maven module :un.api : api-math :
Class : un.impl.math.transform.NodeTransform
Extends/Implements : un.api.math.transform.AbstractTransform un.api.event.EventSource
Subclasses : -

A node transform is the equivalent of a matrix but storing values
in 3 different elements.
At first the project used a Matrix, but this approach starts to raise problems
when node are moved around very often (like billboards), the mathematic inaccuracy makes the
objects start to distord over time.
A good description of the problem can be found here :
http://www.altdevblogaday.com/2012/07/03/matrices-rotation-scale-and-drifting/
author  Johann Sorel


Variables : PROPERTY_MATRIX
Functions : NodeTransform, NodeTransform, NodeTransform, set, set, setToIdentity, setToTranslation, getDimension, getRotation, getScale, getTranslation, notifyChanged, asMatrix, inverseAsMatrix, asMatrix, getInputDimensions, getOutputDimensions, transform, transform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, getEventClasses, getEventManager, getEventManager, addEventListener, addEventListener, removeEventListener, removeEventListener, getListeners, getListeners


public Chars PROPERTY_MATRIX


public void NodeTransform (int dimension)

public void NodeTransform (MatrixRW rotation, Vector scale, Vector translation)

public void NodeTransform (Quaternion rotation, Vector scale, Vector translation)


Copy values from given transform.
param  trs
public void set (NodeTransform trs)


Set transform from given matrix.
Matrix must be orthogonal of size dimension+1.
param  trs
public void set (Matrix trs)


Set to identity.
This method will send a change event if values have changed.
public void setToIdentity ()


Set this transform to given translation.
This will reset rotation and scale values.
This method will send a change event if values have changed.
public void setToTranslation (double[] trs)


Dimension of the transform.
return  int
public int getDimension ()


Get transform rotation.
Call notifyChanged after if you modified the values.
return  Matrix
public MatrixRW getRotation ()


Get transform scale.
Call notifyChanged after if you modified the values.
return  Vector
public Vector getScale ()


Get transform translation.
Call notifyChanged after if you modified the values.
return  Vector
public Vector getTranslation ()


Flag to indicate the transform parameters has changed.
This is used to recalculate the general matrix when needed.
public void notifyChanged ()


Get a general matrix view of size : dimension+1
This matrix combine rotation, scale and translation
DO NOT MODIFY THIS MATRIX.

[R*S, R*S, R*S, T]
[R*S, R*S, R*S, T]
[R*S, R*S, R*S, T]
[ 0, 0, 0, 1]

@return Matrix, never null
public Matrix asMatrix ()


Get a general inverse matrix view of size : dimension+1
DO NOT MODIFY THIS MATRIX.
return  Matrix, never null
public Matrix inverseAsMatrix ()


Create a general matrix of a different dimension.
param  outDimension must be superior to this transformation dimension.
return  Matrix
public MatrixRW asMatrix (int outDimension)


{@inheritDoc }
public int getInputDimensions ()


{@inheritDoc }
public int getOutputDimensions ()


{@inheritDoc }
public double[] transform (double[] in, int sourceOffset, double[] out, int destOffset, int nbTuple)


{@inheritDoc }
public float[] transform (float[] in, int sourceOffset, float[] out, int destOffset, int nbTuple)


Inverse transform a single tuple.
param  source tuple array, can not be null.
param  dest array, can be null.
return  destination tuple.
public double[] inverseTransform (double[] source, double[] dest)


Inverse transform N tuples.
param  source tuple array, can not be null.
param  sourceOffset index where to start.
param  dest array, can not be null.
param  destOffset index where start inserting converted values.
param  nbTuple number of tuples to transform.
public void inverseTransform (double[] source, int sourceOffset, double[] dest, int destOffset, int nbTuple)


Inverse transform a single tuple.
param  source tuple array, can not be null.
param  dest array, can be null.
return  destination tuple.
public float[] inverseTransform (float[] source, float[] dest)


Inverse transform N tuples.
param  source tuple array, can not be null.
param  sourceOffset index where to start.
param  dest array, can not be null.
param  destOffset index where start inserting converted values.
param  nbTuple number of tuples to transform.
public void inverseTransform (float[] source, int sourceOffset, float[] dest, int destOffset, int nbTuple)


Inverse transform a single tuple.
param  source tuple, can not be null.
param  dest tuple, can be null.
return  destination tuple.
public Tuple inverseTransform (Tuple source, Tuple dest)

public Class[] getEventClasses ()

protected EventManager getEventManager ()

protected EventManager getEventManager (boolean create)

public void addEventListener (Class eventClass, EventListener listener)

public void addEventListener (Predicate predicate, EventListener listener)

public void removeEventListener (Class eventClass, EventListener listener)

public void removeEventListener (Predicate predicate, EventListener listener)

public EventListener[] getListeners (Class eventClass)

public EventListener[] getListeners (Predicate predicate)