code: public static RayTraceResult getClosestHit(RayTraceResult.Type hitType, Point src, RayTraceResult result1, RayTraceResult result2)
  	{
  		if (result1 == null)
  			return result2;
  		if (result2 == null)
  			return result1;
  
  		if (result1.typeOfHit == RayTraceResult.Type.MISS && result2.typeOfHit == hitType)
  			return result2;
  		if (result1.typeOfHit == hitType && result2.typeOfHit == RayTraceResult.Type.MISS)
  			return result1;
  
  		if (Point.distanceSquared(src, new Point(result1.hitVec)) > Point.distanceSquared(src, new Point(result2.hitVec)))
  			return result2;
  		return result1;
  	}
docs: Gets the closest {@link RayTraceResult} to the source.
  
  @param src the src
  @param result1 the mop1
  @param result2 the mop2
  @return the closest