/** * Returns the angle in radians between this vector and the vector * parameter; the return value is constrained to the range [0,PI]. * @param v1 the other vector * @return the angle in radians in the range [0,PI] */ public final float angle(Vector3f v1) { double vDot = this.dot(v1) / ( this.length()*v1.length() ); if( vDot < -1.0) vDot = -1.0; if( vDot > 1.0) vDot = 1.0; return((float) (Math.acos( vDot ))); }
public static void assertTuple3fEquals(String message, Tuple3f expected, Tuple3f actual, float delta) { boolean areEqual = expected.epsilonEquals(actual, delta); if (message.equals("")) { message = "Tuple3ds are not Equal!"; } if (!areEqual) { Vector3f difference = new Vector3f(actual); difference.sub(expected); fail(message + " Expected = " + expected + ", actual = " + actual + ". norm of difference = " + difference.length()); } }
/** * @param newPoint * @param lastPoint * @return */ public static boolean distanceCheck(Vector3f newPoint, Vector3f lastPoint) { Vector3f temp = new Vector3f(); temp.sub(newPoint, lastPoint); if (temp.length() > AppSettings.getMinDistance()) { return true; } return false; } }
Point3f xyd = transform(v); double deltaLength = Math.max(EPSILON, fvd.length());
distance.sub(new Vector3f(mLastFramePosition[0], mLastFramePosition[1], mLastFramePosition[2])); if (distance.length() > 0.15) { bTouchDown.set(false);
delta.add(p1); double deltaLength = Math.max(EPSILON, delta.length());
delta.add(p1); double deltaLength = Math.max(EPSILON, delta.length());
public static MeshDataHolder Line(float x0, float y0, float z0, float x1, float y1, float z1, float width) float lineLength = lineDirection.length(); lineDirection.scale(1.0f / lineLength); MeshDataHolder line = Cube(width, width, lineLength, false, null);