diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-04-27 20:47:41 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-04-27 21:17:48 -0400 |
| commit | 53695472cfb20b730d04b2d6a6a16c6d281e9180 (patch) | |
| tree | f257932e5219e59bdd3885e360dc03fb3507bb42 /public/assets/javascripts/rectangles/models/vec3.js | |
| parent | 90b0e89b4dabf67035ae4bccdb02c52da4e31ab1 (diff) | |
outline box
Diffstat (limited to 'public/assets/javascripts/rectangles/models/vec3.js')
| -rw-r--r-- | public/assets/javascripts/rectangles/models/vec3.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/public/assets/javascripts/rectangles/models/vec3.js b/public/assets/javascripts/rectangles/models/vec3.js index 97329ed..b3825a9 100644 --- a/public/assets/javascripts/rectangles/models/vec3.js +++ b/public/assets/javascripts/rectangles/models/vec3.js @@ -39,5 +39,21 @@ vec3.prototype.serialize = function(){ vec3.prototype.deserialize = function(data){ this.a = data[0] this.b = data[1] - this.c = data[2] + this.c = data[2] || data[0] + return this +} +vec3.prototype.clone = function(){ + return new vec3(this.a, this.b, this.c) +} +vec3.prototype.assign = function(v){ + this.a = v.a + this.b = v.b + this.c = v.c + return this +} +vec3.prototype.mul = function(n) { + this.a *= n + this.b *= n + this.c *= n + return this }
\ No newline at end of file |
