@Override
    public boolean shadow_hit(Ray ray, FloatRef tmin) {
        if (material instanceof EmissiveMaterial)
            return false;

        float t = subtract(p0, ray.getOrigin()).dot(normal) / ray.getDirection().dot(normal);

        if (t <= K_EPSILON)
            return false;

        Vector3 p = ray.pointAt(t);
        Vector3 d = subtract(p, p0);

        double ddota = d.dot(a);
        if (ddota < 0.0 || ddota > aLenSquared)
            return false;

        double ddotb = d.dot(b);
        if (ddotb < 0.0 || ddotb > bLenSquared)
            return false;

        tmin.value = t;
        return true;
    }