if (Math.abs(getM00() - comp.getM00()) > Matrix4.ALLOWED_DEVIANCE) { return false; } else if (Math.abs(getM01() - comp.getM01()) > Matrix4.ALLOWED_DEVIANCE) { return false; } else if (Math.abs(getM02() - comp.getM02()) > Matrix4.ALLOWED_DEVIANCE) {
if (Math.abs(getM00() - comp.getM00()) > Matrix4.ALLOWED_DEVIANCE) { return false; } else if (Math.abs(getM01() - comp.getM01()) > Matrix4.ALLOWED_DEVIANCE) { return false; } else if (Math.abs(getM02() - comp.getM02()) > Matrix4.ALLOWED_DEVIANCE) {
@Override public ResultSample doInverse3Test(final int count, final int maxCount, final long timeOutMS) { final Matrix4 mat = a3dMatrixRandom(); final Matrix3 m1 = new Matrix3( // mat.getM00(), mat.getM01(), mat.getM02(), // mat.getM10(), mat.getM11(), mat.getM12(), // mat.getM20(), mat.getM21(), mat.getM22()); mat.setIdentity(); final long start = System.currentTimeMillis(); int loopCount = 0; while (System.currentTimeMillis() - start < timeOutMS && loopCount != maxCount) { ++loopCount; for (int i = 0; i < count; ++i) { m1.invertLocal(); } } return populateResult(System.currentTimeMillis() - start, loopCount, mat.set(m1).toArray(null)); }
tempX = jntMat.getM00() * bindVX + jntMat.getM01() * bindVY + jntMat.getM02() * bindVZ + jntMat.getM03(); tempY = jntMat.getM10() * bindVX + jntMat.getM11() * bindVY + jntMat.getM12() * bindVZ tempX = jntMat.getM00() * bindNX + jntMat.getM01() * bindNY + jntMat.getM02() * bindNZ; tempY = jntMat.getM10() * bindNX + jntMat.getM11() * bindNY + jntMat.getM12() * bindNZ; tempZ = jntMat.getM20() * bindNX + jntMat.getM21() * bindNY + jntMat.getM22() * bindNZ;
tempX = jntMat.getM00() * bindVX + jntMat.getM01() * bindVY + jntMat.getM02() * bindVZ + jntMat.getM03(); tempY = jntMat.getM10() * bindVX + jntMat.getM11() * bindVY + jntMat.getM12() * bindVZ tempX = jntMat.getM00() * bindNX + jntMat.getM01() * bindNY + jntMat.getM02() * bindNZ; tempY = jntMat.getM10() * bindNX + jntMat.getM11() * bindNY + jntMat.getM12() * bindNZ; tempZ = jntMat.getM20() * bindNX + jntMat.getM21() * bindNY + jntMat.getM22() * bindNZ;
mat4A.set(Matrix3.IDENTITY); assertTrue(1.0 == mat4A.getM00()); assertTrue(0.0 == mat4A.getM01()); assertTrue(0.0 == mat4A.getM02()); assertTrue(0.3 == mat4A.getM03());
if (getM00() != comp.getM00()) { return false; } else if (getM01() != comp.getM01()) { return false; } else if (getM02() != comp.getM02()) {
if (getM00() != comp.getM00()) { return false; } else if (getM01() != comp.getM01()) { return false; } else if (getM02() != comp.getM02()) {
mat4A.fromArray(values); assertTrue(0 == mat4A.getM00()); assertTrue(1 == mat4A.getM01()); assertTrue(2 == mat4A.getM02()); assertTrue(3 == mat4A.getM03()); mat4A.fromArray(values, false); assertTrue(0 == mat4A.getM00()); assertTrue(4 == mat4A.getM01()); assertTrue(8 == mat4A.getM02()); assertTrue(12 == mat4A.getM03());
final Matrix4 result = mat4A.multiply(mat4B, null); assertTrue(0.02 * 0.5 + 0.2 * 4 + 0.4 * 8 + 0.6 * 12 == result.getM00()); assertTrue(0.02 * 1 + 0.2 * 5 + 0.4 * 9 + 0.6 * 13 == result.getM01()); assertTrue(0.02 * 2 + 0.2 * 6 + 0.4 * 10 + 0.6 * 14 == result.getM02()); assertTrue(0.02 * 3 + 0.2 * 7 + 0.4 * 11 + 0.6 * 15 == result.getM03()); mat4A.multiplyLocal(mat4B); assertTrue(0.02 * 0.5 + 0.2 * 4 + 0.4 * 8 + 0.6 * 12 == mat4A.getM00()); assertTrue(0.02 * 1 + 0.2 * 5 + 0.4 * 9 + 0.6 * 13 == mat4A.getM01()); assertTrue(0.02 * 2 + 0.2 * 6 + 0.4 * 10 + 0.6 * 14 == mat4A.getM02()); assertTrue(0.02 * 3 + 0.2 * 7 + 0.4 * 11 + 0.6 * 15 == mat4A.getM03());
assertTrue(1 == mat4A.getM01()); assertTrue(2 == mat4A.getM02()); assertTrue(3 == mat4A.getM03()); mat4A.fromFloatBuffer(fb, false); assertTrue(0 == mat4A.getM00()); assertTrue(4 == mat4A.getM01()); assertTrue(8 == mat4A.getM02()); assertTrue(12 == mat4A.getM03()); mat4A.fromDoubleBuffer(db); assertTrue(0 == mat4A.getM00()); assertTrue(1 == mat4A.getM01()); assertTrue(2 == mat4A.getM02()); assertTrue(3 == mat4A.getM03()); mat4A.fromDoubleBuffer(db, false); assertTrue(0 == mat4A.getM00()); assertTrue(4 == mat4A.getM01()); assertTrue(8 == mat4A.getM02()); assertTrue(12 == mat4A.getM03());
assertTrue(0.1 == mat4A.getM01()); assertTrue(0.2 == mat4A.getM02()); assertTrue(0.3 == mat4A.getM03()); assertTrue(0.1 == mat4B.getM01()); assertTrue(0.2 == mat4B.getM02()); assertTrue(0.3 == mat4B.getM03()); 3.3); assertTrue(0.0 == mat4C.getM00()); assertTrue(0.1 == mat4C.getM01()); assertTrue(0.2 == mat4C.getM02()); assertTrue(0.3 == mat4C.getM03());