@Override
    public boolean shadow_hit(Ray ray, FloatRef tmin) {
        float ox = ray.getOrigin().getX();
        float oy = ray.getOrigin().getY();
        float oz = ray.getOrigin().getZ();
        float dx = ray.getDirection().getX();
        float dy = ray.getDirection().getY();
        float dz = ray.getDirection().getZ();

        float a = dx * dx + dz * dz;
        float b = 2.0f * (ox * dx + oz * dz);
        float c = ox * ox + oz * oz - radius * radius;
        float disc = b * b - 4.0f * a * c;

        if (disc < 0.0)
            return false;

        float e = (float) sqrt(disc);
        float denom = 2.0f * a;
        float t = (-b - e) / denom;    // smaller root

        if (t > K_EPSILON) {
            double yhit = oy + t * dy;

            if (yhit > y0 && yhit < y1) {
                tmin.value = t;
                return true;
            }
        }

        t = (-b + e) / denom;    // bigger root
        if (t > K_EPSILON) {
            double yhit = oy + t * dy;
            if (yhit > y0 && yhit < y1) {
                tmin.value = t;
                return true;
            }
        }

        return false;
    }