def get_mtv(self):
        pos = self.pos + self.vec
        pos = collision.uncenter_position(pos, self.col.bbox)
        q = collections.deque((Vector3(),))
        while q:
            current_vector = q.popleft()
            transform_vectors = self.col.check_collision(pos, current_vector)
            if not all(transform_vectors):
                break
            for vector in transform_vectors:
                test_vec = self.vec + current_vector + vector
                if test_vec.dist_sq() <= self.vec.dist_sq() + FP_MAGIC:
                    q.append(current_vector + vector)
        else:
            logger.debug('Physics failed to generate an MTV, bailing out')
            self.vec.zero()
            return Vector3()
        possible_mtv = [current_vector]
        while q:
            current_vector = q.popleft()
            transform_vectors = self.col.check_collision(pos, current_vector)
            if not all(transform_vectors):
                possible_mtv.append(current_vector)
        return min(possible_mtv)
dataset/ETHPy150Open SpockBotMC/SpockBot/spockbot/plugins/helpers/physics.py/PhysicsPlugin.get_mtv/original