diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-08-13 02:25:00 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-08-13 02:25:00 -0400 |
| commit | da43f90115048abffd2b427761185185088b2c48 (patch) | |
| tree | 3d85be32d6db28db087208e9033b92a87194529b /public/assets/javascripts/rectangles/models | |
| parent | f837f1af0033fd351474df3beeed4818b1859e5b (diff) | |
| parent | 5d1bb038332c540d8abe459092648a7b5ddfe734 (diff) | |
merge
Diffstat (limited to 'public/assets/javascripts/rectangles/models')
4 files changed, 16 insertions, 2 deletions
diff --git a/public/assets/javascripts/rectangles/models/rect.js b/public/assets/javascripts/rectangles/models/rect.js index 58469bc..3f94740 100644 --- a/public/assets/javascripts/rectangles/models/rect.js +++ b/public/assets/javascripts/rectangles/models/rect.js @@ -39,6 +39,10 @@ Rect.prototype.clone = function(){ return new Rect( this.x.clone(), this.y.clone() ) } + Rect.prototype.assign = function(r) { + this.x.assign(r.x) + this.y.assign(r.y) + } Rect.prototype.center = function(){ return new vec2(this.x.midpoint(), this.y.midpoint()) } diff --git a/public/assets/javascripts/rectangles/models/room.js b/public/assets/javascripts/rectangles/models/room.js index c2850ba..aa18f6d 100644 --- a/public/assets/javascripts/rectangles/models/room.js +++ b/public/assets/javascripts/rectangles/models/room.js @@ -40,6 +40,14 @@ this.focused = false } + Room.prototype.copy = function(){ + return { + id: this.id, + rect: this.rect.clone(), + height: this.height, + } + } + Room.prototype.toString = function(){ return this.rect.toString() } diff --git a/public/assets/javascripts/rectangles/models/vec2.js b/public/assets/javascripts/rectangles/models/vec2.js index 104c6f7..214feb9 100644 --- a/public/assets/javascripts/rectangles/models/vec2.js +++ b/public/assets/javascripts/rectangles/models/vec2.js @@ -17,6 +17,10 @@ vec2.prototype.clone = function(){ return new vec2(this.a, this.b) } + vec2.prototype.assign = function(v){ + this.a = v.a + this.b = v.b + } vec2.prototype.abs = function(){ if (this.b < this.a) { this.invert() diff --git a/public/assets/javascripts/rectangles/models/wall.js b/public/assets/javascripts/rectangles/models/wall.js index 027d5f5..91e7c18 100644 --- a/public/assets/javascripts/rectangles/models/wall.js +++ b/public/assets/javascripts/rectangles/models/wall.js @@ -146,8 +146,6 @@ window.Wall = (function(){ if (shouldFlip) { sortedWalls = sortedWalls.reverse() } - -console.log(sortedWalls.map(function(z){return useX ? z.x : z.z}).join(" ")) var len = sortedWalls.length |
