本文整理汇总了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));
}