@Override public ResultSample doTransformMultTest(final int count, final int maxCount, final long timeOutMS) { final ReadOnlyMatrix4 m1 = new Matrix4().fromAngleAxis(MathUtils.nextRandomDouble(), new Vector3(MathUtils.nextRandomDouble(), MathUtils.nextRandomDouble(), MathUtils.nextRandomDouble())); final ReadOnlyMatrix4 m2 = new Matrix4().fromAngleAxis(MathUtils.nextRandomDouble(), new Vector3(MathUtils.nextRandomDouble(), MathUtils.nextRandomDouble(), MathUtils.nextRandomDouble())); final Transform a = new Transform().fromHomogeneousMatrix(m1); final Transform b = new Transform(); final Transform by = new Transform().fromHomogeneousMatrix(m2); final long start = System.currentTimeMillis(); int loopCount = 0; while (System.currentTimeMillis() - start < timeOutMS && loopCount != maxCount) { ++loopCount; for (int i = 0; i < count; ++i) { if (i % 2 == 0) { a.multiply(by, b); } else { b.multiply(by, a); } } } return populateResult(System.currentTimeMillis() - start, loopCount, a.getHomogeneousMatrix(null).toArray(null)); }
temp.getHomogeneousMatrix(_matrixPalette[index]);
temp.getHomogeneousMatrix(_matrixPalette[index]);
trans.setTranslation(5, 10, 15); final Matrix4 mat4 = trans.getHomogeneousMatrix(null); assertEquals(new Matrix4( // 2 * Math.cos(a), 2 * 0, 2 * Math.sin(a), 5, // trans2.getHomogeneousMatrix(mat4); assertEquals(new Matrix4( // 2 * Math.cos(a), 2 * 0, 2 * Math.sin(a), 5, // trans.setRotation(new Matrix3(0, 1, 2, 3, 4, 5, 6, 7, 8)); trans.setTranslation(10, 11, 12); trans.getHomogeneousMatrix(mat4); assertEquals(new Matrix4( // 0, 1, 2, 10, //