MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / world_to_pixel

Method world_to_pixel

scenario_runner/no_rendering_mode.py:763–766  ·  view source on GitHub ↗
(self, location, offset=(0, 0))

Source from the content-addressed store, hash-verified

761 draw_traffic_signs(map_surface, yield_font_surface, ts_yield, trigger_color=COLOR_ORANGE_1)
762
763 def world_to_pixel(self, location, offset=(0, 0)):
764 x = self.scale * self._pixels_per_meter * (location.x - self._world_offset[0])
765 y = self.scale * self._pixels_per_meter * (location.y - self._world_offset[1])
766 return [int(x - offset[0]), int(y - offset[1])]
767
768 def world_to_pixel_width(self, width):
769 return int(self.scale * self._pixels_per_meter * width)

Callers 1

renderMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected