From 3412cc42a9fa5e42d47073a2fa05a39712ad40f7 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 16 Apr 2014 15:08:44 -0400 Subject: layer of indirection for rooms --- assets/javascripts/rectangles/rect.js | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'assets/javascripts/rectangles/rect.js') diff --git a/assets/javascripts/rectangles/rect.js b/assets/javascripts/rectangles/rect.js index 1d402cd..50debbc 100644 --- a/assets/javascripts/rectangles/rect.js +++ b/assets/javascripts/rectangles/rect.js @@ -16,8 +16,6 @@ window.rect = (function(){ } this.translation = new vec2(0,0) this.sides = FRONT | BACK | LEFT | RIGHT - this.focused = false - this.id = 0 } rect.prototype.clone = function(){ return new rect( this.x.clone(), this.y.clone() ) @@ -48,35 +46,13 @@ window.rect = (function(){ if (this.sides & BACK) sides += "back " if (this.sides & LEFT) sides += "left " if (this.sides & RIGHT) sides += "right " - var s = this.id + " " + "[" + this.x.toString() + " " + this.y.toString() + "] " + sides - if (this.focused) return "" + s + "" + var s = "[" + this.x.toString() + " " + this.y.toString() + "] " + sides return s } rect.prototype.quantize = function(n){ this.x.quantize(n) this.y.quantize(n) } - rect.prototype.reset = function(){ - var copy = this.clone() - copy.sides = FRONT | BACK | LEFT | RIGHT - copy.focused = this.focused - copy.id = this.id - this.regions = [ copy ] - } - rect.prototype.clipTo = function(r){ - // for each of this rect's regions split the region if necessary - var regions = this.regions - var splits - - for (var i = 0, len = regions.length; i < len; i++) { - if (regions[i] && regions[i].intersects(r)) { - splits = regions[i].split(r) - regions = regions.concat(splits) - regions[i] = null - } - } - this.regions = regions - } rect.prototype.split = function(r){ var rz = this var splits = [] -- cgit v1.2.3-70-g09d2