@Override public int compareTo (Attribute o) { if (type != o.type) return (int)(type - o.type); BlendingAttribute other = (BlendingAttribute)o; if (blended != other.blended) return blended ? 1 : -1; if (sourceFunction != other.sourceFunction) return sourceFunction - other.sourceFunction; if (destFunction != other.destFunction) return destFunction - other.destFunction; return (MathUtils.isEqual(opacity, other.opacity)) ? 0 : (opacity < other.opacity ? 1 : -1); } }
@Override public int compareTo (Attribute o) { if (type != o.type) return type < o.type ? -1 : 1; float otherValue = ((TestAttribute)o).value; return MathUtils.isEqual(value, otherValue) ? 0 : (value < otherValue ? -1 : 1); } }
@Override public int compareTo (Attribute o) { if (type != o.type) return (int)(type - o.type); final float v = ((FloatAttribute)o).value; return MathUtils.isEqual(value, v) ? 0 : value < v ? -1 : 1; } }
@Override public int compareTo (Attribute o) { if (type != o.type) return (int)(type - o.type); BlendingAttribute other = (BlendingAttribute)o; if (blended != other.blended) return blended ? 1 : -1; if (sourceFunction != other.sourceFunction) return sourceFunction - other.sourceFunction; if (destFunction != other.destFunction) return destFunction - other.destFunction; return (MathUtils.isEqual(opacity, other.opacity)) ? 0 : (opacity < other.opacity ? 1 : -1); } }
@Override public int compareTo (Attribute o) { if (type != o.type) return (int)(type - o.type); final float v = ((FloatAttribute)o).value; return MathUtils.isEqual(value, v) ? 0 : value < v ? -1 : 1; } }
@Override public int compareTo (Attribute o) { if (type != o.type) return (int)(type - o.type); DepthTestAttribute other = (DepthTestAttribute)o; if (depthFunc != other.depthFunc) return depthFunc - other.depthFunc; if (depthMask != other.depthMask) return depthMask ? -1 : 1; if (!MathUtils.isEqual(depthRangeNear, other.depthRangeNear)) return depthRangeNear < other.depthRangeNear ? -1 : 1; if (!MathUtils.isEqual(depthRangeFar, other.depthRangeFar)) return depthRangeFar < other.depthRangeFar ? -1 : 1; return 0; } }
@Override public int compareTo (Attribute o) { if (type != o.type) return (int)(type - o.type); DepthTestAttribute other = (DepthTestAttribute)o; if (depthFunc != other.depthFunc) return depthFunc - other.depthFunc; if (depthMask != other.depthMask) return depthMask ? -1 : 1; if (!MathUtils.isEqual(depthRangeNear, other.depthRangeNear)) return depthRangeNear < other.depthRangeNear ? -1 : 1; if (!MathUtils.isEqual(depthRangeFar, other.depthRangeFar)) return depthRangeFar < other.depthRangeFar ? -1 : 1; return 0; } }
@Override public int compareTo (Attribute o) { if (type != o.type) return type < o.type ? -1 : 1; TextureAttribute other = (TextureAttribute)o; final int c = textureDescription.compareTo(other.textureDescription); if (c != 0) return c; if (uvIndex != other.uvIndex) return uvIndex - other.uvIndex; if (!MathUtils.isEqual(scaleU, other.scaleU)) return scaleU > other.scaleU ? 1 : -1; if (!MathUtils.isEqual(scaleV, other.scaleV)) return scaleV > other.scaleV ? 1 : -1; if (!MathUtils.isEqual(offsetU, other.offsetU)) return offsetU > other.offsetU ? 1 : -1; if (!MathUtils.isEqual(offsetV, other.offsetV)) return offsetV > other.offsetV ? 1 : -1; return 0; } }
@Override public int compareTo (Attribute o) { if (type != o.type) return type < o.type ? -1 : 1; TextureAttribute other = (TextureAttribute)o; final int c = textureDescription.compareTo(other.textureDescription); if (c != 0) return c; if (uvIndex != other.uvIndex) return uvIndex - other.uvIndex; if (!MathUtils.isEqual(scaleU, other.scaleU)) return scaleU > other.scaleU ? 1 : -1; if (!MathUtils.isEqual(scaleV, other.scaleV)) return scaleV > other.scaleV ? 1 : -1; if (!MathUtils.isEqual(offsetU, other.offsetU)) return offsetU > other.offsetU ? 1 : -1; if (!MathUtils.isEqual(offsetV, other.offsetV)) return offsetV > other.offsetV ? 1 : -1; return 0; } }
public boolean equals (SpotLight other) { return (other != null && (other == this || (color.equals(other.color) && position.equals(other.position) && direction.equals(other.direction) && MathUtils.isEqual(intensity, other.intensity) && MathUtils.isEqual(cutoffAngle, other.cutoffAngle) && MathUtils.isEqual(exponent, other.exponent) ))); } }
public boolean equals (SpotLight other) { return (other != null && (other == this || (color.equals(other.color) && position.equals(other.position) && direction.equals(other.direction) && MathUtils.isEqual(intensity, other.intensity) && MathUtils.isEqual(cutoffAngle, other.cutoffAngle) && MathUtils.isEqual(exponent, other.exponent) ))); } }
/** Normalizes this quaternion to unit length * @return the quaternion for chaining */ public Quaternion nor () { float len = len2(); if (len != 0.f && !MathUtils.isEqual(len, 1f)) { len = (float)Math.sqrt(len); w /= len; x /= len; y /= len; z /= len; } return this; }
private static void checkEqual (Matrix3 matrix, float[] vals) { for (int i = 0; i < 9; i++) check(MathUtils.isEqual(matrix.val[i], vals[i], TOLERANCE), "matrices are not equal"); }
/** @return True if this matrix has any rotation or scaling, false otherwise */ public boolean hasRotationOrScaling () { return !(MathUtils.isEqual(val[M00], 1) && MathUtils.isEqual(val[M11], 1) && MathUtils.isEqual(val[M22], 1) && MathUtils.isZero(val[M01]) && MathUtils.isZero(val[M02]) && MathUtils.isZero(val[M10]) && MathUtils.isZero(val[M12]) && MathUtils.isZero(val[M20]) && MathUtils.isZero(val[M21])); } }
/** @return True if this matrix has any rotation or scaling, false otherwise */ public boolean hasRotationOrScaling () { return !(MathUtils.isEqual(val[M00], 1) && MathUtils.isEqual(val[M11], 1) && MathUtils.isEqual(val[M22], 1) && MathUtils.isZero(val[M01]) && MathUtils.isZero(val[M02]) && MathUtils.isZero(val[M10]) && MathUtils.isZero(val[M12]) && MathUtils.isZero(val[M20]) && MathUtils.isZero(val[M21])); } }
/** @return If this quaternion is an identity Quaternion */ public boolean isIdentity (final float tolerance) { return MathUtils.isZero(x, tolerance) && MathUtils.isZero(y, tolerance) && MathUtils.isZero(z, tolerance) && MathUtils.isEqual(w, 1f, tolerance); }
/** @return If this quaternion is an identity Quaternion */ public boolean isIdentity (final float tolerance) { return MathUtils.isZero(x, tolerance) && MathUtils.isZero(y, tolerance) && MathUtils.isZero(z, tolerance) && MathUtils.isEqual(w, 1f, tolerance); }
/** @return If this quaternion is an identity Quaternion */ public boolean isIdentity () { return MathUtils.isZero(x) && MathUtils.isZero(y) && MathUtils.isZero(z) && MathUtils.isEqual(w, 1f); }