/** Compares this vector with the other vector using MathUtils.FLOAT_ROUNDING_ERROR for fuzzy equality testing * @param other other vector to compare * @return true if vector are equal, otherwise false */ public boolean epsilonEquals (final Vector2 other) { return epsilonEquals(other, MathUtils.FLOAT_ROUNDING_ERROR); }
/** Compares this vector with the other vector using MathUtils.FLOAT_ROUNDING_ERROR for fuzzy equality testing * @param x x component of the other vector to compare * @param y y component of the other vector to compare * @return true if vector are equal, otherwise false */ public boolean epsilonEquals (float x, float y) { return epsilonEquals(x, y, MathUtils.FLOAT_ROUNDING_ERROR); }
/** Compares this vector with the other vector using MathUtils.FLOAT_ROUNDING_ERROR for fuzzy equality testing * @param other other vector to compare * @return true if vector are equal, otherwise false */ public boolean epsilonEquals (final Vector2 other) { return epsilonEquals(other, MathUtils.FLOAT_ROUNDING_ERROR); }
/** Compares this vector with the other vector using MathUtils.FLOAT_ROUNDING_ERROR for fuzzy equality testing * @param x x component of the other vector to compare * @param y y component of the other vector to compare * @return true if vector are equal, otherwise false */ public boolean epsilonEquals (float x, float y) { return epsilonEquals(x, y, MathUtils.FLOAT_ROUNDING_ERROR); }
lerping1.lerp(lerpTarget, 0.025f); if (lerping1.epsilonEquals(lerpTarget, 0.05f)) { lerpTarget.set(-1.0f + MathUtils.random(2.0f), -1.0f + MathUtils.random(2.0f)).nor(); lerping2.interpolate(lerpTarget2, MathUtils.clamp(timePassed/DURATION,0,1), interpolator); if (lerping2.epsilonEquals(lerpTarget2, 0.025f)) { lerpTarget2.set(-1.0f + MathUtils.random(2.0f), -1.0f + MathUtils.random(2.0f)).nor(); lerpStart2.set(lerping2);
/** Compares this vector with the other vector using MathUtils.FLOAT_ROUNDING_ERROR for fuzzy equality testing * @param other other vector to compare * @return true if vector are equal, otherwise false */ public boolean epsilonEquals (final Vector2 other) { return epsilonEquals(other, MathUtils.FLOAT_ROUNDING_ERROR); }
/** Compares this vector with the other vector using MathUtils.FLOAT_ROUNDING_ERROR for fuzzy equality testing * @param x x component of the other vector to compare * @param y y component of the other vector to compare * @return true if vector are equal, otherwise false */ public boolean epsilonEquals (float x, float y) { return epsilonEquals(x, y, MathUtils.FLOAT_ROUNDING_ERROR); }
@Test public void getPosition() { // Default position of dummy bodies is (1f, 0f) // Epsilon testing because of float accuracy assertTrue(SHARD_CONSTANT.getPosition().epsilonEquals(1f, 0f, 0.01f)); }
@Test public void getSpeed() { Body body = BodyUtilities.createDummyBody(); body.setLinearVelocity(1f, 2f); final Shard shard = new Shard(body, drawables); assertTrue(shard.getVelocity().epsilonEquals(1f, 2f, 0.01f)); assertTrue(SHARD_CONSTANT.getVelocity().epsilonEquals(0f, 0f, 0.01f)); }
@Override public boolean findCollision(Collision<Vector2> outputCollision, Ray<Vector2> inputRay) { if (!inputRay.start.epsilonEquals(inputRay.end, MathUtils.FLOAT_ROUNDING_ERROR)) {