/** * @return true if this matrix equals the 3x3 identity matrix */ @Override public boolean isIdentity() { return strictEquals(Matrix3.IDENTITY); }
/** * @return true if this matrix equals the 3x3 identity matrix */ @Override public boolean isIdentity() { return strictEquals(Matrix3.IDENTITY); }
/** * @param o * the object to compare for equality * @return true if this transform and the provided transform have the exact same double values. */ @Override public boolean strictEquals(final Object o) { if (this == o) { return true; } if (!(o instanceof ReadOnlyTransform)) { return false; } final ReadOnlyTransform comp = (ReadOnlyTransform) o; return _matrix.strictEquals(comp.getMatrix()) && _scale.equals(comp.getScale()) && _translation.equals(comp.getTranslation()); }
/** * @param o * the object to compare for equality * @return true if this transform and the provided transform have the exact same double values. */ @Override public boolean strictEquals(final Object o) { if (this == o) { return true; } if (!(o instanceof ReadOnlyTransform)) { return false; } final ReadOnlyTransform comp = (ReadOnlyTransform) o; return _matrix.strictEquals(comp.getMatrix()) && _scale.equals(comp.getScale()) && _translation.equals(comp.getTranslation()); }
assertTrue(mat3.strictEquals(mat3)); assertFalse(mat3.equals(null)); assertFalse(mat3.strictEquals(null)); assertFalse(mat3.equals(new Vector2())); assertFalse(mat3.strictEquals(new Vector2())); final Matrix3 comp = new Matrix3(-1, -1, -1, -1, -1, -1, -1, -1, -1); assertFalse(mat3.equals(comp)); 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));