import toxi.geom.Vec3D;
public class TreeTest extends TestCase {
public void testOctree() {
PointOctree t = new PointOctree(new Vec3D(), 100);
t.setMinNodeSize(0.5f);
assertEquals(t.addPoint(new Vec3D(0, 0, 0)), true);
assertEquals(t.addPoint(new Vec3D(1, 0, 0)), true);
PointOctree leaf1 = t.getLeafForPoint(new Vec3D(0, 0, 0));
PointOctree leaf2 = t.getLeafForPoint(new Vec3D(1, 0, 0));
assertNotSame(leaf1, leaf2);
assertEquals(t.addPoint(new Vec3D(0, 100, 0)), true);
assertEquals(t.addPoint(new Vec3D(101, 0, 0)), false);
List<Vec3D> points = t.getPointsWithinSphere(new Sphere(new Vec3D(50,
0, 0), 50));