bc.cleanup();
}
@Test
public void testGroundSteps() {
FakeBlockCache bc = new FakeBlockCache();
// Ground using 0.5 high step blocks.
final double[] stepBounds = new double[]{0.0, 0.0, 0.0, 1.0, 0.5, 1.0};
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
// STONE = HACK (CompatBukkit block-flags problem).
bc.set(x, 65, z, Material.STONE, stepBounds);
}
}
PassableRayTracing rt = new PassableRayTracing();
rt.setBlockCache(bc);
// TODO: More Directions, also from air underneath to ground).
double[][] noCollision = new double[][] {
{1.3, 65.5, 2.43, 5.25, 65.5, 7.12},
};
TestRayTracing.runCoordinates(rt, noCollision, false, true, 3.0, true);
double[][] shouldCollide = new double[][] {
{1.3, 65.1, 2.43, 2.3, 65.1, 7.43},
{1.3, 65.0, 2.43, 2.3, 65.0, 7.43},
{1.3, 65.5, 2.43, 1.3, 65.4, 2.43},
{1.3, 65.5, 2.43, 5.25, 65.4, 7.12},
{1.3, 65.4, 2.43, 1.3, 65.4, 2.43}, // No distance.
};
TestRayTracing.runCoordinates(rt, shouldCollide, true, false, 3.0, true);
rt.cleanup();
bc.cleanup();
}