Gets the bounding box corners of an actor in world space
(actor)
| 174 | |
| 175 | @staticmethod |
| 176 | def get_bounding_box(actor): |
| 177 | """Gets the bounding box corners of an actor in world space""" |
| 178 | bb = actor.trigger_volume.extent |
| 179 | corners = [carla.Location(x=-bb.x, y=-bb.y), |
| 180 | carla.Location(x=bb.x, y=-bb.y), |
| 181 | carla.Location(x=bb.x, y=bb.y), |
| 182 | carla.Location(x=-bb.x, y=bb.y), |
| 183 | carla.Location(x=-bb.x, y=-bb.y)] |
| 184 | corners = [x + actor.trigger_volume.location for x in corners] |
| 185 | t = actor.get_transform() |
| 186 | t.transform(corners) |
| 187 | return corners |
| 188 | |
| 189 | # ============================================================================== |
| 190 | # -- FadingText ---------------------------------------------------------------- |
no test coverage detected