Use a kdtree instead of octree for nearest neighbor search.