_orient.setValue(0, 0, _left.getZ()); _orient.setValue(0, 1, 0); _orient.setValue(0, 2, _left.getX()); _orient.setValue(1, 0, 0); _orient.setValue(1, 1, 1); _orient.setValue(1, 2, 0); _orient.setValue(2, 0, -_left.getX()); _orient.setValue(2, 1, 0); _orient.setValue(2, 2, _left.getZ()); } else if (axis.getZ() == 1) { _left.setX(_left.getX() * invLength); _orient.setValue(0, 0, -_left.getY()); _orient.setValue(0, 1, -_left.getX()); _orient.setValue(0, 2, 0); _orient.setValue(1, 0, _left.getX()); _orient.setValue(1, 1, -_left.getY()); _orient.setValue(1, 2, 0); _orient.setValue(2, 0, 0); _orient.setValue(2, 1, 0); _orient.setValue(2, 2, 1); } else if (axis.getX() == 1) { _left.setX(0.0); _orient.setValue(0, 0, 1); _orient.setValue(0, 1, 0); _orient.setValue(0, 2, 0); _orient.setValue(1, 0, 0); _orient.setValue(1, 1, _left.getZ());
_orient.setValue(0, 0, _left.getZ()); _orient.setValue(0, 1, 0); _orient.setValue(0, 2, _left.getX()); _orient.setValue(1, 0, 0); _orient.setValue(1, 1, 1); _orient.setValue(1, 2, 0); _orient.setValue(2, 0, -_left.getX()); _orient.setValue(2, 1, 0); _orient.setValue(2, 2, _left.getZ()); } else if (axis.getZ() == 1) { _left.setX(_left.getX() * invLength); _orient.setValue(0, 0, _left.getY()); _orient.setValue(0, 1, _left.getX()); _orient.setValue(0, 2, 0); _orient.setValue(1, 0, -_left.getY()); _orient.setValue(1, 1, _left.getX()); _orient.setValue(1, 2, 0); _orient.setValue(2, 0, 0); _orient.setValue(2, 1, 0); _orient.setValue(2, 2, 1);
transMatrix.set(rotate); transMatrix.setValue(0, 0, Math.abs(transMatrix.getM00())); transMatrix.setValue(0, 1, Math.abs(transMatrix.getM01())); transMatrix.setValue(0, 2, Math.abs(transMatrix.getM02())); transMatrix.setValue(1, 0, Math.abs(transMatrix.getM10())); transMatrix.setValue(1, 1, Math.abs(transMatrix.getM11())); transMatrix.setValue(1, 2, Math.abs(transMatrix.getM12())); transMatrix.setValue(2, 0, Math.abs(transMatrix.getM20())); transMatrix.setValue(2, 1, Math.abs(transMatrix.getM21())); transMatrix.setValue(2, 2, Math.abs(transMatrix.getM22()));
transMatrix.set(rotate); transMatrix.setValue(0, 0, Math.abs(transMatrix.getM00())); transMatrix.setValue(0, 1, Math.abs(transMatrix.getM01())); transMatrix.setValue(0, 2, Math.abs(transMatrix.getM02())); transMatrix.setValue(1, 0, Math.abs(transMatrix.getM10())); transMatrix.setValue(1, 1, Math.abs(transMatrix.getM11())); transMatrix.setValue(1, 2, Math.abs(transMatrix.getM12())); transMatrix.setValue(2, 0, Math.abs(transMatrix.getM20())); transMatrix.setValue(2, 1, Math.abs(transMatrix.getM21())); transMatrix.setValue(2, 2, Math.abs(transMatrix.getM22()));
_orient.setValue(0, 0, xzp.getZ()); _orient.setValue(0, 1, xzp.getX() * -_look.getY()); _orient.setValue(0, 2, xzp.getX() * cosp); _orient.setValue(1, 0, 0); _orient.setValue(1, 1, cosp); _orient.setValue(1, 2, _look.getY()); _orient.setValue(2, 0, -xzp.getX()); _orient.setValue(2, 1, xzp.getZ() * -_look.getY()); _orient.setValue(2, 2, xzp.getZ() * cosp);
for (int i = 0; i < 9; i++) { mat3.setIdentity(); mat3.setValue(i / 3, i % 3, Double.NaN); assertFalse(Matrix3.isValid(mat3)); mat3.setIdentity(); mat3.setValue(i / 3, i % 3, Double.POSITIVE_INFINITY); assertFalse(Matrix3.isValid(mat3)); assertFalse(mat3.strictEquals(comp)); for (int i = 0; i < 8; i++) { comp.setValue(i / 3, i % 3, i); assertFalse(mat3.equals(comp)); assertFalse(mat3.strictEquals(comp));
for (int y = 0; y < 3; y++) { final double value = (10 * x + y) / 10.; mat3C.setValue(x, y, value); assertTrue(value == mat3C.getValue(x, y)); mat3C.setValue(-1, 0, 0); fail("setValue(-1, 0, 0) should have thrown IllegalArgumentException."); } catch (final IllegalArgumentException e) { mat3C.setValue(0, -1, 0); fail("setValue(0, -1, 0) should have thrown IllegalArgumentException."); } catch (final IllegalArgumentException e) { mat3C.setValue(1, 3, 0); fail("setValue(1, 3, 0) should have thrown IllegalArgumentException."); } catch (final IllegalArgumentException e) { mat3C.setValue(2, -1, 0); fail("setValue(2, -1, 0) should have thrown IllegalArgumentException."); } catch (final IllegalArgumentException e) { mat3C.setValue(3, 0, 0); fail("setValue(3, 0, 0) should have thrown IllegalArgumentException."); } catch (final IllegalArgumentException e) {
assertFalse(trans.strictEquals(comp)); for (int i = 0; i < 8; i++) { mat3.setValue(i / 3, i % 3, i); comp.setRotation(mat3); assertFalse(trans.equals(comp));