本文整理匯總了Java中com.hackoeur.jglm.support.Compare類的典型用法代碼示例。如果您正苦於以下問題:Java Compare類的具體用法?Java Compare怎麽用?Java Compare使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Compare類屬於com.hackoeur.jglm.support包,在下文中一共展示了Compare類的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: equalsWithEpsilon
import com.hackoeur.jglm.support.Compare; //導入依賴的package包/類
@Override
public boolean equalsWithEpsilon(final Vec obj, final float epsilon) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Vec4)) {
return false;
}
Vec4 other = (Vec4) obj;
return Compare.equals(x, other.x, epsilon)
&& Compare.equals(y, other.y, epsilon)
&& Compare.equals(z, other.z, epsilon)
&& Compare.equals(w, other.w, epsilon);
}
示例2: isIdentity
import com.hackoeur.jglm.support.Compare; //導入依賴的package包/類
@Override
public boolean isIdentity() {
return Compare.equals(m00, 1f, Compare.MAT_EPSILON)
&& Compare.equals(m11, 1f, Compare.MAT_EPSILON)
&& Compare.equals(m22, 1f, Compare.MAT_EPSILON)
&& Compare.equals(m33, 1f, Compare.MAT_EPSILON)
&& Compare.equalsZero(m01)
&& Compare.equalsZero(m02)
&& Compare.equalsZero(m03)
&& Compare.equalsZero(m10)
&& Compare.equalsZero(m12)
&& Compare.equalsZero(m13)
&& Compare.equalsZero(m20)
&& Compare.equalsZero(m21)
&& Compare.equalsZero(m23)
&& Compare.equalsZero(m30)
&& Compare.equalsZero(m31)
&& Compare.equalsZero(m32);
}
示例3: isZero
import com.hackoeur.jglm.support.Compare; //導入依賴的package包/類
@Override
public boolean isZero() {
return Compare.equalsZero(m00)
&& Compare.equalsZero(m01)
&& Compare.equalsZero(m02)
&& Compare.equalsZero(m03)
&& Compare.equalsZero(m10)
&& Compare.equalsZero(m11)
&& Compare.equalsZero(m12)
&& Compare.equalsZero(m13)
&& Compare.equalsZero(m20)
&& Compare.equalsZero(m21)
&& Compare.equalsZero(m22)
&& Compare.equalsZero(m23)
&& Compare.equalsZero(m30)
&& Compare.equalsZero(m31)
&& Compare.equalsZero(m32)
&& Compare.equalsZero(m33);
}
示例4: equalsWithEpsilon
import com.hackoeur.jglm.support.Compare; //導入依賴的package包/類
@Override
public boolean equalsWithEpsilon(final Vec obj, final float epsilon) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Vec3)) {
return false;
}
final Vec3 other = (Vec3) obj;
return Compare.equals(x, other.x, epsilon)
&& Compare.equals(y, other.y, epsilon)
&& Compare.equals(z, other.z, epsilon);
}
示例5: equalsWithEpsilon
import com.hackoeur.jglm.support.Compare; //導入依賴的package包/類
@Override
public boolean equalsWithEpsilon(final Mat obj, final float epsilon) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Mat4)) {
return false;
}
final Mat4 other = (Mat4) obj;
return Compare.equals(m00, other.m00, epsilon)
&& Compare.equals(m01, other.m01, epsilon)
&& Compare.equals(m02, other.m02, epsilon)
&& Compare.equals(m03, other.m03, epsilon)
&& Compare.equals(m10, other.m10, epsilon)
&& Compare.equals(m11, other.m11, epsilon)
&& Compare.equals(m12, other.m12, epsilon)
&& Compare.equals(m13, other.m13, epsilon)
&& Compare.equals(m20, other.m20, epsilon)
&& Compare.equals(m21, other.m21, epsilon)
&& Compare.equals(m22, other.m22, epsilon)
&& Compare.equals(m23, other.m23, epsilon)
&& Compare.equals(m30, other.m30, epsilon)
&& Compare.equals(m31, other.m31, epsilon)
&& Compare.equals(m32, other.m32, epsilon)
&& Compare.equals(m33, other.m33, epsilon);
}
示例6: isIdentity
import com.hackoeur.jglm.support.Compare; //導入依賴的package包/類
@Override
public boolean isIdentity() {
return Compare.equals(m00, 1f, Compare.MAT_EPSILON)
&& Compare.equals(m11, 1f, Compare.MAT_EPSILON)
&& Compare.equals(m22, 1f, Compare.MAT_EPSILON)
&& Compare.equalsZero(m01)
&& Compare.equalsZero(m02)
&& Compare.equalsZero(m10)
&& Compare.equalsZero(m12)
&& Compare.equalsZero(m20)
&& Compare.equalsZero(m21);
}
示例7: isZero
import com.hackoeur.jglm.support.Compare; //導入依賴的package包/類
@Override
public boolean isZero() {
return Compare.equalsZero(m00)
&& Compare.equalsZero(m01)
&& Compare.equalsZero(m02)
&& Compare.equalsZero(m10)
&& Compare.equalsZero(m11)
&& Compare.equalsZero(m12)
&& Compare.equalsZero(m20)
&& Compare.equalsZero(m21)
&& Compare.equalsZero(m22);
}
示例8: equalsWithEpsilon
import com.hackoeur.jglm.support.Compare; //導入依賴的package包/類
@Override
public boolean equalsWithEpsilon(final Mat obj, final float epsilon) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Mat3)) {
return false;
}
final Mat3 other = (Mat3) obj;
return Compare.equals(m00, other.m00, epsilon)
&& Compare.equals(m01, other.m01, epsilon)
&& Compare.equals(m02, other.m02, epsilon)
&& Compare.equals(m10, other.m10, epsilon)
&& Compare.equals(m11, other.m11, epsilon)
&& Compare.equals(m12, other.m12, epsilon)
&& Compare.equals(m20, other.m20, epsilon)
&& Compare.equals(m21, other.m21, epsilon)
&& Compare.equals(m22, other.m22, epsilon);
}
示例9: testGetUnitVector
import com.hackoeur.jglm.support.Compare; //導入依賴的package包/類
@Test
public void testGetUnitVector() {
final Vec3 vec1 = new Vec3(1f, 2f, 3f);
final Vec3 norm1 = vec1.getUnitVector();
Assert.assertEquals(0.267261f, norm1.getX(), JglmTesting.DEFAULT_EQUALS_TOL);
Assert.assertEquals(0.534522f, norm1.getY(), JglmTesting.DEFAULT_EQUALS_TOL);
Assert.assertEquals(0.801784f, norm1.getZ(), JglmTesting.DEFAULT_EQUALS_TOL);
final Vec3 vec2 = new Vec3(-2652735904120045568f, 1379645337739722752f, 1107497449448013824f);
final Vec3 norm2 = vec2.getUnitVector();
Assert.assertTrue(Precision.equals(norm2.getLength(), 1f, Compare.VEC_EPSILON));
Assert.assertEquals(-0.831951, norm2.getX(), JglmTesting.DEFAULT_EQUALS_TOL);
Assert.assertEquals(0.432685, norm2.getY(), JglmTesting.DEFAULT_EQUALS_TOL);
Assert.assertEquals(0.347334, norm2.getZ(), JglmTesting.DEFAULT_EQUALS_TOL);
}
示例10: equalsWithEpsilon
import com.hackoeur.jglm.support.Compare; //導入依賴的package包/類
@Override
public boolean equalsWithEpsilon(final Vec obj) {
return equalsWithEpsilon(obj, Compare.VEC_EPSILON);
}
示例11: equalsWithEpsilon
import com.hackoeur.jglm.support.Compare; //導入依賴的package包/類
@Override
public boolean equalsWithEpsilon(final Mat obj) {
return equalsWithEpsilon(obj, Compare.MAT_EPSILON);
}
示例12: assertFloatsEqualDefaultTol
import com.hackoeur.jglm.support.Compare; //導入依賴的package包/類
public static void assertFloatsEqualDefaultTol(final float expected, final float actual) {
Assert.assertTrue("Expected <" + expected + "> but got <" + actual + ">", Compare.equals(expected, actual, DEFAULT_EQUALS_TOL));
}