예제 #1
0
def test_inside_box(ray_inside_box, unit_box):
    hit, tmin, tmax = ray_box_intersect(ray_inside_box, unit_box)

    assert hit
    assert tmin < 0
    assert tmax > 0
예제 #2
0
def test_should_hit(ray_that_hits, unit_box):
    hit, tmin, tmax = ray_box_intersect(ray_that_hits, unit_box)

    assert hit
    assert tmin > 0
    assert tmax > tmin
예제 #3
0
def test_should_miss(ray_that_misses, unit_box):
    hit, tmin, tmax = ray_box_intersect(ray_that_misses, unit_box)

    assert not hit
    assert tmin == 0
    assert tmax == 0