'Move from sector `before` to sector `after`. A sector is a
contiguous x, y sub-region of world. Sectors are used to speed up
world rendering.'

def change_sectors(self, before, after):

    before_set = set()
    after_set = set()
    pad = 4
    for dx in xrange((- pad), (pad + 1)):
        for dy in [0]:
            for dz in xrange((- pad), (pad + 1)):
                if ((((dx ** 2) + (dy ** 2)) + (dz ** 2)) > ((pad + 1) ** 2)):
                    continue
                if before:
                    (x, y, z) = before
                    before_set.add(((x + dx), (y + dy), (z + dz)))
                if after:
                    (x, y, z) = after
                    after_set.add(((x + dx), (y + dy), (z + dz)))
    show = (after_set - before_set)
    hide = (before_set - after_set)
    for sector in show:
        self.show_sector(sector)
    for sector in hide:
        self.hide_sector(sector)
