diff options
| author | ryderr <r@okfoc.us> | 2014-10-02 16:34:58 -0400 |
|---|---|---|
| committer | ryderr <r@okfoc.us> | 2014-10-02 16:34:58 -0400 |
| commit | e6dbfff54e2a97fbb539cab9ef9dd7945d74e0bc (patch) | |
| tree | 21544fd31147879606174b152912612aa81c7551 /public/assets/javascripts/rectangles/models/vec2.js | |
| parent | 9ff15bf5fd1d4e59a1475125f8450fb9e19817e9 (diff) | |
| parent | 286ac452b3eae8fe20c7ccf5769b583942d45dd4 (diff) | |
Merge branch 'master' of github.com:okfocus/vvalls
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 } |
