Computes transformed polygon shapes from a shape according to current position and heading.
(self, poly)
| 3068 | |
| 3069 | |
| 3070 | def _polytrafo(self, poly): |
| 3071 | """Computes transformed polygon shapes from a shape |
| 3072 | according to current position and heading. |
| 3073 | """ |
| 3074 | screen = self.screen |
| 3075 | p0, p1 = self._position |
| 3076 | e0, e1 = self._orient |
| 3077 | e = Vec2D(e0, e1 * screen.yscale / screen.xscale) |
| 3078 | e0, e1 = (1.0 / abs(e)) * e |
| 3079 | return [(p0+(e1*x+e0*y)/screen.xscale, p1+(-e0*x+e1*y)/screen.yscale) |
| 3080 | for (x, y) in poly] |
| 3081 | |
| 3082 | def get_shapepoly(self): |
| 3083 | """Return the current shape polygon as tuple of coordinate pairs. |
no test coverage detected