From 615e285aba96554d0e29063d7491645810cb08b8 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 19 Jun 2014 16:01:25 -0400 Subject: serialize/deserialize scenery --- public/assets/javascripts/rectangles/models/room.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'public/assets/javascripts/rectangles/models/room.js') diff --git a/public/assets/javascripts/rectangles/models/room.js b/public/assets/javascripts/rectangles/models/room.js index d0478b3..61a7447 100644 --- a/public/assets/javascripts/rectangles/models/room.js +++ b/public/assets/javascripts/rectangles/models/room.js @@ -87,6 +87,12 @@ window.Room = (function(){ els.sort(compare_z) } + // wall holds state for the last wall we created/saw.. + // right now we keep walls subdivided where there are half-walls to simplify + // calculations involving placing media on walls, calculating wall boundaries, etc.. + // one consequence of this is we can't place things on the walls above "doorways". + // in the future, we should have more robust placement algorithm, which takes + // this into account, and only use one wall "object" per plane var wall els.forEach(function(el){ @@ -116,6 +122,7 @@ window.Room = (function(){ function new_wall (el) { return new Wall ({ + id: base.id + "_" + (el.side | el.half_side) + "_" + walls.length, room: base.id, side: el.side | el.half_side, half_side: el.half_side, -- cgit v1.2.3-70-g09d2