summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/models/vec2.js
diff options
context:
space:
mode:
authorJulie Lala <jules@okfoc.us>2014-06-10 19:46:53 -0400
committerJulie Lala <jules@okfoc.us>2014-06-10 19:46:53 -0400
commit4e4b5b5668835097f335efaf55dfe837eec7dc3c (patch)
tree5cd6cb12a203c5dd7c8cf9f62b9cd9235e52513c /public/assets/javascripts/rectangles/models/vec2.js
parent3074488306e041718dec221ff9142748e2e68916 (diff)
parentb231af3e38b8f066f18031fd69b0fdb30a5e244a (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.js3
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)