@Override
    public double[] intersect(Ray ray) {
        // Algorithm: http://www.ray-tracing.ru/articles213.html
        
        Vector3 T = ray.getFrom().subtract(v0);
        Vector3 Q = T.crossProduct(e1);
        Vector3 P = ray.getDirection().crossProduct(e2);
        
        double pDotE1 = P.dotProduct(e1);
        
        if (pDotE1 >= MathUtils.GEOMETRY_THRESHOLD || pDotE1 <= -MathUtils.GEOMETRY_THRESHOLD) {
            double u = P.dotProduct(T) / pDotE1;
            double v = Q.dotProduct(ray.getDirection()) / pDotE1;
            
            if (u >= 0 && v >= 0 && u + v <= 1) {
                double distance = Q.dotProduct(e2) / pDotE1;
                return new double[] {distance};
            }
        }
        
        return EMPTY;
    }