diff options
Diffstat (limited to 'assets/javascripts/rectangles/rect.js')
| -rw-r--r-- | assets/javascripts/rectangles/rect.js | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/assets/javascripts/rectangles/rect.js b/assets/javascripts/rectangles/rect.js index a539b74..5f3a211 100644 --- a/assets/javascripts/rectangles/rect.js +++ b/assets/javascripts/rectangles/rect.js @@ -180,7 +180,7 @@ window.rect = (function(){ }) return splits } - + rect.prototype.walls = function(){ var list = [], el = null @@ -192,7 +192,7 @@ window.rect = (function(){ el = wall('.face.front') el.width = width el.height = height - el.x = this.x.a + el.x = this.x.a + width/2 el.z = this.y.a list.push(el) } @@ -201,29 +201,30 @@ window.rect = (function(){ el.width = width el.height = height el.rotationY = PI + el.x = this.x.b - width/2 + el.z = this.y.b + list.push(el) + } + + if (this.sides & LEFT) { + el = wall('.face.left') + el.rotationY = -HALF_PI + el.height = height + el.width = depth el.x = this.x.a - el.z = this.y.a + depth + el.z = this.y.a + depth/2 list.push(el) } -// if (this.sides & LEFT) { -// el = wall('.face.left') -// el.rotationY = -HALF_PI -// el.height = height -// el.width = depth -// el.z = this.y.a - depth/2 -// el.x = this.x.a -// list.push(el) -// } -// if (this.sides & RIGHT) { -// el = wall('.face.right') -// el.rotationY = HALF_PI -// el.height = height -// el.width = depth -// el.z = this.y.a - depth/2 -// el.x = this.x.b -// list.push(el) -// } + if (this.sides & RIGHT) { + el = wall('.face.right') + el.rotationY = HALF_PI + el.height = height + el.width = depth + el.x = this.x.b + el.z = this.y.b - depth/2 + list.push(el) + } function wall(klass){ var el = new MX.Object3D(klass || ".face") |
