From b221034c8dd2cc49f2572aae9ba3564de814e211 Mon Sep 17 00:00:00 2001 From: Stephen McQuay Date: Tue, 7 Jan 2014 23:54:54 -0800 Subject: [PATCH] logic was right, labeling not --- collision.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collision.go b/collision.go index 2d9cee4..b042d0f 100644 --- a/collision.go +++ b/collision.go @@ -33,7 +33,7 @@ func RectIntersection(r AABB2d, p Point2d, v Vector2d) (bool, bool, Point2d) { if wall_left { return wall_left, inside, col1 } - wall_top, col2 := Intersection(p, r.A, v, Vector2d{X: r.B.X - r.A.X, Y: 0}) + wall_top, col2 := Intersection(p, r.B, v, Vector2d{X: -r.B.X + r.A.X, Y: 0}) if wall_top { return wall_top, inside, col2 } @@ -41,7 +41,7 @@ func RectIntersection(r AABB2d, p Point2d, v Vector2d) (bool, bool, Point2d) { if wall_right { return wall_right, inside, col3 } - wall_bottom, col4 := Intersection(p, r.B, v, Vector2d{X: -r.B.X + r.A.X, Y: 0}) + wall_bottom, col4 := Intersection(p, r.A, v, Vector2d{X: r.B.X - r.A.X, Y: 0}) if wall_bottom { return wall_bottom, inside, col4 }