예제 #1
0
  protected boolean intersect(Ray r, double rayStart, double rayEnd, double[] hit) {
    UnivariatePolynomial x = new UnivariatePolynomial(r.o.x, r.d.x);
    UnivariatePolynomial y = new UnivariatePolynomial(r.o.y, r.d.y);
    UnivariatePolynomial z = new UnivariatePolynomial(r.o.z, r.d.z);

    UnivariatePolynomial p = dcsd.coefficientCalculator.calculateCoefficients(x, y, z);
    p = p.shrink();

    hit[0] = (float) dcsd.realRootFinder.findFirstRootIn(p, rayStart, rayEnd);
    return !java.lang.Double.isNaN(hit[0]);
  }