public void RayMissCube(double px, double py, double pz, double vx, double vy, double vz) { var point = pt.Point(px, py, pz); var direction = pt.Vector(vx, vy, vz); var c = new shape.Cube(); var r = new Ray(point, direction); var xs = c.Intersect(r); Assert.Empty(xs); }
public void RayIntersectCube(double px, double py, double pz, double vx, double vy, double vz, double t1, double t2) { var point = pt.Point(px, py, pz); var direction = pt.Vector(vx, vy, vz); var c = new shape.Cube(); var r = new Ray(point, direction); var xs = c.Intersect(r); Assert.Equal(2, xs.Length); Assert.Equal(t1, xs[0].T); Assert.Equal(t2, xs[1].T); }