/** {@inheritDoc} */ @Override public boolean containsNaN() { return super.containsNaN() || radii.containsNaN(); }
@Override public boolean isCommandValid() { if (coefficientOfFriction <= 0.0) return false; if (bodyFrameToContactFrame.containsNaN()) return false; if (contactNormalInWorldFrame.containsNaN()) return false; return true; }
/** * Tests if this plane contains {@link Double#NaN}. * * @return {@code true} if {@code point} and/or {@code normal} contains {@link Double#NaN}, * {@code false} otherwise. */ @Override public boolean containsNaN() { return point.containsNaN() || normal.containsNaN(); }
private void runSomeTestsWithPointInside(Shape3D<?> shape3d, Point3D pointInside) { // Check to make sure the point is actually inside: Point3D pointOnSurface = new Point3D(); Vector3D surfaceNormal = new Vector3D(); boolean isInside = shape3d.checkIfInside(pointInside, pointOnSurface, surfaceNormal); assertTrue(isInside); assertFalse(surfaceNormal.containsNaN()); assertFalse(pointOnSurface.containsNaN()); runSomeTestsWithPointOnSurface(shape3d, pointOnSurface, surfaceNormal); }
private void runSomeTestsWithPointOnSurface(Shape3D<?> shape3d, Point3D pointOnSurface, Vector3D surfaceNormal) if (surfaceNormal.containsNaN()) assertTrue(newNormal.containsNaN()); newProjection.set(pointOnSurface); shape3d.orthogonalProjection(newProjection);
private void runSomeTestsWithPointOutside(Shape3D<?> shape3d, Point3D pointOutside) { // Check to make sure the point is actually outside: Point3D pointOnSurface = new Point3D(); Vector3D surfaceNormal = new Vector3D(); boolean isInside = shape3d.checkIfInside(pointOutside, pointOnSurface, surfaceNormal); assertFalse(isInside); if (pointOnSurface.containsNaN()) { assertTrue(surfaceNormal.containsNaN()); pointOnSurface.set(pointOutside); shape3d.orthogonalProjection(pointOnSurface); } runSomeTestsWithPointOnSurface(shape3d, pointOnSurface, surfaceNormal); }
double errorThreshold = 1.0; if ((avgSquaredError > errorThreshold) || surfaceNormal.containsNaN())
if (surfaceNormal.containsNaN())
@Override protected void updateTwistRelativeToParent(Twist twistRelativeToParentToPack) { RigidBodyTransform transformToRoot = originalFrame.getTransformToRoot(); if (previousRotation.containsNaN() || previousTranslation.containsNaN()) { transformToRoot.get(previousRotation, previousTranslation); angularVelocity.setToZero(); linearVelocity.setToZero(); } else { transformToRoot.get(rotation, translation); rotation.multiplyConjugateOther(previousRotation); rotation.getRotationVector(angularVelocity); angularVelocity.scale(1.0 / updateDT); linearVelocity.sub(translation, previousTranslation); linearVelocity.scale(1.0 / updateDT); transformToRoot.get(previousRotation, previousTranslation); transformToRoot.inverseTransform(angularVelocity); transformToRoot.inverseTransform(linearVelocity); } twistRelativeToParentToPack.setIncludingFrame(this, getParent(), this, angularVelocity, linearVelocity); } }
if (surfaceNormal.containsNaN())