diff --git a/js/cells/DMACell.js b/js/cells/DMACell.js index 7ab6ea12be92629714b6533c30a3ccee495a1c44..9c7cf0ad74e1e5cc50863569474ddebe8176960a 100644 --- a/js/cells/DMACell.js +++ b/js/cells/DMACell.js @@ -276,7 +276,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals'], //subcomponents - DMACell.prototype._initParts = function(){ + DMACell.prototype._initParts = function(callback){ return [];//override in subclasses }; diff --git a/js/cells/GIKCell.js b/js/cells/GIKCell.js index 2c8bf84e67fffa6bd5ab47e2507e2e9a0f1b1dd5..13af33755971627d967f5b534cb6ce31c7e7c14a 100644 --- a/js/cells/GIKCell.js +++ b/js/cells/GIKCell.js @@ -31,16 +31,12 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cubeCell'], if (lattice.get("partType") == "lego") { require(['gikPart'], function(GIKPart){ - for (var i=0;i<length;i++){ - parts.push(new GIKPart(i, self)); - } + parts.push(new GIKPart(self.index.x, self)); callback(parts); }); } else { require(['gikPartLowPoly'], function(GIKPartLowPoly){ - for (var i=0;i<length;i++){ - parts.push(new GIKPartLowPoly(i, self)); - } + parts.push(new GIKPartLowPoly(self.index.x, self)); callback(parts); }); } diff --git a/js/parts/DMAPart.js b/js/parts/DMAPart.js index 35f559618b70092c18fdb628f9caa0ec80400277..2d18f5f1564d91a292915833e2941976dd8fd80f 100644 --- a/js/parts/DMAPart.js +++ b/js/parts/DMAPart.js @@ -32,8 +32,9 @@ define(['underscore', 'three'], function(_, THREE){ }; DMAPart.prototype.destroy = function(){ + console.log("destroy"); if (this.mesh) { - this.mesh.parent.remove(this.mesh); + this.parentCell.removeChildren(this.mesh); this.mesh = null; } this.parentCell = null;