generic octree for fast neighbor lookup in three dimensions