ignore linear impulse if bodies are separating

This commit is contained in:
=
2026-03-13 00:55:01 -04:00
parent c7fd7f0d25
commit 0ff308e110
5 changed files with 81 additions and 115 deletions

View File

@@ -42,6 +42,9 @@ class PolygonalHull:
def project(self, axis: pg.Vector2) -> tuple[float, float]:
projections = [v.dot(axis) for v in self._vertices]
return (min(projections), max(projections))
def closest_vertex(self, v: pg.Vector2) -> pg.Vector2:
return min(self._vertices, key=lambda p: (v-p).length())
class BaseCollider(ABC):