(weak_self, event)
| 699 | |
| 700 | @staticmethod |
| 701 | def _on_collision(weak_self, event): |
| 702 | self = weak_self() |
| 703 | if not self: |
| 704 | return |
| 705 | actor_type = get_actor_display_name(event.other_actor) |
| 706 | self.hud.notification('Collision with %r' % actor_type) |
| 707 | impulse = event.normal_impulse |
| 708 | intensity = math.sqrt(impulse.x**2 + impulse.y**2 + impulse.z**2) |
| 709 | self.history.append((event.frame, intensity)) |
| 710 | if len(self.history) > 4000: |
| 711 | self.history.pop(0) |
| 712 | |
| 713 | |
| 714 | # ============================================================================== |
no test coverage detected