summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/math/line.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/math/line.ts b/src/math/line.ts
index 28a636e..2e38f81 100644
--- a/src/math/line.ts
+++ b/src/math/line.ts
@@ -111,6 +111,9 @@ export class LineSegment extends Line implements Collidable {
if (this.distancePoint(move.p1) < 0)
return false;
+ if (crossz(move.v, this.v) < 0)
+ return false;
+
const t = this.getNormal(vec2.create());
vec2.scale(t, t, -r);