diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-10-02 16:18:12 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-10-02 16:18:12 -0400 |
| commit | f7c36f7a3394caa90937c5687f3ac7aeeed82e82 (patch) | |
| tree | d155f036dff980abc5af7161517842a51887e1ac /public/assets/javascripts/rectangles/models/vec2.js | |
| parent | 55639122a00e77aaca1c6ac2faa5bc9f61ce7124 (diff) | |
add media closer to where you clicked
Diffstat (limited to 'public/assets/javascripts/rectangles/models/vec2.js')
| -rw-r--r-- | public/assets/javascripts/rectangles/models/vec2.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/public/assets/javascripts/rectangles/models/vec2.js b/public/assets/javascripts/rectangles/models/vec2.js index a5a832e..49613c3 100644 --- a/public/assets/javascripts/rectangles/models/vec2.js +++ b/public/assets/javascripts/rectangles/models/vec2.js @@ -63,6 +63,16 @@ this.b /= n return this } + vec2.prototype.addVec = function(v){ + this.a += v.a + this.b += v.b + return this + } + vec2.prototype.subVec = function(v){ + this.a -= v.a + this.b -= v.b + return this + } vec2.prototype.zero = function(){ this.a = this.b = 0 } |
