CCRay3 extends CCLine3Base { public double distanceSquared(final CCVector3 thePoint, final CCVector3 theStore) { final CCVector3 vectorA = new CCVector3(); vectorA.set(thePoint).subtractLocal(_myOrigin); final double t0 = _myDirection.dot(vectorA); if (t0 > 0) { vectorA.set(_myDirection).multiplyLocal(t0); vectorA.addLocal(_myOrigin); } else { vectorA.set(_myOrigin); } if (theStore != null) { theStore.set(vectorA); } thePoint.subtract(vectorA, vectorA); final double lSQ = vectorA.lengthSquared(); return lSQ; } CCRay3();  CCRay3(final CCRay3 theSource);  CCRay3(final CCVector3 theOrigin, final CCVector3 theDirection); static CCRay3 createFromLine(CCVector3 theStart, CCVector3 theEnd); CCRay3 set(final CCRay3 theSource); double getDistanceToPrimitive(final CCVector3[] theWorldVertices); boolean intersects(final CCVector3[] thePolygonVertices, final CCVector3 theLocationStore); boolean intersectsTriangle(
		final CCVector3 theA, 
		final CCVector3 theB, 
		final CCVector3 theC, 
		final CCVector3 theLocationStore
	); boolean intersectsTrianglePlanar(
		final CCVector3 pointA, 
		final CCVector3 pointB, 
		final CCVector3 pointC,
		final CCVector3 locationStore
	); boolean intersectsQuad(
		final CCVector3 theA, 
		final CCVector3 theB, 
		final CCVector3 theC, 
		final CCVector3 theD,
		final CCVector3 theLocationStore
	); boolean intersectsQuadPlanar(
		final CCVector3 theA, 
		final CCVector3 theB, 
		final CCVector3 theC, 
		final CCVector3 theD,
		final CCVector3 theLocationStore
	); CCVector3 intersectsPlane(final CCPlane thePlane, CCVector3 theLocationStore); CCVector3 intersectsPlane(final CCPlane thePlane); double distanceSquared(final CCVector3 thePoint, final CCVector3 theStore); static boolean isValid(final CCRay3 theRay); @Override String toString(); @Override boolean equals(final Object theObject); @Override CCRay3 clone();  }
@Test public void testDistance() { final CCRay3 ray1 = new CCRay3(); assertTrue(25.0 == ray1.distanceSquared(new CCVector3(0, 5, 3), null)); final CCVector3 store = new CCVector3(); assertTrue(9.0 == ray1.distanceSquared(new CCVector3(0, 3, 3), store)); assertEquals(new CCVector3(0, 0, 3), store); assertTrue(18.0 == ray1.distanceSquared(new CCVector3(0, 3, -3), store)); assertEquals(new CCVector3(0, 0, 0), store); }