@Test
public void testThroughOneBlock() {
FakeBlockCache bc = new FakeBlockCache();
bc.set(0, 0, 0, Material.STONE);
PassableRayTracing rt = new PassableRayTracing();
rt.setBlockCache(bc);
double[][] setups = new double[][] {
// Through the middle of the block.
{0.5, 0.5, -0.5, 0.5, 0.5, 1.5},
{-0.5, 0.5, 0.5, 1.5, 0.5, 0.5},
{0.5, -0.5, 0.5, 0.5, 1.5, 0.5},
// Along the edges.
{0.5, 0.0, -0.5, 0.5, 0.0, 1.5},
{-0.5, 0.0, 0.5, 1.5, 0.0, 0.5},
// Exactly diagonal.
{-0.5, -0.5, -0.5, 1.5, 1.5, 1.5}, // 3d
{-0.5, 0.0, -0.5, 1.5, 0.0, 1.5}, // 2d
// Through a corner.
{1.2, 0.5, 0.5, 0.5, 0.5, 1.2},
// TODO: More of each and other... + generic set-ups?
};
TestRayTracing.runCoordinates(rt, setups, true, false, 3.0, true);
rt.cleanup();
bc.cleanup();
}