protected void recalculateTransRotMBuffer(MatrixWindow matrixWindow) {
try {
if(!isVisible() || !isActive()){
matrixWindow.matrix.set(getMatrixID(), invisibleMatrixArray);
return;
}
Vect3D.normalize(heading, aZ);
Vect3D.normalize(top,aY);
Vect3D.cross(top, aZ, aX);
recalculateRotBuffer();
if (translate()) {
recalculateTransBuffer();
Mat4x4.mul(tMd, rMd, rotTransM);
} else {
System.arraycopy(rMd, 0, rotTransM, 0, 16);
}
matrixWindow.
setTransposed(rotTransM, getMatrixID(), scratchMatrixArray);
} catch (MathArithmeticException e) {e.printStackTrace();}
catch (ZeroNormException e) {e.printStackTrace();}
}