Computes transformed polygon shapes from a shape according to current position and heading.
(self, poly)
| 2849 | |
| 2850 | |
| 2851 | def _polytrafo(self, poly): |
| 2852 | """Computes transformed polygon shapes from a shape |
| 2853 | according to current position and heading. |
| 2854 | """ |
| 2855 | screen = self.screen |
| 2856 | p0, p1 = self._position |
| 2857 | e0, e1 = self._orient |
| 2858 | e = Vec2D(e0, e1 * screen.yscale / screen.xscale) |
| 2859 | e0, e1 = (1.0 / abs(e)) * e |
| 2860 | return [(p0+(e1*x+e0*y)/screen.xscale, p1+(-e0*x+e1*y)/screen.yscale) |
| 2861 | for (x, y) in poly] |
| 2862 | |
| 2863 | def get_shapepoly(self): |
| 2864 | """Return the current shape polygon as tuple of coordinate pairs. |
no test coverage detected