/** * Compares {@code this} to {@code other} to determine if the two bounding boxes are geometrically * similar, i.e. the distance between their min and max points is less than or equal to * {@code epsilon}. * * @param other the bounding box to compare to. Not modified. * @param epsilon the tolerance of the comparison. * @return {@code true} if the two bounding boxes represent the same geometry, {@code false} * otherwise. */ @Override public boolean geometricallyEquals(BoundingBox3D other, double epsilon) { return minPoint.geometricallyEquals(other.minPoint, epsilon) && maxPoint.geometricallyEquals(other.maxPoint, epsilon); } }
@Override public boolean geometricallyEquals(EuclideanWaypoint other, double epsilon) { if (!position.geometricallyEquals(other.position, epsilon)) return false; if (!linearVelocity.geometricallyEquals(other.linearVelocity, epsilon)) return false; return true; }
@Override @Test public void testGeometricallyEquals() throws Exception { super.testGeometricallyEquals(); Point3D pointA; Point3D pointB; Random random = new Random(621541L); for (int i = 0; i < 100; ++i) { pointA = EuclidCoreRandomTools.nextPoint3D(random); pointB = EuclidCoreRandomTools.nextPoint3D(random); if (((Point3DReadOnly) pointA).geometricallyEquals(pointB, getEpsilon())) { assertTrue(pointA.geometricallyEquals(pointB, getEpsilon())); } else { assertFalse(pointA.geometricallyEquals(pointB, getEpsilon())); } } }
walkerShape.setRadii(walkerRadii); while (!walkerCurrentPosition.geometricallyEquals(pathEnd, 1.0e-3))
while (!walkerPosition.geometricallyEquals(goal, 1.0e-3))