public void focusCameraAtTiles(List<TileCoord> positions) {

        if (positions.isEmpty()) return;

        // Create cuboid enclosing all tiles
        Cuboid6 bounds = new Cuboid6();

        Iterator<TileCoord> it = positions.iterator();
        TileCoord first = it.next();
        bounds.set(first.x, first.y, first.z, first.x+1, first.y+1, first.z+1);
        while (it.hasNext()) {
            TileCoord next = it.next();
            bounds.enclose(next.x, next.y, next.z, next.x+1, next.y+1, next.z+1);
        }
        bounds.expand(1.0); // Expand by 1 tile in all directions

        // X and Z will be at midpoints
        double midX = (bounds.min.x + bounds.max.x) / 2D;
        double midZ = (bounds.min.z + bounds.max.z) / 2D;

        // Y will be far enough away to enclose all tiles inside FOV
        double dist = distanceToEncloseRect(bounds.max.x - bounds.min.x, bounds.max.z - bounds.min.z);

        // Set camera position
        cameraZoomAnimator.moveToTargetWithDuration(new Vector3(midX, dist, midZ), FOCUS_ANIMATION_TIME_MS);
    }
Apply a camera delta based on NDC delta
@param delta Amount to pan camera in frame NDC units
fabrication/src/main/java/mrtjp/projectred/fabrication/gui/ICRenderNode.java