def display(
        cls,
        object: history_object,
        surface,
        color,
        heading,
        label: bool = False,
        draw_contour=False,
        contour_width=1
    ) -> None:
        """
        Display a vehicle on a pygame surface.

        The vehicle is represented as a colored rotated rectangle.

        :param object: the vehicle to be drawn
        :param surface: the surface to draw the vehicle on
        :param label: whether a text label should be rendered
        """
        if not surface.is_visible(object.position):
            return
        w = surface.pix(object.WIDTH)
        h = surface.pix(object.LENGTH)
        position = [*surface.pos2pix(object.position[0], object.position[1])]
        # As the following rotate code is for left-handed coordinates,
        # so we plus -1 before the heading to adapt it to right-handed coordinates
        angle = -np.rad2deg(heading)
        box = [pygame.math.Vector2(p) for p in [(-h / 2, -w / 2), (-h / 2, w / 2), (h / 2, w / 2), (h / 2, -w / 2)]]
        box_rotate = [p.rotate(angle) + position for p in box]

        pygame.draw.polygon(surface, color, box_rotate)
        if draw_contour and pygame.ver.startswith("2"):
            pygame.draw.polygon(surface, cls.BLACK, box_rotate, width=contour_width)  # , 1)

        # Label
        if label:
            if cls.font is None:
                cls.font = pygame.font.Font(None, 15)
            text = "#{}".format(id(object) % 1000)
            text = cls.font.render(text, 1, (10, 10, 10), (255, 255, 255))
            surface.blit(text, position)

        Display a vehicle on a pygame surface.

        The vehicle is represented as a colored rotated rectangle.

        :param object: the vehicle to be drawn
        :param surface: the surface to draw the vehicle on
        :param label: whether a text label should be rendered
        
metadrive/obs/top_down_obs_impl.py