Added octree and kdtree stuff to distance field