public Vector getRayIntersection(Edge ray) {
		double closestDistance = Double.MAX_VALUE;
		Vector closest = null;
		double distance;
		List<Vector> intersections;
		Polygon polygon = new Polygon(new Vector(0, 0), new Vector(Tile.SIZE, 0), new Vector(Tile.SIZE, Tile.SIZE), new Vector(0, Tile.SIZE));
		for(int i = 0; i < sizeX; i++) {
			for(int j = 0; j < sizeY; j++) {
				if(getTile(i, j).visible) {
					polygon.translate(new Vector(i * Tile.SIZE, j * Tile.SIZE));
					intersections = polygon.getRayCollisions(ray);
					if(intersections != null) {
						for(Vector vector : intersections) {
							distance = ray.start.getDistance(vector);
							if(distance < closestDistance) {
								closestDistance = distance;
								closest = vector;
							}
						}
					}
					polygon.translate(new Vector(-i * Tile.SIZE, -j * Tile.SIZE));
				}
			}
		}
		return closest;
	}