diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-06-10 16:34:52 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-06-10 16:52:14 -0400 |
| commit | 08421d8921fcc9842ea70d2e5c6439d1154e6d73 (patch) | |
| tree | 4d6d9059f912aa5c6ba931383e3f55051bce3c18 /public/assets/javascripts/rectangles/models/vec2.js | |
| parent | a5ba8d536afe5c96c6e01763296de2a407f81aa8 (diff) | |
serialization functions
Diffstat (limited to 'public/assets/javascripts/rectangles/models/vec2.js')
| -rw-r--r-- | public/assets/javascripts/rectangles/models/vec2.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/public/assets/javascripts/rectangles/models/vec2.js b/public/assets/javascripts/rectangles/models/vec2.js index 9b0447c..e56a010 100644 --- a/public/assets/javascripts/rectangles/models/vec2.js +++ b/public/assets/javascripts/rectangles/models/vec2.js @@ -91,6 +91,9 @@ vec2.prototype.intersection = function(v){ vec2.prototype.toString = function(){ return "[" + ~~this.a + " " + ~~this.b + "]" } +vec2.prototype.serialize = function(){ + return [ ~~this.a, ~~this.b ] +} vec2.prototype.quantize = function(n){ n = n || 10 this.a = quantize(this.a, n) |
