diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-04-11 15:20:35 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-04-11 15:20:35 -0400 |
| commit | 4da6259061060a43fe76f89fa908935536e2b666 (patch) | |
| tree | 1e531345e104524b582dd1cafc1af49bd4a00afd /vec2.js | |
| parent | 94e4d463e8b485ddcd45168b4601b9b609f5f21f (diff) | |
AABB intersection, handling most cases
Diffstat (limited to 'vec2.js')
| -rw-r--r-- | vec2.js | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -43,7 +43,7 @@ vec2.prototype.contains = function(n){ } // assumes (vec2)v falls to the right of (vec2)this vec2.prototype.intersects = function(v){ - return (this.b > v.a) || (v.b > this.a) + return (this.b > v.a && this.b < v.b) || (v.b > this.a && v.b < this.b) } vec2.prototype.union = function(v){ if (this.intersects(v)) { |
