MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / _on_collision

Method _on_collision

PythonAPI/examples/manual_control.py:701–711  ·  view source on GitHub ↗
(weak_self, event)

Source from the content-addressed store, hash-verified

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# ==============================================================================

Callers 1

__init__Method · 0.45

Calls 4

get_actor_display_nameFunction · 0.70
notificationMethod · 0.45
appendMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected