'Checks to see if the player at the given `position` and `height`
is colliding with any blocks in the world.
Parameters
position : tuple of len 3
The (x, y, z) position to check for collisions at.
height : int or float
The height of the player.
Returns
position : tuple of len 3
The new position of the player taking into account collisions.'

def collide(self, position, height):

    pad = 0.25
    p = list(position)
    np = normalize(position)
    for face in FACES:
        for i in xrange(3):
            if (not face[i]):
                continue
            d = ((p[i] - np[i]) * face[i])
            if (d < pad):
                continue
            for dy in xrange(height):
                op = list(np)
                op[1] -= dy
                op[i] += face[i]
                if (tuple(op) not in self.model.world):
                    continue
                p[i] -= ((d - pad) * face[i])
                if ((face == (0, (-1), 0)) or (face == (0, 1, 0))):
                    self.dy = 0
                break
    return tuple(p)
